diff --git a/.env b/.env index e3c45cbbb5..5484ea858b 100644 --- a/.env +++ b/.env @@ -27,4 +27,8 @@ _APP_SMTP_PASSWORD= _APP_STORAGE_LIMIT=10000000 _APP_FUNCTIONS_TIMEOUT=900 _APP_FUNCTIONS_CONTAINERS=10 -_APP_SYSTEM_RESPONSE_FORMAT=0.6 +_APP_FUNCTIONS_CPUS=1 +_APP_FUNCTIONS_MEMORY=128 +_APP_FUNCTIONS_MEMORY_SWAP=128 +_APP_MAINTENANCE_INTERVAL=86400 +_APP_SYSTEM_RESPONSE_FORMAT=0.6 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index e6eede459f..ea3d9573ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,6 @@ install: script: - docker ps - docker-compose logs appwrite -- docker exec appwrite doctor -- docker exec appwrite vars -- docker exec appwrite test +- docker-compose exec appwrite doctor +- docker-compose exec appwrite vars +- docker-compose exec appwrite test diff --git a/CHANGES.md b/CHANGES.md index ed3ba228c8..6185144417 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,9 +2,8 @@ ## Features -- New route in Locale API to fetch a list of languages (@TorstenDittmann) - Improved Webhooks and New System Events - [Learn more]() -- Added Google Fonts to Appwrite for offline availability +- New QR code generator library (@PedroCisnerosSantana - [#475](https://github.com/appwrite/appwrite/issues/475)) - Added response to /locale/languages API with a list of languages (@TorstenDittmann ,[#351](https://github.com/appwrite/appwrite/issues/351)) - Added API response payload structure info and examples to the docs site ([#381](https://github.com/appwrite/appwrite/issues/381)) - Added Google Fonts to Appwrite for offline availability @@ -13,14 +12,9 @@ - Added option to view team members from the console ([#378](https://github.com/appwrite/appwrite/issues/378)) - Add option to assign new team members to a team from the console and the API ([#379](https://github.com/appwrite/appwrite/issues/379)) - Added support for Brotli compression (@PedroCisnerosSantana, @Rohitub222, [#310](https://github.com/appwrite/appwrite/issues/310)) -- Added a new route in the Avatars API to get user initials avatar -- Added option to delete team from the console - Added Select All Checkbox for on Console API key Scopes Screen ([#477](https://github.com/appwrite/appwrite/issues/477)) - Added pagination and search for team memberships route ([#387](https://github.com/appwrite/appwrite/issues/387)) - UI performance & accessibility improvements ([#406](https://github.com/appwrite/appwrite/pull/406)) -- Added option to view team members from the console -- Added option to join a user to any team from the console -- Added option to delete user from the API (@TorstenDittmann - #378) - Added option to delete user from the console (@PineappleIOnic - #538) - Created lazy deletion of data worker ([#521](https://github.com/appwrite/appwrite/issues/521)) - All emails are now sent asynchronously for improved performance (@TorstenDittmann ,[#402](https://github.com/appwrite/appwrite/pull/402)) @@ -28,11 +22,7 @@ - Upgraded Redis Resque queue library to version 1.3.6 ([#319](https://github.com/appwrite/appwrite/issues/319)) - Moved all Appwrite container logs to STDOUT & STDERR ([#389](https://github.com/appwrite/appwrite/issues/389)) - New UI micro-interactions and CSS fixes (@AnatoleLucet) -- UI performance & accessibility improvements (#406) - New Doctor CLI to debug the Appwrite server ([#415](https://github.com/appwrite/appwrite/issues/415)) -- All emails are now sent asynchronously for improved performance (@TorstenDittmann) -- Updated grid for OAuth2 providers list in the console -- Upgraded Redis Resque queue library to version 1.3.6 - Added container names to docker-compose.yml (@drandell) - Upgraded ClamAV container image to version 1.0.11 ([#412](https://github.com/appwrite/appwrite/issues/412)) - Optimised function execution by using fully-qualified function calls @@ -40,14 +30,17 @@ - Added pagination for projects list on the console home page. - Updated storage calculation to match IEC standards - Now using Alpine as base Docker image -- User name max length is now 128 chars and not 100 for better API consistency -- Team name max length is now 128 chars and not 100 for better API consistency +- Upgraded device detctor to version 3.12.6 +- Upgraded MariaDB to version 10.5.5 +- Switch standard ports to 95xx prefix ([#780](https://github.com/appwrite/appwrite/pull/780)) +- User & Team name max length is now 128 chars and not 100 for better API consistency - Collection name max length is now 128 chars and not 256 for better API consistency - Project name max length is now 128 chars and not 100 for better API consistency - Webhook name max length is now 128 chars and not 256 for better API consistency - API Key name max length is now 128 chars and not 256 for better API consistency - Task name max length is now 128 chars and not 256 for better API consistency - Platform name max length is now 128 chars and not 256 for better API consistency +- Webhooks payloads are now exactly the same as any of the API response objects - Added new locale: Marathi -mr (@spielers) - New and consistent response format for all API object + new response examples in the docs - Removed user roles attribute from user object (can be fetched from /v1/teams/memberships) ** @@ -69,6 +62,7 @@ ## Bug Fixes +- Fixed a bug that caused blocked users to be able to create sessions ([#777](https://github.com/appwrite/appwrite/pull/781)) - Fixed an issue where Special characters in _APP_OPENSSL_KEY_V1_ env caused an error ([#732](https://github.com/appwrite/appwrite/issues/732)) - Fixed an issue where Account webhook doesn't trigger through the console ([#493](https://github.com/appwrite/appwrite/issues/493)) - Fixed case sensitive country flag code ([#526](https://github.com/appwrite/appwrite/issues/526)) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 72a5ee2665..0f9f433926 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -145,6 +145,10 @@ Each container in Appwrite is a microservice on its own. Each service is an inde Currently, all of the Appwrite microservices are intended to communicate using the TCP protocol over a private network. You should be aware to not expose any of the services to the public-facing network, besides the public port 80 and 443, who, by default, are used to expose the Appwrite HTTP API. +## Ports + +Appwrite dev version uses ports 80 and 443 as an entry point to the Appwrite API and console. We also expose multiple ports in the range of 9500-9504 for debugging some of the Appwrite containers on dev mode. If you have any conflicts with the ports running on your system, you can easily replace them by editing Appwrite's docker-compose.yml file and executing `docker-compose up -d` command. + ## Technology Stack To start helping us to improve the Appwrite server by submitting code, prior knowledge of Appwrite's technology stack can help you with getting started. @@ -224,11 +228,18 @@ bash ./build.sh X.X.X Before running the command, make sure you have proper write permissions to the Appwrite docker hub team. -**Build for multicore** +**Build for Multicore** ```bash docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x -t appwrite/appwrite:dev --push . ``` +**Build Functions Envs** + +Build envs for all supported cloud functions (multicore builds) + +```bash +bash ./docker/environments/build.sh +``` ## Tests diff --git a/Dockerfile b/Dockerfile index 0eba6f5624..cc72b5b776 100755 --- a/Dockerfile +++ b/Dockerfile @@ -92,9 +92,14 @@ ENV _APP_SERVER=swoole \ _APP_SMTP_PORT=25 \ _APP_FUNCTIONS_TIMEOUT=900 \ _APP_FUNCTIONS_CONTAINERS=10 \ + _APP_FUNCTIONS_CPUS=1 \ + _APP_FUNCTIONS_MEMORY=128 \ + _APP_FUNCTIONS_MEMORY_SWAP=128 \ _APP_SETUP=self-hosted \ _APP_VERSION=$VERSION \ - _APP_SYSTEM_RESPONSE_FORMAT=0.6 + _APP_SYSTEM_RESPONSE_FORMAT=0.6 \ + # 1 Day = 86400 s + _APP_MAINTENANCE_INTERVAL=86400 #ENV _APP_SMTP_SECURE '' #ENV _APP_SMTP_USERNAME '' #ENV _APP_SMTP_PASSWORD '' @@ -156,6 +161,7 @@ RUN mkdir -p /storage/uploads && \ # Executables RUN chmod +x /usr/local/bin/doctor && \ + chmod +x /usr/local/bin/maintenance && \ chmod +x /usr/local/bin/install && \ chmod +x /usr/local/bin/migrate && \ chmod +x /usr/local/bin/schedule && \ diff --git a/README.md b/README.md index 063a258354..42b37d53d6 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ [![Discord](https://img.shields.io/discord/564160730845151244?label=discord)](https://appwrite.io/discord) [![Docker Pulls](https://badgen.net/docker/pulls/appwrite/appwrite)](https://hub.docker.com/r/appwrite/appwrite) -[![Travis CI](https://badgen.net/travis/appwrite/appwrite?label=build)](https://travis-ci.com/appwrite/appwrite) +[![Build Status](https://travis-ci.com/appwrite/appwrite.svg?branch=master)](https://travis-ci.com/appwrite/appwrite) [![Twitter Account](https://badgen.net/twitter/follow/appwrite_io?label=twitter)](https://twitter.com/appwrite_io) [![Follow Appwrite on StackShare](https://badgen.net/badge/follow%20on/stackshare/blue)](https://stackshare.io/appwrite) @@ -18,10 +18,10 @@ Appwrite is an end-to-end backend server for Web, Mobile, Native, or Backend app Using Appwrite, you can easily integrate your app with user authentication & multiple sign-in methods, a database for storing and querying users and team data, storage and file management, image manipulation, schedule CRON tasks, and [more services](https://appwrite.io/docs). -Find out more at: [https://appwrite.io](https://appwrite.io) - ![Appwrite](public/images/github.png) +Find out more at: [https://appwrite.io](https://appwrite.io) + Table of Contents: - [Installation](#installation) diff --git a/app/cli.php b/app/cli.php index 9c99890602..ced2fb8da4 100644 --- a/app/cli.php +++ b/app/cli.php @@ -9,6 +9,7 @@ use Utopia\CLI\Console; $cli = new CLI(); include 'tasks/doctor.php'; +include 'tasks/maintenance.php'; include 'tasks/install.php'; include 'tasks/migrate.php'; include 'tasks/sdks.php'; diff --git a/app/config/environments.php b/app/config/environments.php index cd312555a5..11773eed4f 100644 --- a/app/config/environments.php +++ b/app/config/environments.php @@ -5,35 +5,49 @@ return [ 'name' => 'Node.js', 'version' => '14.5', 'base' => 'node:14.5-alpine', - 'image' => 'appwrite/env-node:14.5', + 'image' => 'appwrite/env-node-14.5:1.0.0', 'logo' => 'node.png', ], 'php-7.4' => [ 'name' => 'PHP', 'version' => '7.4', 'base' => 'php:7.4-cli-alpine', - 'image' => 'appwrite/env-php:7.4', + 'image' => 'appwrite/env-php-7.4:1.0.0', + 'logo' => 'php.png', + ], + 'php-8.0' => [ + 'name' => 'PHP', + 'version' => '8.0', + 'base' => 'php:8.0-cli-alpine', + 'image' => 'appwrite/env-php-8.0:1.0.0', 'logo' => 'php.png', ], 'ruby-2.7' => [ 'name' => 'Ruby', 'version' => '2.7', 'base' => 'ruby:2.7-alpine', - 'image' => 'appwrite/env-ruby:2.7', + 'image' => 'appwrite/env-ruby-2.7:1.0.2', 'logo' => 'ruby.png', ], 'python-3.8' => [ 'name' => 'Python', 'version' => '3.8', 'base' => 'python:3.8-alpine', - 'image' => 'appwrite/env-python:3.8', + 'image' => 'appwrite/env-python-3.8:1.0.0', 'logo' => 'python.png', ], 'deno-1.2' => [ 'name' => 'Deno', 'version' => '1.2', 'base' => 'hayd/deno:alpine-1.2.0', - 'image' => 'appwrite/env-deno:1.2', + 'image' => 'appwrite/env-deno-1.2:1.0.0', + 'logo' => 'deno.png', + ], + 'deno-1.5' => [ + 'name' => 'Deno', + 'version' => '1.5', + 'base' => 'hayd/deno:alpine-1.5.0', + 'image' => 'appwrite/env-deno-1.5:1.0.0', 'logo' => 'deno.png', ], // 'dart-2.8' => [ diff --git a/app/config/platforms.php b/app/config/platforms.php index 0239be3474..c9a3f25b59 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -15,7 +15,7 @@ return [ [ 'key' => 'web', 'name' => 'Web', - 'version' => '1.1.0', + 'version' => '1.2.0', 'url' => 'https://github.com/appwrite/sdk-for-js', 'package' => 'https://www.npmjs.com/package/appwrite', 'enabled' => true, @@ -44,22 +44,6 @@ return [ 'gitRepoName' => 'sdk-for-flutter', 'gitUserName' => 'appwrite', ], - [ - 'key' => 'flutter-dev', - 'name' => 'Flutter (Dev Channel)', - 'version' => '0.3.2', - 'url' => 'https://github.com/appwrite/sdk-for-flutter-dev', - 'package' => '', - 'enabled' => true, - 'beta' => true, - 'dev' => true, - 'family' => APP_PLATFORM_CLIENT, - 'prism' => 'dart', - 'source' => realpath(__DIR__ . '/../sdks/client-flutter-dev'), - 'gitUrl' => 'git@github.com:appwrite/sdk-for-flutter-dev.git', - 'gitRepoName' => 'sdk-for-flutter-dev', - 'gitUserName' => 'appwrite', - ], [ 'key' => 'swift', 'name' => 'Swift', diff --git a/app/config/specs/0.6.2.client.json b/app/config/specs/0.6.2.client.json index e130668555..6132b76ba1 100644 --- a/app/config/specs/0.6.2.client.json +++ b/app/config/specs/0.6.2.client.json @@ -1,2 +1,2 @@ -{"swagger":"2.0","info":{"version":"0.6.2","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@localhost.test"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"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":"5df5acd0d48c2"}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","x-appwrite":{"demo":"en"}}},"paths":{"\/account":{"get":{"summary":"Get Account","operationId":"get","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","x-appwrite":{"weight":38,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}]},"post":{"summary":"Create Account","operationId":"create","consumes":["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](\/docs\/client\/account#createVerification) route to start verifying the user email address. To allow your new user to login to his new account, you need to create a new [account session](\/docs\/client\/account#createSession).","x-appwrite":{"weight":32,"cookies":false,"type":"","demo":"docs\/examples\/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":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]},"delete":{"summary":"Delete Account","operationId":"delete","consumes":["application\/json"],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","x-appwrite":{"weight":46,"cookies":false,"type":"","demo":"docs\/examples\/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":["client"]},"security":[{"Project":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"updateEmail","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.","x-appwrite":{"weight":44,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","x-appwrite":{"weight":41,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account Name","operationId":"updateName","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account name.","x-appwrite":{"weight":42,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"User name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]}},"\/account\/password":{"patch":{"summary":"Update Account Password","operationId":"updatePassword","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user password. For validation, user is required to pass the password twice.","x-appwrite":{"weight":43,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"password","description":"New user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"oldPassword","description":"Old user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","x-appwrite":{"weight":39,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}]},"patch":{"summary":"Update Account Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","x-appwrite":{"weight":45,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/account\/recovery":{"post":{"summary":"Create Password Recovery","operationId":"createRecovery","consumes":["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](\/docs\/client\/account#updateRecovery) endpoint to complete the process.","x-appwrite":{"weight":49,"cookies":false,"type":"","demo":"docs\/examples\/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}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"url","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.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Password Recovery","operationId":"updateRecovery","consumes":["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](\/docs\/client\/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.","x-appwrite":{"weight":50,"cookies":false,"type":"","demo":"docs\/examples\/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":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"userId","description":"User account UID address.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid reset token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"},{"name":"password","description":"New password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"passwordAgain","description":"New password again. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","x-appwrite":{"weight":40,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]},"post":{"summary":"Create Account Session","operationId":"createSession","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login into his account by providing a valid email and password combination. This route will create a new session for the user.","x-appwrite":{"weight":33,"cookies":false,"type":"","demo":"docs\/examples\/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":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]},"delete":{"summary":"Delete All Account Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["account"],"description":"Delete all sessions from the user account and remove any sessions cookies from the end client.","x-appwrite":{"weight":48,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}]}},"\/account\/sessions\/oauth2\/{provider}":{"get":{"summary":"Create Account Session with OAuth2","operationId":"createOAuth2Session","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login to his account using the OAuth2 provider of his 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.","x-appwrite":{"weight":34,"cookies":false,"type":"webAuth","demo":"docs\/examples\/account\/create-o-auth2session.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":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, twitch, vk, yahoo, yandex.","required":true,"type":"string","x-example":"amazon","in":"path"},{"name":"success","description":"URL to redirect back to your app after a successful login attempt. 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.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/success","in":"query"},{"name":"failure","description":"URL to redirect back to your app after a failed login attempt. 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.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/failure","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all his account sessions across all his different devices. When using the option id argument, only the session unique ID provider will be deleted.","x-appwrite":{"weight":47,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/verification":{"post":{"summary":"Create Email Verification","operationId":"createVerification","consumes":["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](\/docs\/client\/account#updateAccountVerification). \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","x-appwrite":{"weight":51,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"url","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.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Email Verification","operationId":"updateVerification","consumes":["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.","x-appwrite":{"weight":52,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid verification token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}},"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"getBrowser","consumes":["application\/json"],"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 \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","x-appwrite":{"weight":54,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"getCreditCard","consumes":["application\/json"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? 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.","x-appwrite":{"weight":53,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa.","required":true,"type":"string","x-example":"amex","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"getFavicon","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL.","x-appwrite":{"weight":57,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"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":"getFlag","consumes":["application\/json"],"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.","x-appwrite":{"weight":55,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"getImage","consumes":["application\/json"],"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.","x-appwrite":{"weight":56,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"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.","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.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"getInitials","consumes":["application\/json"],"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.","x-appwrite":{"weight":59,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"Full Name. When empty, current user name or email will be used.","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":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","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":"getQR","consumes":["application\/json"],"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.","x-appwrite":{"weight":58,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-q-r.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"]},"security":[{"Project":[]}],"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 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"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"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"listDocuments","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":66,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"offset","description":"Offset value. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":50,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"$id","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"createDocument","consumes":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","x-appwrite":{"weight":65,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"parentDocument","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"[PARENT_DOCUMENT]","default":"","in":"formData"},{"name":"parentProperty","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","default":"","in":"formData"},{"name":"parentPropertyType","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"assign","default":"assign","in":"formData"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"getDocument","consumes":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","x-appwrite":{"weight":67,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"updateDocument","consumes":["application\/json"],"tags":["database"],"description":"","x-appwrite":{"weight":68,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Document","operationId":"deleteDocument","consumes":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted.","x-appwrite":{"weight":69,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"get","consumes":["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))","x-appwrite":{"weight":70,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"getContinents","consumes":["application\/json"],"tags":["locale"],"description":"List of all continents. You can use the locale header to get the data in a supported language.","x-appwrite":{"weight":74,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"getCountries","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries. You can use the locale header to get the data in a supported language.","x-appwrite":{"weight":71,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"getCountriesEU","consumes":["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.","x-appwrite":{"weight":72,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"getCountriesPhones","consumes":["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.","x-appwrite":{"weight":73,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"getCurrencies","consumes":["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.","x-appwrite":{"weight":75,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"getLanguages","consumes":["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.","x-appwrite":{"weight":76,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"listFiles","consumes":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":124,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"createFile","consumes":["multipart\/form-data"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","x-appwrite":{"weight":123,"cookies":false,"type":"upload","demo":"docs\/examples\/storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"file","description":"Binary File.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"getFile","consumes":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","x-appwrite":{"weight":125,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"updateFile","consumes":["application\/json"],"tags":["storage"],"description":"Update file by its unique ID. Only users with write permissions have access to update this resource.","x-appwrite":{"weight":129,"cookies":false,"type":"","demo":"docs\/examples\/storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete File","operationId":"deleteFile","consumes":["application\/json"],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","x-appwrite":{"weight":130,"cookies":false,"type":"","demo":"docs\/examples\/storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"getFileDownload","consumes":["application\/json"],"tags":["storage"],"description":"Get 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.","x-appwrite":{"weight":127,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"getFilePreview","consumes":["application\/json"],"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.","x-appwrite":{"weight":126,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique 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":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"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","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"getFileView","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.","x-appwrite":{"weight":128,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"list","consumes":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":132,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"create","consumes":["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. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","x-appwrite":{"weight":131,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"roles","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](\/docs\/permissions).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":["owner"],"in":"formData"}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"get","consumes":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","x-appwrite":{"weight":133,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"update","consumes":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","x-appwrite":{"weight":134,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]},"delete":{"summary":"Delete Team","operationId":"delete","consumes":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","x-appwrite":{"weight":135,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"getMemberships","consumes":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","x-appwrite":{"weight":137,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"createMembership","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","x-appwrite":{"weight":136,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"email","description":"New team member email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"name","description":"New team member name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"},{"name":"roles","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](\/docs\/permissions).","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the invitation 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.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"deleteMembership","consumes":["application\/json"],"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 he didn't accept it.","x-appwrite":{"weight":139,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"updateMembershipStatus","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after he is being redirected back to your app from the invitation email he was sent.","x-appwrite":{"weight":138,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"},{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Secret key.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}}},"definitions":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/localhost\/docs"}} \ No newline at end of file +{"swagger":"2.0","info":{"version":"0.6.2","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@localhost.test"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"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":"5df5acd0d48c2"}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","x-appwrite":{"demo":"en"}}},"paths":{"\/account":{"get":{"summary":"Get Account","operationId":"get","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","x-appwrite":{"weight":38,"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"]},"security":[{"Project":[]}]},"post":{"summary":"Create Account","operationId":"create","consumes":["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](\/docs\/client\/account#createVerification) route to start verifying the user email address. To allow your new user to login to his new account, you need to create a new [account session](\/docs\/client\/account#createSession).","x-appwrite":{"weight":32,"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":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]},"delete":{"summary":"Delete Account","operationId":"delete","consumes":["application\/json"],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","x-appwrite":{"weight":46,"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":["client"]},"security":[{"Project":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"updateEmail","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.","x-appwrite":{"weight":44,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","x-appwrite":{"weight":41,"cookies":false,"type":"","demo":"account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account Name","operationId":"updateName","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account name.","x-appwrite":{"weight":42,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"User name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]}},"\/account\/password":{"patch":{"summary":"Update Account Password","operationId":"updatePassword","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user password. For validation, user is required to pass the password twice.","x-appwrite":{"weight":43,"cookies":false,"type":"","demo":"account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"password","description":"New user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"oldPassword","description":"Old user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","x-appwrite":{"weight":39,"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"]},"security":[{"Project":[]}]},"patch":{"summary":"Update Account Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","x-appwrite":{"weight":45,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/account\/recovery":{"post":{"summary":"Create Password Recovery","operationId":"createRecovery","consumes":["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](\/docs\/client\/account#updateRecovery) endpoint to complete the process.","x-appwrite":{"weight":49,"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}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"url","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.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Password Recovery","operationId":"updateRecovery","consumes":["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](\/docs\/client\/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.","x-appwrite":{"weight":50,"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":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"userId","description":"User account UID address.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid reset token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"},{"name":"password","description":"New password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"passwordAgain","description":"New password again. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","x-appwrite":{"weight":40,"cookies":false,"type":"","demo":"account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]},"post":{"summary":"Create Account Session","operationId":"createSession","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login into his account by providing a valid email and password combination. This route will create a new session for the user.","x-appwrite":{"weight":33,"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":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]},"delete":{"summary":"Delete All Account Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["account"],"description":"Delete all sessions from the user account and remove any sessions cookies from the end client.","x-appwrite":{"weight":48,"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"]},"security":[{"Project":[]}]}},"\/account\/sessions\/oauth2\/{provider}":{"get":{"summary":"Create Account Session with OAuth2","operationId":"createOAuth2Session","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login to his account using the OAuth2 provider of his 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.","x-appwrite":{"weight":34,"cookies":false,"type":"webAuth","demo":"account\/create-o-auth2session.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":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, twitch, vk, yahoo, yandex.","required":true,"type":"string","x-example":"amazon","in":"path"},{"name":"success","description":"URL to redirect back to your app after a successful login attempt. 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.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/success","in":"query"},{"name":"failure","description":"URL to redirect back to your app after a failed login attempt. 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.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/failure","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all his account sessions across all his different devices. When using the option id argument, only the session unique ID provider will be deleted.","x-appwrite":{"weight":47,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/verification":{"post":{"summary":"Create Email Verification","operationId":"createVerification","consumes":["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](\/docs\/client\/account#updateAccountVerification). \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","x-appwrite":{"weight":51,"cookies":false,"type":"","demo":"account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"url","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.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Email Verification","operationId":"updateVerification","consumes":["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.","x-appwrite":{"weight":52,"cookies":false,"type":"","demo":"account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid verification token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}},"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"getBrowser","consumes":["application\/json"],"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 \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","x-appwrite":{"weight":54,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"getCreditCard","consumes":["application\/json"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? 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.","x-appwrite":{"weight":53,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa.","required":true,"type":"string","x-example":"amex","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"getFavicon","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL.","x-appwrite":{"weight":57,"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"]},"security":[{"Project":[]}],"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":"getFlag","consumes":["application\/json"],"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.","x-appwrite":{"weight":55,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"getImage","consumes":["application\/json"],"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.","x-appwrite":{"weight":56,"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"]},"security":[{"Project":[]}],"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.","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.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"getInitials","consumes":["application\/json"],"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.","x-appwrite":{"weight":59,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"Full Name. When empty, current user name or email will be used.","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":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","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":"getQR","consumes":["application\/json"],"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.","x-appwrite":{"weight":58,"cookies":false,"type":"location","demo":"avatars\/get-q-r.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"]},"security":[{"Project":[]}],"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 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"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"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"listDocuments","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":66,"cookies":false,"type":"","demo":"database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"offset","description":"Offset value. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":50,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"$id","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"createDocument","consumes":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","x-appwrite":{"weight":65,"cookies":false,"type":"","demo":"database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"parentDocument","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"[PARENT_DOCUMENT]","default":"","in":"formData"},{"name":"parentProperty","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","default":"","in":"formData"},{"name":"parentPropertyType","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"assign","default":"assign","in":"formData"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"getDocument","consumes":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","x-appwrite":{"weight":67,"cookies":false,"type":"","demo":"database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"updateDocument","consumes":["application\/json"],"tags":["database"],"description":"","x-appwrite":{"weight":68,"cookies":false,"type":"","demo":"database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Document","operationId":"deleteDocument","consumes":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted.","x-appwrite":{"weight":69,"cookies":false,"type":"","demo":"database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"get","consumes":["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))","x-appwrite":{"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"]},"security":[{"Project":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"getContinents","consumes":["application\/json"],"tags":["locale"],"description":"List of all continents. You can use the locale header to get the data in a supported language.","x-appwrite":{"weight":74,"cookies":false,"type":"","demo":"locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"getCountries","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries. You can use the locale header to get the data in a supported language.","x-appwrite":{"weight":71,"cookies":false,"type":"","demo":"locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"getCountriesEU","consumes":["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.","x-appwrite":{"weight":72,"cookies":false,"type":"","demo":"locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"getCountriesPhones","consumes":["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.","x-appwrite":{"weight":73,"cookies":false,"type":"","demo":"locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"getCurrencies","consumes":["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.","x-appwrite":{"weight":75,"cookies":false,"type":"","demo":"locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"getLanguages","consumes":["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.","x-appwrite":{"weight":76,"cookies":false,"type":"","demo":"locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"listFiles","consumes":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":124,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"createFile","consumes":["multipart\/form-data"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","x-appwrite":{"weight":123,"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":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"file","description":"Binary File.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"getFile","consumes":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","x-appwrite":{"weight":125,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"updateFile","consumes":["application\/json"],"tags":["storage"],"description":"Update file by its unique ID. Only users with write permissions have access to update this resource.","x-appwrite":{"weight":129,"cookies":false,"type":"","demo":"storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete File","operationId":"deleteFile","consumes":["application\/json"],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","x-appwrite":{"weight":130,"cookies":false,"type":"","demo":"storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"getFileDownload","consumes":["application\/json"],"tags":["storage"],"description":"Get 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.","x-appwrite":{"weight":127,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"getFilePreview","consumes":["application\/json"],"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.","x-appwrite":{"weight":126,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique 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":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"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","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"getFileView","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.","x-appwrite":{"weight":128,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"list","consumes":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":132,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"create","consumes":["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. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","x-appwrite":{"weight":131,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"roles","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](\/docs\/permissions).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":["owner"],"in":"formData"}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"get","consumes":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","x-appwrite":{"weight":133,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"update","consumes":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","x-appwrite":{"weight":134,"cookies":false,"type":"","demo":"teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]},"delete":{"summary":"Delete Team","operationId":"delete","consumes":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","x-appwrite":{"weight":135,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"getMemberships","consumes":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","x-appwrite":{"weight":137,"cookies":false,"type":"","demo":"teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"createMembership","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","x-appwrite":{"weight":136,"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":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"email","description":"New team member email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"name","description":"New team member name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"},{"name":"roles","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](\/docs\/permissions).","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the invitation 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.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"deleteMembership","consumes":["application\/json"],"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 he didn't accept it.","x-appwrite":{"weight":139,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"updateMembershipStatus","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after he is being redirected back to your app from the invitation email he was sent.","x-appwrite":{"weight":138,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"},{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Secret key.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}}},"definitions":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/localhost\/docs"}} \ No newline at end of file diff --git a/app/config/specs/0.6.2.console.json b/app/config/specs/0.6.2.console.json index eda6a38e69..73205ca7c8 100644 --- a/app/config/specs/0.6.2.console.json +++ b/app/config/specs/0.6.2.console.json @@ -1 +1 @@ -{"swagger":"2.0","info":{"version":"0.6.2","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@localhost.test"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"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":"5df5acd0d48c2"}},"Key":{"type":"apiKey","name":"X-Appwrite-Key","description":"Your secret API key","in":"header","x-appwrite":{"demo":"919c2d18fb5d4...a2ae413da83346ad2"}},"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":"get","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","x-appwrite":{"weight":38,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]},"post":{"summary":"Create Account","operationId":"create","consumes":["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](\/docs\/client\/account#createVerification) route to start verifying the user email address. To allow your new user to login to his new account, you need to create a new [account session](\/docs\/client\/account#createSession).","x-appwrite":{"weight":32,"cookies":false,"type":"","demo":"docs\/examples\/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":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]},"delete":{"summary":"Delete Account","operationId":"delete","consumes":["application\/json"],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","x-appwrite":{"weight":46,"cookies":false,"type":"","demo":"docs\/examples\/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":["client"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"updateEmail","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.","x-appwrite":{"weight":44,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","x-appwrite":{"weight":41,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account Name","operationId":"updateName","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account name.","x-appwrite":{"weight":42,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"User name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]}},"\/account\/password":{"patch":{"summary":"Update Account Password","operationId":"updatePassword","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user password. For validation, user is required to pass the password twice.","x-appwrite":{"weight":43,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"password","description":"New user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"oldPassword","description":"Old user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","x-appwrite":{"weight":39,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]},"patch":{"summary":"Update Account Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","x-appwrite":{"weight":45,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/account\/recovery":{"post":{"summary":"Create Password Recovery","operationId":"createRecovery","consumes":["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](\/docs\/client\/account#updateRecovery) endpoint to complete the process.","x-appwrite":{"weight":49,"cookies":false,"type":"","demo":"docs\/examples\/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}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"url","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.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Password Recovery","operationId":"updateRecovery","consumes":["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](\/docs\/client\/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.","x-appwrite":{"weight":50,"cookies":false,"type":"","demo":"docs\/examples\/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":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User account UID address.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid reset token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"},{"name":"password","description":"New password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"passwordAgain","description":"New password again. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","x-appwrite":{"weight":40,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]},"post":{"summary":"Create Account Session","operationId":"createSession","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login into his account by providing a valid email and password combination. This route will create a new session for the user.","x-appwrite":{"weight":33,"cookies":false,"type":"","demo":"docs\/examples\/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":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]},"delete":{"summary":"Delete All Account Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["account"],"description":"Delete all sessions from the user account and remove any sessions cookies from the end client.","x-appwrite":{"weight":48,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/sessions\/oauth2\/{provider}":{"get":{"summary":"Create Account Session with OAuth2","operationId":"createOAuth2Session","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login to his account using the OAuth2 provider of his 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.","x-appwrite":{"weight":34,"cookies":false,"type":"webAuth","demo":"docs\/examples\/account\/create-o-auth2session.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":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, twitch, vk, yahoo, yandex.","required":true,"type":"string","x-example":"amazon","in":"path"},{"name":"success","description":"URL to redirect back to your app after a successful login attempt. 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.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"\/auth\/oauth2\/success","in":"query"},{"name":"failure","description":"URL to redirect back to your app after a failed login attempt. 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.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"\/auth\/oauth2\/failure","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all his account sessions across all his different devices. When using the option id argument, only the session unique ID provider will be deleted.","x-appwrite":{"weight":47,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/verification":{"post":{"summary":"Create Email Verification","operationId":"createVerification","consumes":["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](\/docs\/client\/account#updateAccountVerification). \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","x-appwrite":{"weight":51,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"url","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.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Email Verification","operationId":"updateVerification","consumes":["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.","x-appwrite":{"weight":52,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid verification token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}},"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"getBrowser","consumes":["application\/json"],"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 \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","x-appwrite":{"weight":54,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"getCreditCard","consumes":["application\/json"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? 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.","x-appwrite":{"weight":53,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa.","required":true,"type":"string","x-example":"amex","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"getFavicon","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL.","x-appwrite":{"weight":57,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"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":"getFlag","consumes":["application\/json"],"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.","x-appwrite":{"weight":55,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"getImage","consumes":["application\/json"],"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.","x-appwrite":{"weight":56,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"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.","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.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"getInitials","consumes":["application\/json"],"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.","x-appwrite":{"weight":59,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Full Name. When empty, current user name or email will be used.","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":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","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":"getQR","consumes":["application\/json"],"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.","x-appwrite":{"weight":58,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-q-r.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"]},"security":[{"Project":[],"Key":[]}],"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 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"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"}]}},"\/database\/collections":{"get":{"summary":"List Collections","operationId":"listCollections","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":61,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Collection","operationId":"createCollection","consumes":["application\/json"],"tags":["database"],"description":"Create a new Collection.","x-appwrite":{"weight":60,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Collection name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"rules","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/database\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"getCollection","consumes":["application\/json"],"tags":["database"],"description":"Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.","x-appwrite":{"weight":62,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"updateCollection","consumes":["application\/json"],"tags":["database"],"description":"Update collection by its unique ID.","x-appwrite":{"weight":63,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"name","description":"Collection name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"rules","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"formData"}]},"delete":{"summary":"Delete Collection","operationId":"deleteCollection","consumes":["application\/json"],"tags":["database"],"description":"Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.","x-appwrite":{"weight":64,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"listDocuments","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":66,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"offset","description":"Offset value. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":50,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"$id","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"createDocument","consumes":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","x-appwrite":{"weight":65,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"parentDocument","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"[PARENT_DOCUMENT]","default":"","in":"formData"},{"name":"parentProperty","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","default":"","in":"formData"},{"name":"parentPropertyType","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"assign","default":"assign","in":"formData"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"getDocument","consumes":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","x-appwrite":{"weight":67,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"updateDocument","consumes":["application\/json"],"tags":["database"],"description":"","x-appwrite":{"weight":68,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Document","operationId":"deleteDocument","consumes":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted.","x-appwrite":{"weight":69,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"get","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","x-appwrite":{"weight":77,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/anti-virus":{"get":{"summary":"Get Anti virus","operationId":"getAntiVirus","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite Anti Virus server is up and connection is successful.","x-appwrite":{"weight":89,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-anti-virus.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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"getCache","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","x-appwrite":{"weight":80,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/db":{"get":{"summary":"Get DB","operationId":"getDB","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","x-appwrite":{"weight":79,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-d-b.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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/certificates":{"get":{"summary":"Get Certificate Queue","operationId":"getQueueCertificates","consumes":["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.","x-appwrite":{"weight":86,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/functions":{"get":{"summary":"Get Functions Queue","operationId":"getQueueFunctions","consumes":["application\/json"],"tags":["health"],"description":"","x-appwrite":{"weight":87,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/logs":{"get":{"summary":"Get Logs Queue","operationId":"getQueueLogs","consumes":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","x-appwrite":{"weight":84,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/tasks":{"get":{"summary":"Get Tasks Queue","operationId":"getQueueTasks","consumes":["application\/json"],"tags":["health"],"description":"Get the number of tasks that are waiting to be processed in the Appwrite internal queue server.","x-appwrite":{"weight":83,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-tasks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/usage":{"get":{"summary":"Get Usage Queue","operationId":"getQueueUsage","consumes":["application\/json"],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","x-appwrite":{"weight":85,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"getQueueWebhooks","consumes":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","x-appwrite":{"weight":82,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/storage\/local":{"get":{"summary":"Get Local Storage","operationId":"getStorageLocal","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","x-appwrite":{"weight":88,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/time":{"get":{"summary":"Get Time","operationId":"getTime","consumes":["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.","x-appwrite":{"weight":81,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"get","consumes":["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))","x-appwrite":{"weight":70,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"getContinents","consumes":["application\/json"],"tags":["locale"],"description":"List of all continents. You can use the locale header to get the data in a supported language.","x-appwrite":{"weight":74,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"getCountries","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries. You can use the locale header to get the data in a supported language.","x-appwrite":{"weight":71,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"getCountriesEU","consumes":["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.","x-appwrite":{"weight":72,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"getCountriesPhones","consumes":["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.","x-appwrite":{"weight":73,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"getCurrencies","consumes":["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.","x-appwrite":{"weight":75,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"getLanguages","consumes":["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.","x-appwrite":{"weight":76,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/mock\/tests\/bar":{"get":{"summary":"Mock a get request for SDK tests","operationId":"get","consumes":["application\/json"],"tags":["bar"],"description":"","x-appwrite":{"weight":155,"cookies":false,"type":"","demo":"docs\/examples\/bar\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a get request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"query"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"query"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"query"}]},"post":{"summary":"Mock a post request for SDK tests","operationId":"post","consumes":["application\/json"],"tags":["bar"],"description":"","x-appwrite":{"weight":156,"cookies":false,"type":"","demo":"docs\/examples\/bar\/post.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a post request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"put":{"summary":"Mock a put request for SDK tests","operationId":"put","consumes":["application\/json"],"tags":["bar"],"description":"","x-appwrite":{"weight":158,"cookies":false,"type":"","demo":"docs\/examples\/bar\/put.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a put request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"patch":{"summary":"Mock a patch request for SDK tests","operationId":"patch","consumes":["application\/json"],"tags":["bar"],"description":"","x-appwrite":{"weight":157,"cookies":false,"type":"","demo":"docs\/examples\/bar\/patch.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a get request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Mock a delete request for SDK tests","operationId":"delete","consumes":["application\/json"],"tags":["bar"],"description":"","x-appwrite":{"weight":159,"cookies":false,"type":"","demo":"docs\/examples\/bar\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a delete request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/mock\/tests\/foo":{"get":{"summary":"Mock a get request for SDK tests","operationId":"get","consumes":["application\/json"],"tags":["foo"],"description":"","x-appwrite":{"weight":150,"cookies":false,"type":"","demo":"docs\/examples\/foo\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a get request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"query"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"query"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"query"}]},"post":{"summary":"Mock a post request for SDK tests","operationId":"post","consumes":["application\/json"],"tags":["foo"],"description":"","x-appwrite":{"weight":151,"cookies":false,"type":"","demo":"docs\/examples\/foo\/post.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a post request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"put":{"summary":"Mock a put request for SDK tests","operationId":"put","consumes":["application\/json"],"tags":["foo"],"description":"","x-appwrite":{"weight":153,"cookies":false,"type":"","demo":"docs\/examples\/foo\/put.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a put request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"patch":{"summary":"Mock a patch request for SDK tests","operationId":"patch","consumes":["application\/json"],"tags":["foo"],"description":"","x-appwrite":{"weight":152,"cookies":false,"type":"","demo":"docs\/examples\/foo\/patch.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a get request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Mock a delete request for SDK tests","operationId":"delete","consumes":["application\/json"],"tags":["foo"],"description":"","x-appwrite":{"weight":154,"cookies":false,"type":"","demo":"docs\/examples\/foo\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a delete request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/mock\/tests\/general\/empty":{"get":{"summary":"Mock a post request for SDK tests","operationId":"empty","consumes":["application\/json"],"tags":["general"],"description":"","x-appwrite":{"weight":165,"cookies":false,"type":"","demo":"docs\/examples\/general\/empty.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a redirected request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}]}},"\/mock\/tests\/general\/get-cookie":{"get":{"summary":"Mock a cookie request for SDK tests","operationId":"getCookie","consumes":["application\/json"],"tags":["general"],"description":"","x-appwrite":{"weight":164,"cookies":false,"type":"","demo":"docs\/examples\/general\/get-cookie.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a get cookie request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}]}},"\/mock\/tests\/general\/redirect":{"get":{"summary":"Mock a post request for SDK tests","operationId":"redirect","consumes":["application\/json"],"tags":["general"],"description":"","x-appwrite":{"weight":161,"cookies":false,"type":"","demo":"docs\/examples\/general\/redirect.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a redirect request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}]}},"\/mock\/tests\/general\/redirected":{"get":{"summary":"Mock a post request for SDK tests","operationId":"redirected","consumes":["application\/json"],"tags":["general"],"description":"","x-appwrite":{"weight":162,"cookies":false,"type":"","demo":"docs\/examples\/general\/redirected.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a redirected request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}]}},"\/mock\/tests\/general\/set-cookie":{"get":{"summary":"Mock a cookie request for SDK tests","operationId":"setCookie","consumes":["application\/json"],"tags":["general"],"description":"","x-appwrite":{"weight":163,"cookies":false,"type":"","demo":"docs\/examples\/general\/set-cookie.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a set cookie request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}]}},"\/mock\/tests\/general\/upload":{"post":{"summary":"Mock a post request for SDK tests","operationId":"upload","consumes":["multipart\/form-data"],"tags":["general"],"description":"","x-appwrite":{"weight":160,"cookies":false,"type":"","demo":"docs\/examples\/general\/upload.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a delete request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"file","description":"Sample file param","required":true,"type":"file","in":"formData"}]}},"\/projects":{"get":{"summary":"List Projects","operationId":"list","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":92,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}]},"post":{"summary":"Create Project","operationId":"create","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":91,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Project name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"formData"},{"name":"description","description":"Project description.","required":false,"type":"string","x-example":"[DESCRIPTION]","default":"","in":"formData"},{"name":"logo","description":"Project logo.","required":false,"type":"string","x-example":"[LOGO]","default":"","in":"formData"},{"name":"url","description":"Project URL.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"","in":"formData"},{"name":"legalName","description":"Project legal Name.","required":false,"type":"string","x-example":"[LEGAL_NAME]","default":"","in":"formData"},{"name":"legalCountry","description":"Project legal Country.","required":false,"type":"string","x-example":"[LEGAL_COUNTRY]","default":"","in":"formData"},{"name":"legalState","description":"Project legal State.","required":false,"type":"string","x-example":"[LEGAL_STATE]","default":"","in":"formData"},{"name":"legalCity","description":"Project legal City.","required":false,"type":"string","x-example":"[LEGAL_CITY]","default":"","in":"formData"},{"name":"legalAddress","description":"Project legal Address.","required":false,"type":"string","x-example":"[LEGAL_ADDRESS]","default":"","in":"formData"},{"name":"legalTaxId","description":"Project legal Tax ID.","required":false,"type":"string","x-example":"[LEGAL_TAX_ID]","default":"","in":"formData"}]}},"\/projects\/{projectId}":{"get":{"summary":"Get Project","operationId":"get","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":93,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"patch":{"summary":"Update Project","operationId":"update","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":95,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"name","description":"Project name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"description","description":"Project description.","required":false,"type":"string","x-example":"[DESCRIPTION]","default":"","in":"formData"},{"name":"logo","description":"Project logo.","required":false,"type":"string","x-example":"[LOGO]","default":"","in":"formData"},{"name":"url","description":"Project URL.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"","in":"formData"},{"name":"legalName","description":"Project legal name.","required":false,"type":"string","x-example":"[LEGAL_NAME]","default":"","in":"formData"},{"name":"legalCountry","description":"Project legal country..","required":false,"type":"string","x-example":"[LEGAL_COUNTRY]","default":"","in":"formData"},{"name":"legalState","description":"Project legal state.","required":false,"type":"string","x-example":"[LEGAL_STATE]","default":"","in":"formData"},{"name":"legalCity","description":"Project legal city.","required":false,"type":"string","x-example":"[LEGAL_CITY]","default":"","in":"formData"},{"name":"legalAddress","description":"Project legal address.","required":false,"type":"string","x-example":"[LEGAL_ADDRESS]","default":"","in":"formData"},{"name":"legalTaxId","description":"Project legal tax ID.","required":false,"type":"string","x-example":"[LEGAL_TAX_ID]","default":"","in":"formData"}]},"delete":{"summary":"Delete Project","operationId":"delete","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":97,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"password","description":"Your user password for confirmation. Must be between 6 to 32 chars.","required":true,"type":"string","x-example":"[PASSWORD]","in":"formData"}]}},"\/projects\/{projectId}\/domains":{"get":{"summary":"List Domains","operationId":"listDomains","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":119,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-domains.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Domain","operationId":"createDomain","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":118,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domain","description":"Domain name.","required":true,"type":"string","in":"formData"}]}},"\/projects\/{projectId}\/domains\/{domainId}":{"get":{"summary":"Get Domain","operationId":"getDomain","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":120,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]},"delete":{"summary":"Delete Domain","operationId":"deleteDomain","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":122,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]}},"\/projects\/{projectId}\/domains\/{domainId}\/verification":{"patch":{"summary":"Update Domain Verification Status","operationId":"updateDomainVerification","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":121,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-domain-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]}},"\/projects\/{projectId}\/keys":{"get":{"summary":"List Keys","operationId":"listKeys","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":104,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-keys.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Key","operationId":"createKey","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":103,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"name","description":"Key name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"scopes","description":"Key scopes list.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/projects\/{projectId}\/keys\/{keyId}":{"get":{"summary":"Get Key","operationId":"getKey","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":105,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"updateKey","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":106,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"name","description":"Key name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"scopes","description":"Key scopes list","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Key","operationId":"deleteKey","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":107,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"updateOAuth2","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":96,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-o-auth2.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"provider","description":"Provider Name","required":true,"type":"string","x-example":"amazon","in":"formData"},{"name":"appId","description":"Provider app ID.","required":false,"type":"string","x-example":"[APP_ID]","default":"","in":"formData"},{"name":"secret","description":"Provider secret key.","required":false,"type":"string","x-example":"[SECRET]","default":"","in":"formData"}]}},"\/projects\/{projectId}\/platforms":{"get":{"summary":"List Platforms","operationId":"listPlatforms","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":114,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-platforms.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Platform","operationId":"createPlatform","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":113,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"type","description":"Platform type.","required":true,"type":"string","x-example":"web","in":"formData"},{"name":"name","description":"Platform name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"key","description":"Package name for android or bundle ID for iOS.","required":false,"type":"string","x-example":"[KEY]","default":"","in":"formData"},{"name":"store","description":"App store or Google Play store ID.","required":false,"type":"string","x-example":"[STORE]","default":"","in":"formData"},{"name":"hostname","description":"Platform client hostname.","required":false,"type":"string","x-example":"[HOSTNAME]","default":"","in":"formData"}]}},"\/projects\/{projectId}\/platforms\/{platformId}":{"get":{"summary":"Get Platform","operationId":"getPlatform","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":115,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"updatePlatform","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":116,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"name","description":"Platform name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"key","description":"Package name for android or bundle ID for iOS.","required":false,"type":"string","x-example":"[KEY]","default":"","in":"formData"},{"name":"store","description":"App store or Google Play store ID.","required":false,"type":"string","x-example":"[STORE]","default":"","in":"formData"},{"name":"hostname","description":"Platform client URL.","required":false,"type":"string","x-example":"[HOSTNAME]","default":"","in":"formData"}]},"delete":{"summary":"Delete Platform","operationId":"deletePlatform","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":117,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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}\/tasks":{"get":{"summary":"List Tasks","operationId":"listTasks","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":109,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Task","operationId":"createTask","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":108,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"name","description":"Task name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"status","description":"Task status.","required":true,"type":"string","x-example":"play","in":"formData"},{"name":"schedule","description":"Task schedule CRON syntax.","required":true,"type":"string","in":"formData"},{"name":"security","description":"Certificate verification, false for disabled or true for enabled.","required":true,"type":"boolean","x-example":false,"in":"formData"},{"name":"httpMethod","description":"Task HTTP method.","required":true,"type":"string","x-example":"GET","in":"formData"},{"name":"httpUrl","description":"Task HTTP URL","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"},{"name":"httpHeaders","description":"Task HTTP headers list.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"httpUser","description":"Task HTTP user.","required":false,"type":"string","x-example":"[HTTP_USER]","default":"","in":"formData"},{"name":"httpPass","description":"Task HTTP password.","required":false,"type":"string","x-example":"[HTTP_PASS]","default":"","in":"formData"}]}},"\/projects\/{projectId}\/tasks\/{taskId}":{"get":{"summary":"Get Task","operationId":"getTask","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":110,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"}]},"put":{"summary":"Update Task","operationId":"updateTask","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":111,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"},{"name":"name","description":"Task name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"status","description":"Task status.","required":true,"type":"string","x-example":"play","in":"formData"},{"name":"schedule","description":"Task schedule CRON syntax.","required":true,"type":"string","in":"formData"},{"name":"security","description":"Certificate verification, false for disabled or true for enabled.","required":true,"type":"boolean","x-example":false,"in":"formData"},{"name":"httpMethod","description":"Task HTTP method.","required":true,"type":"string","x-example":"GET","in":"formData"},{"name":"httpUrl","description":"Task HTTP URL.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"},{"name":"httpHeaders","description":"Task HTTP headers list.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"httpUser","description":"Task HTTP user.","required":false,"type":"string","x-example":"[HTTP_USER]","default":"","in":"formData"},{"name":"httpPass","description":"Task HTTP password.","required":false,"type":"string","x-example":"[HTTP_PASS]","default":"","in":"formData"}]},"delete":{"summary":"Delete Task","operationId":"deleteTask","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":112,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get Project","operationId":"getUsage","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":94,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"daily","default":"last30","in":"query"}]}},"\/projects\/{projectId}\/webhooks":{"get":{"summary":"List Webhooks","operationId":"listWebhooks","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":99,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-webhooks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Webhook","operationId":"createWebhook","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":98,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"name","description":"Webhook name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"events","description":"Webhook events list.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"Webhook URL.","required":true,"type":"string","x-example":"[URL]","in":"formData"},{"name":"security","description":"Certificate verification, false for disabled or true for enabled.","required":true,"type":"boolean","x-example":false,"in":"formData"},{"name":"httpUser","description":"Webhook HTTP user.","required":false,"type":"string","x-example":"[HTTP_USER]","default":"","in":"formData"},{"name":"httpPass","description":"Webhook HTTP password.","required":false,"type":"string","x-example":"[HTTP_PASS]","default":"","in":"formData"}]}},"\/projects\/{projectId}\/webhooks\/{webhookId}":{"get":{"summary":"Get Webhook","operationId":"getWebhook","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":100,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"updateWebhook","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":101,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"name","description":"Webhook name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"events","description":"Webhook events list.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"Webhook URL.","required":true,"type":"string","x-example":"[URL]","in":"formData"},{"name":"security","description":"Certificate verification, false for disabled or true for enabled.","required":true,"type":"boolean","x-example":false,"in":"formData"},{"name":"httpUser","description":"Webhook HTTP user.","required":false,"type":"string","x-example":"[HTTP_USER]","default":"","in":"formData"},{"name":"httpPass","description":"Webhook HTTP password.","required":false,"type":"string","x-example":"[HTTP_PASS]","default":"","in":"formData"}]},"delete":{"summary":"Delete Webhook","operationId":"deleteWebhook","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":102,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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"}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"listFiles","consumes":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":124,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"createFile","consumes":["multipart\/form-data"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","x-appwrite":{"weight":123,"cookies":false,"type":"upload","demo":"docs\/examples\/storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"file","description":"Binary File.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"getFile","consumes":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","x-appwrite":{"weight":125,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"updateFile","consumes":["application\/json"],"tags":["storage"],"description":"Update file by its unique ID. Only users with write permissions have access to update this resource.","x-appwrite":{"weight":129,"cookies":false,"type":"","demo":"docs\/examples\/storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete File","operationId":"deleteFile","consumes":["application\/json"],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","x-appwrite":{"weight":130,"cookies":false,"type":"","demo":"docs\/examples\/storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"getFileDownload","consumes":["application\/json"],"tags":["storage"],"description":"Get 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.","x-appwrite":{"weight":127,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"getFilePreview","consumes":["application\/json"],"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.","x-appwrite":{"weight":126,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique 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":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"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","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"getFileView","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.","x-appwrite":{"weight":128,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"list","consumes":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":132,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"create","consumes":["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. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","x-appwrite":{"weight":131,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"roles","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](\/docs\/permissions).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":["owner"],"in":"formData"}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"get","consumes":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","x-appwrite":{"weight":133,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"update","consumes":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","x-appwrite":{"weight":134,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]},"delete":{"summary":"Delete Team","operationId":"delete","consumes":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","x-appwrite":{"weight":135,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"getMemberships","consumes":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","x-appwrite":{"weight":137,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"createMembership","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","x-appwrite":{"weight":136,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"email","description":"New team member email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"name","description":"New team member name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"},{"name":"roles","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](\/docs\/permissions).","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the invitation 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.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"deleteMembership","consumes":["application\/json"],"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 he didn't accept it.","x-appwrite":{"weight":139,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"updateMembershipStatus","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after he is being redirected back to your app from the invitation email he was sent.","x-appwrite":{"weight":138,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"},{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Secret key.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}},"\/users":{"get":{"summary":"List Users","operationId":"list","consumes":["application\/json"],"tags":["users"],"description":"Get a list of all the project users. You can use the query params to filter your results.","x-appwrite":{"weight":141,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create User","operationId":"create","consumes":["application\/json"],"tags":["users"],"description":"Create a new user.","x-appwrite":{"weight":140,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]}},"\/users\/{userId}":{"get":{"summary":"Get User","operationId":"get","consumes":["application\/json"],"tags":["users"],"description":"Get user by its unique ID.","x-appwrite":{"weight":142,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["users"],"description":"Get user activity logs list by its unique ID.","x-appwrite":{"weight":145,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/prefs":{"get":{"summary":"Get User Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["users"],"description":"Get user preferences by its unique ID.","x-appwrite":{"weight":143,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["users"],"description":"Update user preferences by its unique ID. You can pass only the specific settings you wish to update.","x-appwrite":{"weight":147,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"Get User Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["users"],"description":"Get user sessions list by its unique ID.","x-appwrite":{"weight":144,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["users"],"description":"Delete all user sessions by its unique ID.","x-appwrite":{"weight":149,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/sessions\/{sessionId}":{"delete":{"summary":"Delete User Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["users"],"description":"Delete user sessions by its unique ID.","x-appwrite":{"weight":148,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"User unique session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"updateStatus","consumes":["application\/json"],"tags":["users"],"description":"Update user status by its unique ID.","x-appwrite":{"weight":146,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"status","description":"User Status code. To activate the user pass 1, to block the user pass 2 and for disabling the user pass 0","required":true,"type":"string","x-example":1,"in":"formData"}]}}},"definitions":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/localhost\/docs"}} \ No newline at end of file +{"swagger":"2.0","info":{"version":"0.6.2","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@localhost.test"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"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":"5df5acd0d48c2"}},"Key":{"type":"apiKey","name":"X-Appwrite-Key","description":"Your secret API key","in":"header","x-appwrite":{"demo":"919c2d18fb5d4...a2ae413da83346ad2"}},"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":"get","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","x-appwrite":{"weight":38,"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"]},"security":[{"Project":[],"Key":[]}]},"post":{"summary":"Create Account","operationId":"create","consumes":["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](\/docs\/client\/account#createVerification) route to start verifying the user email address. To allow your new user to login to his new account, you need to create a new [account session](\/docs\/client\/account#createSession).","x-appwrite":{"weight":32,"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":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]},"delete":{"summary":"Delete Account","operationId":"delete","consumes":["application\/json"],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","x-appwrite":{"weight":46,"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":["client"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"updateEmail","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.","x-appwrite":{"weight":44,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","x-appwrite":{"weight":41,"cookies":false,"type":"","demo":"account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account Name","operationId":"updateName","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account name.","x-appwrite":{"weight":42,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"User name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]}},"\/account\/password":{"patch":{"summary":"Update Account Password","operationId":"updatePassword","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user password. For validation, user is required to pass the password twice.","x-appwrite":{"weight":43,"cookies":false,"type":"","demo":"account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"password","description":"New user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"oldPassword","description":"Old user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","x-appwrite":{"weight":39,"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"]},"security":[{"Project":[],"Key":[]}]},"patch":{"summary":"Update Account Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","x-appwrite":{"weight":45,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/account\/recovery":{"post":{"summary":"Create Password Recovery","operationId":"createRecovery","consumes":["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](\/docs\/client\/account#updateRecovery) endpoint to complete the process.","x-appwrite":{"weight":49,"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}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"url","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.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Password Recovery","operationId":"updateRecovery","consumes":["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](\/docs\/client\/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.","x-appwrite":{"weight":50,"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":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User account UID address.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid reset token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"},{"name":"password","description":"New password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"passwordAgain","description":"New password again. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","x-appwrite":{"weight":40,"cookies":false,"type":"","demo":"account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]},"post":{"summary":"Create Account Session","operationId":"createSession","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login into his account by providing a valid email and password combination. This route will create a new session for the user.","x-appwrite":{"weight":33,"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":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]},"delete":{"summary":"Delete All Account Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["account"],"description":"Delete all sessions from the user account and remove any sessions cookies from the end client.","x-appwrite":{"weight":48,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/sessions\/oauth2\/{provider}":{"get":{"summary":"Create Account Session with OAuth2","operationId":"createOAuth2Session","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login to his account using the OAuth2 provider of his 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.","x-appwrite":{"weight":34,"cookies":false,"type":"webAuth","demo":"account\/create-o-auth2session.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":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, twitch, vk, yahoo, yandex.","required":true,"type":"string","x-example":"amazon","in":"path"},{"name":"success","description":"URL to redirect back to your app after a successful login attempt. 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.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"\/auth\/oauth2\/success","in":"query"},{"name":"failure","description":"URL to redirect back to your app after a failed login attempt. 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.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"\/auth\/oauth2\/failure","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all his account sessions across all his different devices. When using the option id argument, only the session unique ID provider will be deleted.","x-appwrite":{"weight":47,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/verification":{"post":{"summary":"Create Email Verification","operationId":"createVerification","consumes":["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](\/docs\/client\/account#updateAccountVerification). \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","x-appwrite":{"weight":51,"cookies":false,"type":"","demo":"account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"url","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.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Email Verification","operationId":"updateVerification","consumes":["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.","x-appwrite":{"weight":52,"cookies":false,"type":"","demo":"account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid verification token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}},"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"getBrowser","consumes":["application\/json"],"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 \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","x-appwrite":{"weight":54,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"getCreditCard","consumes":["application\/json"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? 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.","x-appwrite":{"weight":53,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa.","required":true,"type":"string","x-example":"amex","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"getFavicon","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL.","x-appwrite":{"weight":57,"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"]},"security":[{"Project":[],"Key":[]}],"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":"getFlag","consumes":["application\/json"],"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.","x-appwrite":{"weight":55,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"getImage","consumes":["application\/json"],"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.","x-appwrite":{"weight":56,"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"]},"security":[{"Project":[],"Key":[]}],"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.","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.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"getInitials","consumes":["application\/json"],"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.","x-appwrite":{"weight":59,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Full Name. When empty, current user name or email will be used.","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":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","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":"getQR","consumes":["application\/json"],"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.","x-appwrite":{"weight":58,"cookies":false,"type":"location","demo":"avatars\/get-q-r.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"]},"security":[{"Project":[],"Key":[]}],"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 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"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"}]}},"\/database\/collections":{"get":{"summary":"List Collections","operationId":"listCollections","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":61,"cookies":false,"type":"","demo":"database\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Collection","operationId":"createCollection","consumes":["application\/json"],"tags":["database"],"description":"Create a new Collection.","x-appwrite":{"weight":60,"cookies":false,"type":"","demo":"database\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Collection name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"rules","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/database\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"getCollection","consumes":["application\/json"],"tags":["database"],"description":"Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.","x-appwrite":{"weight":62,"cookies":false,"type":"","demo":"database\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"updateCollection","consumes":["application\/json"],"tags":["database"],"description":"Update collection by its unique ID.","x-appwrite":{"weight":63,"cookies":false,"type":"","demo":"database\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"name","description":"Collection name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"rules","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"formData"}]},"delete":{"summary":"Delete Collection","operationId":"deleteCollection","consumes":["application\/json"],"tags":["database"],"description":"Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.","x-appwrite":{"weight":64,"cookies":false,"type":"","demo":"database\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"listDocuments","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":66,"cookies":false,"type":"","demo":"database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"offset","description":"Offset value. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":50,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"$id","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"createDocument","consumes":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","x-appwrite":{"weight":65,"cookies":false,"type":"","demo":"database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"parentDocument","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"[PARENT_DOCUMENT]","default":"","in":"formData"},{"name":"parentProperty","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","default":"","in":"formData"},{"name":"parentPropertyType","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"assign","default":"assign","in":"formData"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"getDocument","consumes":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","x-appwrite":{"weight":67,"cookies":false,"type":"","demo":"database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"updateDocument","consumes":["application\/json"],"tags":["database"],"description":"","x-appwrite":{"weight":68,"cookies":false,"type":"","demo":"database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Document","operationId":"deleteDocument","consumes":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted.","x-appwrite":{"weight":69,"cookies":false,"type":"","demo":"database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"get","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","x-appwrite":{"weight":77,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/anti-virus":{"get":{"summary":"Get Anti virus","operationId":"getAntiVirus","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite Anti Virus server is up and connection is successful.","x-appwrite":{"weight":89,"cookies":false,"type":"","demo":"health\/get-anti-virus.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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"getCache","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","x-appwrite":{"weight":80,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/db":{"get":{"summary":"Get DB","operationId":"getDB","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","x-appwrite":{"weight":79,"cookies":false,"type":"","demo":"health\/get-d-b.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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/certificates":{"get":{"summary":"Get Certificate Queue","operationId":"getQueueCertificates","consumes":["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.","x-appwrite":{"weight":86,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/functions":{"get":{"summary":"Get Functions Queue","operationId":"getQueueFunctions","consumes":["application\/json"],"tags":["health"],"description":"","x-appwrite":{"weight":87,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/logs":{"get":{"summary":"Get Logs Queue","operationId":"getQueueLogs","consumes":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","x-appwrite":{"weight":84,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/tasks":{"get":{"summary":"Get Tasks Queue","operationId":"getQueueTasks","consumes":["application\/json"],"tags":["health"],"description":"Get the number of tasks that are waiting to be processed in the Appwrite internal queue server.","x-appwrite":{"weight":83,"cookies":false,"type":"","demo":"health\/get-queue-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-tasks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/usage":{"get":{"summary":"Get Usage Queue","operationId":"getQueueUsage","consumes":["application\/json"],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","x-appwrite":{"weight":85,"cookies":false,"type":"","demo":"health\/get-queue-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"getQueueWebhooks","consumes":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","x-appwrite":{"weight":82,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/storage\/local":{"get":{"summary":"Get Local Storage","operationId":"getStorageLocal","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","x-appwrite":{"weight":88,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/time":{"get":{"summary":"Get Time","operationId":"getTime","consumes":["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.","x-appwrite":{"weight":81,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"get","consumes":["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))","x-appwrite":{"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"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"getContinents","consumes":["application\/json"],"tags":["locale"],"description":"List of all continents. You can use the locale header to get the data in a supported language.","x-appwrite":{"weight":74,"cookies":false,"type":"","demo":"locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"getCountries","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries. You can use the locale header to get the data in a supported language.","x-appwrite":{"weight":71,"cookies":false,"type":"","demo":"locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"getCountriesEU","consumes":["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.","x-appwrite":{"weight":72,"cookies":false,"type":"","demo":"locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"getCountriesPhones","consumes":["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.","x-appwrite":{"weight":73,"cookies":false,"type":"","demo":"locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"getCurrencies","consumes":["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.","x-appwrite":{"weight":75,"cookies":false,"type":"","demo":"locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"getLanguages","consumes":["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.","x-appwrite":{"weight":76,"cookies":false,"type":"","demo":"locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/mock\/tests\/bar":{"get":{"summary":"Mock a get request for SDK tests","operationId":"get","consumes":["application\/json"],"tags":["bar"],"description":"","x-appwrite":{"weight":155,"cookies":false,"type":"","demo":"bar\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a get request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"query"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"query"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"query"}]},"post":{"summary":"Mock a post request for SDK tests","operationId":"post","consumes":["application\/json"],"tags":["bar"],"description":"","x-appwrite":{"weight":156,"cookies":false,"type":"","demo":"bar\/post.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a post request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"put":{"summary":"Mock a put request for SDK tests","operationId":"put","consumes":["application\/json"],"tags":["bar"],"description":"","x-appwrite":{"weight":158,"cookies":false,"type":"","demo":"bar\/put.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a put request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"patch":{"summary":"Mock a patch request for SDK tests","operationId":"patch","consumes":["application\/json"],"tags":["bar"],"description":"","x-appwrite":{"weight":157,"cookies":false,"type":"","demo":"bar\/patch.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a get request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Mock a delete request for SDK tests","operationId":"delete","consumes":["application\/json"],"tags":["bar"],"description":"","x-appwrite":{"weight":159,"cookies":false,"type":"","demo":"bar\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a delete request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/mock\/tests\/foo":{"get":{"summary":"Mock a get request for SDK tests","operationId":"get","consumes":["application\/json"],"tags":["foo"],"description":"","x-appwrite":{"weight":150,"cookies":false,"type":"","demo":"foo\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a get request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"query"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"query"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"query"}]},"post":{"summary":"Mock a post request for SDK tests","operationId":"post","consumes":["application\/json"],"tags":["foo"],"description":"","x-appwrite":{"weight":151,"cookies":false,"type":"","demo":"foo\/post.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a post request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"put":{"summary":"Mock a put request for SDK tests","operationId":"put","consumes":["application\/json"],"tags":["foo"],"description":"","x-appwrite":{"weight":153,"cookies":false,"type":"","demo":"foo\/put.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a put request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"patch":{"summary":"Mock a patch request for SDK tests","operationId":"patch","consumes":["application\/json"],"tags":["foo"],"description":"","x-appwrite":{"weight":152,"cookies":false,"type":"","demo":"foo\/patch.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a get request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Mock a delete request for SDK tests","operationId":"delete","consumes":["application\/json"],"tags":["foo"],"description":"","x-appwrite":{"weight":154,"cookies":false,"type":"","demo":"foo\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a delete request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/mock\/tests\/general\/empty":{"get":{"summary":"Mock a post request for SDK tests","operationId":"empty","consumes":["application\/json"],"tags":["general"],"description":"","x-appwrite":{"weight":165,"cookies":false,"type":"","demo":"general\/empty.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a redirected request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}]}},"\/mock\/tests\/general\/get-cookie":{"get":{"summary":"Mock a cookie request for SDK tests","operationId":"getCookie","consumes":["application\/json"],"tags":["general"],"description":"","x-appwrite":{"weight":164,"cookies":false,"type":"","demo":"general\/get-cookie.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a get cookie request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}]}},"\/mock\/tests\/general\/redirect":{"get":{"summary":"Mock a post request for SDK tests","operationId":"redirect","consumes":["application\/json"],"tags":["general"],"description":"","x-appwrite":{"weight":161,"cookies":false,"type":"","demo":"general\/redirect.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a redirect request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}]}},"\/mock\/tests\/general\/redirected":{"get":{"summary":"Mock a post request for SDK tests","operationId":"redirected","consumes":["application\/json"],"tags":["general"],"description":"","x-appwrite":{"weight":162,"cookies":false,"type":"","demo":"general\/redirected.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a redirected request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}]}},"\/mock\/tests\/general\/set-cookie":{"get":{"summary":"Mock a cookie request for SDK tests","operationId":"setCookie","consumes":["application\/json"],"tags":["general"],"description":"","x-appwrite":{"weight":163,"cookies":false,"type":"","demo":"general\/set-cookie.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a set cookie request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}]}},"\/mock\/tests\/general\/upload":{"post":{"summary":"Mock a post request for SDK tests","operationId":"upload","consumes":["multipart\/form-data"],"tags":["general"],"description":"","x-appwrite":{"weight":160,"cookies":false,"type":"","demo":"general\/upload.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a delete request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"file","description":"Sample file param","required":true,"type":"file","in":"formData"}]}},"\/projects":{"get":{"summary":"List Projects","operationId":"list","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":92,"cookies":false,"type":"","demo":"projects\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}]},"post":{"summary":"Create Project","operationId":"create","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":91,"cookies":false,"type":"","demo":"projects\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Project name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"formData"},{"name":"description","description":"Project description.","required":false,"type":"string","x-example":"[DESCRIPTION]","default":"","in":"formData"},{"name":"logo","description":"Project logo.","required":false,"type":"string","x-example":"[LOGO]","default":"","in":"formData"},{"name":"url","description":"Project URL.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"","in":"formData"},{"name":"legalName","description":"Project legal Name.","required":false,"type":"string","x-example":"[LEGAL_NAME]","default":"","in":"formData"},{"name":"legalCountry","description":"Project legal Country.","required":false,"type":"string","x-example":"[LEGAL_COUNTRY]","default":"","in":"formData"},{"name":"legalState","description":"Project legal State.","required":false,"type":"string","x-example":"[LEGAL_STATE]","default":"","in":"formData"},{"name":"legalCity","description":"Project legal City.","required":false,"type":"string","x-example":"[LEGAL_CITY]","default":"","in":"formData"},{"name":"legalAddress","description":"Project legal Address.","required":false,"type":"string","x-example":"[LEGAL_ADDRESS]","default":"","in":"formData"},{"name":"legalTaxId","description":"Project legal Tax ID.","required":false,"type":"string","x-example":"[LEGAL_TAX_ID]","default":"","in":"formData"}]}},"\/projects\/{projectId}":{"get":{"summary":"Get Project","operationId":"get","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":93,"cookies":false,"type":"","demo":"projects\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"patch":{"summary":"Update Project","operationId":"update","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":95,"cookies":false,"type":"","demo":"projects\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"name","description":"Project name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"description","description":"Project description.","required":false,"type":"string","x-example":"[DESCRIPTION]","default":"","in":"formData"},{"name":"logo","description":"Project logo.","required":false,"type":"string","x-example":"[LOGO]","default":"","in":"formData"},{"name":"url","description":"Project URL.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"","in":"formData"},{"name":"legalName","description":"Project legal name.","required":false,"type":"string","x-example":"[LEGAL_NAME]","default":"","in":"formData"},{"name":"legalCountry","description":"Project legal country..","required":false,"type":"string","x-example":"[LEGAL_COUNTRY]","default":"","in":"formData"},{"name":"legalState","description":"Project legal state.","required":false,"type":"string","x-example":"[LEGAL_STATE]","default":"","in":"formData"},{"name":"legalCity","description":"Project legal city.","required":false,"type":"string","x-example":"[LEGAL_CITY]","default":"","in":"formData"},{"name":"legalAddress","description":"Project legal address.","required":false,"type":"string","x-example":"[LEGAL_ADDRESS]","default":"","in":"formData"},{"name":"legalTaxId","description":"Project legal tax ID.","required":false,"type":"string","x-example":"[LEGAL_TAX_ID]","default":"","in":"formData"}]},"delete":{"summary":"Delete Project","operationId":"delete","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":97,"cookies":false,"type":"","demo":"projects\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"password","description":"Your user password for confirmation. Must be between 6 to 32 chars.","required":true,"type":"string","x-example":"[PASSWORD]","in":"formData"}]}},"\/projects\/{projectId}\/domains":{"get":{"summary":"List Domains","operationId":"listDomains","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":119,"cookies":false,"type":"","demo":"projects\/list-domains.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Domain","operationId":"createDomain","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":118,"cookies":false,"type":"","demo":"projects\/create-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domain","description":"Domain name.","required":true,"type":"string","in":"formData"}]}},"\/projects\/{projectId}\/domains\/{domainId}":{"get":{"summary":"Get Domain","operationId":"getDomain","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":120,"cookies":false,"type":"","demo":"projects\/get-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]},"delete":{"summary":"Delete Domain","operationId":"deleteDomain","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":122,"cookies":false,"type":"","demo":"projects\/delete-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]}},"\/projects\/{projectId}\/domains\/{domainId}\/verification":{"patch":{"summary":"Update Domain Verification Status","operationId":"updateDomainVerification","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":121,"cookies":false,"type":"","demo":"projects\/update-domain-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]}},"\/projects\/{projectId}\/keys":{"get":{"summary":"List Keys","operationId":"listKeys","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":104,"cookies":false,"type":"","demo":"projects\/list-keys.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Key","operationId":"createKey","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":103,"cookies":false,"type":"","demo":"projects\/create-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"name","description":"Key name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"scopes","description":"Key scopes list.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/projects\/{projectId}\/keys\/{keyId}":{"get":{"summary":"Get Key","operationId":"getKey","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":105,"cookies":false,"type":"","demo":"projects\/get-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"updateKey","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":106,"cookies":false,"type":"","demo":"projects\/update-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"name","description":"Key name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"scopes","description":"Key scopes list","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Key","operationId":"deleteKey","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":107,"cookies":false,"type":"","demo":"projects\/delete-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"updateOAuth2","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":96,"cookies":false,"type":"","demo":"projects\/update-o-auth2.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"provider","description":"Provider Name","required":true,"type":"string","x-example":"amazon","in":"formData"},{"name":"appId","description":"Provider app ID.","required":false,"type":"string","x-example":"[APP_ID]","default":"","in":"formData"},{"name":"secret","description":"Provider secret key.","required":false,"type":"string","x-example":"[SECRET]","default":"","in":"formData"}]}},"\/projects\/{projectId}\/platforms":{"get":{"summary":"List Platforms","operationId":"listPlatforms","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":114,"cookies":false,"type":"","demo":"projects\/list-platforms.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Platform","operationId":"createPlatform","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":113,"cookies":false,"type":"","demo":"projects\/create-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"type","description":"Platform type.","required":true,"type":"string","x-example":"web","in":"formData"},{"name":"name","description":"Platform name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"key","description":"Package name for android or bundle ID for iOS.","required":false,"type":"string","x-example":"[KEY]","default":"","in":"formData"},{"name":"store","description":"App store or Google Play store ID.","required":false,"type":"string","x-example":"[STORE]","default":"","in":"formData"},{"name":"hostname","description":"Platform client hostname.","required":false,"type":"string","x-example":"[HOSTNAME]","default":"","in":"formData"}]}},"\/projects\/{projectId}\/platforms\/{platformId}":{"get":{"summary":"Get Platform","operationId":"getPlatform","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":115,"cookies":false,"type":"","demo":"projects\/get-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"updatePlatform","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":116,"cookies":false,"type":"","demo":"projects\/update-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"name","description":"Platform name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"key","description":"Package name for android or bundle ID for iOS.","required":false,"type":"string","x-example":"[KEY]","default":"","in":"formData"},{"name":"store","description":"App store or Google Play store ID.","required":false,"type":"string","x-example":"[STORE]","default":"","in":"formData"},{"name":"hostname","description":"Platform client URL.","required":false,"type":"string","x-example":"[HOSTNAME]","default":"","in":"formData"}]},"delete":{"summary":"Delete Platform","operationId":"deletePlatform","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":117,"cookies":false,"type":"","demo":"projects\/delete-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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}\/tasks":{"get":{"summary":"List Tasks","operationId":"listTasks","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":109,"cookies":false,"type":"","demo":"projects\/list-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Task","operationId":"createTask","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":108,"cookies":false,"type":"","demo":"projects\/create-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"name","description":"Task name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"status","description":"Task status.","required":true,"type":"string","x-example":"play","in":"formData"},{"name":"schedule","description":"Task schedule CRON syntax.","required":true,"type":"string","in":"formData"},{"name":"security","description":"Certificate verification, false for disabled or true for enabled.","required":true,"type":"boolean","x-example":false,"in":"formData"},{"name":"httpMethod","description":"Task HTTP method.","required":true,"type":"string","x-example":"GET","in":"formData"},{"name":"httpUrl","description":"Task HTTP URL","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"},{"name":"httpHeaders","description":"Task HTTP headers list.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"httpUser","description":"Task HTTP user.","required":false,"type":"string","x-example":"[HTTP_USER]","default":"","in":"formData"},{"name":"httpPass","description":"Task HTTP password.","required":false,"type":"string","x-example":"[HTTP_PASS]","default":"","in":"formData"}]}},"\/projects\/{projectId}\/tasks\/{taskId}":{"get":{"summary":"Get Task","operationId":"getTask","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":110,"cookies":false,"type":"","demo":"projects\/get-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"}]},"put":{"summary":"Update Task","operationId":"updateTask","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":111,"cookies":false,"type":"","demo":"projects\/update-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"},{"name":"name","description":"Task name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"status","description":"Task status.","required":true,"type":"string","x-example":"play","in":"formData"},{"name":"schedule","description":"Task schedule CRON syntax.","required":true,"type":"string","in":"formData"},{"name":"security","description":"Certificate verification, false for disabled or true for enabled.","required":true,"type":"boolean","x-example":false,"in":"formData"},{"name":"httpMethod","description":"Task HTTP method.","required":true,"type":"string","x-example":"GET","in":"formData"},{"name":"httpUrl","description":"Task HTTP URL.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"},{"name":"httpHeaders","description":"Task HTTP headers list.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"httpUser","description":"Task HTTP user.","required":false,"type":"string","x-example":"[HTTP_USER]","default":"","in":"formData"},{"name":"httpPass","description":"Task HTTP password.","required":false,"type":"string","x-example":"[HTTP_PASS]","default":"","in":"formData"}]},"delete":{"summary":"Delete Task","operationId":"deleteTask","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":112,"cookies":false,"type":"","demo":"projects\/delete-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get Project","operationId":"getUsage","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":94,"cookies":false,"type":"","demo":"projects\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"daily","default":"last30","in":"query"}]}},"\/projects\/{projectId}\/webhooks":{"get":{"summary":"List Webhooks","operationId":"listWebhooks","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":99,"cookies":false,"type":"","demo":"projects\/list-webhooks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Webhook","operationId":"createWebhook","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":98,"cookies":false,"type":"","demo":"projects\/create-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"name","description":"Webhook name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"events","description":"Webhook events list.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"Webhook URL.","required":true,"type":"string","x-example":"[URL]","in":"formData"},{"name":"security","description":"Certificate verification, false for disabled or true for enabled.","required":true,"type":"boolean","x-example":false,"in":"formData"},{"name":"httpUser","description":"Webhook HTTP user.","required":false,"type":"string","x-example":"[HTTP_USER]","default":"","in":"formData"},{"name":"httpPass","description":"Webhook HTTP password.","required":false,"type":"string","x-example":"[HTTP_PASS]","default":"","in":"formData"}]}},"\/projects\/{projectId}\/webhooks\/{webhookId}":{"get":{"summary":"Get Webhook","operationId":"getWebhook","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":100,"cookies":false,"type":"","demo":"projects\/get-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"updateWebhook","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":101,"cookies":false,"type":"","demo":"projects\/update-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"name","description":"Webhook name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"events","description":"Webhook events list.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"Webhook URL.","required":true,"type":"string","x-example":"[URL]","in":"formData"},{"name":"security","description":"Certificate verification, false for disabled or true for enabled.","required":true,"type":"boolean","x-example":false,"in":"formData"},{"name":"httpUser","description":"Webhook HTTP user.","required":false,"type":"string","x-example":"[HTTP_USER]","default":"","in":"formData"},{"name":"httpPass","description":"Webhook HTTP password.","required":false,"type":"string","x-example":"[HTTP_PASS]","default":"","in":"formData"}]},"delete":{"summary":"Delete Webhook","operationId":"deleteWebhook","consumes":["application\/json"],"tags":["projects"],"description":"","x-appwrite":{"weight":102,"cookies":false,"type":"","demo":"projects\/delete-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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"}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"listFiles","consumes":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":124,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"createFile","consumes":["multipart\/form-data"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","x-appwrite":{"weight":123,"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":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"file","description":"Binary File.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"getFile","consumes":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","x-appwrite":{"weight":125,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"updateFile","consumes":["application\/json"],"tags":["storage"],"description":"Update file by its unique ID. Only users with write permissions have access to update this resource.","x-appwrite":{"weight":129,"cookies":false,"type":"","demo":"storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete File","operationId":"deleteFile","consumes":["application\/json"],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","x-appwrite":{"weight":130,"cookies":false,"type":"","demo":"storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"getFileDownload","consumes":["application\/json"],"tags":["storage"],"description":"Get 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.","x-appwrite":{"weight":127,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"getFilePreview","consumes":["application\/json"],"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.","x-appwrite":{"weight":126,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique 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":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"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","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"getFileView","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.","x-appwrite":{"weight":128,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"list","consumes":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":132,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"create","consumes":["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. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","x-appwrite":{"weight":131,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"roles","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](\/docs\/permissions).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":["owner"],"in":"formData"}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"get","consumes":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","x-appwrite":{"weight":133,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"update","consumes":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","x-appwrite":{"weight":134,"cookies":false,"type":"","demo":"teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]},"delete":{"summary":"Delete Team","operationId":"delete","consumes":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","x-appwrite":{"weight":135,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"getMemberships","consumes":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","x-appwrite":{"weight":137,"cookies":false,"type":"","demo":"teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"createMembership","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","x-appwrite":{"weight":136,"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":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"email","description":"New team member email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"name","description":"New team member name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"},{"name":"roles","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](\/docs\/permissions).","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the invitation 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.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"deleteMembership","consumes":["application\/json"],"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 he didn't accept it.","x-appwrite":{"weight":139,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"updateMembershipStatus","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after he is being redirected back to your app from the invitation email he was sent.","x-appwrite":{"weight":138,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"},{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Secret key.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}},"\/users":{"get":{"summary":"List Users","operationId":"list","consumes":["application\/json"],"tags":["users"],"description":"Get a list of all the project users. You can use the query params to filter your results.","x-appwrite":{"weight":141,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create User","operationId":"create","consumes":["application\/json"],"tags":["users"],"description":"Create a new user.","x-appwrite":{"weight":140,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]}},"\/users\/{userId}":{"get":{"summary":"Get User","operationId":"get","consumes":["application\/json"],"tags":["users"],"description":"Get user by its unique ID.","x-appwrite":{"weight":142,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["users"],"description":"Get user activity logs list by its unique ID.","x-appwrite":{"weight":145,"cookies":false,"type":"","demo":"users\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/prefs":{"get":{"summary":"Get User Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["users"],"description":"Get user preferences by its unique ID.","x-appwrite":{"weight":143,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["users"],"description":"Update user preferences by its unique ID. You can pass only the specific settings you wish to update.","x-appwrite":{"weight":147,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"Get User Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["users"],"description":"Get user sessions list by its unique ID.","x-appwrite":{"weight":144,"cookies":false,"type":"","demo":"users\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["users"],"description":"Delete all user sessions by its unique ID.","x-appwrite":{"weight":149,"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":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/sessions\/{sessionId}":{"delete":{"summary":"Delete User Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["users"],"description":"Delete user sessions by its unique ID.","x-appwrite":{"weight":148,"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":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"User unique session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"updateStatus","consumes":["application\/json"],"tags":["users"],"description":"Update user status by its unique ID.","x-appwrite":{"weight":146,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"status","description":"User Status code. To activate the user pass 1, to block the user pass 2 and for disabling the user pass 0","required":true,"type":"string","x-example":1,"in":"formData"}]}}},"definitions":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/localhost\/docs"}} \ No newline at end of file diff --git a/app/config/specs/0.6.2.server.json b/app/config/specs/0.6.2.server.json index 3cf2338d41..6186f78a4c 100644 --- a/app/config/specs/0.6.2.server.json +++ b/app/config/specs/0.6.2.server.json @@ -1 +1 @@ -{"swagger":"2.0","info":{"version":"0.6.2","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@localhost.test"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"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":"5df5acd0d48c2"}},"Key":{"type":"apiKey","name":"X-Appwrite-Key","description":"Your secret API key","in":"header","x-appwrite":{"demo":"919c2d18fb5d4...a2ae413da83346ad2"}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","x-appwrite":{"demo":"en"}}},"paths":{"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"getBrowser","consumes":["application\/json"],"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 \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","x-appwrite":{"weight":54,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"getCreditCard","consumes":["application\/json"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? 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.","x-appwrite":{"weight":53,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa.","required":true,"type":"string","x-example":"amex","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"getFavicon","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL.","x-appwrite":{"weight":57,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"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":"getFlag","consumes":["application\/json"],"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.","x-appwrite":{"weight":55,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"getImage","consumes":["application\/json"],"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.","x-appwrite":{"weight":56,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"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.","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.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"getInitials","consumes":["application\/json"],"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.","x-appwrite":{"weight":59,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Full Name. When empty, current user name or email will be used.","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":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","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":"getQR","consumes":["application\/json"],"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.","x-appwrite":{"weight":58,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-q-r.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"]},"security":[{"Project":[],"Key":[]}],"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 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"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"}]}},"\/database\/collections":{"get":{"summary":"List Collections","operationId":"listCollections","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":61,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Collection","operationId":"createCollection","consumes":["application\/json"],"tags":["database"],"description":"Create a new Collection.","x-appwrite":{"weight":60,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Collection name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"rules","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/database\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"getCollection","consumes":["application\/json"],"tags":["database"],"description":"Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.","x-appwrite":{"weight":62,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"updateCollection","consumes":["application\/json"],"tags":["database"],"description":"Update collection by its unique ID.","x-appwrite":{"weight":63,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"name","description":"Collection name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"rules","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"formData"}]},"delete":{"summary":"Delete Collection","operationId":"deleteCollection","consumes":["application\/json"],"tags":["database"],"description":"Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.","x-appwrite":{"weight":64,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"listDocuments","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":66,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"offset","description":"Offset value. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":50,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"$id","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"createDocument","consumes":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","x-appwrite":{"weight":65,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"parentDocument","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"[PARENT_DOCUMENT]","default":"","in":"formData"},{"name":"parentProperty","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","default":"","in":"formData"},{"name":"parentPropertyType","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"assign","default":"assign","in":"formData"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"getDocument","consumes":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","x-appwrite":{"weight":67,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"updateDocument","consumes":["application\/json"],"tags":["database"],"description":"","x-appwrite":{"weight":68,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Document","operationId":"deleteDocument","consumes":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted.","x-appwrite":{"weight":69,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"get","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","x-appwrite":{"weight":77,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/anti-virus":{"get":{"summary":"Get Anti virus","operationId":"getAntiVirus","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite Anti Virus server is up and connection is successful.","x-appwrite":{"weight":89,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-anti-virus.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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"getCache","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","x-appwrite":{"weight":80,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/db":{"get":{"summary":"Get DB","operationId":"getDB","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","x-appwrite":{"weight":79,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-d-b.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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/certificates":{"get":{"summary":"Get Certificate Queue","operationId":"getQueueCertificates","consumes":["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.","x-appwrite":{"weight":86,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/functions":{"get":{"summary":"Get Functions Queue","operationId":"getQueueFunctions","consumes":["application\/json"],"tags":["health"],"description":"","x-appwrite":{"weight":87,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/logs":{"get":{"summary":"Get Logs Queue","operationId":"getQueueLogs","consumes":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","x-appwrite":{"weight":84,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/tasks":{"get":{"summary":"Get Tasks Queue","operationId":"getQueueTasks","consumes":["application\/json"],"tags":["health"],"description":"Get the number of tasks that are waiting to be processed in the Appwrite internal queue server.","x-appwrite":{"weight":83,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-tasks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/usage":{"get":{"summary":"Get Usage Queue","operationId":"getQueueUsage","consumes":["application\/json"],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","x-appwrite":{"weight":85,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"getQueueWebhooks","consumes":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","x-appwrite":{"weight":82,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/storage\/local":{"get":{"summary":"Get Local Storage","operationId":"getStorageLocal","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","x-appwrite":{"weight":88,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/time":{"get":{"summary":"Get Time","operationId":"getTime","consumes":["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.","x-appwrite":{"weight":81,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"get","consumes":["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))","x-appwrite":{"weight":70,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"getContinents","consumes":["application\/json"],"tags":["locale"],"description":"List of all continents. You can use the locale header to get the data in a supported language.","x-appwrite":{"weight":74,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"getCountries","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries. You can use the locale header to get the data in a supported language.","x-appwrite":{"weight":71,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"getCountriesEU","consumes":["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.","x-appwrite":{"weight":72,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"getCountriesPhones","consumes":["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.","x-appwrite":{"weight":73,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"getCurrencies","consumes":["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.","x-appwrite":{"weight":75,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"getLanguages","consumes":["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.","x-appwrite":{"weight":76,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"listFiles","consumes":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":124,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"createFile","consumes":["multipart\/form-data"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","x-appwrite":{"weight":123,"cookies":false,"type":"upload","demo":"docs\/examples\/storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"file","description":"Binary File.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"getFile","consumes":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","x-appwrite":{"weight":125,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"updateFile","consumes":["application\/json"],"tags":["storage"],"description":"Update file by its unique ID. Only users with write permissions have access to update this resource.","x-appwrite":{"weight":129,"cookies":false,"type":"","demo":"docs\/examples\/storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete File","operationId":"deleteFile","consumes":["application\/json"],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","x-appwrite":{"weight":130,"cookies":false,"type":"","demo":"docs\/examples\/storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"getFileDownload","consumes":["application\/json"],"tags":["storage"],"description":"Get 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.","x-appwrite":{"weight":127,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"getFilePreview","consumes":["application\/json"],"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.","x-appwrite":{"weight":126,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique 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":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"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","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"getFileView","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.","x-appwrite":{"weight":128,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"list","consumes":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":132,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"create","consumes":["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. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","x-appwrite":{"weight":131,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"roles","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](\/docs\/permissions).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":["owner"],"in":"formData"}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"get","consumes":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","x-appwrite":{"weight":133,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"update","consumes":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","x-appwrite":{"weight":134,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]},"delete":{"summary":"Delete Team","operationId":"delete","consumes":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","x-appwrite":{"weight":135,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"getMemberships","consumes":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","x-appwrite":{"weight":137,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"createMembership","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","x-appwrite":{"weight":136,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"email","description":"New team member email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"name","description":"New team member name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"},{"name":"roles","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](\/docs\/permissions).","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the invitation 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.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"deleteMembership","consumes":["application\/json"],"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 he didn't accept it.","x-appwrite":{"weight":139,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/users":{"get":{"summary":"List Users","operationId":"list","consumes":["application\/json"],"tags":["users"],"description":"Get a list of all the project users. You can use the query params to filter your results.","x-appwrite":{"weight":141,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create User","operationId":"create","consumes":["application\/json"],"tags":["users"],"description":"Create a new user.","x-appwrite":{"weight":140,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]}},"\/users\/{userId}":{"get":{"summary":"Get User","operationId":"get","consumes":["application\/json"],"tags":["users"],"description":"Get user by its unique ID.","x-appwrite":{"weight":142,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["users"],"description":"Get user activity logs list by its unique ID.","x-appwrite":{"weight":145,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/prefs":{"get":{"summary":"Get User Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["users"],"description":"Get user preferences by its unique ID.","x-appwrite":{"weight":143,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["users"],"description":"Update user preferences by its unique ID. You can pass only the specific settings you wish to update.","x-appwrite":{"weight":147,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"Get User Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["users"],"description":"Get user sessions list by its unique ID.","x-appwrite":{"weight":144,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["users"],"description":"Delete all user sessions by its unique ID.","x-appwrite":{"weight":149,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/sessions\/{sessionId}":{"delete":{"summary":"Delete User Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["users"],"description":"Delete user sessions by its unique ID.","x-appwrite":{"weight":148,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"User unique session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"updateStatus","consumes":["application\/json"],"tags":["users"],"description":"Update user status by its unique ID.","x-appwrite":{"weight":146,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"status","description":"User Status code. To activate the user pass 1, to block the user pass 2 and for disabling the user pass 0","required":true,"type":"string","x-example":1,"in":"formData"}]}}},"definitions":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/localhost\/docs"}} \ No newline at end of file +{"swagger":"2.0","info":{"version":"0.6.2","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@localhost.test"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"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":"5df5acd0d48c2"}},"Key":{"type":"apiKey","name":"X-Appwrite-Key","description":"Your secret API key","in":"header","x-appwrite":{"demo":"919c2d18fb5d4...a2ae413da83346ad2"}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","x-appwrite":{"demo":"en"}}},"paths":{"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"getBrowser","consumes":["application\/json"],"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 \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","x-appwrite":{"weight":54,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"getCreditCard","consumes":["application\/json"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? 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.","x-appwrite":{"weight":53,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa.","required":true,"type":"string","x-example":"amex","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"getFavicon","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL.","x-appwrite":{"weight":57,"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"]},"security":[{"Project":[],"Key":[]}],"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":"getFlag","consumes":["application\/json"],"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.","x-appwrite":{"weight":55,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"getImage","consumes":["application\/json"],"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.","x-appwrite":{"weight":56,"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"]},"security":[{"Project":[],"Key":[]}],"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.","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.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"getInitials","consumes":["application\/json"],"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.","x-appwrite":{"weight":59,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Full Name. When empty, current user name or email will be used.","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":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","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":"getQR","consumes":["application\/json"],"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.","x-appwrite":{"weight":58,"cookies":false,"type":"location","demo":"avatars\/get-q-r.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"]},"security":[{"Project":[],"Key":[]}],"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 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"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"}]}},"\/database\/collections":{"get":{"summary":"List Collections","operationId":"listCollections","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":61,"cookies":false,"type":"","demo":"database\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Collection","operationId":"createCollection","consumes":["application\/json"],"tags":["database"],"description":"Create a new Collection.","x-appwrite":{"weight":60,"cookies":false,"type":"","demo":"database\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Collection name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"rules","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/database\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"getCollection","consumes":["application\/json"],"tags":["database"],"description":"Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.","x-appwrite":{"weight":62,"cookies":false,"type":"","demo":"database\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"updateCollection","consumes":["application\/json"],"tags":["database"],"description":"Update collection by its unique ID.","x-appwrite":{"weight":63,"cookies":false,"type":"","demo":"database\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"name","description":"Collection name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"rules","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"formData"}]},"delete":{"summary":"Delete Collection","operationId":"deleteCollection","consumes":["application\/json"],"tags":["database"],"description":"Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.","x-appwrite":{"weight":64,"cookies":false,"type":"","demo":"database\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"listDocuments","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":66,"cookies":false,"type":"","demo":"database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"offset","description":"Offset value. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":50,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"$id","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"createDocument","consumes":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","x-appwrite":{"weight":65,"cookies":false,"type":"","demo":"database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"parentDocument","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"[PARENT_DOCUMENT]","default":"","in":"formData"},{"name":"parentProperty","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","default":"","in":"formData"},{"name":"parentPropertyType","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"assign","default":"assign","in":"formData"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"getDocument","consumes":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","x-appwrite":{"weight":67,"cookies":false,"type":"","demo":"database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"updateDocument","consumes":["application\/json"],"tags":["database"],"description":"","x-appwrite":{"weight":68,"cookies":false,"type":"","demo":"database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Document","operationId":"deleteDocument","consumes":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted.","x-appwrite":{"weight":69,"cookies":false,"type":"","demo":"database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"get","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","x-appwrite":{"weight":77,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/anti-virus":{"get":{"summary":"Get Anti virus","operationId":"getAntiVirus","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite Anti Virus server is up and connection is successful.","x-appwrite":{"weight":89,"cookies":false,"type":"","demo":"health\/get-anti-virus.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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"getCache","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","x-appwrite":{"weight":80,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/db":{"get":{"summary":"Get DB","operationId":"getDB","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","x-appwrite":{"weight":79,"cookies":false,"type":"","demo":"health\/get-d-b.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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/certificates":{"get":{"summary":"Get Certificate Queue","operationId":"getQueueCertificates","consumes":["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.","x-appwrite":{"weight":86,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/functions":{"get":{"summary":"Get Functions Queue","operationId":"getQueueFunctions","consumes":["application\/json"],"tags":["health"],"description":"","x-appwrite":{"weight":87,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/logs":{"get":{"summary":"Get Logs Queue","operationId":"getQueueLogs","consumes":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","x-appwrite":{"weight":84,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/tasks":{"get":{"summary":"Get Tasks Queue","operationId":"getQueueTasks","consumes":["application\/json"],"tags":["health"],"description":"Get the number of tasks that are waiting to be processed in the Appwrite internal queue server.","x-appwrite":{"weight":83,"cookies":false,"type":"","demo":"health\/get-queue-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-tasks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/usage":{"get":{"summary":"Get Usage Queue","operationId":"getQueueUsage","consumes":["application\/json"],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","x-appwrite":{"weight":85,"cookies":false,"type":"","demo":"health\/get-queue-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"getQueueWebhooks","consumes":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","x-appwrite":{"weight":82,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/storage\/local":{"get":{"summary":"Get Local Storage","operationId":"getStorageLocal","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","x-appwrite":{"weight":88,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/time":{"get":{"summary":"Get Time","operationId":"getTime","consumes":["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.","x-appwrite":{"weight":81,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"get","consumes":["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))","x-appwrite":{"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"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"getContinents","consumes":["application\/json"],"tags":["locale"],"description":"List of all continents. You can use the locale header to get the data in a supported language.","x-appwrite":{"weight":74,"cookies":false,"type":"","demo":"locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"getCountries","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries. You can use the locale header to get the data in a supported language.","x-appwrite":{"weight":71,"cookies":false,"type":"","demo":"locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"getCountriesEU","consumes":["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.","x-appwrite":{"weight":72,"cookies":false,"type":"","demo":"locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"getCountriesPhones","consumes":["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.","x-appwrite":{"weight":73,"cookies":false,"type":"","demo":"locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"getCurrencies","consumes":["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.","x-appwrite":{"weight":75,"cookies":false,"type":"","demo":"locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"getLanguages","consumes":["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.","x-appwrite":{"weight":76,"cookies":false,"type":"","demo":"locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"listFiles","consumes":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":124,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"createFile","consumes":["multipart\/form-data"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","x-appwrite":{"weight":123,"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":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"file","description":"Binary File.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"getFile","consumes":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","x-appwrite":{"weight":125,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"updateFile","consumes":["application\/json"],"tags":["storage"],"description":"Update file by its unique ID. Only users with write permissions have access to update this resource.","x-appwrite":{"weight":129,"cookies":false,"type":"","demo":"storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete File","operationId":"deleteFile","consumes":["application\/json"],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","x-appwrite":{"weight":130,"cookies":false,"type":"","demo":"storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"getFileDownload","consumes":["application\/json"],"tags":["storage"],"description":"Get 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.","x-appwrite":{"weight":127,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"getFilePreview","consumes":["application\/json"],"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.","x-appwrite":{"weight":126,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique 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":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"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","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"getFileView","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.","x-appwrite":{"weight":128,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"list","consumes":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","x-appwrite":{"weight":132,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"create","consumes":["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. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","x-appwrite":{"weight":131,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"roles","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](\/docs\/permissions).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":["owner"],"in":"formData"}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"get","consumes":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","x-appwrite":{"weight":133,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"update","consumes":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","x-appwrite":{"weight":134,"cookies":false,"type":"","demo":"teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]},"delete":{"summary":"Delete Team","operationId":"delete","consumes":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","x-appwrite":{"weight":135,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"getMemberships","consumes":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","x-appwrite":{"weight":137,"cookies":false,"type":"","demo":"teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"createMembership","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","x-appwrite":{"weight":136,"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":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"email","description":"New team member email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"name","description":"New team member name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"},{"name":"roles","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](\/docs\/permissions).","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the invitation 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.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"deleteMembership","consumes":["application\/json"],"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 he didn't accept it.","x-appwrite":{"weight":139,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/users":{"get":{"summary":"List Users","operationId":"list","consumes":["application\/json"],"tags":["users"],"description":"Get a list of all the project users. You can use the query params to filter your results.","x-appwrite":{"weight":141,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create User","operationId":"create","consumes":["application\/json"],"tags":["users"],"description":"Create a new user.","x-appwrite":{"weight":140,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]}},"\/users\/{userId}":{"get":{"summary":"Get User","operationId":"get","consumes":["application\/json"],"tags":["users"],"description":"Get user by its unique ID.","x-appwrite":{"weight":142,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["users"],"description":"Get user activity logs list by its unique ID.","x-appwrite":{"weight":145,"cookies":false,"type":"","demo":"users\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/prefs":{"get":{"summary":"Get User Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["users"],"description":"Get user preferences by its unique ID.","x-appwrite":{"weight":143,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["users"],"description":"Update user preferences by its unique ID. You can pass only the specific settings you wish to update.","x-appwrite":{"weight":147,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"Get User Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["users"],"description":"Get user sessions list by its unique ID.","x-appwrite":{"weight":144,"cookies":false,"type":"","demo":"users\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["users"],"description":"Delete all user sessions by its unique ID.","x-appwrite":{"weight":149,"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":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/sessions\/{sessionId}":{"delete":{"summary":"Delete User Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["users"],"description":"Delete user sessions by its unique ID.","x-appwrite":{"weight":148,"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":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"User unique session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"updateStatus","consumes":["application\/json"],"tags":["users"],"description":"Update user status by its unique ID.","x-appwrite":{"weight":146,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"status","description":"User Status code. To activate the user pass 1, to block the user pass 2 and for disabling the user pass 0","required":true,"type":"string","x-example":1,"in":"formData"}]}}},"definitions":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/localhost\/docs"}} \ No newline at end of file diff --git a/app/config/specs/0.7.0.client.json b/app/config/specs/0.7.0.client.json index 631064ca4d..04c989d463 100644 --- a/app/config/specs/0.7.0.client.json +++ b/app/config/specs/0.7.0.client.json @@ -1,2 +1,2 @@ -{"swagger":"2.0","info":{"version":"0.7.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":"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":"5df5acd0d48c2"}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","x-appwrite":{"demo":"en"}}},"paths":{"\/account":{"get":{"summary":"Get Account","operationId":"accountGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"get","weight":41,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}]},"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](\/docs\/client\/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](\/docs\/client\/account#createSession).","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"create","weight":35,"cookies":false,"type":"","demo":"docs\/examples\/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":"public","platforms":["client"]},"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 between 6 to 32 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":49,"cookies":false,"type":"","demo":"docs\/examples\/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":["client"]},"security":[{"Project":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"accountUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":47,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"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 between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"accountGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":44,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account 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"}}},"x-appwrite":{"method":"updateName","weight":45,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"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 Account 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 the password twice.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":46,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Old user password. Must be between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["password","oldPassword"]}}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"accountGetPrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"getPrefs","weight":42,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}]},"patch":{"summary":"Update Account Preferences","operationId":"accountUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"updatePrefs","weight":48,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":null,"x-example":"{}"}},"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](\/docs\/client\/account#updateRecovery) endpoint to complete the process.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createRecovery","weight":52,"cookies":false,"type":"","demo":"docs\/examples\/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}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"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":"Complete Password Recovery","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](\/docs\/client\/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"}}},"x-appwrite":{"method":"updateRecovery","weight":53,"cookies":false,"type":"","demo":"docs\/examples\/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":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User account UID address.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"New password again. Must be between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["userId","secret","password","passwordAgain"]}}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"accountGetSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","responses":{"200":{"description":"Sessions List","schema":{"$ref":"#\/definitions\/sessionList"}}},"x-appwrite":{"method":"getSessions","weight":43,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]},"post":{"summary":"Create Account Session","operationId":"accountCreateSession","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.","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createSession","weight":36,"cookies":false,"type":"","demo":"docs\/examples\/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":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"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 between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]},"delete":{"summary":"Delete All Account Sessions","operationId":"accountDeleteSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Delete all sessions from the user account and remove any sessions cookies from the end client.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSessions","weight":51,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}]}},"\/account\/sessions\/oauth2\/{provider}":{"get":{"summary":"Create Account Session with OAuth2","operationId":"accountCreateOAuth2Session","consumes":["application\/json"],"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.","responses":{"301":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"createOAuth2Session","weight":37,"cookies":false,"type":"webAuth","demo":"docs\/examples\/account\/create-o-auth2session.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":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, twitch, vk, yahoo, yandex, wordpress.","required":true,"type":"string","x-example":"amazon","in":"path"},{"name":"success","description":"URL to redirect back to your app after a successful login attempt. 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.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/success","in":"query"},{"name":"failure","description":"URL to redirect back to your app after a failed login attempt. 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.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/failure","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"accountDeleteSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all their account sessions across all of their different devices. When using the option id argument, only the session unique ID provider will be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":50,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/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](\/docs\/client\/account#updateVerification). \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"}}},"x-appwrite":{"method":"createVerification","weight":54,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"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":"Complete Email Verification","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"}}},"x-appwrite":{"method":"updateVerification","weight":55,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User unique 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":["application\/json"],"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 \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":57,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"avatarsGetCreditCard","consumes":["application\/json"],"produces":["image\/png"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? 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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":56,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.","required":true,"type":"string","x-example":"amex","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"avatarsGetFavicon","consumes":["application\/json"],"produces":["image\/*"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFavicon","weight":60,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"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":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":58,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"avatarsGetImage","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":59,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"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.","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.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":62,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"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":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","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":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":61,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-q-r.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"]},"security":[{"Project":[]}],"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 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"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"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"databaseListDocuments","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Documents List","schema":{"$ref":"#\/definitions\/documentList"}}},"x-appwrite":{"method":"listDocuments","weight":69,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Offset value. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"$id","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"databaseCreateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","responses":{"201":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"createDocument","weight":68,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","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.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"parentDocument":{"type":"string","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","default":"","x-example":"[PARENT_DOCUMENT]"},"parentProperty":{"type":"string","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","default":"","x-example":null},"parentPropertyType":{"type":"string","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","default":"assign","x-example":"assign"}},"required":["data","read","write"]}}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"databaseGetDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"getDocument","weight":70,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"databaseUpdateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"updateDocument","weight":71,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique 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.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["data","read","write"]}}]},"delete":{"summary":"Delete Document","operationId":"databaseDeleteDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents **will not** be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":72,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"localeGet","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"get","weight":73,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"localeGetContinents","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getContinents","weight":77,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"localeGetCountries","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCountries","weight":74,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"localeGetCountriesEU","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCountriesEU","weight":75,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"localeGetCountriesPhones","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCountriesPhones","weight":76,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"localeGetCurrencies","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCurrencies","weight":78,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"localeGetLanguages","consumes":["application\/json"],"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\/langaugeList"}}},"x-appwrite":{"method":"getLanguages","weight":79,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Files List","schema":{"$ref":"#\/definitions\/fileList"}}},"x-appwrite":{"method":"listFiles","weight":127,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"storageCreateFile","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":126,"cookies":false,"type":"upload","demo":"docs\/examples\/storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"storageGetFile","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"getFile","weight":128,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique 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 file by its unique ID. Only users with write permissions have access to update this resource.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"updateFile","weight":132,"cookies":false,"type":"","demo":"docs\/examples\/storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["read","write"]}}]},"delete":{"summary":"Delete File","operationId":"storageDeleteFile","consumes":["application\/json"],"produces":["application\/json"],"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"}},"x-appwrite":{"method":"deleteFile","weight":133,"cookies":false,"type":"","demo":"docs\/examples\/storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["application\/json"],"produces":["*\/*"],"tags":["storage"],"description":"Get 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"}}},"x-appwrite":{"method":"getFileDownload","weight":130,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"storageGetFilePreview","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":129,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique 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":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"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","default":"","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"storageGetFileView","consumes":["application\/json"],"produces":["*\/*"],"tags":["storage"],"description":"Get 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"}}},"x-appwrite":{"method":"getFileView","weight":131,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":135,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","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. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":134,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](\/docs\/permissions). Max length for each role is 32 chars.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":136,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"teamsUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":137,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":138,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"teamsGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":140,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"teamsCreateMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":139,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"New team member email.","default":null,"x-example":"email@example.com"},"name":{"type":"string","description":"New team member name. Max length: 128 chars.","default":"","x-example":"[NAME]"},"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](\/docs\/permissions). Max length for each role is 32 chars.","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. 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","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"teamsDeleteMembership","consumes":["application\/json"],"produces":["application\/json"],"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"}},"x-appwrite":{"method":"deleteMembership","weight":142,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}\/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 recieved by the user.","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":141,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User unique ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}}},"definitions":{"none":{"description":"None","type":"object"},"any":{"description":"Any","type":"object","additionalProperties":true},"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"},"version":{"type":"string","description":"Server version number.","x-example":"1.0"}},"required":["message","code","version"]},"collectionList":{"description":"Collections List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"}}},"required":["sum","collections"]},"documentList":{"description":"Documents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/any"}}},"required":["sum","documents"]},"userList":{"description":"Users List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"users":{"type":"array","description":"List of users.","items":{"type":"object","$ref":"#\/definitions\/user"}}},"required":["sum","users"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"}}},"required":["sum","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"}}},"required":["logs"]},"fileList":{"description":"Files List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"}}},"required":["sum","files"]},"teamList":{"description":"Teams List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"}}},"required":["sum","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"}}},"required":["sum","memberships"]},"functionList":{"description":"Functions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"}}},"required":["sum","functions"]},"tagList":{"description":"Tags List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"tags":{"type":"array","description":"List of tags.","items":{"type":"object","$ref":"#\/definitions\/tag"}}},"required":["sum","tags"]},"executionList":{"description":"Executions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"}}},"required":["sum","executions"]},"countryList":{"description":"Countries List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"}}},"required":["sum","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"}}},"required":["sum","continents"]},"langaugeList":{"description":"Languages List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/langauge"}}},"required":["sum","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"}}},"required":["sum","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"}}},"required":["sum","phones"]},"permissions":{"description":"Permissions","type":"object","properties":{"read":{"type":"array","description":"Read permissions.","items":{"type":"string"}},"write":{"type":"array","description":"Write permissions.","items":{"type":"string"}}},"required":["read","write"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"Collection permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"Collection name.","x-example":"Movies"},"dateCreated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981550,"format":"int32"},"rules":{"type":"array","description":"Collection rules.","items":{"type":"object","$ref":"#\/definitions\/rule"}}},"required":["$id","$permissions","name","dateCreated","dateUpdated","rules"]},"rule":{"description":"Rule","type":"object","properties":{"$id":{"type":"string","description":"Rule ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Rule Collection.","x-example":"5e5e66c16897e"},"type":{"type":"string","description":"Rule type. Possible values: ","x-example":"title"},"key":{"type":"string","description":"Rule key.","x-example":"title"},"label":{"type":"string","description":"Rule label.","x-example":"Title"},"default":{"type":"string","description":"Rule default value.","x-example":"Movie Name"},"array":{"type":"boolean","description":"Is array?","x-example":false},"required":{"type":"boolean","description":"Is required?","x-example":true},"list":{"type":"array","description":"List of allowed values","items":{"type":"string"}}},"required":["$id","$collection","type","key","label","default","array","required","list"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"integer","description":"Log creation time in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"User name.","x-example":"John Doe"},"registration":{"type":"integer","description":"User registration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"status":{"type":"integer","description":"User status. 0 for Unavtivated, 1 for active and 2 is blocked.","x-example":0,"format":"int32"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"emailVerification":{"type":"boolean","description":"Email verification status.","x-example":true},"prefs":{"type":"string","description":"User preferences as a key-value object","x-example":{"theme":"pink","timezone":"UTC"}},"roles":{"type":"array","description":"User list of roles","items":{"type":"string"}}},"required":["$id","name","registration","status","email","emailVerification","prefs","roles"]},"session":{"description":"Session","type":"object","properties":{"$id":{"type":"string","description":"Session ID.","x-example":"5e5ea5c16897e"},"expire":{"type":"integer","description":"Session expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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}},"required":["$id","expire","ip","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName","current"]},"token":{"description":"Token","type":"object","properties":{"$id":{"type":"string","description":"Token ID.","x-example":"5e5ea5c16897e"},"expire":{"type":"integer","description":"Token expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"}},"required":["$id","expire"]},"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 Europian 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"]},"file":{"description":"File","type":"object","properties":{"$id":{"type":"string","description":"File ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"File permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"File name.","x-example":"Pink.png"},"dateCreated":{"type":"integer","description":"File creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"}},"required":["$id","$permissions","name","dateCreated","signature","mimeType","sizeOriginal"]},"team":{"description":"Team","type":"object","properties":{"$id":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Team name.","x-example":"VIP"},"dateCreated":{"type":"integer","description":"Team creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"sum":{"type":"integer","description":"Total sum of team members.","x-example":7,"format":"int32"}},"required":["$id","name","dateCreated","sum"]},"membership":{"description":"Membership","type":"object","properties":{"$id":{"type":"string","description":"Membership ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"teamId":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"User name.","x-example":"VIP"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"invited":{"type":"integer","description":"Date, the user has been invited to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"joined":{"type":"integer","description":"Date, the user has accepted the invitation to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"confirm":{"type":"boolean","description":"User confirmation status, true if the user has joined the team or false otherwise.","x-example":false},"roles":{"type":"array","description":"User list of roles","items":{"type":"string"}}},"required":["$id","userId","teamId","name","email","invited","joined","confirm","roles"]},"function":{"description":"Function","type":"object","properties":{"$id":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Function name.","x-example":"My Function"},"dateCreated":{"type":"integer","description":"Function creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Function update date in Unix timestamp.","x-example":1592981257,"format":"int32"},"status":{"type":"string","description":"Function status. Possible values: disabled, enabled","x-example":"enabled"},"env":{"type":"string","description":"Function execution environment.","x-example":"python-3.8"},"tag":{"type":"string","description":"Function active tag ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"string","description":"Function environment variables.","x-example":{"key":"value"}},"events":{"type":"array","description":"Function trigger events.","items":{"type":"string"}},"schedule":{"type":"string","description":"Function execution schedult in CRON format.","x-example":"5 4 * * *"},"scheduleNext":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981292,"format":"int32"},"schedulePrevious":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981237,"format":"int32"},"timeout":{"type":"integer","description":"Function execution timeout in seconds.","x-example":1592981237,"format":"int32"}},"required":["$id","name","dateCreated","dateUpdated","status","env","tag","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"tag":{"description":"Tag","type":"object","properties":{"$id":{"type":"string","description":"Tag ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The tag creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"command":{"type":"string","description":"The entrypoint command in use to execute the tag code.","x-example":"enabled"},"size":{"type":"string","description":"The code size in bytes.","x-example":"python-3.8"}},"required":["$id","functionId","dateCreated","command","size"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The execution creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"trigger":{"type":"string","description":"The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.","x-example":"http"},"status":{"type":"string","description":"The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.","x-example":"processing"},"exitCode":{"type":"integer","description":"The script exit code.","x-example":0,"format":"int32"},"stdout":{"type":"string","description":"The script stdout output string.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string.","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"float"}},"required":["$id","functionId","dateCreated","trigger","status","exitCode","stdout","stderr","time"]},"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"]},"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"]},"langauge":{"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"]},"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":"float"},"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"]},"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"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file +{"swagger":"2.0","info":{"version":"0.7.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":"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":"5df5acd0d48c2"}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","x-appwrite":{"demo":"en"}}},"paths":{"\/account":{"get":{"summary":"Get Account","operationId":"accountGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"get","weight":41,"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"]},"security":[{"Project":[]}]},"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](\/docs\/client\/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](\/docs\/client\/account#createSession).","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"create","weight":35,"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":"public","platforms":["client"]},"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 between 6 to 32 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":49,"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":["client"]},"security":[{"Project":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"accountUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":47,"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"]},"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 between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"accountGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":44,"cookies":false,"type":"","demo":"account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account 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"}}},"x-appwrite":{"method":"updateName","weight":45,"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"]},"security":[{"Project":[]}],"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 Account 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 the password twice.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":46,"cookies":false,"type":"","demo":"account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Old user password. Must be between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["password","oldPassword"]}}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"accountGetPrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"getPrefs","weight":42,"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"]},"security":[{"Project":[]}]},"patch":{"summary":"Update Account Preferences","operationId":"accountUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"updatePrefs","weight":48,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":null,"x-example":"{}"}},"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](\/docs\/client\/account#updateRecovery) endpoint to complete the process.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createRecovery","weight":52,"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}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"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":"Complete Password Recovery","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](\/docs\/client\/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"}}},"x-appwrite":{"method":"updateRecovery","weight":53,"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":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User account UID address.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"New password again. Must be between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["userId","secret","password","passwordAgain"]}}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"accountGetSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","responses":{"200":{"description":"Sessions List","schema":{"$ref":"#\/definitions\/sessionList"}}},"x-appwrite":{"method":"getSessions","weight":43,"cookies":false,"type":"","demo":"account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]},"post":{"summary":"Create Account Session","operationId":"accountCreateSession","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.","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createSession","weight":36,"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":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"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 between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]},"delete":{"summary":"Delete All Account Sessions","operationId":"accountDeleteSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Delete all sessions from the user account and remove any sessions cookies from the end client.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSessions","weight":51,"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"]},"security":[{"Project":[]}]}},"\/account\/sessions\/oauth2\/{provider}":{"get":{"summary":"Create Account Session with OAuth2","operationId":"accountCreateOAuth2Session","consumes":["application\/json"],"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.","responses":{"301":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"createOAuth2Session","weight":37,"cookies":false,"type":"webAuth","demo":"account\/create-o-auth2session.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":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, twitch, vk, yahoo, yandex, wordpress.","required":true,"type":"string","x-example":"amazon","in":"path"},{"name":"success","description":"URL to redirect back to your app after a successful login attempt. 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.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/success","in":"query"},{"name":"failure","description":"URL to redirect back to your app after a failed login attempt. 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.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/failure","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"accountDeleteSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all their account sessions across all of their different devices. When using the option id argument, only the session unique ID provider will be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":50,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/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](\/docs\/client\/account#updateVerification). \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"}}},"x-appwrite":{"method":"createVerification","weight":54,"cookies":false,"type":"","demo":"account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"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":"Complete Email Verification","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"}}},"x-appwrite":{"method":"updateVerification","weight":55,"cookies":false,"type":"","demo":"account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User unique 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":["application\/json"],"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 \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":57,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"avatarsGetCreditCard","consumes":["application\/json"],"produces":["image\/png"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? 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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":56,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.","required":true,"type":"string","x-example":"amex","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"avatarsGetFavicon","consumes":["application\/json"],"produces":["image\/*"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFavicon","weight":60,"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"]},"security":[{"Project":[]}],"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":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":58,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"avatarsGetImage","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":59,"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"]},"security":[{"Project":[]}],"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.","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.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":62,"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"]},"security":[{"Project":[]}],"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":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","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":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":61,"cookies":false,"type":"location","demo":"avatars\/get-q-r.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"]},"security":[{"Project":[]}],"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 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"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"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"databaseListDocuments","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Documents List","schema":{"$ref":"#\/definitions\/documentList"}}},"x-appwrite":{"method":"listDocuments","weight":69,"cookies":false,"type":"","demo":"database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Offset value. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"databaseCreateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","responses":{"201":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"createDocument","weight":68,"cookies":false,"type":"","demo":"database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","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.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"parentDocument":{"type":"string","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","default":"","x-example":"[PARENT_DOCUMENT]"},"parentProperty":{"type":"string","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","default":"","x-example":null},"parentPropertyType":{"type":"string","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","default":"assign","x-example":"assign"}},"required":["data","read","write"]}}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"databaseGetDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"getDocument","weight":70,"cookies":false,"type":"","demo":"database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"databaseUpdateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"updateDocument","weight":71,"cookies":false,"type":"","demo":"database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique 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.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["data","read","write"]}}]},"delete":{"summary":"Delete Document","operationId":"databaseDeleteDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents **will not** be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":72,"cookies":false,"type":"","demo":"database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"localeGet","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"get","weight":73,"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"]},"security":[{"Project":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"localeGetContinents","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getContinents","weight":77,"cookies":false,"type":"","demo":"locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"localeGetCountries","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCountries","weight":74,"cookies":false,"type":"","demo":"locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"localeGetCountriesEU","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCountriesEU","weight":75,"cookies":false,"type":"","demo":"locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"localeGetCountriesPhones","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCountriesPhones","weight":76,"cookies":false,"type":"","demo":"locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"localeGetCurrencies","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCurrencies","weight":78,"cookies":false,"type":"","demo":"locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"localeGetLanguages","consumes":["application\/json"],"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\/langaugeList"}}},"x-appwrite":{"method":"getLanguages","weight":79,"cookies":false,"type":"","demo":"locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Files List","schema":{"$ref":"#\/definitions\/fileList"}}},"x-appwrite":{"method":"listFiles","weight":127,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"storageCreateFile","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":126,"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":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"storageGetFile","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"getFile","weight":128,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique 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 file by its unique ID. Only users with write permissions have access to update this resource.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"updateFile","weight":132,"cookies":false,"type":"","demo":"storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["read","write"]}}]},"delete":{"summary":"Delete File","operationId":"storageDeleteFile","consumes":["application\/json"],"produces":["application\/json"],"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"}},"x-appwrite":{"method":"deleteFile","weight":133,"cookies":false,"type":"","demo":"storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["application\/json"],"produces":["*\/*"],"tags":["storage"],"description":"Get 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"}}},"x-appwrite":{"method":"getFileDownload","weight":130,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"storageGetFilePreview","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":129,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique 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":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"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","default":"","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"storageGetFileView","consumes":["application\/json"],"produces":["*\/*"],"tags":["storage"],"description":"Get 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"}}},"x-appwrite":{"method":"getFileView","weight":131,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":135,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","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. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":134,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](\/docs\/permissions). Max length for each role is 32 chars.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":136,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"teamsUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":137,"cookies":false,"type":"","demo":"teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":138,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"teamsGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":140,"cookies":false,"type":"","demo":"teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"teamsCreateMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":139,"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":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"New team member email.","default":null,"x-example":"email@example.com"},"name":{"type":"string","description":"New team member name. Max length: 128 chars.","default":"","x-example":"[NAME]"},"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](\/docs\/permissions). Max length for each role is 32 chars.","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. 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","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"teamsDeleteMembership","consumes":["application\/json"],"produces":["application\/json"],"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"}},"x-appwrite":{"method":"deleteMembership","weight":142,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}\/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 recieved by the user.","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":141,"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"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User unique ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}}},"definitions":{"none":{"description":"None","type":"object"},"any":{"description":"Any","type":"object","additionalProperties":true},"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"},"version":{"type":"string","description":"Server version number.","x-example":"1.0"}},"required":["message","code","version"]},"collectionList":{"description":"Collections List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"}}},"required":["sum","collections"]},"documentList":{"description":"Documents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/any"}}},"required":["sum","documents"]},"userList":{"description":"Users List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"users":{"type":"array","description":"List of users.","items":{"type":"object","$ref":"#\/definitions\/user"}}},"required":["sum","users"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"}}},"required":["sum","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"}}},"required":["logs"]},"fileList":{"description":"Files List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"}}},"required":["sum","files"]},"teamList":{"description":"Teams List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"}}},"required":["sum","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"}}},"required":["sum","memberships"]},"functionList":{"description":"Functions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"}}},"required":["sum","functions"]},"tagList":{"description":"Tags List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"tags":{"type":"array","description":"List of tags.","items":{"type":"object","$ref":"#\/definitions\/tag"}}},"required":["sum","tags"]},"executionList":{"description":"Executions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"}}},"required":["sum","executions"]},"countryList":{"description":"Countries List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"}}},"required":["sum","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"}}},"required":["sum","continents"]},"langaugeList":{"description":"Languages List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/langauge"}}},"required":["sum","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"}}},"required":["sum","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"}}},"required":["sum","phones"]},"permissions":{"description":"Permissions","type":"object","properties":{"read":{"type":"array","description":"Read permissions.","items":{"type":"string"}},"write":{"type":"array","description":"Write permissions.","items":{"type":"string"}}},"required":["read","write"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"Collection permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"Collection name.","x-example":"Movies"},"dateCreated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981550,"format":"int32"},"rules":{"type":"array","description":"Collection rules.","items":{"type":"object","$ref":"#\/definitions\/rule"}}},"required":["$id","$permissions","name","dateCreated","dateUpdated","rules"]},"rule":{"description":"Rule","type":"object","properties":{"$id":{"type":"string","description":"Rule ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Rule Collection.","x-example":"5e5e66c16897e"},"type":{"type":"string","description":"Rule type. Possible values: ","x-example":"title"},"key":{"type":"string","description":"Rule key.","x-example":"title"},"label":{"type":"string","description":"Rule label.","x-example":"Title"},"default":{"type":"string","description":"Rule default value.","x-example":"Movie Name"},"array":{"type":"boolean","description":"Is array?","x-example":false},"required":{"type":"boolean","description":"Is required?","x-example":true},"list":{"type":"array","description":"List of allowed values","items":{"type":"string"}}},"required":["$id","$collection","type","key","label","default","array","required","list"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"integer","description":"Log creation time in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"User name.","x-example":"John Doe"},"registration":{"type":"integer","description":"User registration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"status":{"type":"integer","description":"User status. 0 for Unavtivated, 1 for active and 2 is blocked.","x-example":0,"format":"int32"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"emailVerification":{"type":"boolean","description":"Email verification status.","x-example":true},"prefs":{"type":"string","description":"User preferences as a key-value object","x-example":{"theme":"pink","timezone":"UTC"}}},"required":["$id","name","registration","status","email","emailVerification","prefs"]},"session":{"description":"Session","type":"object","properties":{"$id":{"type":"string","description":"Session ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5bb8c16897e"},"expire":{"type":"integer","description":"Session expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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}},"required":["$id","userId","expire","ip","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName","current"]},"token":{"description":"Token","type":"object","properties":{"$id":{"type":"string","description":"Token ID.","x-example":"bb8ea5c16897e"},"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":"integer","description":"Token expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"}},"required":["$id","userId","secret","expire"]},"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 Europian 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"]},"file":{"description":"File","type":"object","properties":{"$id":{"type":"string","description":"File ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"File permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"File name.","x-example":"Pink.png"},"dateCreated":{"type":"integer","description":"File creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"}},"required":["$id","$permissions","name","dateCreated","signature","mimeType","sizeOriginal"]},"team":{"description":"Team","type":"object","properties":{"$id":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Team name.","x-example":"VIP"},"dateCreated":{"type":"integer","description":"Team creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"sum":{"type":"integer","description":"Total sum of team members.","x-example":7,"format":"int32"}},"required":["$id","name","dateCreated","sum"]},"membership":{"description":"Membership","type":"object","properties":{"$id":{"type":"string","description":"Membership ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"teamId":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"User name.","x-example":"VIP"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"invited":{"type":"integer","description":"Date, the user has been invited to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"joined":{"type":"integer","description":"Date, the user has accepted the invitation to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"confirm":{"type":"boolean","description":"User confirmation status, true if the user has joined the team or false otherwise.","x-example":false},"roles":{"type":"array","description":"User list of roles","items":{"type":"string"}}},"required":["$id","userId","teamId","name","email","invited","joined","confirm","roles"]},"function":{"description":"Function","type":"object","properties":{"$id":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Function name.","x-example":"My Function"},"dateCreated":{"type":"integer","description":"Function creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Function update date in Unix timestamp.","x-example":1592981257,"format":"int32"},"status":{"type":"string","description":"Function status. Possible values: disabled, enabled","x-example":"enabled"},"env":{"type":"string","description":"Function execution environment.","x-example":"python-3.8"},"tag":{"type":"string","description":"Function active tag ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"string","description":"Function environment variables.","x-example":{"key":"value"}},"events":{"type":"array","description":"Function trigger events.","items":{"type":"string"}},"schedule":{"type":"string","description":"Function execution schedult in CRON format.","x-example":"5 4 * * *"},"scheduleNext":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981292,"format":"int32"},"schedulePrevious":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981237,"format":"int32"},"timeout":{"type":"integer","description":"Function execution timeout in seconds.","x-example":1592981237,"format":"int32"}},"required":["$id","name","dateCreated","dateUpdated","status","env","tag","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"tag":{"description":"Tag","type":"object","properties":{"$id":{"type":"string","description":"Tag ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The tag creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"command":{"type":"string","description":"The entrypoint command in use to execute the tag code.","x-example":"enabled"},"size":{"type":"string","description":"The code size in bytes.","x-example":"python-3.8"}},"required":["$id","functionId","dateCreated","command","size"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The execution creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"trigger":{"type":"string","description":"The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.","x-example":"http"},"status":{"type":"string","description":"The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.","x-example":"processing"},"exitCode":{"type":"integer","description":"The script exit code.","x-example":0,"format":"int32"},"stdout":{"type":"string","description":"The script stdout output string.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string.","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"float"}},"required":["$id","functionId","dateCreated","trigger","status","exitCode","stdout","stderr","time"]},"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"]},"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"]},"langauge":{"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"]},"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":"float"},"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"]},"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"]}},"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/0.7.0.console.json b/app/config/specs/0.7.0.console.json index 1bec594ba1..ced5aa3bcd 100644 --- a/app/config/specs/0.7.0.console.json +++ b/app/config/specs/0.7.0.console.json @@ -1,2 +1,2 @@ -{"swagger":"2.0","info":{"version":"0.7.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":"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":"5df5acd0d48c2"}},"Key":{"type":"apiKey","name":"X-Appwrite-Key","description":"Your secret API key","in":"header","x-appwrite":{"demo":"919c2d18fb5d4...a2ae413da83346ad2"}},"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":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"get","weight":41,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]},"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](\/docs\/client\/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](\/docs\/client\/account#createSession).","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"create","weight":35,"cookies":false,"type":"","demo":"docs\/examples\/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":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"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 between 6 to 32 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":49,"cookies":false,"type":"","demo":"docs\/examples\/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":["client"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"accountUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":47,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"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 between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"accountGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":44,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account 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"}}},"x-appwrite":{"method":"updateName","weight":45,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"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 Account 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 the password twice.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":46,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Old user password. Must be between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["password","oldPassword"]}}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"accountGetPrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"getPrefs","weight":42,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]},"patch":{"summary":"Update Account Preferences","operationId":"accountUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"updatePrefs","weight":48,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":null,"x-example":"{}"}},"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](\/docs\/client\/account#updateRecovery) endpoint to complete the process.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createRecovery","weight":52,"cookies":false,"type":"","demo":"docs\/examples\/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}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"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":"Complete Password Recovery","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](\/docs\/client\/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"}}},"x-appwrite":{"method":"updateRecovery","weight":53,"cookies":false,"type":"","demo":"docs\/examples\/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":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User account UID address.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"New password again. Must be between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["userId","secret","password","passwordAgain"]}}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"accountGetSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","responses":{"200":{"description":"Sessions List","schema":{"$ref":"#\/definitions\/sessionList"}}},"x-appwrite":{"method":"getSessions","weight":43,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]},"post":{"summary":"Create Account Session","operationId":"accountCreateSession","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.","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createSession","weight":36,"cookies":false,"type":"","demo":"docs\/examples\/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":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"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 between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]},"delete":{"summary":"Delete All Account Sessions","operationId":"accountDeleteSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Delete all sessions from the user account and remove any sessions cookies from the end client.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSessions","weight":51,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/sessions\/oauth2\/{provider}":{"get":{"summary":"Create Account Session with OAuth2","operationId":"accountCreateOAuth2Session","consumes":["application\/json"],"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.","responses":{"301":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"createOAuth2Session","weight":37,"cookies":false,"type":"webAuth","demo":"docs\/examples\/account\/create-o-auth2session.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":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, twitch, vk, yahoo, yandex, wordpress.","required":true,"type":"string","x-example":"amazon","in":"path"},{"name":"success","description":"URL to redirect back to your app after a successful login attempt. 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.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/success","in":"query"},{"name":"failure","description":"URL to redirect back to your app after a failed login attempt. 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.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/failure","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"accountDeleteSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all their account sessions across all of their different devices. When using the option id argument, only the session unique ID provider will be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":50,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/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](\/docs\/client\/account#updateVerification). \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"}}},"x-appwrite":{"method":"createVerification","weight":54,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"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":"Complete Email Verification","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"}}},"x-appwrite":{"method":"updateVerification","weight":55,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User unique 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":["application\/json"],"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 \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":57,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"avatarsGetCreditCard","consumes":["application\/json"],"produces":["image\/png"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? 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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":56,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.","required":true,"type":"string","x-example":"amex","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"avatarsGetFavicon","consumes":["application\/json"],"produces":["image\/*"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFavicon","weight":60,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"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":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":58,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"avatarsGetImage","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":59,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"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.","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.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":62,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"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":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","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":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":61,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-q-r.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"]},"security":[{"Project":[],"Key":[]}],"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 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"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"}]}},"\/database\/collections":{"get":{"summary":"List Collections","operationId":"databaseListCollections","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Collections List","schema":{"$ref":"#\/definitions\/collectionList"}}},"x-appwrite":{"method":"listCollections","weight":64,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Collection","operationId":"databaseCreateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new Collection.","responses":{"201":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"createCollection","weight":63,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"rules":{"type":"array","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["name","read","write","rules"]}}]}},"\/database\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"databaseGetCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"getCollection","weight":65,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"databaseUpdateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Update collection by its unique ID.","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"updateCollection","weight":66,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique 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]"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"rules":{"type":"array","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["name","read","write"]}}]},"delete":{"summary":"Delete Collection","operationId":"databaseDeleteCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteCollection","weight":67,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"databaseListDocuments","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Documents List","schema":{"$ref":"#\/definitions\/documentList"}}},"x-appwrite":{"method":"listDocuments","weight":69,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Offset value. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"$id","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"databaseCreateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","responses":{"201":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"createDocument","weight":68,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","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.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"parentDocument":{"type":"string","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","default":"","x-example":"[PARENT_DOCUMENT]"},"parentProperty":{"type":"string","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","default":"","x-example":null},"parentPropertyType":{"type":"string","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","default":"assign","x-example":"assign"}},"required":["data","read","write"]}}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"databaseGetDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"getDocument","weight":70,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"databaseUpdateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"updateDocument","weight":71,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique 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.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["data","read","write"]}}]},"delete":{"summary":"Delete Document","operationId":"databaseDeleteDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents **will not** be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":72,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/functions":{"get":{"summary":"List Functions","operationId":"functionsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Functions List","schema":{"$ref":"#\/definitions\/functionList"}}},"x-appwrite":{"method":"list","weight":155,"cookies":false,"type":"","demo":"docs\/examples\/functions\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-functions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Function","operationId":"functionsCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"201":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"create","weight":154,"cookies":false,"type":"","demo":"docs\/examples\/functions\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Function name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"env":{"type":"string","description":"Execution enviornment.","default":null,"x-example":"node-14"},"vars":{"type":"object","description":"Key-value JSON object.","default":[],"x-example":"{}"},"events":{"type":"array","description":"Events list.","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}},"required":["name","env"]}}]}},"\/functions\/{functionId}":{"get":{"summary":"Get Function","operationId":"functionsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"get","weight":156,"cookies":false,"type":"","demo":"docs\/examples\/functions\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique 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":"","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"update","weight":158,"cookies":false,"type":"","demo":"docs\/examples\/functions\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"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":{"name":{"type":"string","description":"Function name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"vars":{"type":"object","description":"Key-value JSON object.","default":[],"x-example":"{}"},"events":{"type":"array","description":"Events list.","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}},"required":["name"]}}]},"delete":{"summary":"Delete Function","operationId":"functionsDelete","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":160,"cookies":false,"type":"","demo":"docs\/examples\/functions\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/executions":{"get":{"summary":"List Executions","operationId":"functionsListExecutions","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Executions List","schema":{"$ref":"#\/definitions\/executionList"}}},"x-appwrite":{"method":"listExecutions","weight":166,"cookies":false,"type":"","demo":"docs\/examples\/functions\/list-executions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-executions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Execution","operationId":"functionsCreateExecution","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"201":{"description":"Execution","schema":{"$ref":"#\/definitions\/execution"}}},"x-appwrite":{"method":"createExecution","weight":165,"cookies":false,"type":"","demo":"docs\/examples\/functions\/create-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/executions\/{executionId}":{"get":{"summary":"Get Execution","operationId":"functionsGetExecution","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Execution","schema":{"$ref":"#\/definitions\/execution"}}},"x-appwrite":{"method":"getExecution","weight":167,"cookies":false,"type":"","demo":"docs\/examples\/functions\/get-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution unique ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/tag":{"patch":{"summary":"Update Function Tag","operationId":"functionsUpdateTag","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"updateTag","weight":159,"cookies":false,"type":"","demo":"docs\/examples\/functions\/update-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"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":{"tag":{"type":"string","description":"Tag unique ID.","default":null,"x-example":"[TAG]"}},"required":["tag"]}}]}},"\/functions\/{functionId}\/tags":{"get":{"summary":"List Tags","operationId":"functionsListTags","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Tags List","schema":{"$ref":"#\/definitions\/tagList"}}},"x-appwrite":{"method":"listTags","weight":162,"cookies":false,"type":"","demo":"docs\/examples\/functions\/list-tags.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-tags.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Tag","operationId":"functionsCreateTag","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"201":{"description":"Tag","schema":{"$ref":"#\/definitions\/tag"}}},"x-appwrite":{"method":"createTag","weight":161,"cookies":false,"type":"","demo":"docs\/examples\/functions\/create-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"command","description":"Code execution command.","required":true,"type":"string","x-example":"[COMMAND]","in":"formData"},{"name":"code","description":"Gzip file containing your code.","required":true,"type":"file","in":"formData"}]}},"\/functions\/{functionId}\/tags\/{tagId}":{"get":{"summary":"Get Tag","operationId":"functionsGetTag","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Tag","schema":{"$ref":"#\/definitions\/tag"}}},"x-appwrite":{"method":"getTag","weight":163,"cookies":false,"type":"","demo":"docs\/examples\/functions\/get-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]},"delete":{"summary":"Delete Tag","operationId":"functionsDeleteTag","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteTag","weight":164,"cookies":false,"type":"","demo":"docs\/examples\/functions\/delete-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]}},"\/functions\/{functionId}\/usage":{"get":{"summary":"Get Function Usage","operationId":"functionsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getUsage","weight":157,"cookies":false,"type":"","demo":"docs\/examples\/functions\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["console"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"healthGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"get","weight":80,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/anti-virus":{"get":{"summary":"Get Anti virus","operationId":"healthGetAntiVirus","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite Anti Virus server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getAntiVirus","weight":92,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-anti-virus.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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getCache","weight":83,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/db":{"get":{"summary":"Get DB","operationId":"healthGetDB","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getDB","weight":82,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-d-b.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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/certificates":{"get":{"summary":"Get Certificate Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"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":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueCertificates","weight":89,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/functions":{"get":{"summary":"Get Functions Queue","operationId":"healthGetQueueFunctions","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueFunctions","weight":90,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/logs":{"get":{"summary":"Get Logs Queue","operationId":"healthGetQueueLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueLogs","weight":87,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/tasks":{"get":{"summary":"Get Tasks Queue","operationId":"healthGetQueueTasks","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of tasks that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueTasks","weight":86,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-tasks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/usage":{"get":{"summary":"Get Usage Queue","operationId":"healthGetQueueUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueUsage","weight":88,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"healthGetQueueWebhooks","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":85,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/storage\/local":{"get":{"summary":"Get Local Storage","operationId":"healthGetStorageLocal","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getStorageLocal","weight":91,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/time":{"get":{"summary":"Get Time","operationId":"healthGetTime","consumes":["application\/json"],"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":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getTime","weight":84,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"localeGet","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"get","weight":73,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"localeGetContinents","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getContinents","weight":77,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"localeGetCountries","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCountries","weight":74,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"localeGetCountriesEU","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCountriesEU","weight":75,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"localeGetCountriesPhones","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCountriesPhones","weight":76,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"localeGetCurrencies","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCurrencies","weight":78,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"localeGetLanguages","consumes":["application\/json"],"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\/langaugeList"}}},"x-appwrite":{"method":"getLanguages","weight":79,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/projects":{"get":{"summary":"List Projects","operationId":"projectsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Projects List","schema":{"$ref":"#\/definitions\/projectsList"}}},"x-appwrite":{"method":"list","weight":95,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Project","operationId":"projectsCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"201":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"create","weight":94,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"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]"},"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","teamId"]}}]}},"\/projects\/{projectId}":{"get":{"summary":"Get Project","operationId":"projectsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"get","weight":96,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"update","weight":98,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":["application\/json"],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":100,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":{"password":{"type":"string","description":"Your user password for confirmation. Must be between 6 to 32 chars.","default":null,"x-example":"[PASSWORD]"}},"required":["password"]}}]}},"\/projects\/{projectId}\/domains":{"get":{"summary":"List Domains","operationId":"projectsListDomains","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Domains List","schema":{"$ref":"#\/definitions\/domainList"}}},"x-appwrite":{"method":"listDomains","weight":122,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-domains.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Domain","operationId":"projectsCreateDomain","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"201":{"description":"Domain","schema":{"$ref":"#\/definitions\/domain"}}},"x-appwrite":{"method":"createDomain","weight":121,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":{"domain":{"type":"string","description":"Domain name.","default":null,"x-example":null}},"required":["domain"]}}]}},"\/projects\/{projectId}\/domains\/{domainId}":{"get":{"summary":"Get Domain","operationId":"projectsGetDomain","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Domain","schema":{"$ref":"#\/definitions\/domain"}}},"x-appwrite":{"method":"getDomain","weight":123,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]},"delete":{"summary":"Delete Domain","operationId":"projectsDeleteDomain","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDomain","weight":125,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]}},"\/projects\/{projectId}\/domains\/{domainId}\/verification":{"patch":{"summary":"Update Domain Verification Status","operationId":"projectsUpdateDomainVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Domain","schema":{"$ref":"#\/definitions\/domain"}}},"x-appwrite":{"method":"updateDomainVerification","weight":124,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-domain-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]}},"\/projects\/{projectId}\/keys":{"get":{"summary":"List Keys","operationId":"projectsListKeys","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"API Keys List","schema":{"$ref":"#\/definitions\/keyList"}}},"x-appwrite":{"method":"listKeys","weight":107,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-keys.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"","responses":{"201":{"description":"Key","schema":{"$ref":"#\/definitions\/key"}}},"x-appwrite":{"method":"createKey","weight":106,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["name","scopes"]}}]}},"\/projects\/{projectId}\/keys\/{keyId}":{"get":{"summary":"Get Key","operationId":"projectsGetKey","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Key","schema":{"$ref":"#\/definitions\/key"}}},"x-appwrite":{"method":"getKey","weight":108,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"","responses":{"200":{"description":"Key","schema":{"$ref":"#\/definitions\/key"}}},"x-appwrite":{"method":"updateKey","weight":109,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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","default":null,"x-example":null,"items":{"type":"string"}}},"required":["name","scopes"]}}]},"delete":{"summary":"Delete Key","operationId":"projectsDeleteKey","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteKey","weight":110,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateOAuth2","weight":99,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-o-auth2.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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"},"appId":{"type":"string","description":"Provider app ID. Max length: 256 chars.","default":"","x-example":"[APP_ID]"},"secret":{"type":"string","description":"Provider secret key. Max length: 512 chars.","default":"","x-example":"[SECRET]"}},"required":["provider"]}}]}},"\/projects\/{projectId}\/platforms":{"get":{"summary":"List Platforms","operationId":"projectsListPlatforms","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Platforms List","schema":{"$ref":"#\/definitions\/platformList"}}},"x-appwrite":{"method":"listPlatforms","weight":117,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-platforms.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"","responses":{"201":{"description":"Platform","schema":{"$ref":"#\/definitions\/platform"}}},"x-appwrite":{"method":"createPlatform","weight":116,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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"},"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 hostname. Max length: 256 chars.","default":"","x-example":"[HOSTNAME]"}},"required":["type","name"]}}]}},"\/projects\/{projectId}\/platforms\/{platformId}":{"get":{"summary":"Get Platform","operationId":"projectsGetPlatform","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Platform","schema":{"$ref":"#\/definitions\/platform"}}},"x-appwrite":{"method":"getPlatform","weight":118,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"","responses":{"200":{"description":"Platform","schema":{"$ref":"#\/definitions\/platform"}}},"x-appwrite":{"method":"updatePlatform","weight":119,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"[HOSTNAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Platform","operationId":"projectsDeletePlatform","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deletePlatform","weight":120,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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}\/tasks":{"get":{"summary":"List Tasks","operationId":"projectsListTasks","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Tasks List","schema":{"$ref":"#\/definitions\/taskList"}}},"x-appwrite":{"method":"listTasks","weight":112,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Task","operationId":"projectsCreateTask","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"201":{"description":"Task","schema":{"$ref":"#\/definitions\/task"}}},"x-appwrite":{"method":"createTask","weight":111,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"Task name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"status":{"type":"string","description":"Task status.","default":null,"x-example":"play"},"schedule":{"type":"string","description":"Task schedule CRON syntax.","default":null,"x-example":null},"security":{"type":"boolean","description":"Certificate verification, false for disabled or true for enabled.","default":null,"x-example":false},"httpMethod":{"type":"string","description":"Task HTTP method.","default":null,"x-example":"GET"},"httpUrl":{"type":"string","description":"Task HTTP URL","default":null,"x-example":"https:\/\/example.com"},"httpHeaders":{"type":"array","description":"Task HTTP headers list.","default":null,"x-example":null,"items":{"type":"string"}},"httpUser":{"type":"string","description":"Task HTTP user. Max length: 256 chars.","default":"","x-example":"[HTTP_USER]"},"httpPass":{"type":"string","description":"Task HTTP password. Max length: 256 chars.","default":"","x-example":"[HTTP_PASS]"}},"required":["name","status","schedule","security","httpMethod","httpUrl"]}}]}},"\/projects\/{projectId}\/tasks\/{taskId}":{"get":{"summary":"Get Task","operationId":"projectsGetTask","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Task","schema":{"$ref":"#\/definitions\/task"}}},"x-appwrite":{"method":"getTask","weight":113,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"}]},"put":{"summary":"Update Task","operationId":"projectsUpdateTask","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Task","schema":{"$ref":"#\/definitions\/task"}}},"x-appwrite":{"method":"updateTask","weight":114,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Task name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"status":{"type":"string","description":"Task status.","default":null,"x-example":"play"},"schedule":{"type":"string","description":"Task schedule CRON syntax.","default":null,"x-example":null},"security":{"type":"boolean","description":"Certificate verification, false for disabled or true for enabled.","default":null,"x-example":false},"httpMethod":{"type":"string","description":"Task HTTP method.","default":null,"x-example":"GET"},"httpUrl":{"type":"string","description":"Task HTTP URL.","default":null,"x-example":"https:\/\/example.com"},"httpHeaders":{"type":"array","description":"Task HTTP headers list.","default":null,"x-example":null,"items":{"type":"string"}},"httpUser":{"type":"string","description":"Task HTTP user. Max length: 256 chars.","default":"","x-example":"[HTTP_USER]"},"httpPass":{"type":"string","description":"Task HTTP password. Max length: 256 chars.","default":"","x-example":"[HTTP_PASS]"}},"required":["name","status","schedule","security","httpMethod","httpUrl"]}}]},"delete":{"summary":"Delete Task","operationId":"projectsDeleteTask","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteTask","weight":115,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get Project","operationId":"projectsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getUsage","weight":97,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/projects\/{projectId}\/webhooks":{"get":{"summary":"List Webhooks","operationId":"projectsListWebhooks","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Webhooks List","schema":{"$ref":"#\/definitions\/webhookList"}}},"x-appwrite":{"method":"listWebhooks","weight":102,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-webhooks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"","responses":{"201":{"description":"Webhook","schema":{"$ref":"#\/definitions\/webhook"}}},"x-appwrite":{"method":"createWebhook","weight":101,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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]"},"events":{"type":"array","description":"Events list.","default":null,"x-example":null,"items":{"type":"string"}},"url":{"type":"string","description":"Webhook URL.","default":null,"x-example":"https:\/\/example.com"},"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":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Webhook","schema":{"$ref":"#\/definitions\/webhook"}}},"x-appwrite":{"method":"getWebhook","weight":103,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"","responses":{"200":{"description":"Webhook","schema":{"$ref":"#\/definitions\/webhook"}}},"x-appwrite":{"method":"updateWebhook","weight":104,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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]"},"events":{"type":"array","description":"Events list.","default":null,"x-example":null,"items":{"type":"string"}},"url":{"type":"string","description":"Webhook URL.","default":null,"x-example":"https:\/\/example.com"},"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":["application\/json"],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteWebhook","weight":105,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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"}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Files List","schema":{"$ref":"#\/definitions\/fileList"}}},"x-appwrite":{"method":"listFiles","weight":127,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"storageCreateFile","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":126,"cookies":false,"type":"upload","demo":"docs\/examples\/storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"storageGetFile","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"getFile","weight":128,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique 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 file by its unique ID. Only users with write permissions have access to update this resource.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"updateFile","weight":132,"cookies":false,"type":"","demo":"docs\/examples\/storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["read","write"]}}]},"delete":{"summary":"Delete File","operationId":"storageDeleteFile","consumes":["application\/json"],"produces":["application\/json"],"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"}},"x-appwrite":{"method":"deleteFile","weight":133,"cookies":false,"type":"","demo":"docs\/examples\/storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["application\/json"],"produces":["*\/*"],"tags":["storage"],"description":"Get 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"}}},"x-appwrite":{"method":"getFileDownload","weight":130,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"storageGetFilePreview","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":129,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique 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":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"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","default":"","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"storageGetFileView","consumes":["application\/json"],"produces":["*\/*"],"tags":["storage"],"description":"Get 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"}}},"x-appwrite":{"method":"getFileView","weight":131,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":135,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","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. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":134,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](\/docs\/permissions). Max length for each role is 32 chars.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":136,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"teamsUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":137,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":138,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"teamsGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":140,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"teamsCreateMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":139,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"New team member email.","default":null,"x-example":"email@example.com"},"name":{"type":"string","description":"New team member name. Max length: 128 chars.","default":"","x-example":"[NAME]"},"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](\/docs\/permissions). Max length for each role is 32 chars.","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. 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","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"teamsDeleteMembership","consumes":["application\/json"],"produces":["application\/json"],"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"}},"x-appwrite":{"method":"deleteMembership","weight":142,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}\/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 recieved by the user.","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":141,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User unique ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/users":{"get":{"summary":"List Users","operationId":"usersList","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get a list of all the project users. You can use the query params to filter your results.","responses":{"200":{"description":"Users List","schema":{"$ref":"#\/definitions\/userList"}}},"x-appwrite":{"method":"list","weight":144,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","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"}}},"x-appwrite":{"method":"create","weight":143,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"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 between 6 to 32 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","password"]}}]}},"\/users\/{userId}":{"get":{"summary":"Get User","operationId":"usersGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get user by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"get","weight":145,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User","operationId":"usersDeleteUser","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Delete a user by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteUser","weight":153,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":148,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/prefs":{"get":{"summary":"Get User Preferences","operationId":"usersGetPrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get user preferences by its unique ID.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"getPrefs","weight":146,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique 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 user preferences by its unique ID. You can pass only the specific settings you wish to update.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"updatePrefs","weight":150,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique 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":null,"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"Get User Sessions","operationId":"usersGetSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get user sessions list by its unique ID.","responses":{"200":{"description":"Sessions List","schema":{"$ref":"#\/definitions\/sessionList"}}},"x-appwrite":{"method":"getSessions","weight":147,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User Sessions","operationId":"usersDeleteSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Delete all user sessions by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSessions","weight":152,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique 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":["application\/json"],"tags":["users"],"description":"Delete user sessions by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":151,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"User unique 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 user status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":149,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"string","description":"User Status code. To activate the user pass 1, to block the user pass 2 and for disabling the user pass 0","default":null,"x-example":1}},"required":["status"]}}]}}},"definitions":{"none":{"description":"None","type":"object"},"any":{"description":"Any","type":"object","additionalProperties":true},"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"},"version":{"type":"string","description":"Server version number.","x-example":"1.0"}},"required":["message","code","version"]},"errorDev":{"description":"Error","type":"object","properties":{"message":{"type":"string","description":"Error message.","x-example":"Not found"},"code":{"type":"string","description":"Error code.","x-example":"404"},"version":{"type":"string","description":"Server version number.","x-example":"1.0"},"file":{"type":"string","description":"File path.","x-example":"\/usr\/code\/vendor\/utopia-php\/framework\/src\/App.php"},"line":{"type":"integer","description":"Line number.","x-example":209,"format":"int32"},"trace":{"type":"string","description":"Error trace.","x-example":[""]}},"required":["message","code","version","file","line","trace"]},"collectionList":{"description":"Collections List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"}}},"required":["sum","collections"]},"documentList":{"description":"Documents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/any"}}},"required":["sum","documents"]},"userList":{"description":"Users List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"users":{"type":"array","description":"List of users.","items":{"type":"object","$ref":"#\/definitions\/user"}}},"required":["sum","users"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"}}},"required":["sum","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"}}},"required":["logs"]},"fileList":{"description":"Files List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"}}},"required":["sum","files"]},"teamList":{"description":"Teams List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"}}},"required":["sum","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"}}},"required":["sum","memberships"]},"functionList":{"description":"Functions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"}}},"required":["sum","functions"]},"tagList":{"description":"Tags List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"tags":{"type":"array","description":"List of tags.","items":{"type":"object","$ref":"#\/definitions\/tag"}}},"required":["sum","tags"]},"executionList":{"description":"Executions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"}}},"required":["sum","executions"]},"projectsList":{"description":"Projects List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"projects":{"type":"array","description":"List of projects.","items":{"type":"object","$ref":"#\/definitions\/project"}}},"required":["sum","projects"]},"webhookList":{"description":"Webhooks List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"webhooks":{"type":"array","description":"List of webhooks.","items":{"type":"object","$ref":"#\/definitions\/webhook"}}},"required":["sum","webhooks"]},"keyList":{"description":"API Keys List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"keys":{"type":"array","description":"List of keys.","items":{"type":"object","$ref":"#\/definitions\/key"}}},"required":["sum","keys"]},"taskList":{"description":"Tasks List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"tasks":{"type":"array","description":"List of tasks.","items":{"type":"object","$ref":"#\/definitions\/task"}}},"required":["sum","tasks"]},"platformList":{"description":"Platforms List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"platforms":{"type":"array","description":"List of platforms.","items":{"type":"object","$ref":"#\/definitions\/platform"}}},"required":["sum","platforms"]},"domainList":{"description":"Domains List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"domains":{"type":"array","description":"List of domains.","items":{"type":"object","$ref":"#\/definitions\/domain"}}},"required":["sum","domains"]},"countryList":{"description":"Countries List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"}}},"required":["sum","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"}}},"required":["sum","continents"]},"langaugeList":{"description":"Languages List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/langauge"}}},"required":["sum","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"}}},"required":["sum","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"}}},"required":["sum","phones"]},"permissions":{"description":"Permissions","type":"object","properties":{"read":{"type":"array","description":"Read permissions.","items":{"type":"string"}},"write":{"type":"array","description":"Write permissions.","items":{"type":"string"}}},"required":["read","write"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"Collection permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"Collection name.","x-example":"Movies"},"dateCreated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981550,"format":"int32"},"rules":{"type":"array","description":"Collection rules.","items":{"type":"object","$ref":"#\/definitions\/rule"}}},"required":["$id","$permissions","name","dateCreated","dateUpdated","rules"]},"rule":{"description":"Rule","type":"object","properties":{"$id":{"type":"string","description":"Rule ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Rule Collection.","x-example":"5e5e66c16897e"},"type":{"type":"string","description":"Rule type. Possible values: ","x-example":"title"},"key":{"type":"string","description":"Rule key.","x-example":"title"},"label":{"type":"string","description":"Rule label.","x-example":"Title"},"default":{"type":"string","description":"Rule default value.","x-example":"Movie Name"},"array":{"type":"boolean","description":"Is array?","x-example":false},"required":{"type":"boolean","description":"Is required?","x-example":true},"list":{"type":"array","description":"List of allowed values","items":{"type":"string"}}},"required":["$id","$collection","type","key","label","default","array","required","list"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"integer","description":"Log creation time in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"User name.","x-example":"John Doe"},"registration":{"type":"integer","description":"User registration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"status":{"type":"integer","description":"User status. 0 for Unavtivated, 1 for active and 2 is blocked.","x-example":0,"format":"int32"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"emailVerification":{"type":"boolean","description":"Email verification status.","x-example":true},"prefs":{"type":"string","description":"User preferences as a key-value object","x-example":{"theme":"pink","timezone":"UTC"}},"roles":{"type":"array","description":"User list of roles","items":{"type":"string"}}},"required":["$id","name","registration","status","email","emailVerification","prefs","roles"]},"session":{"description":"Session","type":"object","properties":{"$id":{"type":"string","description":"Session ID.","x-example":"5e5ea5c16897e"},"expire":{"type":"integer","description":"Session expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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}},"required":["$id","expire","ip","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName","current"]},"token":{"description":"Token","type":"object","properties":{"$id":{"type":"string","description":"Token ID.","x-example":"5e5ea5c16897e"},"expire":{"type":"integer","description":"Token expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"}},"required":["$id","expire"]},"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 Europian 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"]},"file":{"description":"File","type":"object","properties":{"$id":{"type":"string","description":"File ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"File permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"File name.","x-example":"Pink.png"},"dateCreated":{"type":"integer","description":"File creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"}},"required":["$id","$permissions","name","dateCreated","signature","mimeType","sizeOriginal"]},"team":{"description":"Team","type":"object","properties":{"$id":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Team name.","x-example":"VIP"},"dateCreated":{"type":"integer","description":"Team creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"sum":{"type":"integer","description":"Total sum of team members.","x-example":7,"format":"int32"}},"required":["$id","name","dateCreated","sum"]},"membership":{"description":"Membership","type":"object","properties":{"$id":{"type":"string","description":"Membership ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"teamId":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"User name.","x-example":"VIP"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"invited":{"type":"integer","description":"Date, the user has been invited to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"joined":{"type":"integer","description":"Date, the user has accepted the invitation to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"confirm":{"type":"boolean","description":"User confirmation status, true if the user has joined the team or false otherwise.","x-example":false},"roles":{"type":"array","description":"User list of roles","items":{"type":"string"}}},"required":["$id","userId","teamId","name","email","invited","joined","confirm","roles"]},"function":{"description":"Function","type":"object","properties":{"$id":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Function name.","x-example":"My Function"},"dateCreated":{"type":"integer","description":"Function creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Function update date in Unix timestamp.","x-example":1592981257,"format":"int32"},"status":{"type":"string","description":"Function status. Possible values: disabled, enabled","x-example":"enabled"},"env":{"type":"string","description":"Function execution environment.","x-example":"python-3.8"},"tag":{"type":"string","description":"Function active tag ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"string","description":"Function environment variables.","x-example":{"key":"value"}},"events":{"type":"array","description":"Function trigger events.","items":{"type":"string"}},"schedule":{"type":"string","description":"Function execution schedult in CRON format.","x-example":"5 4 * * *"},"scheduleNext":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981292,"format":"int32"},"schedulePrevious":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981237,"format":"int32"},"timeout":{"type":"integer","description":"Function execution timeout in seconds.","x-example":1592981237,"format":"int32"}},"required":["$id","name","dateCreated","dateUpdated","status","env","tag","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"tag":{"description":"Tag","type":"object","properties":{"$id":{"type":"string","description":"Tag ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The tag creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"command":{"type":"string","description":"The entrypoint command in use to execute the tag code.","x-example":"enabled"},"size":{"type":"string","description":"The code size in bytes.","x-example":"python-3.8"}},"required":["$id","functionId","dateCreated","command","size"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The execution creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"trigger":{"type":"string","description":"The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.","x-example":"http"},"status":{"type":"string","description":"The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.","x-example":"processing"},"exitCode":{"type":"integer","description":"The script exit code.","x-example":0,"format":"int32"},"stdout":{"type":"string","description":"The script stdout output string.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string.","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"float"}},"required":["$id","functionId","dateCreated","trigger","status","exitCode","stdout","stderr","time"]},"project":{"description":"Project","type":"object","properties":{"$id":{"type":"string","description":"Project ID.","x-example":"5e5ea5c16897e"},"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"},"platforms":{"type":"array","description":"List of Platforms.","items":{"type":"object","$ref":"#\/definitions\/platform"}},"webhooks":{"type":"array","description":"List of Webhooks.","items":{"type":"object","$ref":"#\/definitions\/webhook"}},"keys":{"type":"array","description":"List of API Keys.","items":{"type":"object","$ref":"#\/definitions\/key"}},"domains":{"type":"array","description":"List of Domains.","items":{"type":"object","$ref":"#\/definitions\/domain"}},"tasks":{"type":"array","description":"List of Tasks.","items":{"type":"object","$ref":"#\/definitions\/task"}},"usersOauth2AmazonAppid":{"type":"string","description":"Amazon OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2AmazonSecret":{"type":"string","description":"Amazon OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2AppleAppid":{"type":"string","description":"Apple OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2AppleSecret":{"type":"string","description":"Apple OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2BitbucketAppid":{"type":"string","description":"BitBucket OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2BitbucketSecret":{"type":"string","description":"BitBucket OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2BitlyAppid":{"type":"string","description":"Bitly OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2BitlySecret":{"type":"string","description":"Bitly OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2BoxAppid":{"type":"string","description":"Box OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2BoxSecret":{"type":"string","description":"Box OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2DiscordAppid":{"type":"string","description":"Discord OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2DiscordSecret":{"type":"string","description":"Discord OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2DropboxAppid":{"type":"string","description":"Dropbox OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2DropboxSecret":{"type":"string","description":"Dropbox OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2FacebookAppid":{"type":"string","description":"Facebook OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2FacebookSecret":{"type":"string","description":"Facebook OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2GithubAppid":{"type":"string","description":"GitHub OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2GithubSecret":{"type":"string","description":"GitHub OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2GitlabAppid":{"type":"string","description":"GitLab OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2GitlabSecret":{"type":"string","description":"GitLab OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2GoogleAppid":{"type":"string","description":"Google OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2GoogleSecret":{"type":"string","description":"Google OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2LinkedinAppid":{"type":"string","description":"LinkedIn OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2LinkedinSecret":{"type":"string","description":"LinkedIn OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2MicrosoftAppid":{"type":"string","description":"Microsoft OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2MicrosoftSecret":{"type":"string","description":"Microsoft OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2PaypalAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2PaypalSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2PaypalSandboxAppid":{"type":"string","description":"PayPal (Sandbox) OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2PaypalSandboxSecret":{"type":"string","description":"PayPal (Sandbox) OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2SalesforceAppid":{"type":"string","description":"Salesforce OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2SalesforceSecret":{"type":"string","description":"Salesforce OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2SlackAppid":{"type":"string","description":"Slack OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2SlackSecret":{"type":"string","description":"Slack OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2SpotifyAppid":{"type":"string","description":"Spotify OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2SpotifySecret":{"type":"string","description":"Spotify OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2TwitchAppid":{"type":"string","description":"Twitch OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2TwitchSecret":{"type":"string","description":"Twitch OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2VkAppid":{"type":"string","description":"VK OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2VkSecret":{"type":"string","description":"VK OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2YahooAppid":{"type":"string","description":"Yahoo OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2YahooSecret":{"type":"string","description":"Yahoo OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2YandexAppid":{"type":"string","description":"Yandex OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2YandexSecret":{"type":"string","description":"Yandex OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2MockAppid":{"type":"string","description":"Mock OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2MockSecret":{"type":"string","description":"Mock OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2WordpressAppid":{"type":"string","description":"WordPress OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2WordpressSecret":{"type":"string","description":"WordPress OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."}},"required":["$id","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","platforms","webhooks","keys","domains","tasks","usersOauth2AmazonAppid","usersOauth2AmazonSecret","usersOauth2AppleAppid","usersOauth2AppleSecret","usersOauth2BitbucketAppid","usersOauth2BitbucketSecret","usersOauth2BitlyAppid","usersOauth2BitlySecret","usersOauth2BoxAppid","usersOauth2BoxSecret","usersOauth2DiscordAppid","usersOauth2DiscordSecret","usersOauth2DropboxAppid","usersOauth2DropboxSecret","usersOauth2FacebookAppid","usersOauth2FacebookSecret","usersOauth2GithubAppid","usersOauth2GithubSecret","usersOauth2GitlabAppid","usersOauth2GitlabSecret","usersOauth2GoogleAppid","usersOauth2GoogleSecret","usersOauth2LinkedinAppid","usersOauth2LinkedinSecret","usersOauth2MicrosoftAppid","usersOauth2MicrosoftSecret","usersOauth2PaypalAppid","usersOauth2PaypalSecret","usersOauth2PaypalSandboxAppid","usersOauth2PaypalSandboxSecret","usersOauth2SalesforceAppid","usersOauth2SalesforceSecret","usersOauth2SlackAppid","usersOauth2SlackSecret","usersOauth2SpotifyAppid","usersOauth2SpotifySecret","usersOauth2TwitchAppid","usersOauth2TwitchSecret","usersOauth2VkAppid","usersOauth2VkSecret","usersOauth2YahooAppid","usersOauth2YahooSecret","usersOauth2YandexAppid","usersOauth2YandexSecret","usersOauth2MockAppid","usersOauth2MockSecret","usersOauth2WordpressAppid","usersOauth2WordpressSecret"]},"webhook":{"description":"Webhook","type":"object","properties":{"$id":{"type":"string","description":"Webhook ID.","x-example":"5e5ea5c16897e"},"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"}},"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"}},"required":["$id","name","url","events","security","httpUser","httpPass"]},"key":{"description":"Key","type":"object","properties":{"$id":{"type":"string","description":"Key ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Key name.","x-example":"My API Key"},"scopes":{"type":"array","description":"Allowed permission scopes.","items":{"type":"string"}},"secret":{"type":"string","description":"Secret key.","x-example":"919c2d18fb5d4...a2ae413da83346ad2"}},"required":["$id","name","scopes","secret"]},"task":{"description":"Task","type":"object","properties":{"$id":{"type":"string","description":"Task ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Task name.","x-example":"My Task"},"security":{"type":"boolean","description":"Indicated if SSL \/ TLS Certificate verification is enabled.","x-example":true},"httpMethod":{"type":"string","description":"Task HTTP Method.","x-example":"POST"},"httpUrl":{"type":"string","description":"Task HTTP URL.","x-example":"https:\/\/example.com\/task"},"httpHeaders":{"type":"array","description":"Task HTTP headers.","items":{"type":"string"}},"httpUser":{"type":"string","description":"HTTP basic authentication username.","x-example":"username"},"httpPass":{"type":"string","description":"HTTP basic authentication password.","x-example":"password"},"duration":{"type":"number","description":"Task duration in seconds.","x-example":1.2,"format":"float"},"delay":{"type":"number","description":"Task delay time in seconds.","x-example":1.2,"format":"float"},"failures":{"type":"integer","description":"Number of recurring task failures.","x-example":0,"format":"int32"},"schedule":{"type":"string","description":"Task schedule in CRON syntax.","x-example":"* * * * *"},"status":{"type":"string","description":"Task status. Possible values: play, pause","x-example":"enabled"},"updated":{"type":"integer","description":"Task last updated time in Unix timestamp.","x-example":1592981250,"format":"int32"},"previous":{"type":"integer","description":"Task previous run time in Unix timestamp.","x-example":1592981250,"format":"int32"},"next":{"type":"integer","description":"Task next run time in Unix timestamp.","x-example":1592981650,"format":"int32"}},"required":["$id","name","security","httpMethod","httpUrl","httpHeaders","httpUser","httpPass","duration","delay","failures","schedule","status","updated","previous","next"]},"domain":{"description":"Domain","type":"object","properties":{"$id":{"type":"string","description":"Domain ID.","x-example":"5e5ea5c16897e"},"domain":{"type":"string","description":"Domain name.","x-example":"appwrite.company.com"},"registerable":{"type":"string","description":"Registerable domain name.","x-example":"company.com"},"tld":{"type":"string","description":"TLD name.","x-example":"com"},"verification":{"type":"boolean","description":"Verification process status.","x-example":true}},"required":["$id","domain","registerable","tld","verification"]},"platform":{"description":"Platform","type":"object","properties":{"$id":{"type":"string","description":"Platform ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Platform name.","x-example":"My Web App"},"type":{"type":"string","description":"Platform type. Possible values are: web, flutter-ios, flutter-android, ios, android, and unity.","x-example":"My Web App"},"key":{"type":"string","description":"Platform Key. iOS bundle ID or Android package name. Empty string for other platforms.","x-example":"com.company.appname"},"hostname":{"type":"string","description":"Web app hostname. Empty string for other platforms.","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"}},"required":["$id","name","type","key","hostname","httpUser","httpPass"]},"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"]},"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"]},"langauge":{"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"]},"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":"float"},"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"]},"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"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file +{"swagger":"2.0","info":{"version":"0.7.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":"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":"5df5acd0d48c2"}},"Key":{"type":"apiKey","name":"X-Appwrite-Key","description":"Your secret API key","in":"header","x-appwrite":{"demo":"919c2d18fb5d4...a2ae413da83346ad2"}},"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":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"get","weight":41,"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"]},"security":[{"Project":[],"Key":[]}]},"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](\/docs\/client\/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](\/docs\/client\/account#createSession).","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"create","weight":35,"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":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"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 between 6 to 32 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":49,"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":["client"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"accountUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":47,"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"]},"security":[{"Project":[],"Key":[]}],"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 between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"accountGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":44,"cookies":false,"type":"","demo":"account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account 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"}}},"x-appwrite":{"method":"updateName","weight":45,"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"]},"security":[{"Project":[],"Key":[]}],"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 Account 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 the password twice.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":46,"cookies":false,"type":"","demo":"account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Old user password. Must be between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["password","oldPassword"]}}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"accountGetPrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"getPrefs","weight":42,"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"]},"security":[{"Project":[],"Key":[]}]},"patch":{"summary":"Update Account Preferences","operationId":"accountUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"updatePrefs","weight":48,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":null,"x-example":"{}"}},"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](\/docs\/client\/account#updateRecovery) endpoint to complete the process.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createRecovery","weight":52,"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}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"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":"Complete Password Recovery","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](\/docs\/client\/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"}}},"x-appwrite":{"method":"updateRecovery","weight":53,"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":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User account UID address.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"New password again. Must be between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["userId","secret","password","passwordAgain"]}}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"accountGetSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","responses":{"200":{"description":"Sessions List","schema":{"$ref":"#\/definitions\/sessionList"}}},"x-appwrite":{"method":"getSessions","weight":43,"cookies":false,"type":"","demo":"account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]},"post":{"summary":"Create Account Session","operationId":"accountCreateSession","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.","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createSession","weight":36,"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":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"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 between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]},"delete":{"summary":"Delete All Account Sessions","operationId":"accountDeleteSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Delete all sessions from the user account and remove any sessions cookies from the end client.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSessions","weight":51,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/sessions\/oauth2\/{provider}":{"get":{"summary":"Create Account Session with OAuth2","operationId":"accountCreateOAuth2Session","consumes":["application\/json"],"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.","responses":{"301":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"createOAuth2Session","weight":37,"cookies":false,"type":"webAuth","demo":"account\/create-o-auth2session.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":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, twitch, vk, yahoo, yandex, wordpress.","required":true,"type":"string","x-example":"amazon","in":"path"},{"name":"success","description":"URL to redirect back to your app after a successful login attempt. 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.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/success","in":"query"},{"name":"failure","description":"URL to redirect back to your app after a failed login attempt. 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.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/failure","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"accountDeleteSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all their account sessions across all of their different devices. When using the option id argument, only the session unique ID provider will be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":50,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/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](\/docs\/client\/account#updateVerification). \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"}}},"x-appwrite":{"method":"createVerification","weight":54,"cookies":false,"type":"","demo":"account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"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":"Complete Email Verification","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"}}},"x-appwrite":{"method":"updateVerification","weight":55,"cookies":false,"type":"","demo":"account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User unique 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":["application\/json"],"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 \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":57,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"avatarsGetCreditCard","consumes":["application\/json"],"produces":["image\/png"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? 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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":56,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.","required":true,"type":"string","x-example":"amex","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"avatarsGetFavicon","consumes":["application\/json"],"produces":["image\/*"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFavicon","weight":60,"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"]},"security":[{"Project":[],"Key":[]}],"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":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":58,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"avatarsGetImage","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":59,"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"]},"security":[{"Project":[],"Key":[]}],"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.","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.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":62,"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"]},"security":[{"Project":[],"Key":[]}],"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":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","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":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":61,"cookies":false,"type":"location","demo":"avatars\/get-q-r.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"]},"security":[{"Project":[],"Key":[]}],"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 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"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"}]}},"\/database\/collections":{"get":{"summary":"List Collections","operationId":"databaseListCollections","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Collections List","schema":{"$ref":"#\/definitions\/collectionList"}}},"x-appwrite":{"method":"listCollections","weight":64,"cookies":false,"type":"","demo":"database\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Collection","operationId":"databaseCreateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new Collection.","responses":{"201":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"createCollection","weight":63,"cookies":false,"type":"","demo":"database\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"rules":{"type":"array","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["name","read","write","rules"]}}]}},"\/database\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"databaseGetCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"getCollection","weight":65,"cookies":false,"type":"","demo":"database\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"databaseUpdateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Update collection by its unique ID.","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"updateCollection","weight":66,"cookies":false,"type":"","demo":"database\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique 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]"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"rules":{"type":"array","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["name","read","write"]}}]},"delete":{"summary":"Delete Collection","operationId":"databaseDeleteCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteCollection","weight":67,"cookies":false,"type":"","demo":"database\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"databaseListDocuments","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Documents List","schema":{"$ref":"#\/definitions\/documentList"}}},"x-appwrite":{"method":"listDocuments","weight":69,"cookies":false,"type":"","demo":"database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Offset value. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"databaseCreateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","responses":{"201":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"createDocument","weight":68,"cookies":false,"type":"","demo":"database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","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.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"parentDocument":{"type":"string","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","default":"","x-example":"[PARENT_DOCUMENT]"},"parentProperty":{"type":"string","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","default":"","x-example":null},"parentPropertyType":{"type":"string","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","default":"assign","x-example":"assign"}},"required":["data","read","write"]}}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"databaseGetDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"getDocument","weight":70,"cookies":false,"type":"","demo":"database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"databaseUpdateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"updateDocument","weight":71,"cookies":false,"type":"","demo":"database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique 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.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["data","read","write"]}}]},"delete":{"summary":"Delete Document","operationId":"databaseDeleteDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents **will not** be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":72,"cookies":false,"type":"","demo":"database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/functions":{"get":{"summary":"List Functions","operationId":"functionsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Functions List","schema":{"$ref":"#\/definitions\/functionList"}}},"x-appwrite":{"method":"list","weight":155,"cookies":false,"type":"","demo":"functions\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-functions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Function","operationId":"functionsCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"201":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"create","weight":154,"cookies":false,"type":"","demo":"functions\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Function name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"env":{"type":"string","description":"Execution enviornment.","default":null,"x-example":"node-14"},"vars":{"type":"object","description":"Key-value JSON object.","default":[],"x-example":"{}"},"events":{"type":"array","description":"Events list.","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}},"required":["name","env"]}}]}},"\/functions\/{functionId}":{"get":{"summary":"Get Function","operationId":"functionsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"get","weight":156,"cookies":false,"type":"","demo":"functions\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique 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":"","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"update","weight":158,"cookies":false,"type":"","demo":"functions\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"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":{"name":{"type":"string","description":"Function name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"vars":{"type":"object","description":"Key-value JSON object.","default":[],"x-example":"{}"},"events":{"type":"array","description":"Events list.","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}},"required":["name"]}}]},"delete":{"summary":"Delete Function","operationId":"functionsDelete","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":160,"cookies":false,"type":"","demo":"functions\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/executions":{"get":{"summary":"List Executions","operationId":"functionsListExecutions","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Executions List","schema":{"$ref":"#\/definitions\/executionList"}}},"x-appwrite":{"method":"listExecutions","weight":166,"cookies":false,"type":"","demo":"functions\/list-executions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-executions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Execution","operationId":"functionsCreateExecution","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"201":{"description":"Execution","schema":{"$ref":"#\/definitions\/execution"}}},"x-appwrite":{"method":"createExecution","weight":165,"cookies":false,"type":"","demo":"functions\/create-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/executions\/{executionId}":{"get":{"summary":"Get Execution","operationId":"functionsGetExecution","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Execution","schema":{"$ref":"#\/definitions\/execution"}}},"x-appwrite":{"method":"getExecution","weight":167,"cookies":false,"type":"","demo":"functions\/get-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution unique ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/tag":{"patch":{"summary":"Update Function Tag","operationId":"functionsUpdateTag","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"updateTag","weight":159,"cookies":false,"type":"","demo":"functions\/update-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"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":{"tag":{"type":"string","description":"Tag unique ID.","default":null,"x-example":"[TAG]"}},"required":["tag"]}}]}},"\/functions\/{functionId}\/tags":{"get":{"summary":"List Tags","operationId":"functionsListTags","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Tags List","schema":{"$ref":"#\/definitions\/tagList"}}},"x-appwrite":{"method":"listTags","weight":162,"cookies":false,"type":"","demo":"functions\/list-tags.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-tags.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Tag","operationId":"functionsCreateTag","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"201":{"description":"Tag","schema":{"$ref":"#\/definitions\/tag"}}},"x-appwrite":{"method":"createTag","weight":161,"cookies":false,"type":"","demo":"functions\/create-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"command","description":"Code execution command.","required":true,"type":"string","x-example":"[COMMAND]","in":"formData"},{"name":"code","description":"Gzip file containing your code.","required":true,"type":"file","in":"formData"}]}},"\/functions\/{functionId}\/tags\/{tagId}":{"get":{"summary":"Get Tag","operationId":"functionsGetTag","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Tag","schema":{"$ref":"#\/definitions\/tag"}}},"x-appwrite":{"method":"getTag","weight":163,"cookies":false,"type":"","demo":"functions\/get-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]},"delete":{"summary":"Delete Tag","operationId":"functionsDeleteTag","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteTag","weight":164,"cookies":false,"type":"","demo":"functions\/delete-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]}},"\/functions\/{functionId}\/usage":{"get":{"summary":"Get Function Usage","operationId":"functionsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getUsage","weight":157,"cookies":false,"type":"","demo":"functions\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["console"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"healthGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"get","weight":80,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/anti-virus":{"get":{"summary":"Get Anti virus","operationId":"healthGetAntiVirus","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite Anti Virus server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getAntiVirus","weight":92,"cookies":false,"type":"","demo":"health\/get-anti-virus.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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getCache","weight":83,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/db":{"get":{"summary":"Get DB","operationId":"healthGetDB","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getDB","weight":82,"cookies":false,"type":"","demo":"health\/get-d-b.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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/certificates":{"get":{"summary":"Get Certificate Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"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":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueCertificates","weight":89,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/functions":{"get":{"summary":"Get Functions Queue","operationId":"healthGetQueueFunctions","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueFunctions","weight":90,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/logs":{"get":{"summary":"Get Logs Queue","operationId":"healthGetQueueLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueLogs","weight":87,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/tasks":{"get":{"summary":"Get Tasks Queue","operationId":"healthGetQueueTasks","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of tasks that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueTasks","weight":86,"cookies":false,"type":"","demo":"health\/get-queue-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-tasks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/usage":{"get":{"summary":"Get Usage Queue","operationId":"healthGetQueueUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueUsage","weight":88,"cookies":false,"type":"","demo":"health\/get-queue-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"healthGetQueueWebhooks","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":85,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/storage\/local":{"get":{"summary":"Get Local Storage","operationId":"healthGetStorageLocal","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getStorageLocal","weight":91,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/time":{"get":{"summary":"Get Time","operationId":"healthGetTime","consumes":["application\/json"],"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":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getTime","weight":84,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"localeGet","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"get","weight":73,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"localeGetContinents","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getContinents","weight":77,"cookies":false,"type":"","demo":"locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"localeGetCountries","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCountries","weight":74,"cookies":false,"type":"","demo":"locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"localeGetCountriesEU","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCountriesEU","weight":75,"cookies":false,"type":"","demo":"locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"localeGetCountriesPhones","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCountriesPhones","weight":76,"cookies":false,"type":"","demo":"locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"localeGetCurrencies","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCurrencies","weight":78,"cookies":false,"type":"","demo":"locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"localeGetLanguages","consumes":["application\/json"],"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\/langaugeList"}}},"x-appwrite":{"method":"getLanguages","weight":79,"cookies":false,"type":"","demo":"locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/projects":{"get":{"summary":"List Projects","operationId":"projectsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Projects List","schema":{"$ref":"#\/definitions\/projectsList"}}},"x-appwrite":{"method":"list","weight":95,"cookies":false,"type":"","demo":"projects\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Project","operationId":"projectsCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"201":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"create","weight":94,"cookies":false,"type":"","demo":"projects\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"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]"},"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","teamId"]}}]}},"\/projects\/{projectId}":{"get":{"summary":"Get Project","operationId":"projectsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"get","weight":96,"cookies":false,"type":"","demo":"projects\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"update","weight":98,"cookies":false,"type":"","demo":"projects\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":["application\/json"],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":100,"cookies":false,"type":"","demo":"projects\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":{"password":{"type":"string","description":"Your user password for confirmation. Must be between 6 to 32 chars.","default":null,"x-example":"[PASSWORD]"}},"required":["password"]}}]}},"\/projects\/{projectId}\/domains":{"get":{"summary":"List Domains","operationId":"projectsListDomains","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Domains List","schema":{"$ref":"#\/definitions\/domainList"}}},"x-appwrite":{"method":"listDomains","weight":122,"cookies":false,"type":"","demo":"projects\/list-domains.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Domain","operationId":"projectsCreateDomain","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"201":{"description":"Domain","schema":{"$ref":"#\/definitions\/domain"}}},"x-appwrite":{"method":"createDomain","weight":121,"cookies":false,"type":"","demo":"projects\/create-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":{"domain":{"type":"string","description":"Domain name.","default":null,"x-example":null}},"required":["domain"]}}]}},"\/projects\/{projectId}\/domains\/{domainId}":{"get":{"summary":"Get Domain","operationId":"projectsGetDomain","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Domain","schema":{"$ref":"#\/definitions\/domain"}}},"x-appwrite":{"method":"getDomain","weight":123,"cookies":false,"type":"","demo":"projects\/get-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]},"delete":{"summary":"Delete Domain","operationId":"projectsDeleteDomain","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDomain","weight":125,"cookies":false,"type":"","demo":"projects\/delete-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]}},"\/projects\/{projectId}\/domains\/{domainId}\/verification":{"patch":{"summary":"Update Domain Verification Status","operationId":"projectsUpdateDomainVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Domain","schema":{"$ref":"#\/definitions\/domain"}}},"x-appwrite":{"method":"updateDomainVerification","weight":124,"cookies":false,"type":"","demo":"projects\/update-domain-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]}},"\/projects\/{projectId}\/keys":{"get":{"summary":"List Keys","operationId":"projectsListKeys","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"API Keys List","schema":{"$ref":"#\/definitions\/keyList"}}},"x-appwrite":{"method":"listKeys","weight":107,"cookies":false,"type":"","demo":"projects\/list-keys.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"","responses":{"201":{"description":"Key","schema":{"$ref":"#\/definitions\/key"}}},"x-appwrite":{"method":"createKey","weight":106,"cookies":false,"type":"","demo":"projects\/create-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["name","scopes"]}}]}},"\/projects\/{projectId}\/keys\/{keyId}":{"get":{"summary":"Get Key","operationId":"projectsGetKey","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Key","schema":{"$ref":"#\/definitions\/key"}}},"x-appwrite":{"method":"getKey","weight":108,"cookies":false,"type":"","demo":"projects\/get-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"","responses":{"200":{"description":"Key","schema":{"$ref":"#\/definitions\/key"}}},"x-appwrite":{"method":"updateKey","weight":109,"cookies":false,"type":"","demo":"projects\/update-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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","default":null,"x-example":null,"items":{"type":"string"}}},"required":["name","scopes"]}}]},"delete":{"summary":"Delete Key","operationId":"projectsDeleteKey","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteKey","weight":110,"cookies":false,"type":"","demo":"projects\/delete-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateOAuth2","weight":99,"cookies":false,"type":"","demo":"projects\/update-o-auth2.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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"},"appId":{"type":"string","description":"Provider app ID. Max length: 256 chars.","default":"","x-example":"[APP_ID]"},"secret":{"type":"string","description":"Provider secret key. Max length: 512 chars.","default":"","x-example":"[SECRET]"}},"required":["provider"]}}]}},"\/projects\/{projectId}\/platforms":{"get":{"summary":"List Platforms","operationId":"projectsListPlatforms","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Platforms List","schema":{"$ref":"#\/definitions\/platformList"}}},"x-appwrite":{"method":"listPlatforms","weight":117,"cookies":false,"type":"","demo":"projects\/list-platforms.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"","responses":{"201":{"description":"Platform","schema":{"$ref":"#\/definitions\/platform"}}},"x-appwrite":{"method":"createPlatform","weight":116,"cookies":false,"type":"","demo":"projects\/create-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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"},"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 hostname. Max length: 256 chars.","default":"","x-example":"[HOSTNAME]"}},"required":["type","name"]}}]}},"\/projects\/{projectId}\/platforms\/{platformId}":{"get":{"summary":"Get Platform","operationId":"projectsGetPlatform","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Platform","schema":{"$ref":"#\/definitions\/platform"}}},"x-appwrite":{"method":"getPlatform","weight":118,"cookies":false,"type":"","demo":"projects\/get-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"","responses":{"200":{"description":"Platform","schema":{"$ref":"#\/definitions\/platform"}}},"x-appwrite":{"method":"updatePlatform","weight":119,"cookies":false,"type":"","demo":"projects\/update-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"[HOSTNAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Platform","operationId":"projectsDeletePlatform","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deletePlatform","weight":120,"cookies":false,"type":"","demo":"projects\/delete-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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}\/tasks":{"get":{"summary":"List Tasks","operationId":"projectsListTasks","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Tasks List","schema":{"$ref":"#\/definitions\/taskList"}}},"x-appwrite":{"method":"listTasks","weight":112,"cookies":false,"type":"","demo":"projects\/list-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Task","operationId":"projectsCreateTask","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"201":{"description":"Task","schema":{"$ref":"#\/definitions\/task"}}},"x-appwrite":{"method":"createTask","weight":111,"cookies":false,"type":"","demo":"projects\/create-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"Task name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"status":{"type":"string","description":"Task status.","default":null,"x-example":"play"},"schedule":{"type":"string","description":"Task schedule CRON syntax.","default":null,"x-example":null},"security":{"type":"boolean","description":"Certificate verification, false for disabled or true for enabled.","default":null,"x-example":false},"httpMethod":{"type":"string","description":"Task HTTP method.","default":null,"x-example":"GET"},"httpUrl":{"type":"string","description":"Task HTTP URL","default":null,"x-example":"https:\/\/example.com"},"httpHeaders":{"type":"array","description":"Task HTTP headers list.","default":null,"x-example":null,"items":{"type":"string"}},"httpUser":{"type":"string","description":"Task HTTP user. Max length: 256 chars.","default":"","x-example":"[HTTP_USER]"},"httpPass":{"type":"string","description":"Task HTTP password. Max length: 256 chars.","default":"","x-example":"[HTTP_PASS]"}},"required":["name","status","schedule","security","httpMethod","httpUrl"]}}]}},"\/projects\/{projectId}\/tasks\/{taskId}":{"get":{"summary":"Get Task","operationId":"projectsGetTask","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Task","schema":{"$ref":"#\/definitions\/task"}}},"x-appwrite":{"method":"getTask","weight":113,"cookies":false,"type":"","demo":"projects\/get-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"}]},"put":{"summary":"Update Task","operationId":"projectsUpdateTask","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Task","schema":{"$ref":"#\/definitions\/task"}}},"x-appwrite":{"method":"updateTask","weight":114,"cookies":false,"type":"","demo":"projects\/update-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Task name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"status":{"type":"string","description":"Task status.","default":null,"x-example":"play"},"schedule":{"type":"string","description":"Task schedule CRON syntax.","default":null,"x-example":null},"security":{"type":"boolean","description":"Certificate verification, false for disabled or true for enabled.","default":null,"x-example":false},"httpMethod":{"type":"string","description":"Task HTTP method.","default":null,"x-example":"GET"},"httpUrl":{"type":"string","description":"Task HTTP URL.","default":null,"x-example":"https:\/\/example.com"},"httpHeaders":{"type":"array","description":"Task HTTP headers list.","default":null,"x-example":null,"items":{"type":"string"}},"httpUser":{"type":"string","description":"Task HTTP user. Max length: 256 chars.","default":"","x-example":"[HTTP_USER]"},"httpPass":{"type":"string","description":"Task HTTP password. Max length: 256 chars.","default":"","x-example":"[HTTP_PASS]"}},"required":["name","status","schedule","security","httpMethod","httpUrl"]}}]},"delete":{"summary":"Delete Task","operationId":"projectsDeleteTask","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteTask","weight":115,"cookies":false,"type":"","demo":"projects\/delete-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get Project","operationId":"projectsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getUsage","weight":97,"cookies":false,"type":"","demo":"projects\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/projects\/{projectId}\/webhooks":{"get":{"summary":"List Webhooks","operationId":"projectsListWebhooks","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Webhooks List","schema":{"$ref":"#\/definitions\/webhookList"}}},"x-appwrite":{"method":"listWebhooks","weight":102,"cookies":false,"type":"","demo":"projects\/list-webhooks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"","responses":{"201":{"description":"Webhook","schema":{"$ref":"#\/definitions\/webhook"}}},"x-appwrite":{"method":"createWebhook","weight":101,"cookies":false,"type":"","demo":"projects\/create-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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]"},"events":{"type":"array","description":"Events list.","default":null,"x-example":null,"items":{"type":"string"}},"url":{"type":"string","description":"Webhook URL.","default":null,"x-example":"https:\/\/example.com"},"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":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Webhook","schema":{"$ref":"#\/definitions\/webhook"}}},"x-appwrite":{"method":"getWebhook","weight":103,"cookies":false,"type":"","demo":"projects\/get-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"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":"","responses":{"200":{"description":"Webhook","schema":{"$ref":"#\/definitions\/webhook"}}},"x-appwrite":{"method":"updateWebhook","weight":104,"cookies":false,"type":"","demo":"projects\/update-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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]"},"events":{"type":"array","description":"Events list.","default":null,"x-example":null,"items":{"type":"string"}},"url":{"type":"string","description":"Webhook URL.","default":null,"x-example":"https:\/\/example.com"},"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":["application\/json"],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteWebhook","weight":105,"cookies":false,"type":"","demo":"projects\/delete-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"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"}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Files List","schema":{"$ref":"#\/definitions\/fileList"}}},"x-appwrite":{"method":"listFiles","weight":127,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"storageCreateFile","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":126,"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":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"storageGetFile","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"getFile","weight":128,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique 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 file by its unique ID. Only users with write permissions have access to update this resource.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"updateFile","weight":132,"cookies":false,"type":"","demo":"storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["read","write"]}}]},"delete":{"summary":"Delete File","operationId":"storageDeleteFile","consumes":["application\/json"],"produces":["application\/json"],"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"}},"x-appwrite":{"method":"deleteFile","weight":133,"cookies":false,"type":"","demo":"storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["application\/json"],"produces":["*\/*"],"tags":["storage"],"description":"Get 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"}}},"x-appwrite":{"method":"getFileDownload","weight":130,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"storageGetFilePreview","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":129,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique 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":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"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","default":"","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"storageGetFileView","consumes":["application\/json"],"produces":["*\/*"],"tags":["storage"],"description":"Get 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"}}},"x-appwrite":{"method":"getFileView","weight":131,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":135,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","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. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":134,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](\/docs\/permissions). Max length for each role is 32 chars.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":136,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"teamsUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":137,"cookies":false,"type":"","demo":"teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":138,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"teamsGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":140,"cookies":false,"type":"","demo":"teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"teamsCreateMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":139,"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":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"New team member email.","default":null,"x-example":"email@example.com"},"name":{"type":"string","description":"New team member name. Max length: 128 chars.","default":"","x-example":"[NAME]"},"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](\/docs\/permissions). Max length for each role is 32 chars.","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. 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","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"teamsDeleteMembership","consumes":["application\/json"],"produces":["application\/json"],"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"}},"x-appwrite":{"method":"deleteMembership","weight":142,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}\/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 recieved by the user.","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":141,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User unique ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/users":{"get":{"summary":"List Users","operationId":"usersList","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get a list of all the project users. You can use the query params to filter your results.","responses":{"200":{"description":"Users List","schema":{"$ref":"#\/definitions\/userList"}}},"x-appwrite":{"method":"list","weight":144,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","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"}}},"x-appwrite":{"method":"create","weight":143,"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"]},"security":[{"Project":[],"Key":[]}],"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 between 6 to 32 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","password"]}}]}},"\/users\/{userId}":{"get":{"summary":"Get User","operationId":"usersGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get user by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"get","weight":145,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User","operationId":"usersDeleteUser","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Delete a user by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteUser","weight":153,"cookies":false,"type":"","demo":"users\/delete-user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":148,"cookies":false,"type":"","demo":"users\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/prefs":{"get":{"summary":"Get User Preferences","operationId":"usersGetPrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get user preferences by its unique ID.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"getPrefs","weight":146,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique 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 user preferences by its unique ID. You can pass only the specific settings you wish to update.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"updatePrefs","weight":150,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique 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":null,"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"Get User Sessions","operationId":"usersGetSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get user sessions list by its unique ID.","responses":{"200":{"description":"Sessions List","schema":{"$ref":"#\/definitions\/sessionList"}}},"x-appwrite":{"method":"getSessions","weight":147,"cookies":false,"type":"","demo":"users\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User Sessions","operationId":"usersDeleteSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Delete all user sessions by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSessions","weight":152,"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":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique 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":["application\/json"],"tags":["users"],"description":"Delete user sessions by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":151,"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":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"User unique 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 user status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":149,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"string","description":"User Status code. To activate the user pass 1, to block the user pass 2 and for disabling the user pass 0","default":null,"x-example":1}},"required":["status"]}}]}}},"definitions":{"none":{"description":"None","type":"object"},"any":{"description":"Any","type":"object","additionalProperties":true},"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"},"version":{"type":"string","description":"Server version number.","x-example":"1.0"}},"required":["message","code","version"]},"errorDev":{"description":"Error","type":"object","properties":{"message":{"type":"string","description":"Error message.","x-example":"Not found"},"code":{"type":"string","description":"Error code.","x-example":"404"},"version":{"type":"string","description":"Server version number.","x-example":"1.0"},"file":{"type":"string","description":"File path.","x-example":"\/usr\/code\/vendor\/utopia-php\/framework\/src\/App.php"},"line":{"type":"integer","description":"Line number.","x-example":209,"format":"int32"},"trace":{"type":"string","description":"Error trace.","x-example":[""]}},"required":["message","code","version","file","line","trace"]},"collectionList":{"description":"Collections List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"}}},"required":["sum","collections"]},"documentList":{"description":"Documents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/any"}}},"required":["sum","documents"]},"userList":{"description":"Users List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"users":{"type":"array","description":"List of users.","items":{"type":"object","$ref":"#\/definitions\/user"}}},"required":["sum","users"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"}}},"required":["sum","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"}}},"required":["logs"]},"fileList":{"description":"Files List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"}}},"required":["sum","files"]},"teamList":{"description":"Teams List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"}}},"required":["sum","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"}}},"required":["sum","memberships"]},"functionList":{"description":"Functions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"}}},"required":["sum","functions"]},"tagList":{"description":"Tags List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"tags":{"type":"array","description":"List of tags.","items":{"type":"object","$ref":"#\/definitions\/tag"}}},"required":["sum","tags"]},"executionList":{"description":"Executions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"}}},"required":["sum","executions"]},"projectsList":{"description":"Projects List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"projects":{"type":"array","description":"List of projects.","items":{"type":"object","$ref":"#\/definitions\/project"}}},"required":["sum","projects"]},"webhookList":{"description":"Webhooks List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"webhooks":{"type":"array","description":"List of webhooks.","items":{"type":"object","$ref":"#\/definitions\/webhook"}}},"required":["sum","webhooks"]},"keyList":{"description":"API Keys List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"keys":{"type":"array","description":"List of keys.","items":{"type":"object","$ref":"#\/definitions\/key"}}},"required":["sum","keys"]},"taskList":{"description":"Tasks List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"tasks":{"type":"array","description":"List of tasks.","items":{"type":"object","$ref":"#\/definitions\/task"}}},"required":["sum","tasks"]},"platformList":{"description":"Platforms List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"platforms":{"type":"array","description":"List of platforms.","items":{"type":"object","$ref":"#\/definitions\/platform"}}},"required":["sum","platforms"]},"domainList":{"description":"Domains List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"domains":{"type":"array","description":"List of domains.","items":{"type":"object","$ref":"#\/definitions\/domain"}}},"required":["sum","domains"]},"countryList":{"description":"Countries List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"}}},"required":["sum","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"}}},"required":["sum","continents"]},"langaugeList":{"description":"Languages List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/langauge"}}},"required":["sum","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"}}},"required":["sum","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"}}},"required":["sum","phones"]},"permissions":{"description":"Permissions","type":"object","properties":{"read":{"type":"array","description":"Read permissions.","items":{"type":"string"}},"write":{"type":"array","description":"Write permissions.","items":{"type":"string"}}},"required":["read","write"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"Collection permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"Collection name.","x-example":"Movies"},"dateCreated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981550,"format":"int32"},"rules":{"type":"array","description":"Collection rules.","items":{"type":"object","$ref":"#\/definitions\/rule"}}},"required":["$id","$permissions","name","dateCreated","dateUpdated","rules"]},"rule":{"description":"Rule","type":"object","properties":{"$id":{"type":"string","description":"Rule ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Rule Collection.","x-example":"5e5e66c16897e"},"type":{"type":"string","description":"Rule type. Possible values: ","x-example":"title"},"key":{"type":"string","description":"Rule key.","x-example":"title"},"label":{"type":"string","description":"Rule label.","x-example":"Title"},"default":{"type":"string","description":"Rule default value.","x-example":"Movie Name"},"array":{"type":"boolean","description":"Is array?","x-example":false},"required":{"type":"boolean","description":"Is required?","x-example":true},"list":{"type":"array","description":"List of allowed values","items":{"type":"string"}}},"required":["$id","$collection","type","key","label","default","array","required","list"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"integer","description":"Log creation time in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"User name.","x-example":"John Doe"},"registration":{"type":"integer","description":"User registration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"status":{"type":"integer","description":"User status. 0 for Unavtivated, 1 for active and 2 is blocked.","x-example":0,"format":"int32"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"emailVerification":{"type":"boolean","description":"Email verification status.","x-example":true},"prefs":{"type":"string","description":"User preferences as a key-value object","x-example":{"theme":"pink","timezone":"UTC"}}},"required":["$id","name","registration","status","email","emailVerification","prefs"]},"session":{"description":"Session","type":"object","properties":{"$id":{"type":"string","description":"Session ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5bb8c16897e"},"expire":{"type":"integer","description":"Session expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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}},"required":["$id","userId","expire","ip","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName","current"]},"token":{"description":"Token","type":"object","properties":{"$id":{"type":"string","description":"Token ID.","x-example":"bb8ea5c16897e"},"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":"integer","description":"Token expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"}},"required":["$id","userId","secret","expire"]},"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 Europian 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"]},"file":{"description":"File","type":"object","properties":{"$id":{"type":"string","description":"File ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"File permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"File name.","x-example":"Pink.png"},"dateCreated":{"type":"integer","description":"File creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"}},"required":["$id","$permissions","name","dateCreated","signature","mimeType","sizeOriginal"]},"team":{"description":"Team","type":"object","properties":{"$id":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Team name.","x-example":"VIP"},"dateCreated":{"type":"integer","description":"Team creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"sum":{"type":"integer","description":"Total sum of team members.","x-example":7,"format":"int32"}},"required":["$id","name","dateCreated","sum"]},"membership":{"description":"Membership","type":"object","properties":{"$id":{"type":"string","description":"Membership ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"teamId":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"User name.","x-example":"VIP"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"invited":{"type":"integer","description":"Date, the user has been invited to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"joined":{"type":"integer","description":"Date, the user has accepted the invitation to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"confirm":{"type":"boolean","description":"User confirmation status, true if the user has joined the team or false otherwise.","x-example":false},"roles":{"type":"array","description":"User list of roles","items":{"type":"string"}}},"required":["$id","userId","teamId","name","email","invited","joined","confirm","roles"]},"function":{"description":"Function","type":"object","properties":{"$id":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Function name.","x-example":"My Function"},"dateCreated":{"type":"integer","description":"Function creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Function update date in Unix timestamp.","x-example":1592981257,"format":"int32"},"status":{"type":"string","description":"Function status. Possible values: disabled, enabled","x-example":"enabled"},"env":{"type":"string","description":"Function execution environment.","x-example":"python-3.8"},"tag":{"type":"string","description":"Function active tag ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"string","description":"Function environment variables.","x-example":{"key":"value"}},"events":{"type":"array","description":"Function trigger events.","items":{"type":"string"}},"schedule":{"type":"string","description":"Function execution schedult in CRON format.","x-example":"5 4 * * *"},"scheduleNext":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981292,"format":"int32"},"schedulePrevious":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981237,"format":"int32"},"timeout":{"type":"integer","description":"Function execution timeout in seconds.","x-example":1592981237,"format":"int32"}},"required":["$id","name","dateCreated","dateUpdated","status","env","tag","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"tag":{"description":"Tag","type":"object","properties":{"$id":{"type":"string","description":"Tag ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The tag creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"command":{"type":"string","description":"The entrypoint command in use to execute the tag code.","x-example":"enabled"},"size":{"type":"string","description":"The code size in bytes.","x-example":"python-3.8"}},"required":["$id","functionId","dateCreated","command","size"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The execution creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"trigger":{"type":"string","description":"The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.","x-example":"http"},"status":{"type":"string","description":"The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.","x-example":"processing"},"exitCode":{"type":"integer","description":"The script exit code.","x-example":0,"format":"int32"},"stdout":{"type":"string","description":"The script stdout output string.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string.","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"float"}},"required":["$id","functionId","dateCreated","trigger","status","exitCode","stdout","stderr","time"]},"project":{"description":"Project","type":"object","properties":{"$id":{"type":"string","description":"Project ID.","x-example":"5e5ea5c16897e"},"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"},"platforms":{"type":"array","description":"List of Platforms.","items":{"type":"object","$ref":"#\/definitions\/platform"}},"webhooks":{"type":"array","description":"List of Webhooks.","items":{"type":"object","$ref":"#\/definitions\/webhook"}},"keys":{"type":"array","description":"List of API Keys.","items":{"type":"object","$ref":"#\/definitions\/key"}},"domains":{"type":"array","description":"List of Domains.","items":{"type":"object","$ref":"#\/definitions\/domain"}},"tasks":{"type":"array","description":"List of Tasks.","items":{"type":"object","$ref":"#\/definitions\/task"}},"usersOauth2AmazonAppid":{"type":"string","description":"Amazon OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2AmazonSecret":{"type":"string","description":"Amazon OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2AppleAppid":{"type":"string","description":"Apple OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2AppleSecret":{"type":"string","description":"Apple OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2BitbucketAppid":{"type":"string","description":"BitBucket OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2BitbucketSecret":{"type":"string","description":"BitBucket OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2BitlyAppid":{"type":"string","description":"Bitly OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2BitlySecret":{"type":"string","description":"Bitly OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2BoxAppid":{"type":"string","description":"Box OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2BoxSecret":{"type":"string","description":"Box OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2DiscordAppid":{"type":"string","description":"Discord OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2DiscordSecret":{"type":"string","description":"Discord OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2DropboxAppid":{"type":"string","description":"Dropbox OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2DropboxSecret":{"type":"string","description":"Dropbox OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2FacebookAppid":{"type":"string","description":"Facebook OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2FacebookSecret":{"type":"string","description":"Facebook OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2GithubAppid":{"type":"string","description":"GitHub OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2GithubSecret":{"type":"string","description":"GitHub OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2GitlabAppid":{"type":"string","description":"GitLab OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2GitlabSecret":{"type":"string","description":"GitLab OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2GoogleAppid":{"type":"string","description":"Google OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2GoogleSecret":{"type":"string","description":"Google OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2LinkedinAppid":{"type":"string","description":"LinkedIn OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2LinkedinSecret":{"type":"string","description":"LinkedIn OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2MicrosoftAppid":{"type":"string","description":"Microsoft OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2MicrosoftSecret":{"type":"string","description":"Microsoft OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2PaypalAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2PaypalSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2PaypalSandboxAppid":{"type":"string","description":"PayPal (Sandbox) OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2PaypalSandboxSecret":{"type":"string","description":"PayPal (Sandbox) OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2SalesforceAppid":{"type":"string","description":"Salesforce OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2SalesforceSecret":{"type":"string","description":"Salesforce OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2SlackAppid":{"type":"string","description":"Slack OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2SlackSecret":{"type":"string","description":"Slack OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2SpotifyAppid":{"type":"string","description":"Spotify OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2SpotifySecret":{"type":"string","description":"Spotify OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2TwitchAppid":{"type":"string","description":"Twitch OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2TwitchSecret":{"type":"string","description":"Twitch OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2VkAppid":{"type":"string","description":"VK OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2VkSecret":{"type":"string","description":"VK OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2YahooAppid":{"type":"string","description":"Yahoo OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2YahooSecret":{"type":"string","description":"Yahoo OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2YandexAppid":{"type":"string","description":"Yandex OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2YandexSecret":{"type":"string","description":"Yandex OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2MockAppid":{"type":"string","description":"Mock OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2MockSecret":{"type":"string","description":"Mock OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2WordpressAppid":{"type":"string","description":"WordPress OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2WordpressSecret":{"type":"string","description":"WordPress OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."}},"required":["$id","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","platforms","webhooks","keys","domains","tasks","usersOauth2AmazonAppid","usersOauth2AmazonSecret","usersOauth2AppleAppid","usersOauth2AppleSecret","usersOauth2BitbucketAppid","usersOauth2BitbucketSecret","usersOauth2BitlyAppid","usersOauth2BitlySecret","usersOauth2BoxAppid","usersOauth2BoxSecret","usersOauth2DiscordAppid","usersOauth2DiscordSecret","usersOauth2DropboxAppid","usersOauth2DropboxSecret","usersOauth2FacebookAppid","usersOauth2FacebookSecret","usersOauth2GithubAppid","usersOauth2GithubSecret","usersOauth2GitlabAppid","usersOauth2GitlabSecret","usersOauth2GoogleAppid","usersOauth2GoogleSecret","usersOauth2LinkedinAppid","usersOauth2LinkedinSecret","usersOauth2MicrosoftAppid","usersOauth2MicrosoftSecret","usersOauth2PaypalAppid","usersOauth2PaypalSecret","usersOauth2PaypalSandboxAppid","usersOauth2PaypalSandboxSecret","usersOauth2SalesforceAppid","usersOauth2SalesforceSecret","usersOauth2SlackAppid","usersOauth2SlackSecret","usersOauth2SpotifyAppid","usersOauth2SpotifySecret","usersOauth2TwitchAppid","usersOauth2TwitchSecret","usersOauth2VkAppid","usersOauth2VkSecret","usersOauth2YahooAppid","usersOauth2YahooSecret","usersOauth2YandexAppid","usersOauth2YandexSecret","usersOauth2MockAppid","usersOauth2MockSecret","usersOauth2WordpressAppid","usersOauth2WordpressSecret"]},"webhook":{"description":"Webhook","type":"object","properties":{"$id":{"type":"string","description":"Webhook ID.","x-example":"5e5ea5c16897e"},"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"}},"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"}},"required":["$id","name","url","events","security","httpUser","httpPass"]},"key":{"description":"Key","type":"object","properties":{"$id":{"type":"string","description":"Key ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Key name.","x-example":"My API Key"},"scopes":{"type":"array","description":"Allowed permission scopes.","items":{"type":"string"}},"secret":{"type":"string","description":"Secret key.","x-example":"919c2d18fb5d4...a2ae413da83346ad2"}},"required":["$id","name","scopes","secret"]},"task":{"description":"Task","type":"object","properties":{"$id":{"type":"string","description":"Task ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Task name.","x-example":"My Task"},"security":{"type":"boolean","description":"Indicated if SSL \/ TLS Certificate verification is enabled.","x-example":true},"httpMethod":{"type":"string","description":"Task HTTP Method.","x-example":"POST"},"httpUrl":{"type":"string","description":"Task HTTP URL.","x-example":"https:\/\/example.com\/task"},"httpHeaders":{"type":"array","description":"Task HTTP headers.","items":{"type":"string"}},"httpUser":{"type":"string","description":"HTTP basic authentication username.","x-example":"username"},"httpPass":{"type":"string","description":"HTTP basic authentication password.","x-example":"password"},"duration":{"type":"number","description":"Task duration in seconds.","x-example":1.2,"format":"float"},"delay":{"type":"number","description":"Task delay time in seconds.","x-example":1.2,"format":"float"},"failures":{"type":"integer","description":"Number of recurring task failures.","x-example":0,"format":"int32"},"schedule":{"type":"string","description":"Task schedule in CRON syntax.","x-example":"* * * * *"},"status":{"type":"string","description":"Task status. Possible values: play, pause","x-example":"enabled"},"updated":{"type":"integer","description":"Task last updated time in Unix timestamp.","x-example":1592981250,"format":"int32"},"previous":{"type":"integer","description":"Task previous run time in Unix timestamp.","x-example":1592981250,"format":"int32"},"next":{"type":"integer","description":"Task next run time in Unix timestamp.","x-example":1592981650,"format":"int32"}},"required":["$id","name","security","httpMethod","httpUrl","httpHeaders","httpUser","httpPass","duration","delay","failures","schedule","status","updated","previous","next"]},"domain":{"description":"Domain","type":"object","properties":{"$id":{"type":"string","description":"Domain ID.","x-example":"5e5ea5c16897e"},"domain":{"type":"string","description":"Domain name.","x-example":"appwrite.company.com"},"registerable":{"type":"string","description":"Registerable domain name.","x-example":"company.com"},"tld":{"type":"string","description":"TLD name.","x-example":"com"},"verification":{"type":"boolean","description":"Verification process status.","x-example":true}},"required":["$id","domain","registerable","tld","verification"]},"platform":{"description":"Platform","type":"object","properties":{"$id":{"type":"string","description":"Platform ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Platform name.","x-example":"My Web App"},"type":{"type":"string","description":"Platform type. Possible values are: web, flutter-ios, flutter-android, ios, android, and unity.","x-example":"My Web App"},"key":{"type":"string","description":"Platform Key. iOS bundle ID or Android package name. Empty string for other platforms.","x-example":"com.company.appname"},"hostname":{"type":"string","description":"Web app hostname. Empty string for other platforms.","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"}},"required":["$id","name","type","key","hostname","httpUser","httpPass"]},"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"]},"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"]},"langauge":{"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"]},"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":"float"},"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"]},"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"]}},"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/0.7.0.server.json b/app/config/specs/0.7.0.server.json index 343c5bc9cc..c22a9df69d 100644 --- a/app/config/specs/0.7.0.server.json +++ b/app/config/specs/0.7.0.server.json @@ -1,2 +1,2 @@ -{"swagger":"2.0","info":{"version":"0.7.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":"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":"5df5acd0d48c2"}},"Key":{"type":"apiKey","name":"X-Appwrite-Key","description":"Your secret API key","in":"header","x-appwrite":{"demo":"919c2d18fb5d4...a2ae413da83346ad2"}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","x-appwrite":{"demo":"en"}}},"paths":{"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"avatarsGetBrowser","consumes":["application\/json"],"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 \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":57,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"avatarsGetCreditCard","consumes":["application\/json"],"produces":["image\/png"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? 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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":56,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.","required":true,"type":"string","x-example":"amex","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"avatarsGetFavicon","consumes":["application\/json"],"produces":["image\/*"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFavicon","weight":60,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"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":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":58,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"avatarsGetImage","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":59,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"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.","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.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":62,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"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":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","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":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":61,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-q-r.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"]},"security":[{"Project":[],"Key":[]}],"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 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"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"}]}},"\/database\/collections":{"get":{"summary":"List Collections","operationId":"databaseListCollections","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Collections List","schema":{"$ref":"#\/definitions\/collectionList"}}},"x-appwrite":{"method":"listCollections","weight":64,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Collection","operationId":"databaseCreateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new Collection.","responses":{"201":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"createCollection","weight":63,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"rules":{"type":"array","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["name","read","write","rules"]}}]}},"\/database\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"databaseGetCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"getCollection","weight":65,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"databaseUpdateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Update collection by its unique ID.","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"updateCollection","weight":66,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique 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]"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"rules":{"type":"array","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["name","read","write"]}}]},"delete":{"summary":"Delete Collection","operationId":"databaseDeleteCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteCollection","weight":67,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"databaseListDocuments","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Documents List","schema":{"$ref":"#\/definitions\/documentList"}}},"x-appwrite":{"method":"listDocuments","weight":69,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Offset value. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"$id","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"databaseCreateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","responses":{"201":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"createDocument","weight":68,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","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.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"parentDocument":{"type":"string","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","default":"","x-example":"[PARENT_DOCUMENT]"},"parentProperty":{"type":"string","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","default":"","x-example":null},"parentPropertyType":{"type":"string","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","default":"assign","x-example":"assign"}},"required":["data","read","write"]}}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"databaseGetDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"getDocument","weight":70,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"databaseUpdateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"updateDocument","weight":71,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique 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.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["data","read","write"]}}]},"delete":{"summary":"Delete Document","operationId":"databaseDeleteDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents **will not** be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":72,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/functions":{"get":{"summary":"List Functions","operationId":"functionsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Functions List","schema":{"$ref":"#\/definitions\/functionList"}}},"x-appwrite":{"method":"list","weight":155,"cookies":false,"type":"","demo":"docs\/examples\/functions\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-functions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Function","operationId":"functionsCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"201":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"create","weight":154,"cookies":false,"type":"","demo":"docs\/examples\/functions\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Function name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"env":{"type":"string","description":"Execution enviornment.","default":null,"x-example":"node-14"},"vars":{"type":"object","description":"Key-value JSON object.","default":[],"x-example":"{}"},"events":{"type":"array","description":"Events list.","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}},"required":["name","env"]}}]}},"\/functions\/{functionId}":{"get":{"summary":"Get Function","operationId":"functionsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"get","weight":156,"cookies":false,"type":"","demo":"docs\/examples\/functions\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique 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":"","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"update","weight":158,"cookies":false,"type":"","demo":"docs\/examples\/functions\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"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":{"name":{"type":"string","description":"Function name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"vars":{"type":"object","description":"Key-value JSON object.","default":[],"x-example":"{}"},"events":{"type":"array","description":"Events list.","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}},"required":["name"]}}]},"delete":{"summary":"Delete Function","operationId":"functionsDelete","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":160,"cookies":false,"type":"","demo":"docs\/examples\/functions\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/executions":{"get":{"summary":"List Executions","operationId":"functionsListExecutions","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Executions List","schema":{"$ref":"#\/definitions\/executionList"}}},"x-appwrite":{"method":"listExecutions","weight":166,"cookies":false,"type":"","demo":"docs\/examples\/functions\/list-executions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-executions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Execution","operationId":"functionsCreateExecution","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"201":{"description":"Execution","schema":{"$ref":"#\/definitions\/execution"}}},"x-appwrite":{"method":"createExecution","weight":165,"cookies":false,"type":"","demo":"docs\/examples\/functions\/create-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/executions\/{executionId}":{"get":{"summary":"Get Execution","operationId":"functionsGetExecution","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Execution","schema":{"$ref":"#\/definitions\/execution"}}},"x-appwrite":{"method":"getExecution","weight":167,"cookies":false,"type":"","demo":"docs\/examples\/functions\/get-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution unique ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/tag":{"patch":{"summary":"Update Function Tag","operationId":"functionsUpdateTag","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"updateTag","weight":159,"cookies":false,"type":"","demo":"docs\/examples\/functions\/update-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"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":{"tag":{"type":"string","description":"Tag unique ID.","default":null,"x-example":"[TAG]"}},"required":["tag"]}}]}},"\/functions\/{functionId}\/tags":{"get":{"summary":"List Tags","operationId":"functionsListTags","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Tags List","schema":{"$ref":"#\/definitions\/tagList"}}},"x-appwrite":{"method":"listTags","weight":162,"cookies":false,"type":"","demo":"docs\/examples\/functions\/list-tags.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-tags.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Tag","operationId":"functionsCreateTag","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"201":{"description":"Tag","schema":{"$ref":"#\/definitions\/tag"}}},"x-appwrite":{"method":"createTag","weight":161,"cookies":false,"type":"","demo":"docs\/examples\/functions\/create-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"command","description":"Code execution command.","required":true,"type":"string","x-example":"[COMMAND]","in":"formData"},{"name":"code","description":"Gzip file containing your code.","required":true,"type":"file","in":"formData"}]}},"\/functions\/{functionId}\/tags\/{tagId}":{"get":{"summary":"Get Tag","operationId":"functionsGetTag","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Tag","schema":{"$ref":"#\/definitions\/tag"}}},"x-appwrite":{"method":"getTag","weight":163,"cookies":false,"type":"","demo":"docs\/examples\/functions\/get-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]},"delete":{"summary":"Delete Tag","operationId":"functionsDeleteTag","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteTag","weight":164,"cookies":false,"type":"","demo":"docs\/examples\/functions\/delete-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"healthGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"get","weight":80,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/anti-virus":{"get":{"summary":"Get Anti virus","operationId":"healthGetAntiVirus","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite Anti Virus server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getAntiVirus","weight":92,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-anti-virus.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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getCache","weight":83,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/db":{"get":{"summary":"Get DB","operationId":"healthGetDB","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getDB","weight":82,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-d-b.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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/certificates":{"get":{"summary":"Get Certificate Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"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":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueCertificates","weight":89,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/functions":{"get":{"summary":"Get Functions Queue","operationId":"healthGetQueueFunctions","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueFunctions","weight":90,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/logs":{"get":{"summary":"Get Logs Queue","operationId":"healthGetQueueLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueLogs","weight":87,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/tasks":{"get":{"summary":"Get Tasks Queue","operationId":"healthGetQueueTasks","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of tasks that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueTasks","weight":86,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-tasks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/usage":{"get":{"summary":"Get Usage Queue","operationId":"healthGetQueueUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueUsage","weight":88,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"healthGetQueueWebhooks","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":85,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/storage\/local":{"get":{"summary":"Get Local Storage","operationId":"healthGetStorageLocal","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getStorageLocal","weight":91,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/time":{"get":{"summary":"Get Time","operationId":"healthGetTime","consumes":["application\/json"],"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":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getTime","weight":84,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"localeGet","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"get","weight":73,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"localeGetContinents","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getContinents","weight":77,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"localeGetCountries","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCountries","weight":74,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"localeGetCountriesEU","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCountriesEU","weight":75,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"localeGetCountriesPhones","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCountriesPhones","weight":76,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"localeGetCurrencies","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCurrencies","weight":78,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"localeGetLanguages","consumes":["application\/json"],"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\/langaugeList"}}},"x-appwrite":{"method":"getLanguages","weight":79,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Files List","schema":{"$ref":"#\/definitions\/fileList"}}},"x-appwrite":{"method":"listFiles","weight":127,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"storageCreateFile","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":126,"cookies":false,"type":"upload","demo":"docs\/examples\/storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"storageGetFile","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"getFile","weight":128,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique 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 file by its unique ID. Only users with write permissions have access to update this resource.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"updateFile","weight":132,"cookies":false,"type":"","demo":"docs\/examples\/storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["read","write"]}}]},"delete":{"summary":"Delete File","operationId":"storageDeleteFile","consumes":["application\/json"],"produces":["application\/json"],"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"}},"x-appwrite":{"method":"deleteFile","weight":133,"cookies":false,"type":"","demo":"docs\/examples\/storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["application\/json"],"produces":["*\/*"],"tags":["storage"],"description":"Get 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"}}},"x-appwrite":{"method":"getFileDownload","weight":130,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"storageGetFilePreview","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":129,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique 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":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"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","default":"","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"storageGetFileView","consumes":["application\/json"],"produces":["*\/*"],"tags":["storage"],"description":"Get 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"}}},"x-appwrite":{"method":"getFileView","weight":131,"cookies":false,"type":"location","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":135,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","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. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":134,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](\/docs\/permissions). Max length for each role is 32 chars.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":136,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"teamsUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":137,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":138,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"teamsGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":140,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"teamsCreateMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":139,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"New team member email.","default":null,"x-example":"email@example.com"},"name":{"type":"string","description":"New team member name. Max length: 128 chars.","default":"","x-example":"[NAME]"},"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](\/docs\/permissions). Max length for each role is 32 chars.","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. 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","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"teamsDeleteMembership","consumes":["application\/json"],"produces":["application\/json"],"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"}},"x-appwrite":{"method":"deleteMembership","weight":142,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/users":{"get":{"summary":"List Users","operationId":"usersList","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get a list of all the project users. You can use the query params to filter your results.","responses":{"200":{"description":"Users List","schema":{"$ref":"#\/definitions\/userList"}}},"x-appwrite":{"method":"list","weight":144,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","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"}}},"x-appwrite":{"method":"create","weight":143,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"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 between 6 to 32 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","password"]}}]}},"\/users\/{userId}":{"get":{"summary":"Get User","operationId":"usersGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get user by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"get","weight":145,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User","operationId":"usersDeleteUser","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Delete a user by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteUser","weight":153,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":148,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/prefs":{"get":{"summary":"Get User Preferences","operationId":"usersGetPrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get user preferences by its unique ID.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"getPrefs","weight":146,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique 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 user preferences by its unique ID. You can pass only the specific settings you wish to update.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"updatePrefs","weight":150,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique 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":null,"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"Get User Sessions","operationId":"usersGetSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get user sessions list by its unique ID.","responses":{"200":{"description":"Sessions List","schema":{"$ref":"#\/definitions\/sessionList"}}},"x-appwrite":{"method":"getSessions","weight":147,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User Sessions","operationId":"usersDeleteSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Delete all user sessions by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSessions","weight":152,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique 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":["application\/json"],"tags":["users"],"description":"Delete user sessions by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":151,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"User unique 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 user status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":149,"cookies":false,"type":"","demo":"docs\/examples\/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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"string","description":"User Status code. To activate the user pass 1, to block the user pass 2 and for disabling the user pass 0","default":null,"x-example":1}},"required":["status"]}}]}}},"definitions":{"none":{"description":"None","type":"object"},"any":{"description":"Any","type":"object","additionalProperties":true},"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"},"version":{"type":"string","description":"Server version number.","x-example":"1.0"}},"required":["message","code","version"]},"collectionList":{"description":"Collections List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"}}},"required":["sum","collections"]},"documentList":{"description":"Documents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/any"}}},"required":["sum","documents"]},"userList":{"description":"Users List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"users":{"type":"array","description":"List of users.","items":{"type":"object","$ref":"#\/definitions\/user"}}},"required":["sum","users"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"}}},"required":["sum","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"}}},"required":["logs"]},"fileList":{"description":"Files List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"}}},"required":["sum","files"]},"teamList":{"description":"Teams List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"}}},"required":["sum","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"}}},"required":["sum","memberships"]},"functionList":{"description":"Functions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"}}},"required":["sum","functions"]},"tagList":{"description":"Tags List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"tags":{"type":"array","description":"List of tags.","items":{"type":"object","$ref":"#\/definitions\/tag"}}},"required":["sum","tags"]},"executionList":{"description":"Executions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"}}},"required":["sum","executions"]},"countryList":{"description":"Countries List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"}}},"required":["sum","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"}}},"required":["sum","continents"]},"langaugeList":{"description":"Languages List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/langauge"}}},"required":["sum","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"}}},"required":["sum","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"}}},"required":["sum","phones"]},"permissions":{"description":"Permissions","type":"object","properties":{"read":{"type":"array","description":"Read permissions.","items":{"type":"string"}},"write":{"type":"array","description":"Write permissions.","items":{"type":"string"}}},"required":["read","write"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"Collection permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"Collection name.","x-example":"Movies"},"dateCreated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981550,"format":"int32"},"rules":{"type":"array","description":"Collection rules.","items":{"type":"object","$ref":"#\/definitions\/rule"}}},"required":["$id","$permissions","name","dateCreated","dateUpdated","rules"]},"rule":{"description":"Rule","type":"object","properties":{"$id":{"type":"string","description":"Rule ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Rule Collection.","x-example":"5e5e66c16897e"},"type":{"type":"string","description":"Rule type. Possible values: ","x-example":"title"},"key":{"type":"string","description":"Rule key.","x-example":"title"},"label":{"type":"string","description":"Rule label.","x-example":"Title"},"default":{"type":"string","description":"Rule default value.","x-example":"Movie Name"},"array":{"type":"boolean","description":"Is array?","x-example":false},"required":{"type":"boolean","description":"Is required?","x-example":true},"list":{"type":"array","description":"List of allowed values","items":{"type":"string"}}},"required":["$id","$collection","type","key","label","default","array","required","list"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"integer","description":"Log creation time in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"User name.","x-example":"John Doe"},"registration":{"type":"integer","description":"User registration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"status":{"type":"integer","description":"User status. 0 for Unavtivated, 1 for active and 2 is blocked.","x-example":0,"format":"int32"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"emailVerification":{"type":"boolean","description":"Email verification status.","x-example":true},"prefs":{"type":"string","description":"User preferences as a key-value object","x-example":{"theme":"pink","timezone":"UTC"}},"roles":{"type":"array","description":"User list of roles","items":{"type":"string"}}},"required":["$id","name","registration","status","email","emailVerification","prefs","roles"]},"session":{"description":"Session","type":"object","properties":{"$id":{"type":"string","description":"Session ID.","x-example":"5e5ea5c16897e"},"expire":{"type":"integer","description":"Session expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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}},"required":["$id","expire","ip","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName","current"]},"token":{"description":"Token","type":"object","properties":{"$id":{"type":"string","description":"Token ID.","x-example":"5e5ea5c16897e"},"expire":{"type":"integer","description":"Token expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"}},"required":["$id","expire"]},"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 Europian 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"]},"file":{"description":"File","type":"object","properties":{"$id":{"type":"string","description":"File ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"File permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"File name.","x-example":"Pink.png"},"dateCreated":{"type":"integer","description":"File creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"}},"required":["$id","$permissions","name","dateCreated","signature","mimeType","sizeOriginal"]},"team":{"description":"Team","type":"object","properties":{"$id":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Team name.","x-example":"VIP"},"dateCreated":{"type":"integer","description":"Team creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"sum":{"type":"integer","description":"Total sum of team members.","x-example":7,"format":"int32"}},"required":["$id","name","dateCreated","sum"]},"membership":{"description":"Membership","type":"object","properties":{"$id":{"type":"string","description":"Membership ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"teamId":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"User name.","x-example":"VIP"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"invited":{"type":"integer","description":"Date, the user has been invited to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"joined":{"type":"integer","description":"Date, the user has accepted the invitation to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"confirm":{"type":"boolean","description":"User confirmation status, true if the user has joined the team or false otherwise.","x-example":false},"roles":{"type":"array","description":"User list of roles","items":{"type":"string"}}},"required":["$id","userId","teamId","name","email","invited","joined","confirm","roles"]},"function":{"description":"Function","type":"object","properties":{"$id":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Function name.","x-example":"My Function"},"dateCreated":{"type":"integer","description":"Function creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Function update date in Unix timestamp.","x-example":1592981257,"format":"int32"},"status":{"type":"string","description":"Function status. Possible values: disabled, enabled","x-example":"enabled"},"env":{"type":"string","description":"Function execution environment.","x-example":"python-3.8"},"tag":{"type":"string","description":"Function active tag ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"string","description":"Function environment variables.","x-example":{"key":"value"}},"events":{"type":"array","description":"Function trigger events.","items":{"type":"string"}},"schedule":{"type":"string","description":"Function execution schedult in CRON format.","x-example":"5 4 * * *"},"scheduleNext":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981292,"format":"int32"},"schedulePrevious":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981237,"format":"int32"},"timeout":{"type":"integer","description":"Function execution timeout in seconds.","x-example":1592981237,"format":"int32"}},"required":["$id","name","dateCreated","dateUpdated","status","env","tag","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"tag":{"description":"Tag","type":"object","properties":{"$id":{"type":"string","description":"Tag ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The tag creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"command":{"type":"string","description":"The entrypoint command in use to execute the tag code.","x-example":"enabled"},"size":{"type":"string","description":"The code size in bytes.","x-example":"python-3.8"}},"required":["$id","functionId","dateCreated","command","size"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The execution creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"trigger":{"type":"string","description":"The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.","x-example":"http"},"status":{"type":"string","description":"The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.","x-example":"processing"},"exitCode":{"type":"integer","description":"The script exit code.","x-example":0,"format":"int32"},"stdout":{"type":"string","description":"The script stdout output string.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string.","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"float"}},"required":["$id","functionId","dateCreated","trigger","status","exitCode","stdout","stderr","time"]},"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"]},"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"]},"langauge":{"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"]},"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":"float"},"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"]},"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"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file +{"swagger":"2.0","info":{"version":"0.7.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":"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":"5df5acd0d48c2"}},"Key":{"type":"apiKey","name":"X-Appwrite-Key","description":"Your secret API key","in":"header","x-appwrite":{"demo":"919c2d18fb5d4...a2ae413da83346ad2"}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","x-appwrite":{"demo":"en"}}},"paths":{"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"avatarsGetBrowser","consumes":["application\/json"],"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 \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":57,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"avatarsGetCreditCard","consumes":["application\/json"],"produces":["image\/png"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? 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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":56,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.","required":true,"type":"string","x-example":"amex","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"avatarsGetFavicon","consumes":["application\/json"],"produces":["image\/*"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFavicon","weight":60,"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"]},"security":[{"Project":[],"Key":[]}],"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":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":58,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","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 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"avatarsGetImage","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":59,"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"]},"security":[{"Project":[],"Key":[]}],"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.","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.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":62,"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"]},"security":[{"Project":[],"Key":[]}],"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":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","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":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":61,"cookies":false,"type":"location","demo":"avatars\/get-q-r.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"]},"security":[{"Project":[],"Key":[]}],"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 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"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"}]}},"\/database\/collections":{"get":{"summary":"List Collections","operationId":"databaseListCollections","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Collections List","schema":{"$ref":"#\/definitions\/collectionList"}}},"x-appwrite":{"method":"listCollections","weight":64,"cookies":false,"type":"","demo":"database\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Collection","operationId":"databaseCreateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new Collection.","responses":{"201":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"createCollection","weight":63,"cookies":false,"type":"","demo":"database\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"rules":{"type":"array","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["name","read","write","rules"]}}]}},"\/database\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"databaseGetCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"getCollection","weight":65,"cookies":false,"type":"","demo":"database\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"databaseUpdateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Update collection by its unique ID.","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"updateCollection","weight":66,"cookies":false,"type":"","demo":"database\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique 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]"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"rules":{"type":"array","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["name","read","write"]}}]},"delete":{"summary":"Delete Collection","operationId":"databaseDeleteCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteCollection","weight":67,"cookies":false,"type":"","demo":"database\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"databaseListDocuments","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Documents List","schema":{"$ref":"#\/definitions\/documentList"}}},"x-appwrite":{"method":"listDocuments","weight":69,"cookies":false,"type":"","demo":"database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Offset value. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"databaseCreateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","responses":{"201":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"createDocument","weight":68,"cookies":false,"type":"","demo":"database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","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.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"parentDocument":{"type":"string","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","default":"","x-example":"[PARENT_DOCUMENT]"},"parentProperty":{"type":"string","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","default":"","x-example":null},"parentPropertyType":{"type":"string","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","default":"assign","x-example":"assign"}},"required":["data","read","write"]}}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"databaseGetDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"getDocument","weight":70,"cookies":false,"type":"","demo":"database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"databaseUpdateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"updateDocument","weight":71,"cookies":false,"type":"","demo":"database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique 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.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["data","read","write"]}}]},"delete":{"summary":"Delete Document","operationId":"databaseDeleteDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents **will not** be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":72,"cookies":false,"type":"","demo":"database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/functions":{"get":{"summary":"List Functions","operationId":"functionsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Functions List","schema":{"$ref":"#\/definitions\/functionList"}}},"x-appwrite":{"method":"list","weight":155,"cookies":false,"type":"","demo":"functions\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-functions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Function","operationId":"functionsCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"201":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"create","weight":154,"cookies":false,"type":"","demo":"functions\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Function name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"env":{"type":"string","description":"Execution enviornment.","default":null,"x-example":"node-14"},"vars":{"type":"object","description":"Key-value JSON object.","default":[],"x-example":"{}"},"events":{"type":"array","description":"Events list.","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}},"required":["name","env"]}}]}},"\/functions\/{functionId}":{"get":{"summary":"Get Function","operationId":"functionsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"get","weight":156,"cookies":false,"type":"","demo":"functions\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique 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":"","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"update","weight":158,"cookies":false,"type":"","demo":"functions\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"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":{"name":{"type":"string","description":"Function name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"vars":{"type":"object","description":"Key-value JSON object.","default":[],"x-example":"{}"},"events":{"type":"array","description":"Events list.","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}},"required":["name"]}}]},"delete":{"summary":"Delete Function","operationId":"functionsDelete","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":160,"cookies":false,"type":"","demo":"functions\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/executions":{"get":{"summary":"List Executions","operationId":"functionsListExecutions","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Executions List","schema":{"$ref":"#\/definitions\/executionList"}}},"x-appwrite":{"method":"listExecutions","weight":166,"cookies":false,"type":"","demo":"functions\/list-executions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-executions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Execution","operationId":"functionsCreateExecution","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"201":{"description":"Execution","schema":{"$ref":"#\/definitions\/execution"}}},"x-appwrite":{"method":"createExecution","weight":165,"cookies":false,"type":"","demo":"functions\/create-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/executions\/{executionId}":{"get":{"summary":"Get Execution","operationId":"functionsGetExecution","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Execution","schema":{"$ref":"#\/definitions\/execution"}}},"x-appwrite":{"method":"getExecution","weight":167,"cookies":false,"type":"","demo":"functions\/get-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution unique ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/tag":{"patch":{"summary":"Update Function Tag","operationId":"functionsUpdateTag","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"updateTag","weight":159,"cookies":false,"type":"","demo":"functions\/update-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"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":{"tag":{"type":"string","description":"Tag unique ID.","default":null,"x-example":"[TAG]"}},"required":["tag"]}}]}},"\/functions\/{functionId}\/tags":{"get":{"summary":"List Tags","operationId":"functionsListTags","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Tags List","schema":{"$ref":"#\/definitions\/tagList"}}},"x-appwrite":{"method":"listTags","weight":162,"cookies":false,"type":"","demo":"functions\/list-tags.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-tags.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Tag","operationId":"functionsCreateTag","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"201":{"description":"Tag","schema":{"$ref":"#\/definitions\/tag"}}},"x-appwrite":{"method":"createTag","weight":161,"cookies":false,"type":"","demo":"functions\/create-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"command","description":"Code execution command.","required":true,"type":"string","x-example":"[COMMAND]","in":"formData"},{"name":"code","description":"Gzip file containing your code.","required":true,"type":"file","in":"formData"}]}},"\/functions\/{functionId}\/tags\/{tagId}":{"get":{"summary":"Get Tag","operationId":"functionsGetTag","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"Tag","schema":{"$ref":"#\/definitions\/tag"}}},"x-appwrite":{"method":"getTag","weight":163,"cookies":false,"type":"","demo":"functions\/get-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]},"delete":{"summary":"Delete Tag","operationId":"functionsDeleteTag","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteTag","weight":164,"cookies":false,"type":"","demo":"functions\/delete-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"healthGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"get","weight":80,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/anti-virus":{"get":{"summary":"Get Anti virus","operationId":"healthGetAntiVirus","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite Anti Virus server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getAntiVirus","weight":92,"cookies":false,"type":"","demo":"health\/get-anti-virus.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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getCache","weight":83,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/db":{"get":{"summary":"Get DB","operationId":"healthGetDB","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getDB","weight":82,"cookies":false,"type":"","demo":"health\/get-d-b.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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/certificates":{"get":{"summary":"Get Certificate Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"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":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueCertificates","weight":89,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/functions":{"get":{"summary":"Get Functions Queue","operationId":"healthGetQueueFunctions","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueFunctions","weight":90,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/logs":{"get":{"summary":"Get Logs Queue","operationId":"healthGetQueueLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueLogs","weight":87,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/tasks":{"get":{"summary":"Get Tasks Queue","operationId":"healthGetQueueTasks","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of tasks that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueTasks","weight":86,"cookies":false,"type":"","demo":"health\/get-queue-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-tasks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/usage":{"get":{"summary":"Get Usage Queue","operationId":"healthGetQueueUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueUsage","weight":88,"cookies":false,"type":"","demo":"health\/get-queue-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"healthGetQueueWebhooks","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":85,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/storage\/local":{"get":{"summary":"Get Local Storage","operationId":"healthGetStorageLocal","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getStorageLocal","weight":91,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/time":{"get":{"summary":"Get Time","operationId":"healthGetTime","consumes":["application\/json"],"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":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getTime","weight":84,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"localeGet","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"get","weight":73,"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"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"localeGetContinents","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getContinents","weight":77,"cookies":false,"type":"","demo":"locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"localeGetCountries","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCountries","weight":74,"cookies":false,"type":"","demo":"locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"localeGetCountriesEU","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCountriesEU","weight":75,"cookies":false,"type":"","demo":"locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"localeGetCountriesPhones","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCountriesPhones","weight":76,"cookies":false,"type":"","demo":"locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"localeGetCurrencies","consumes":["application\/json"],"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"}}},"x-appwrite":{"method":"getCurrencies","weight":78,"cookies":false,"type":"","demo":"locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"localeGetLanguages","consumes":["application\/json"],"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\/langaugeList"}}},"x-appwrite":{"method":"getLanguages","weight":79,"cookies":false,"type":"","demo":"locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Files List","schema":{"$ref":"#\/definitions\/fileList"}}},"x-appwrite":{"method":"listFiles","weight":127,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"storageCreateFile","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":126,"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":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"storageGetFile","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"getFile","weight":128,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique 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 file by its unique ID. Only users with write permissions have access to update this resource.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"updateFile","weight":132,"cookies":false,"type":"","demo":"storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["read","write"]}}]},"delete":{"summary":"Delete File","operationId":"storageDeleteFile","consumes":["application\/json"],"produces":["application\/json"],"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"}},"x-appwrite":{"method":"deleteFile","weight":133,"cookies":false,"type":"","demo":"storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["application\/json"],"produces":["*\/*"],"tags":["storage"],"description":"Get 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"}}},"x-appwrite":{"method":"getFileDownload","weight":130,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"storageGetFilePreview","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":129,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique 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":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"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","default":"","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"storageGetFileView","consumes":["application\/json"],"produces":["*\/*"],"tags":["storage"],"description":"Get 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"}}},"x-appwrite":{"method":"getFileView","weight":131,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":135,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","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. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":134,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](\/docs\/permissions). Max length for each role is 32 chars.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":136,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"teamsUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":137,"cookies":false,"type":"","demo":"teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":138,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"teamsGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":140,"cookies":false,"type":"","demo":"teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"teamsCreateMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":139,"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":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"New team member email.","default":null,"x-example":"email@example.com"},"name":{"type":"string","description":"New team member name. Max length: 128 chars.","default":"","x-example":"[NAME]"},"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](\/docs\/permissions). Max length for each role is 32 chars.","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. 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","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"teamsDeleteMembership","consumes":["application\/json"],"produces":["application\/json"],"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"}},"x-appwrite":{"method":"deleteMembership","weight":142,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/users":{"get":{"summary":"List Users","operationId":"usersList","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get a list of all the project users. You can use the query params to filter your results.","responses":{"200":{"description":"Users List","schema":{"$ref":"#\/definitions\/userList"}}},"x-appwrite":{"method":"list","weight":144,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","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"}}},"x-appwrite":{"method":"create","weight":143,"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"]},"security":[{"Project":[],"Key":[]}],"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 between 6 to 32 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","password"]}}]}},"\/users\/{userId}":{"get":{"summary":"Get User","operationId":"usersGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get user by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"get","weight":145,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User","operationId":"usersDeleteUser","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Delete a user by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteUser","weight":153,"cookies":false,"type":"","demo":"users\/delete-user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":148,"cookies":false,"type":"","demo":"users\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/prefs":{"get":{"summary":"Get User Preferences","operationId":"usersGetPrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get user preferences by its unique ID.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"getPrefs","weight":146,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique 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 user preferences by its unique ID. You can pass only the specific settings you wish to update.","responses":{"200":{"description":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"updatePrefs","weight":150,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique 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":null,"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"Get User Sessions","operationId":"usersGetSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get user sessions list by its unique ID.","responses":{"200":{"description":"Sessions List","schema":{"$ref":"#\/definitions\/sessionList"}}},"x-appwrite":{"method":"getSessions","weight":147,"cookies":false,"type":"","demo":"users\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User Sessions","operationId":"usersDeleteSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Delete all user sessions by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSessions","weight":152,"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":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique 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":["application\/json"],"tags":["users"],"description":"Delete user sessions by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":151,"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":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"User unique 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 user status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":149,"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"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"string","description":"User Status code. To activate the user pass 1, to block the user pass 2 and for disabling the user pass 0","default":null,"x-example":1}},"required":["status"]}}]}}},"definitions":{"none":{"description":"None","type":"object"},"any":{"description":"Any","type":"object","additionalProperties":true},"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"},"version":{"type":"string","description":"Server version number.","x-example":"1.0"}},"required":["message","code","version"]},"collectionList":{"description":"Collections List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"}}},"required":["sum","collections"]},"documentList":{"description":"Documents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/any"}}},"required":["sum","documents"]},"userList":{"description":"Users List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"users":{"type":"array","description":"List of users.","items":{"type":"object","$ref":"#\/definitions\/user"}}},"required":["sum","users"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"}}},"required":["sum","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"}}},"required":["logs"]},"fileList":{"description":"Files List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"}}},"required":["sum","files"]},"teamList":{"description":"Teams List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"}}},"required":["sum","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"}}},"required":["sum","memberships"]},"functionList":{"description":"Functions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"}}},"required":["sum","functions"]},"tagList":{"description":"Tags List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"tags":{"type":"array","description":"List of tags.","items":{"type":"object","$ref":"#\/definitions\/tag"}}},"required":["sum","tags"]},"executionList":{"description":"Executions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"}}},"required":["sum","executions"]},"countryList":{"description":"Countries List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"}}},"required":["sum","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"}}},"required":["sum","continents"]},"langaugeList":{"description":"Languages List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/langauge"}}},"required":["sum","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"}}},"required":["sum","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"}}},"required":["sum","phones"]},"permissions":{"description":"Permissions","type":"object","properties":{"read":{"type":"array","description":"Read permissions.","items":{"type":"string"}},"write":{"type":"array","description":"Write permissions.","items":{"type":"string"}}},"required":["read","write"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"Collection permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"Collection name.","x-example":"Movies"},"dateCreated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981550,"format":"int32"},"rules":{"type":"array","description":"Collection rules.","items":{"type":"object","$ref":"#\/definitions\/rule"}}},"required":["$id","$permissions","name","dateCreated","dateUpdated","rules"]},"rule":{"description":"Rule","type":"object","properties":{"$id":{"type":"string","description":"Rule ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Rule Collection.","x-example":"5e5e66c16897e"},"type":{"type":"string","description":"Rule type. Possible values: ","x-example":"title"},"key":{"type":"string","description":"Rule key.","x-example":"title"},"label":{"type":"string","description":"Rule label.","x-example":"Title"},"default":{"type":"string","description":"Rule default value.","x-example":"Movie Name"},"array":{"type":"boolean","description":"Is array?","x-example":false},"required":{"type":"boolean","description":"Is required?","x-example":true},"list":{"type":"array","description":"List of allowed values","items":{"type":"string"}}},"required":["$id","$collection","type","key","label","default","array","required","list"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"integer","description":"Log creation time in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"User name.","x-example":"John Doe"},"registration":{"type":"integer","description":"User registration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"status":{"type":"integer","description":"User status. 0 for Unavtivated, 1 for active and 2 is blocked.","x-example":0,"format":"int32"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"emailVerification":{"type":"boolean","description":"Email verification status.","x-example":true},"prefs":{"type":"string","description":"User preferences as a key-value object","x-example":{"theme":"pink","timezone":"UTC"}}},"required":["$id","name","registration","status","email","emailVerification","prefs"]},"session":{"description":"Session","type":"object","properties":{"$id":{"type":"string","description":"Session ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5bb8c16897e"},"expire":{"type":"integer","description":"Session expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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}},"required":["$id","userId","expire","ip","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName","current"]},"token":{"description":"Token","type":"object","properties":{"$id":{"type":"string","description":"Token ID.","x-example":"bb8ea5c16897e"},"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":"integer","description":"Token expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"}},"required":["$id","userId","secret","expire"]},"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 Europian 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"]},"file":{"description":"File","type":"object","properties":{"$id":{"type":"string","description":"File ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"File permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"File name.","x-example":"Pink.png"},"dateCreated":{"type":"integer","description":"File creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"}},"required":["$id","$permissions","name","dateCreated","signature","mimeType","sizeOriginal"]},"team":{"description":"Team","type":"object","properties":{"$id":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Team name.","x-example":"VIP"},"dateCreated":{"type":"integer","description":"Team creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"sum":{"type":"integer","description":"Total sum of team members.","x-example":7,"format":"int32"}},"required":["$id","name","dateCreated","sum"]},"membership":{"description":"Membership","type":"object","properties":{"$id":{"type":"string","description":"Membership ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"teamId":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"User name.","x-example":"VIP"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"invited":{"type":"integer","description":"Date, the user has been invited to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"joined":{"type":"integer","description":"Date, the user has accepted the invitation to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"confirm":{"type":"boolean","description":"User confirmation status, true if the user has joined the team or false otherwise.","x-example":false},"roles":{"type":"array","description":"User list of roles","items":{"type":"string"}}},"required":["$id","userId","teamId","name","email","invited","joined","confirm","roles"]},"function":{"description":"Function","type":"object","properties":{"$id":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Function name.","x-example":"My Function"},"dateCreated":{"type":"integer","description":"Function creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Function update date in Unix timestamp.","x-example":1592981257,"format":"int32"},"status":{"type":"string","description":"Function status. Possible values: disabled, enabled","x-example":"enabled"},"env":{"type":"string","description":"Function execution environment.","x-example":"python-3.8"},"tag":{"type":"string","description":"Function active tag ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"string","description":"Function environment variables.","x-example":{"key":"value"}},"events":{"type":"array","description":"Function trigger events.","items":{"type":"string"}},"schedule":{"type":"string","description":"Function execution schedult in CRON format.","x-example":"5 4 * * *"},"scheduleNext":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981292,"format":"int32"},"schedulePrevious":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981237,"format":"int32"},"timeout":{"type":"integer","description":"Function execution timeout in seconds.","x-example":1592981237,"format":"int32"}},"required":["$id","name","dateCreated","dateUpdated","status","env","tag","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"tag":{"description":"Tag","type":"object","properties":{"$id":{"type":"string","description":"Tag ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The tag creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"command":{"type":"string","description":"The entrypoint command in use to execute the tag code.","x-example":"enabled"},"size":{"type":"string","description":"The code size in bytes.","x-example":"python-3.8"}},"required":["$id","functionId","dateCreated","command","size"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The execution creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"trigger":{"type":"string","description":"The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.","x-example":"http"},"status":{"type":"string","description":"The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.","x-example":"processing"},"exitCode":{"type":"integer","description":"The script exit code.","x-example":0,"format":"int32"},"stdout":{"type":"string","description":"The script stdout output string.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string.","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"float"}},"required":["$id","functionId","dateCreated","trigger","status","exitCode","stdout","stderr","time"]},"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"]},"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"]},"langauge":{"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"]},"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":"float"},"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"]},"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"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file diff --git a/app/config/variables.php b/app/config/variables.php index 3da5a21e25..0893dfd252 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -151,4 +151,28 @@ return [ 'required' => false, 'question' => '', ], + [ + 'name' => '_APP_FUNCTIONS_CPUS', + 'default' => '1', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_FUNCTIONS_MEMORY', + 'default' => '128', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_FUNCTIONS_MEMORY_SWAP', + 'default' => '128', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_MAINTENANCE_INTERVAL', + 'default' => '86400', + 'required' => false, + 'question' => '', + ], ]; \ No newline at end of file diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index f4ccd225c8..fd06fc0eaf 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -44,6 +44,11 @@ App::post('/v1/account') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password. Must be between 6 to 32 chars.') ->param('name', '', new Text(128), 'User name. Max length: 128 chars.', true) + ->inject('request') + ->inject('response') + ->inject('project') + ->inject('projectDB') + ->inject('audits') ->action(function ($email, $password, $name, $request, $response, $project, $projectDB, $audits) { /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ @@ -123,7 +128,7 @@ App::post('/v1/account') ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($user, Response::MODEL_USER) ; - }, ['request', 'response', 'project', 'projectDB', 'audits']); + }); App::post('/v1/account/sessions') ->desc('Create Account Session') @@ -141,6 +146,12 @@ App::post('/v1/account/sessions') ->label('abuse-key', 'url:{url},email:{param-email}') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password. Must be between 6 to 32 chars.') + ->inject('request') + ->inject('response') + ->inject('projectDB') + ->inject('locale') + ->inject('geodb') + ->inject('audits') ->action(function ($email, $password, $request, $response, $projectDB, $locale, $geodb, $audits) { /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ @@ -168,6 +179,10 @@ App::post('/v1/account/sessions') throw new Exception('Invalid credentials', 401); // Wrong password or username } + if (Auth::USER_STATUS_BLOCKED == $profile->getAttribute('status')) { // Account is blocked + throw new Exception('Invalid credentials. User is blocked', 401); // User is in status blocked + } + $dd = new DeviceDetector($request->getUserAgent('UNKNOWN')); $dd->parse(); @@ -262,7 +277,7 @@ App::post('/v1/account/sessions') ; $response->dynamic($session, Response::MODEL_SESSION); - }, ['request', 'response', 'projectDB', 'locale', 'geodb', 'audits']); + }); App::get('/v1/account/sessions/oauth2/:provider') ->desc('Create Account Session with OAuth2') @@ -282,6 +297,9 @@ App::get('/v1/account/sessions/oauth2/:provider') ->param('success', $oauthDefaultSuccess, function ($clients) { return new Host($clients); }, 'URL to redirect back to your app after a successful login attempt. 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']) ->param('failure', $oauthDefaultFailure, function ($clients) { return new Host($clients); }, 'URL to redirect back to your app after a failed login attempt. 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']) ->param('scopes', [], new ArrayList(new Text(128)), 'A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.', true) + ->inject('request') + ->inject('response') + ->inject('project') ->action(function ($provider, $success, $failure, $scopes, $request, $response, $project) { /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ @@ -292,8 +310,6 @@ App::get('/v1/account/sessions/oauth2/:provider') $appId = $project->getAttribute('usersOauth2'.\ucfirst($provider).'Appid', ''); $appSecret = $project->getAttribute('usersOauth2'.\ucfirst($provider).'Secret', '{}'); - $appSecret = \json_decode($appSecret, true); - if (!empty($appSecret) && isset($appSecret['version'])) { $key = App::getEnv('_APP_OPENSSL_KEY_V'.$appSecret['version']); $appSecret = OpenSSL::decrypt($appSecret['data'], $appSecret['method'], $key, 0, \hex2bin($appSecret['iv']), \hex2bin($appSecret['tag'])); @@ -315,7 +331,7 @@ App::get('/v1/account/sessions/oauth2/:provider') ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') ->addHeader('Pragma', 'no-cache') ->redirect($oauth2->getLoginURL()); - }, ['request', 'response', 'project']); + }); App::get('/v1/account/sessions/oauth2/callback/:provider/:projectId') ->desc('OAuth2 Callback') @@ -327,6 +343,8 @@ App::get('/v1/account/sessions/oauth2/callback/:provider/:projectId') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('providers')), true), 'OAuth2 provider.') ->param('code', '', new Text(1024), 'OAuth2 code.') ->param('state', '', new Text(2048), 'Login state params.', true) + ->inject('request') + ->inject('response') ->action(function ($projectId, $provider, $code, $state, $request, $response) { /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ @@ -339,7 +357,7 @@ App::get('/v1/account/sessions/oauth2/callback/:provider/:projectId') ->addHeader('Pragma', 'no-cache') ->redirect($protocol.'://'.$domain.'/v1/account/sessions/oauth2/'.$provider.'/redirect?' .\http_build_query(['project' => $projectId, 'code' => $code, 'state' => $state])); - }, ['request', 'response']); + }); App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId') ->desc('OAuth2 Callback') @@ -352,6 +370,8 @@ App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('providers')), true), 'OAuth2 provider.') ->param('code', '', new Text(1024), 'OAuth2 code.') ->param('state', '', new Text(2048), 'Login state params.', true) + ->inject('request') + ->inject('response') ->action(function ($projectId, $provider, $code, $state, $request, $response) { /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ @@ -364,7 +384,7 @@ App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId') ->addHeader('Pragma', 'no-cache') ->redirect($protocol.'://'.$domain.'/v1/account/sessions/oauth2/'.$provider.'/redirect?' .\http_build_query(['project' => $projectId, 'code' => $code, 'state' => $state])); - }, ['request', 'response']); + }); App::get('/v1/account/sessions/oauth2/:provider/redirect') ->desc('OAuth2 Redirect') @@ -378,6 +398,13 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('providers')), true), 'OAuth2 provider.') ->param('code', '', new Text(1024), 'OAuth2 code.') ->param('state', '', new Text(2048), 'OAuth2 state params.', true) + ->inject('request') + ->inject('response') + ->inject('project') + ->inject('user') + ->inject('projectDB') + ->inject('geodb') + ->inject('audits') ->action(function ($provider, $code, $state, $request, $response, $project, $user, $projectDB, $geodb, $audits) use ($oauthDefaultSuccess) { /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ @@ -395,8 +422,6 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') $appId = $project->getAttribute('usersOauth2'.\ucfirst($provider).'Appid', ''); $appSecret = $project->getAttribute('usersOauth2'.\ucfirst($provider).'Secret', '{}'); - $appSecret = \json_decode($appSecret, true); - if (!empty($appSecret) && isset($appSecret['version'])) { $key = App::getEnv('_APP_OPENSSL_KEY_V'.$appSecret['version']); $appSecret = OpenSSL::decrypt($appSecret['data'], $appSecret['method'], $key, 0, \hex2bin($appSecret['iv']), \hex2bin($appSecret['tag'])); @@ -503,6 +528,10 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') } } + if (Auth::USER_STATUS_BLOCKED == $user->getAttribute('status')) { // Account is blocked + throw new Exception('Invalid credentials. User is blocked', 401); // User is in status blocked + } + // Create session token, verify user account and update OAuth2 ID and Access Token $dd = new DeviceDetector($request->getUserAgent('UNKNOWN')); @@ -606,7 +635,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') ->addCookie(Auth::$cookieName, Auth::encodeSession($user->getId(), $secret), $expiry, '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, Config::getParam('cookieSamesite')) ->redirect($state['success']) ; - }, ['request', 'response', 'project', 'user', 'projectDB', 'geodb', 'audits']); + }); App::get('/v1/account') ->desc('Get Account') @@ -619,12 +648,14 @@ App::get('/v1/account') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_USER) + ->inject('response') + ->inject('user') ->action(function ($response, $user) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Document $user */ $response->dynamic($user, Response::MODEL_USER); - }, ['response', 'user']); + }); App::get('/v1/account/prefs') ->desc('Get Account Preferences') @@ -637,6 +668,8 @@ App::get('/v1/account/prefs') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_ANY) + ->inject('response') + ->inject('user') ->action(function ($response, $user) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Document $user */ @@ -644,7 +677,7 @@ App::get('/v1/account/prefs') $prefs = $user->getAttribute('prefs', new \stdClass); $response->dynamic(new Document($prefs), Response::MODEL_ANY); - }, ['response', 'user']); + }); App::get('/v1/account/sessions') ->desc('Get Account Sessions') @@ -657,6 +690,9 @@ App::get('/v1/account/sessions') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_SESSION_LIST) + ->inject('response') + ->inject('user') + ->inject('locale') ->action(function ($response, $user, $locale) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Document $user */ @@ -684,7 +720,7 @@ App::get('/v1/account/sessions') 'sum' => count($sessions), 'sessions' => $sessions ]), Response::MODEL_SESSION_LIST); - }, ['response', 'user', 'locale']); + }); App::get('/v1/account/logs') ->desc('Get Account Logs') @@ -697,6 +733,12 @@ App::get('/v1/account/logs') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->inject('response') + ->inject('register') + ->inject('project') + ->inject('user') + ->inject('locale') + ->inject('geodb') ->action(function ($response, $register, $project, $user, $locale, $geodb) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Document $project */ @@ -784,7 +826,7 @@ App::get('/v1/account/logs') } $response->dynamic(new Document(['logs' => $output]), Response::MODEL_LOG_LIST); - }, ['response', 'register', 'project', 'user', 'locale', 'geodb']); + }); App::patch('/v1/account/name') ->desc('Update Account Name') @@ -799,6 +841,10 @@ App::patch('/v1/account/name') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_USER) ->param('name', '', new Text(128), 'User name. Max length: 128 chars.') + ->inject('response') + ->inject('user') + ->inject('projectDB') + ->inject('audits') ->action(function ($name, $response, $user, $projectDB, $audits) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Document $user */ @@ -820,7 +866,7 @@ App::patch('/v1/account/name') ; $response->dynamic($user, Response::MODEL_USER); - }, ['response', 'user', 'projectDB', 'audits']); + }); App::patch('/v1/account/password') ->desc('Update Account Password') @@ -836,6 +882,10 @@ App::patch('/v1/account/password') ->label('sdk.response.model', Response::MODEL_USER) ->param('password', '', new Password(), 'New user password. Must be between 6 to 32 chars.') ->param('oldPassword', '', new Password(), 'Old user password. Must be between 6 to 32 chars.') + ->inject('response') + ->inject('user') + ->inject('projectDB') + ->inject('audits') ->action(function ($password, $oldPassword, $response, $user, $projectDB, $audits) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Document $user */ @@ -861,7 +911,7 @@ App::patch('/v1/account/password') ; $response->dynamic($user, Response::MODEL_USER); - }, ['response', 'user', 'projectDB', 'audits']); + }); App::patch('/v1/account/email') ->desc('Update Account Email') @@ -877,6 +927,10 @@ App::patch('/v1/account/email') ->label('sdk.response.model', Response::MODEL_USER) ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password. Must be between 6 to 32 chars.') + ->inject('response') + ->inject('user') + ->inject('projectDB') + ->inject('audits') ->action(function ($email, $password, $response, $user, $projectDB, $audits) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Document $user */ @@ -917,7 +971,7 @@ App::patch('/v1/account/email') ; $response->dynamic($user, Response::MODEL_USER); - }, ['response', 'user', 'projectDB', 'audits']); + }); App::patch('/v1/account/prefs') ->desc('Update Account Preferences') @@ -932,6 +986,10 @@ App::patch('/v1/account/prefs') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_ANY) ->param('prefs', [], new Assoc(), 'Prefs key-value JSON object.') + ->inject('response') + ->inject('user') + ->inject('projectDB') + ->inject('audits') ->action(function ($prefs, $response, $user, $projectDB, $audits) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Document $user */ @@ -952,7 +1010,7 @@ App::patch('/v1/account/prefs') ; $response->dynamic($user, Response::MODEL_USER); - }, ['response', 'user', 'projectDB', 'audits']); + }); App::delete('/v1/account') ->desc('Delete Account') @@ -966,6 +1024,12 @@ App::delete('/v1/account') ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_NONE) + ->inject('request') + ->inject('response') + ->inject('user') + ->inject('projectDB') + ->inject('audits') + ->inject('events') ->action(function ($request, $response, $user, $projectDB, $audits, $events) { /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ @@ -1013,7 +1077,7 @@ App::delete('/v1/account') ->addCookie(Auth::$cookieName, '', \time() - 3600, '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, Config::getParam('cookieSamesite')) ->noContent() ; - }, ['request', 'response', 'user', 'projectDB', 'audits', 'events']); + }); App::delete('/v1/account/sessions/:sessionId') ->desc('Delete Account Session') @@ -1029,6 +1093,12 @@ App::delete('/v1/account/sessions/:sessionId') ->label('sdk.response.model', Response::MODEL_NONE) ->label('abuse-limit', 100) ->param('sessionId', null, new UID(), 'Session unique ID. Use the string \'current\' to delete the current device session.') + ->inject('request') + ->inject('response') + ->inject('user') + ->inject('projectDB') + ->inject('audits') + ->inject('events') ->action(function ($sessionId, $request, $response, $user, $projectDB, $audits, $events) { /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ @@ -1082,7 +1152,7 @@ App::delete('/v1/account/sessions/:sessionId') } throw new Exception('Session not found', 404); - }, ['request', 'response', 'user', 'projectDB', 'audits', 'events']); + }); App::delete('/v1/account/sessions') ->desc('Delete All Account Sessions') @@ -1097,6 +1167,12 @@ App::delete('/v1/account/sessions') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_NONE) ->label('abuse-limit', 100) + ->inject('request') + ->inject('response') + ->inject('user') + ->inject('projectDB') + ->inject('audits') + ->inject('events') ->action(function ($request, $response, $user, $projectDB, $audits, $events) { /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ @@ -1144,7 +1220,7 @@ App::delete('/v1/account/sessions') ; $response->noContent(); - }, ['request', 'response', 'user', 'projectDB', 'audits', 'events']); + }); App::post('/v1/account/recovery') ->desc('Create Password Recovery') @@ -1162,6 +1238,14 @@ App::post('/v1/account/recovery') ->label('abuse-key', 'url:{url},email:{param-email}') ->param('email', '', new Email(), 'User email.') ->param('url', '', function ($clients) { return new Host($clients); }, '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']) + ->inject('request') + ->inject('response') + ->inject('projectDB') + ->inject('project') + ->inject('locale') + ->inject('mails') + ->inject('audits') + ->inject('events') ->action(function ($email, $url, $request, $response, $projectDB, $project, $locale, $mails, $audits, $events) { /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ @@ -1187,6 +1271,10 @@ App::post('/v1/account/recovery') throw new Exception('User not found', 404); // TODO maybe hide this } + if (Auth::USER_STATUS_BLOCKED == $profile->getAttribute('status')) { // Account is blocked + throw new Exception('Invalid credentials. User is blocked', 401); // User is in status blocked + } + $secret = Auth::tokenGenerator(); $recovery = new Document([ '$collection' => Database::SYSTEM_COLLECTION_TOKENS, @@ -1270,7 +1358,7 @@ App::post('/v1/account/recovery') ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($recovery, Response::MODEL_TOKEN) ; - }, ['request', 'response', 'projectDB', 'project', 'locale', 'mails', 'audits', 'events']); + }); App::put('/v1/account/recovery') ->desc('Complete Password Recovery') @@ -1290,6 +1378,9 @@ App::put('/v1/account/recovery') ->param('secret', '', new Text(256), 'Valid reset token.') ->param('password', '', new Password(), 'New password. Must be between 6 to 32 chars.') ->param('passwordAgain', '', new Password(), 'New password again. Must be between 6 to 32 chars.') + ->inject('response') + ->inject('projectDB') + ->inject('audits') ->action(function ($userId, $secret, $password, $passwordAgain, $response, $projectDB, $audits) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -1346,7 +1437,7 @@ App::put('/v1/account/recovery') $recovery = $profile->search('$id', $recovery, $profile->getAttribute('tokens', [])); $response->dynamic($recovery, Response::MODEL_TOKEN); - }, ['response', 'projectDB', 'audits']); + }); App::post('/v1/account/verification') ->desc('Create Email Verification') @@ -1363,6 +1454,15 @@ App::post('/v1/account/verification') ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') ->param('url', '', function ($clients) { return new Host($clients); }, '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']) // TODO add built-in confirm page + ->inject('request') + ->inject('response') + ->inject('project') + ->inject('user') + ->inject('projectDB') + ->inject('locale') + ->inject('audits') + ->inject('events') + ->inject('mails') ->action(function ($url, $request, $response, $project, $user, $projectDB, $locale, $audits, $events, $mails) { /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ @@ -1461,7 +1561,7 @@ App::post('/v1/account/verification') ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($verification, Response::MODEL_TOKEN) ; - }, ['request', 'response', 'project', 'user', 'projectDB', 'locale', 'audits', 'events', 'mails']); + }); App::put('/v1/account/verification') ->desc('Complete Email Verification') @@ -1479,6 +1579,10 @@ App::put('/v1/account/verification') ->label('abuse-key', 'url:{url},userId:{param-userId}') ->param('userId', '', new UID(), 'User unique ID.') ->param('secret', '', new Text(256), 'Valid verification token.') + ->inject('response') + ->inject('user') + ->inject('projectDB') + ->inject('audits') ->action(function ($userId, $secret, $response, $user, $projectDB, $audits) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Document $user */ @@ -1530,4 +1634,4 @@ App::put('/v1/account/verification') $verification = $profile->search('$id', $verification, $profile->getAttribute('tokens', [])); $response->dynamic($verification, Response::MODEL_TOKEN); - }, ['response', 'user', 'projectDB', 'audits']); \ No newline at end of file + }); \ No newline at end of file diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 096f1f284c..1059c6e1c7 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -95,9 +95,10 @@ App::get('/v1/avatars/credit-cards/:code') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) ->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) ->param('quality', 100, new Range(0, 100), 'Image quality. Pass an integer between 0 to 100. Defaults to 100.', true) + ->inject('response') ->action(function ($code, $width, $height, $quality, $response) use ($avatarCallback) { return $avatarCallback('credit-cards', $code, $width, $height, $quality, $response); - }, ['response']); + }); App::get('/v1/avatars/browsers/:code') ->desc('Get Browser Icon') @@ -114,9 +115,10 @@ App::get('/v1/avatars/browsers/:code') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) ->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) ->param('quality', 100, new Range(0, 100), 'Image quality. Pass an integer between 0 to 100. Defaults to 100.', true) + ->inject('response') ->action(function ($code, $width, $height, $quality, $response) use ($avatarCallback) { return $avatarCallback('browsers', $code, $width, $height, $quality, $response); - }, ['response']); + }); App::get('/v1/avatars/flags/:code') ->desc('Get Country Flag') @@ -133,9 +135,10 @@ App::get('/v1/avatars/flags/:code') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) ->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) ->param('quality', 100, new Range(0, 100), 'Image quality. Pass an integer between 0 to 100. Defaults to 100.', true) + ->inject('response') ->action(function ($code, $width, $height, $quality, $response) use ($avatarCallback) { return $avatarCallback('flags', $code, $width, $height, $quality, $response); - }, ['response']); + }); App::get('/v1/avatars/image') ->desc('Get Image from URL') @@ -151,6 +154,7 @@ App::get('/v1/avatars/image') ->param('url', '', new URL(), 'Image URL which you want to crop.') ->param('width', 400, new Range(0, 2000), 'Resize preview image width, Pass an integer between 0 to 2000.', true) ->param('height', 400, new Range(0, 2000), 'Resize preview image height, Pass an integer between 0 to 2000.', true) + ->inject('response') ->action(function ($url, $width, $height, $response) { /** @var Appwrite\Utopia\Response $response */ @@ -203,7 +207,7 @@ App::get('/v1/avatars/image') ; unset($resize); - }, ['response']); + }); App::get('/v1/avatars/favicon') ->desc('Get Favicon') @@ -217,6 +221,7 @@ App::get('/v1/avatars/favicon') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE) ->param('url', '', new URL(), 'Website URL which you want to fetch the favicon from.') + ->inject('response') ->action(function ($url, $response) { /** @var Appwrite\Utopia\Response $response */ @@ -355,7 +360,7 @@ App::get('/v1/avatars/favicon') ->send($data); unset($resize); - }, ['response']); + }); App::get('/v1/avatars/qr') ->desc('Get QR Code') @@ -372,6 +377,7 @@ App::get('/v1/avatars/qr') ->param('size', 400, new Range(0, 1000), 'QR code size. Pass an integer between 0 to 1000. Defaults to 400.', true) ->param('margin', 1, new Range(0, 10), 'Margin from edge. Pass an integer between 0 to 10. Defaults to 1.', true) ->param('download', false, new Boolean(true), '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.', true) + ->inject('response') ->action(function ($text, $size, $margin, $download, $response) { /** @var Appwrite\Utopia\Response $response */ @@ -392,7 +398,7 @@ App::get('/v1/avatars/qr') ->setContentType('image/png') ->send($qrcode->render($text)) ; - }, ['response']); + }); App::get('/v1/avatars/initials') ->desc('Get User Initials') @@ -410,6 +416,8 @@ App::get('/v1/avatars/initials') ->param('height', 500, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) ->param('color', '', new HexColor(), 'Changes text color. By default a random color will be picked and stay will persistent to the given name.', true) ->param('background', '', new HexColor(), 'Changes background color. By default a random color will be picked and stay will persistent to the given name.', true) + ->inject('response') + ->inject('user') ->action(function ($name, $width, $height, $color, $background, $response, $user) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Document $user */ @@ -472,4 +480,4 @@ App::get('/v1/avatars/initials') ->setContentType('image/png') ->send($image->getImageBlob()) ; - }, ['response', 'user']); + }); diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php index a31c87bc7a..ad32e80116 100644 --- a/app/controllers/api/database.php +++ b/app/controllers/api/database.php @@ -34,6 +34,9 @@ App::post('/v1/database/collections') ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') ->param('rules', [], function ($projectDB) { return new ArrayList(new Collection($projectDB, [Database::SYSTEM_COLLECTION_RULES], ['$collection' => Database::SYSTEM_COLLECTION_RULES, '$permissions' => ['read' => [], 'write' => []]])); }, 'Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation.', false, ['projectDB']) + ->inject('response') + ->inject('projectDB') + ->inject('audits') ->action(function ($name, $read, $write, $rules, $response, $projectDB, $audits) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -86,7 +89,7 @@ App::post('/v1/database/collections') ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($data, Response::MODEL_COLLECTION) ; - }, ['response', 'projectDB', 'audits']); + }); App::get('/v1/database/collections') ->desc('List Collections') @@ -103,6 +106,8 @@ App::get('/v1/database/collections') ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) ->param('offset', 0, new Range(0, 40000), 'Results offset. The default value is 0. Use this param to manage pagination.', true) ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true) + ->inject('response') + ->inject('projectDB') ->action(function ($search, $limit, $offset, $orderType, $response, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -110,6 +115,7 @@ App::get('/v1/database/collections') $results = $projectDB->getCollection([ 'limit' => $limit, 'offset' => $offset, + 'orderType' => $orderType, 'search' => $search, 'filters' => [ '$collection='.Database::SYSTEM_COLLECTION_COLLECTIONS, @@ -120,7 +126,7 @@ App::get('/v1/database/collections') 'sum' => $projectDB->getSum(), 'collections' => $results ]), Response::MODEL_COLLECTION_LIST); - }, ['response', 'projectDB']); + }); App::get('/v1/database/collections/:collectionId') ->desc('Get Collection') @@ -134,6 +140,8 @@ App::get('/v1/database/collections/:collectionId') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_COLLECTION) ->param('collectionId', '', new UID(), 'Collection unique ID.') + ->inject('response') + ->inject('projectDB') ->action(function ($collectionId, $response, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -145,7 +153,7 @@ App::get('/v1/database/collections/:collectionId') } $response->dynamic($collection, Response::MODEL_COLLECTION); - }, ['response', 'projectDB']); + }); App::put('/v1/database/collections/:collectionId') ->desc('Update Collection') @@ -164,6 +172,9 @@ App::put('/v1/database/collections/:collectionId') ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(/docs/permissions) and get a full list of available permissions.') ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') ->param('rules', [], function ($projectDB) { return new ArrayList(new Collection($projectDB, [Database::SYSTEM_COLLECTION_RULES], ['$collection' => Database::SYSTEM_COLLECTION_RULES, '$permissions' => ['read' => [], 'write' => []]])); }, 'Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation.', true, ['projectDB']) + ->inject('response') + ->inject('projectDB') + ->inject('audits') ->action(function ($collectionId, $name, $read, $write, $rules, $response, $projectDB, $audits) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -217,7 +228,7 @@ App::put('/v1/database/collections/:collectionId') ; $response->dynamic($collection, Response::MODEL_COLLECTION); - }, ['response', 'projectDB', 'audits']); + }); App::delete('/v1/database/collections/:collectionId') ->desc('Delete Collection') @@ -232,6 +243,11 @@ App::delete('/v1/database/collections/:collectionId') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_NONE) ->param('collectionId', '', new UID(), 'Collection unique ID.') + ->inject('response') + ->inject('projectDB') + ->inject('events') + ->inject('audits') + ->inject('deletes') ->action(function ($collectionId, $response, $projectDB, $events, $audits, $deletes) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -249,6 +265,7 @@ App::delete('/v1/database/collections/:collectionId') } $deletes + ->setParam('type', DELETE_TYPE_DOCUMENT) ->setParam('document', $collection) ; @@ -263,7 +280,7 @@ App::delete('/v1/database/collections/:collectionId') ; $response->noContent(); - }, ['response', 'projectDB', 'events', 'audits', 'deletes']); + }); App::post('/v1/database/collections/:collectionId/documents') ->desc('Create Document') @@ -284,6 +301,9 @@ App::post('/v1/database/collections/:collectionId/documents') ->param('parentDocument', '', new UID(), 'Parent document unique ID. Use when you want your new document to be a child of a parent document.', true) ->param('parentProperty', '', new Key(), 'Parent document property name. Use when you want your new document to be a child of a parent document.', true) ->param('parentPropertyType', Document::SET_TYPE_ASSIGN, new WhiteList([Document::SET_TYPE_ASSIGN, Document::SET_TYPE_APPEND, Document::SET_TYPE_PREPEND], true), 'Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.', true) + ->inject('response') + ->inject('projectDB') + ->inject('audits') ->action(function ($collectionId, $data, $read, $write, $parentDocument, $parentProperty, $parentPropertyType, $response, $projectDB, $audits) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -380,7 +400,7 @@ App::post('/v1/database/collections/:collectionId/documents') ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($data, Response::MODEL_ANY) ; - }, ['response', 'projectDB', 'audits']); + }); App::get('/v1/database/collections/:collectionId/documents') ->desc('List Documents') @@ -401,6 +421,8 @@ App::get('/v1/database/collections/:collectionId/documents') ->param('orderType', 'ASC', new WhiteList(['DESC', 'ASC'], true), 'Order direction. Possible values are DESC for descending order, or ASC for ascending order.', true) ->param('orderCast', 'string', new WhiteList(['int', 'string', 'date', 'time', 'datetime'], true), 'Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.', true) ->param('search', '', new Text(256), 'Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.', true) + ->inject('response') + ->inject('projectDB') ->action(function ($collectionId, $filters, $limit, $offset, $orderField, $orderType, $orderCast, $search, $response, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -441,7 +463,7 @@ App::get('/v1/database/collections/:collectionId/documents') ; $response->dynamic($collection, Response::MODEL_DOCUMENT_LIST); - }, ['response', 'projectDB']); + }); App::get('/v1/database/collections/:collectionId/documents/:documentId') ->desc('Get Document') @@ -456,8 +478,9 @@ App::get('/v1/database/collections/:collectionId/documents/:documentId') ->label('sdk.response.model', Response::MODEL_ANY) ->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).') ->param('documentId', null, new UID(), 'Document unique ID.') - ->action(function ($collectionId, $documentId, $request, $response, $projectDB) { - /** @var Utopia\Swoole\Request $request */ + ->inject('response') + ->inject('projectDB') + ->action(function ($collectionId, $documentId, $response, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -469,7 +492,7 @@ App::get('/v1/database/collections/:collectionId/documents/:documentId') } $response->dynamic($document, Response::MODEL_ANY); - }, ['request', 'response', 'projectDB']); + }); App::patch('/v1/database/collections/:collectionId/documents/:documentId') ->desc('Update Document') @@ -488,6 +511,9 @@ App::patch('/v1/database/collections/:collectionId/documents/:documentId') ->param('data', [], new JSON(), 'Document data as JSON object.') ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') + ->inject('response') + ->inject('projectDB') + ->inject('audits') ->action(function ($collectionId, $documentId, $data, $read, $write, $response, $projectDB, $audits) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -546,7 +572,7 @@ App::patch('/v1/database/collections/:collectionId/documents/:documentId') ; $response->dynamic($data, Response::MODEL_ANY); - }, ['response', 'projectDB', 'audits']); + }); App::delete('/v1/database/collections/:collectionId/documents/:documentId') ->desc('Delete Document') @@ -562,6 +588,10 @@ App::delete('/v1/database/collections/:collectionId/documents/:documentId') ->label('sdk.response.model', Response::MODEL_NONE) ->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).') ->param('documentId', null, new UID(), 'Document unique ID.') + ->inject('response') + ->inject('projectDB') + ->inject('events') + ->inject('audits') ->action(function ($collectionId, $documentId, $response, $projectDB, $events, $audits) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -600,4 +630,4 @@ App::delete('/v1/database/collections/:collectionId/documents/:documentId') ; $response->noContent(); - }, ['response', 'projectDB', 'events', 'audits']); \ No newline at end of file + }); \ No newline at end of file diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index edd24f4778..f4135d359d 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -38,6 +38,8 @@ App::post('/v1/functions') ->param('events', [], new ArrayList(new WhiteList(array_keys(Config::getParam('events')), true)), 'Events list.', true) ->param('schedule', '', new Cron(), 'Schedule CRON syntax.', true) ->param('timeout', 15, new Range(1, 900), 'Function maximum execution time in seconds.', true) + ->inject('response') + ->inject('projectDB') ->action(function ($name, $env, $vars, $events, $schedule, $timeout, $response, $projectDB) { $function = $projectDB->createDocument([ '$collection' => Database::SYSTEM_COLLECTION_FUNCTIONS, @@ -67,7 +69,7 @@ App::post('/v1/functions') ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($function, Response::MODEL_FUNCTION) ; - }, ['response', 'projectDB']); + }); App::get('/v1/functions') ->groups(['api', 'functions']) @@ -84,10 +86,13 @@ App::get('/v1/functions') ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true) ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true) + ->inject('response') + ->inject('projectDB') ->action(function ($search, $limit, $offset, $orderType, $response, $projectDB) { $results = $projectDB->getCollection([ 'limit' => $limit, 'offset' => $offset, + 'orderType' => $orderType, 'search' => $search, 'filters' => [ '$collection='.Database::SYSTEM_COLLECTION_FUNCTIONS, @@ -98,7 +103,7 @@ App::get('/v1/functions') 'sum' => $projectDB->getSum(), 'functions' => $results ]), Response::MODEL_FUNCTION_LIST); - }, ['response', 'projectDB']); + }); App::get('/v1/functions/:functionId') ->groups(['api', 'functions']) @@ -112,6 +117,8 @@ App::get('/v1/functions/:functionId') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_FUNCTION) ->param('functionId', '', new UID(), 'Function unique ID.') + ->inject('response') + ->inject('projectDB') ->action(function ($functionId, $response, $projectDB) { $function = $projectDB->getDocument($functionId); @@ -120,7 +127,7 @@ App::get('/v1/functions/:functionId') } $response->dynamic($function, Response::MODEL_FUNCTION); - }, ['response', 'projectDB']); + }); App::get('/v1/functions/:functionId/usage') ->desc('Get Function Usage') @@ -131,6 +138,10 @@ App::get('/v1/functions/:functionId/usage') ->label('sdk.method', 'getUsage') ->param('functionId', '', new UID(), 'Function unique ID.') ->param('range', '30d', new WhiteList(['24h', '7d', '30d', '90d']), 'Date range.', true) + ->inject('response') + ->inject('project') + ->inject('projectDB') + ->inject('register') ->action(function ($functionId, $range, $response, $project, $projectDB, $register) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Document $project */ @@ -233,7 +244,7 @@ App::get('/v1/functions/:functionId/usage') }, $compute)), ], ]); - }, ['response', 'project', 'projectDB', 'register']); + }); App::put('/v1/functions/:functionId') ->groups(['api', 'functions']) @@ -252,6 +263,8 @@ App::put('/v1/functions/:functionId') ->param('events', [], new ArrayList(new WhiteList(array_keys(Config::getParam('events')), true)), 'Events list.', true) ->param('schedule', '', new Cron(), 'Schedule CRON syntax.', true) ->param('timeout', 15, new Range(1, 900), 'Function maximum execution time in seconds.', true) + ->inject('response') + ->inject('projectDB') ->action(function ($functionId, $name, $vars, $events, $schedule, $timeout, $response, $projectDB) { $function = $projectDB->getDocument($functionId); @@ -291,7 +304,7 @@ App::put('/v1/functions/:functionId') } $response->dynamic($function, Response::MODEL_FUNCTION); - }, ['response', 'projectDB']); + }); App::patch('/v1/functions/:functionId/tag') ->groups(['api', 'functions']) @@ -300,12 +313,14 @@ App::patch('/v1/functions/:functionId/tag') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'functions') ->label('sdk.method', 'updateTag') - ->label('sdk.description', '/docs/references/functions/update-tag.md') + ->label('sdk.description', '/docs/references/functions/update-function-tag.md') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_FUNCTION) ->param('functionId', '', new UID(), 'Function unique ID.') ->param('tag', '', new UID(), 'Tag unique ID.') + ->inject('response') + ->inject('projectDB') ->action(function ($functionId, $tag, $response, $projectDB) { $function = $projectDB->getDocument($functionId); $tag = $projectDB->getDocument($tag); @@ -332,7 +347,7 @@ App::patch('/v1/functions/:functionId/tag') } $response->dynamic($function, Response::MODEL_FUNCTION); - }, ['response', 'projectDB']); + }); App::delete('/v1/functions/:functionId') ->groups(['api', 'functions']) @@ -346,6 +361,9 @@ App::delete('/v1/functions/:functionId') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_NONE) ->param('functionId', '', new UID(), 'Function unique ID.') + ->inject('response') + ->inject('projectDB') + ->inject('deletes') ->action(function ($functionId, $response, $projectDB, $deletes) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -362,11 +380,12 @@ App::delete('/v1/functions/:functionId') } $deletes + ->setParam('type', DELETE_TYPE_DOCUMENT) ->setParam('document', $function->getArrayCopy()) ; $response->noContent(); - }, ['response', 'projectDB', 'deletes']); + }); App::post('/v1/functions/:functionId/tags') ->groups(['api', 'functions']) @@ -384,6 +403,10 @@ App::post('/v1/functions/:functionId/tags') ->param('command', '', new Text('1028'), 'Code execution command.') ->param('code', [], new File(), 'Gzip file containing your code.', false) // ->param('code', '', new Text(128), 'Code package. Use the '.APP_NAME.' code packager to create a deployable package file.') + ->inject('request') + ->inject('response') + ->inject('projectDB') + ->inject('usage') ->action(function ($functionId, $command, $code, $request, $response, $projectDB, $usage) { $function = $projectDB->getDocument($functionId); @@ -452,7 +475,7 @@ App::post('/v1/functions/:functionId/tags') ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($tag, Response::MODEL_TAG) ; - }, ['request', 'response', 'projectDB', 'usage']); + }); App::get('/v1/functions/:functionId/tags') ->groups(['api', 'functions']) @@ -470,6 +493,8 @@ App::get('/v1/functions/:functionId/tags') ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true) ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true) + ->inject('response') + ->inject('projectDB') ->action(function ($functionId, $search, $limit, $offset, $orderType, $response, $projectDB) { $function = $projectDB->getDocument($functionId); @@ -480,6 +505,7 @@ App::get('/v1/functions/:functionId/tags') $results = $projectDB->getCollection([ 'limit' => $limit, 'offset' => $offset, + 'orderType' => $orderType, 'search' => $search, 'filters' => [ '$collection='.Database::SYSTEM_COLLECTION_TAGS, @@ -491,7 +517,7 @@ App::get('/v1/functions/:functionId/tags') 'sum' => $projectDB->getSum(), 'tags' => $results ]), Response::MODEL_TAG_LIST); - }, ['response', 'projectDB']); + }); App::get('/v1/functions/:functionId/tags/:tagId') ->groups(['api', 'functions']) @@ -506,6 +532,8 @@ App::get('/v1/functions/:functionId/tags/:tagId') ->label('sdk.response.model', Response::MODEL_TAG) ->param('functionId', '', new UID(), 'Function unique ID.') ->param('tagId', '', new UID(), 'Tag unique ID.') + ->inject('response') + ->inject('projectDB') ->action(function ($functionId, $tagId, $response, $projectDB) { $function = $projectDB->getDocument($functionId); @@ -524,7 +552,7 @@ App::get('/v1/functions/:functionId/tags/:tagId') } $response->dynamic($tag, Response::MODEL_TAG); - }, ['response', 'projectDB']); + }); App::delete('/v1/functions/:functionId/tags/:tagId') ->groups(['api', 'functions']) @@ -539,6 +567,9 @@ App::delete('/v1/functions/:functionId/tags/:tagId') ->label('sdk.response.model', Response::MODEL_NONE) ->param('functionId', '', new UID(), 'Function unique ID.') ->param('tagId', '', new UID(), 'Tag unique ID.') + ->inject('response') + ->inject('projectDB') + ->inject('usage') ->action(function ($functionId, $tagId, $response, $projectDB, $usage) { $function = $projectDB->getDocument($functionId); @@ -579,7 +610,7 @@ App::delete('/v1/functions/:functionId/tags/:tagId') ; $response->noContent(); - }, ['response', 'projectDB', 'usage']); + }); App::post('/v1/functions/:functionId/executions') ->groups(['api', 'functions']) @@ -594,6 +625,9 @@ App::post('/v1/functions/:functionId/executions') ->label('sdk.response.model', Response::MODEL_EXECUTION) ->param('functionId', '', new UID(), 'Function unique ID.') // ->param('async', 1, new Range(0, 1), 'Execute code asynchronously. Pass 1 for true, 0 for false. Default value is 1.', true) + ->inject('response') + ->inject('project') + ->inject('projectDB') ->action(function ($functionId, /*$async,*/ $response, $project, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Document $project */ @@ -635,7 +669,6 @@ App::post('/v1/functions/:functionId/executions') throw new Exception('Failed saving execution to DB', 500); } - // Issue a TLS certificate when domain is verified Resque::enqueue('v1-functions', 'FunctionsV1', [ 'projectId' => $project->getId(), 'functionId' => $function->getId(), @@ -647,7 +680,7 @@ App::post('/v1/functions/:functionId/executions') ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($execution, Response::MODEL_EXECUTION) ; - }, ['response', 'project', 'projectDB']); + }); App::get('/v1/functions/:functionId/executions') ->groups(['api', 'functions']) @@ -665,6 +698,8 @@ App::get('/v1/functions/:functionId/executions') ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true) ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true) + ->inject('response') + ->inject('projectDB') ->action(function ($functionId, $search, $limit, $offset, $orderType, $response, $projectDB) { $function = $projectDB->getDocument($functionId); @@ -675,6 +710,7 @@ App::get('/v1/functions/:functionId/executions') $results = $projectDB->getCollection([ 'limit' => $limit, 'offset' => $offset, + 'orderType' => $orderType, 'search' => $search, 'filters' => [ '$collection='.Database::SYSTEM_COLLECTION_EXECUTIONS, @@ -686,7 +722,7 @@ App::get('/v1/functions/:functionId/executions') 'sum' => $projectDB->getSum(), 'executions' => $results ]), Response::MODEL_EXECUTION_LIST); - }, ['response', 'projectDB']); + }); App::get('/v1/functions/:functionId/executions/:executionId') ->groups(['api', 'functions']) @@ -701,6 +737,8 @@ App::get('/v1/functions/:functionId/executions/:executionId') ->label('sdk.response.model', Response::MODEL_EXECUTION) ->param('functionId', '', new UID(), 'Function unique ID.') ->param('executionId', '', new UID(), 'Execution unique ID.') + ->inject('response') + ->inject('projectDB') ->action(function ($functionId, $executionId, $response, $projectDB) { $function = $projectDB->getDocument($functionId); @@ -719,4 +757,4 @@ App::get('/v1/functions/:functionId/executions/:executionId') } $response->dynamic($execution, Response::MODEL_EXECUTION); - }, ['response', 'projectDB']); + }); diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 8b146167da..90efef16c5 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -5,6 +5,7 @@ use Utopia\Exception; use Appwrite\Storage\Device\Local; use Appwrite\Storage\Storage; use Appwrite\ClamAV\Network; +use Appwrite\Event\Event; App::get('/v1/health') ->desc('Get HTTP') @@ -14,21 +15,23 @@ App::get('/v1/health') ->label('sdk.namespace', 'health') ->label('sdk.method', 'get') ->label('sdk.description', '/docs/references/health/get.md') + ->inject('response') ->action(function ($response) { /** @var Appwrite\Utopia\Response $response */ $response->json(['status' => 'OK']); - }, ['response']); + }); App::get('/v1/health/version') ->desc('Get Version') ->groups(['api', 'health']) ->label('scope', 'public') + ->inject('response') ->action(function ($response) { /** @var Appwrite\Utopia\Response $response */ $response->json(['version' => APP_VERSION_STABLE]); - }, ['response']); + }); App::get('/v1/health/db') ->desc('Get DB') @@ -38,6 +41,8 @@ App::get('/v1/health/db') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getDB') ->label('sdk.description', '/docs/references/health/get-db.md') + ->inject('response') + ->inject('register') ->action(function ($response, $register) { /** @var Appwrite\Utopia\Response $response */ /** @var Utopia\Registry\Registry $register */ @@ -45,7 +50,7 @@ App::get('/v1/health/db') $register->get('db'); /* @var $db PDO */ $response->json(['status' => 'OK']); - }, ['response', 'register']); + }); App::get('/v1/health/cache') ->desc('Get Cache') @@ -55,13 +60,15 @@ App::get('/v1/health/cache') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getCache') ->label('sdk.description', '/docs/references/health/get-cache.md') + ->inject('response') + ->inject('register') ->action(function ($response, $register) { /** @var Appwrite\Utopia\Response $response */ /** @var Utopia\Registry\Registry $register */ $register->get('cache'); /* @var $cache Predis\Client */ $response->json(['status' => 'OK']); - }, ['response']); + }); App::get('/v1/health/time') ->desc('Get Time') @@ -71,6 +78,7 @@ App::get('/v1/health/time') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getTime') ->label('sdk.description', '/docs/references/health/get-time.md') + ->inject('response') ->action(function ($response) { /** @var Appwrite\Utopia\Response $response */ @@ -109,7 +117,7 @@ App::get('/v1/health/time') } $response->json(['remote' => $timestamp, 'local' => \time(), 'diff' => $diff]); - }, ['response']); + }); App::get('/v1/health/queue/webhooks') ->desc('Get Webhooks Queue') @@ -119,10 +127,11 @@ App::get('/v1/health/queue/webhooks') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getQueueWebhooks') ->label('sdk.description', '/docs/references/health/get-queue-webhooks.md') + ->inject('response') ->action(function ($response) { /** @var Appwrite\Utopia\Response $response */ - $response->json(['size' => Resque::size('v1-webhooks')]); + $response->json(['size' => Resque::size(Event::WEBHOOK_QUEUE_NAME)]); }, ['response']); App::get('/v1/health/queue/tasks') @@ -133,10 +142,11 @@ App::get('/v1/health/queue/tasks') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getQueueTasks') ->label('sdk.description', '/docs/references/health/get-queue-tasks.md') + ->inject('response') ->action(function ($response) { /** @var Appwrite\Utopia\Response $response */ - $response->json(['size' => Resque::size('v1-tasks')]); + $response->json(['size' => Resque::size(Event::TASK_QUEUE_NAME)]); }, ['response']); App::get('/v1/health/queue/logs') @@ -147,10 +157,11 @@ App::get('/v1/health/queue/logs') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getQueueLogs') ->label('sdk.description', '/docs/references/health/get-queue-logs.md') + ->inject('response') ->action(function ($response) { /** @var Appwrite\Utopia\Response $response */ - $response->json(['size' => Resque::size('v1-audit')]); + $response->json(['size' => Resque::size(Event::AUDITS_QUEUE_NAME)]); }, ['response']); App::get('/v1/health/queue/usage') @@ -161,10 +172,11 @@ App::get('/v1/health/queue/usage') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getQueueUsage') ->label('sdk.description', '/docs/references/health/get-queue-usage.md') + ->inject('response') ->action(function ($response) { /** @var Appwrite\Utopia\Response $response */ - $response->json(['size' => Resque::size('v1-usage')]); + $response->json(['size' => Resque::size(Event::USAGE_QUEUE_NAME)]); }, ['response']); App::get('/v1/health/queue/certificates') @@ -175,10 +187,11 @@ App::get('/v1/health/queue/certificates') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getQueueCertificates') ->label('sdk.description', '/docs/references/health/get-queue-certificates.md') + ->inject('response') ->action(function ($response) { /** @var Appwrite\Utopia\Response $response */ - $response->json(['size' => Resque::size('v1-certificates')]); + $response->json(['size' => Resque::size(Event::CERTIFICATES_QUEUE_NAME)]); }, ['response']); App::get('/v1/health/queue/functions') @@ -189,10 +202,11 @@ App::get('/v1/health/queue/functions') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getQueueFunctions') ->label('sdk.description', '/docs/references/health/get-queue-functions.md') + ->inject('response') ->action(function ($response) { /** @var Appwrite\Utopia\Response $response */ - $response->json(['size' => Resque::size('v1-functions')]); + $response->json(['size' => Resque::size(Event::FUNCTIONS_QUEUE_NAME)]); }, ['response']); App::get('/v1/health/storage/local') @@ -203,6 +217,7 @@ App::get('/v1/health/storage/local') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getStorageLocal') ->label('sdk.description', '/docs/references/health/get-storage-local.md') + ->inject('response') ->action(function ($response) { /** @var Appwrite\Utopia\Response $response */ @@ -224,7 +239,7 @@ App::get('/v1/health/storage/local') } $response->json(['status' => 'OK']); - }, ['response']); + }); App::get('/v1/health/anti-virus') ->desc('Get Anti virus') @@ -234,6 +249,7 @@ App::get('/v1/health/anti-virus') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getAntiVirus') ->label('sdk.description', '/docs/references/health/get-storage-anti-virus.md') + ->inject('response') ->action(function ($response) { /** @var Appwrite\Utopia\Response $response */ @@ -247,7 +263,7 @@ App::get('/v1/health/anti-virus') 'status' => (@$antiVirus->ping()) ? 'online' : 'offline', 'version' => @$antiVirus->version(), ]); - }, ['response']); + }); App::get('/v1/health/stats') // Currently only used internally ->desc('Get System Stats') @@ -257,6 +273,8 @@ App::get('/v1/health/stats') // Currently only used internally // ->label('sdk.namespace', 'health') // ->label('sdk.method', 'getStats') ->label('docs', false) + ->inject('response') + ->inject('register') ->action(function ($response, $register) { /** @var Appwrite\Utopia\Response $response */ /** @var Utopia\Registry\Registry $register */ @@ -288,4 +306,4 @@ App::get('/v1/health/stats') // Currently only used internally 'memory_used_peak_human' => $cacheStats['used_memory_peak_human'] ?? 0, ], ]); - }, ['response', 'register']); + }); diff --git a/app/controllers/api/locale.php b/app/controllers/api/locale.php index c6c929ca84..80826bdc03 100644 --- a/app/controllers/api/locale.php +++ b/app/controllers/api/locale.php @@ -16,6 +16,10 @@ App::get('/v1/locale') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_LOCALE) + ->inject('request') + ->inject('response') + ->inject('locale') + ->inject('geodb') ->action(function ($request, $response, $locale, $geodb) { /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ @@ -64,7 +68,7 @@ App::get('/v1/locale') ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + $time).' GMT') // 45 days cache ; $response->dynamic(new Document($output), Response::MODEL_LOCALE); - }, ['request', 'response', 'locale', 'geodb']); + }); App::get('/v1/locale/countries') ->desc('List Countries') @@ -77,6 +81,8 @@ App::get('/v1/locale/countries') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_COUNTRY_LIST) + ->inject('response') + ->inject('locale') ->action(function ($response, $locale) { /** @var Appwrite\Utopia\Response $response */ /** @var Utopia\Locale\Locale $locale */ @@ -94,7 +100,7 @@ App::get('/v1/locale/countries') } $response->dynamic(new Document(['countries' => $output, 'sum' => \count($output)]), Response::MODEL_COUNTRY_LIST); - }, ['response', 'locale']); + }); App::get('/v1/locale/countries/eu') ->desc('List EU Countries') @@ -106,7 +112,9 @@ App::get('/v1/locale/countries/eu') ->label('sdk.description', '/docs/references/locale/get-countries-eu.md') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_COUNTRY_LIST) + ->label('sdk.response.model', Response::MODEL_COUNTRY_LIST) + ->inject('response') + ->inject('locale') ->action(function ($response, $locale) { /** @var Appwrite\Utopia\Response $response */ /** @var Utopia\Locale\Locale $locale */ @@ -127,7 +135,7 @@ App::get('/v1/locale/countries/eu') } $response->dynamic(new Document(['countries' => $output, 'sum' => \count($output)]), Response::MODEL_COUNTRY_LIST); - }, ['response', 'locale']); + }); App::get('/v1/locale/countries/phones') ->desc('List Countries Phone Codes') @@ -140,6 +148,8 @@ App::get('/v1/locale/countries/phones') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_PHONE_LIST) + ->inject('response') + ->inject('locale') ->action(function ($response, $locale) { /** @var Appwrite\Utopia\Response $response */ /** @var Utopia\Locale\Locale $locale */ @@ -161,7 +171,7 @@ App::get('/v1/locale/countries/phones') } $response->dynamic(new Document(['phones' => $output, 'sum' => \count($output)]), Response::MODEL_PHONE_LIST); - }, ['response', 'locale']); + }); App::get('/v1/locale/continents') ->desc('List Continents') @@ -174,6 +184,8 @@ App::get('/v1/locale/continents') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_CONTINENT_LIST) + ->inject('response') + ->inject('locale') ->action(function ($response, $locale) { /** @var Appwrite\Utopia\Response $response */ /** @var Utopia\Locale\Locale $locale */ @@ -190,7 +202,7 @@ App::get('/v1/locale/continents') } $response->dynamic(new Document(['continents' => $output, 'sum' => \count($output)]), Response::MODEL_CONTINENT_LIST); - }, ['response', 'locale']); + }); App::get('/v1/locale/currencies') ->desc('List Currencies') @@ -203,6 +215,7 @@ App::get('/v1/locale/currencies') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_CURRENCY_LIST) + ->inject('response') ->action(function ($response) { /** @var Appwrite\Utopia\Response $response */ @@ -213,7 +226,7 @@ App::get('/v1/locale/currencies') }, $list); $response->dynamic(new Document(['currencies' => $list, 'sum' => \count($list)]), Response::MODEL_CURRENCY_LIST); - }, ['response']); + }); App::get('/v1/locale/languages') @@ -227,6 +240,7 @@ App::get('/v1/locale/languages') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_LANGUAGE_LIST) + ->inject('response') ->action(function ($response) { /** @var Appwrite\Utopia\Response $response */ @@ -237,4 +251,4 @@ App::get('/v1/locale/languages') }, $list); $response->dynamic(new Document(['languages' => $list, 'sum' => \count($list)]), Response::MODEL_LANGUAGE_LIST); - }, ['response']); \ No newline at end of file + }); \ No newline at end of file diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index b25f831b9e..377def2960 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -40,6 +40,9 @@ App::post('/v1/projects') ->param('legalCity', '', new Text(256), 'Project legal City. Max length: 256 chars.', true) ->param('legalAddress', '', new Text(256), 'Project legal Address. Max length: 256 chars.', true) ->param('legalTaxId', '', new Text(256), 'Project legal Tax ID. Max length: 256 chars.', true) + ->inject('response') + ->inject('consoleDB') + ->inject('projectDB') ->action(function ($name, $teamId, $description, $logo, $url, $legalName, $legalCountry, $legalState, $legalCity, $legalAddress, $legalTaxId, $response, $consoleDB, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -87,7 +90,7 @@ App::post('/v1/projects') ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($project, Response::MODEL_PROJECT) ; - }, ['response', 'consoleDB', 'projectDB']); + }); App::get('/v1/projects') ->desc('List Projects') @@ -102,6 +105,8 @@ App::get('/v1/projects') ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true) ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true) + ->inject('response') + ->inject('consoleDB') ->action(function ($search, $limit, $offset, $orderType, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -109,6 +114,7 @@ App::get('/v1/projects') $results = $consoleDB->getCollection([ 'limit' => $limit, 'offset' => $offset, + 'orderType' => $orderType, 'search' => $search, 'filters' => [ '$collection='.Database::SYSTEM_COLLECTION_PROJECTS, @@ -119,7 +125,7 @@ App::get('/v1/projects') 'sum' => $consoleDB->getSum(), 'projects' => $results ]), Response::MODEL_PROJECT_LIST); - }, ['response', 'consoleDB']); + }); App::get('/v1/projects/:projectId') ->desc('Get Project') @@ -131,6 +137,8 @@ App::get('/v1/projects/:projectId') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_PROJECT) ->param('projectId', '', new UID(), 'Project unique ID.') + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -142,7 +150,7 @@ App::get('/v1/projects/:projectId') } $response->dynamic($project, Response::MODEL_PROJECT); - }, ['response', 'consoleDB']); + }); App::get('/v1/projects/:projectId/usage') ->desc('Get Project') @@ -152,6 +160,10 @@ App::get('/v1/projects/:projectId/usage') ->label('sdk.method', 'getUsage') ->param('projectId', '', new UID(), 'Project unique ID.') ->param('range', '30d', new WhiteList(['24h', '7d', '30d', '90d'], true), 'Date range.', true) + ->inject('response') + ->inject('consoleDB') + ->inject('projectDB') + ->inject('register') ->action(function ($projectId, $range, $response, $consoleDB, $projectDB, $register) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -191,6 +203,7 @@ App::get('/v1/projects/:projectId/usage') $requests = []; $network = []; + $functions = []; if ($client) { $start = $period[$range]['start']->format(DateTime::RFC3339); @@ -218,6 +231,17 @@ App::get('/v1/projects/:projectId/usage') 'date' => \strtotime($point['time']), ]; } + + // Functions + $result = $database->query('SELECT sum(value) AS "value" FROM "appwrite_usage_executions_all" WHERE time > \''.$start.'\' AND time < \''.$end.'\' AND "metric_type"=\'counter\' AND "project"=\''.$project->getId().'\' GROUP BY time('.$period[$range]['group'].') FILL(null)'); + $points = $result->getPoints(); + + foreach ($points as $point) { + $functions[] = [ + 'value' => (!empty($point['value'])) ? $point['value'] : 0, + 'date' => \strtotime($point['time']), + ]; + } } // Users @@ -275,6 +299,12 @@ App::get('/v1/projects/:projectId/usage') return $item['value']; }, $network)), ], + 'functions' => [ + 'data' => $functions, + 'total' => \array_sum(\array_map(function ($item) { + return $item['value']; + }, $functions)), + ], 'collections' => [ 'data' => $collections, 'total' => $collectionsTotal, @@ -312,7 +342,7 @@ App::get('/v1/projects/:projectId/usage') ), ], ]); - }, ['response', 'consoleDB', 'projectDB', 'register']); + }); App::patch('/v1/projects/:projectId') ->desc('Update Project') @@ -334,6 +364,8 @@ App::patch('/v1/projects/:projectId') ->param('legalCity', '', new Text(256), 'Project legal city. Max length: 256 chars.', true) ->param('legalAddress', '', new Text(256), 'Project legal address. Max length: 256 chars.', true) ->param('legalTaxId', '', new Text(256), 'Project legal tax ID. Max length: 256 chars.', true) + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $name, $description, $logo, $url, $legalName, $legalCountry, $legalState, $legalCity, $legalAddress, $legalTaxId, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -362,7 +394,7 @@ App::patch('/v1/projects/:projectId') } $response->dynamic($project, Response::MODEL_PROJECT); - }, ['response', 'consoleDB']); + }); App::patch('/v1/projects/:projectId/oauth2') ->desc('Update Project OAuth2') @@ -377,6 +409,8 @@ App::patch('/v1/projects/:projectId/oauth2') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('providers')), true), 'Provider Name', false) ->param('appId', '', new Text(256), 'Provider app ID. Max length: 256 chars.', true) ->param('secret', '', new text(512), 'Provider secret key. Max length: 512 chars.', true) + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $provider, $appId, $secret, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -397,7 +431,7 @@ App::patch('/v1/projects/:projectId/oauth2') } $response->dynamic($project, Response::MODEL_PROJECT); - }, ['response', 'consoleDB']); + }); App::delete('/v1/projects/:projectId') ->desc('Delete Project') @@ -410,6 +444,10 @@ App::delete('/v1/projects/:projectId') ->label('sdk.response.model', Response::MODEL_NONE) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('password', '', new UID(), 'Your user password for confirmation. Must be between 6 to 32 chars.') + ->inject('response') + ->inject('user') + ->inject('consoleDB') + ->inject('deletes') ->action(function ($projectId, $password, $response, $user, $consoleDB, $deletes) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Document $user */ @@ -426,7 +464,10 @@ App::delete('/v1/projects/:projectId') throw new Exception('Project not found', 404); } - $deletes->setParam('document', $project->getArrayCopy()); + $deletes + ->setParam('type', DELETE_TYPE_DOCUMENT) + ->setParam('document', $project->getArrayCopy()) + ; foreach (['keys', 'webhooks', 'tasks', 'platforms', 'domains'] as $key) { // Delete all children (keys, webhooks, tasks [stop tasks?], platforms) $list = $project->getAttribute('webhooks', []); @@ -447,7 +488,7 @@ App::delete('/v1/projects/:projectId') } $response->noContent(); - }, ['response', 'user', 'consoleDB', 'deletes']); + }); // Webhooks @@ -467,6 +508,8 @@ App::post('/v1/projects/:projectId/webhooks') ->param('security', false, new Boolean(true), 'Certificate verification, false for disabled or true for enabled.') ->param('httpUser', '', new Text(256), 'Webhook HTTP user. Max length: 256 chars.', true) ->param('httpPass', '', new Text(256), 'Webhook HTTP password. Max length: 256 chars.', true) + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $name, $events, $url, $security, $httpUser, $httpPass, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -509,7 +552,7 @@ App::post('/v1/projects/:projectId/webhooks') ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($webhook, Response::MODEL_WEBHOOK) ; - }, ['response', 'consoleDB']); + }); App::get('/v1/projects/:projectId/webhooks') ->desc('List Webhooks') @@ -521,6 +564,8 @@ App::get('/v1/projects/:projectId/webhooks') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_WEBHOOK_LIST) ->param('projectId', '', new UID(), 'Project unique ID.') + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -537,7 +582,7 @@ App::get('/v1/projects/:projectId/webhooks') 'sum' => count($webhooks), 'webhooks' => $webhooks ]), Response::MODEL_WEBHOOK_LIST); - }, ['response', 'consoleDB']); + }); App::get('/v1/projects/:projectId/webhooks/:webhookId') ->desc('Get Webhook') @@ -550,6 +595,8 @@ App::get('/v1/projects/:projectId/webhooks/:webhookId') ->label('sdk.response.model', Response::MODEL_WEBHOOK) ->param('projectId', null, new UID(), 'Project unique ID.') ->param('webhookId', null, new UID(), 'Webhook unique ID.') + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $webhookId, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -567,7 +614,7 @@ App::get('/v1/projects/:projectId/webhooks/:webhookId') } $response->dynamic($webhook, Response::MODEL_WEBHOOK); - }, ['response', 'consoleDB']); + }); App::put('/v1/projects/:projectId/webhooks/:webhookId') ->desc('Update Webhook') @@ -586,6 +633,8 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId') ->param('security', false, new Boolean(true), 'Certificate verification, false for disabled or true for enabled.') ->param('httpUser', '', new Text(256), 'Webhook HTTP user. Max length: 256 chars.', true) ->param('httpPass', '', new Text(256), 'Webhook HTTP password. Max length: 256 chars.', true) + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $webhookId, $name, $events, $url, $security, $httpUser, $httpPass, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -618,7 +667,7 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId') } $response->dynamic($webhook, Response::MODEL_WEBHOOK); - }, ['response', 'consoleDB']); + }); App::delete('/v1/projects/:projectId/webhooks/:webhookId') ->desc('Delete Webhook') @@ -631,6 +680,8 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId') ->label('sdk.response.model', Response::MODEL_NONE) ->param('projectId', null, new UID(), 'Project unique ID.') ->param('webhookId', null, new UID(), 'Webhook unique ID.') + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $webhookId, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -652,7 +703,7 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId') } $response->noContent(); - }, ['response', 'consoleDB']); + }); // Keys @@ -668,6 +719,8 @@ App::post('/v1/projects/:projectId/keys') ->param('projectId', null, new UID(), 'Project unique ID.') ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') ->param('scopes', null, new ArrayList(new WhiteList(Config::getParam('scopes'), true)), 'Key scopes list.') + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $name, $scopes, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -705,7 +758,7 @@ App::post('/v1/projects/:projectId/keys') ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($key, Response::MODEL_KEY) ; - }, ['response', 'consoleDB']); + }); App::get('/v1/projects/:projectId/keys') ->desc('List Keys') @@ -717,6 +770,8 @@ App::get('/v1/projects/:projectId/keys') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_KEY_LIST) ->param('projectId', null, new UID(), 'Project unique ID.') + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -733,7 +788,7 @@ App::get('/v1/projects/:projectId/keys') 'sum' => count($keys), 'keys' => $keys ]), Response::MODEL_KEY_LIST); - }, ['response', 'consoleDB']); + }); App::get('/v1/projects/:projectId/keys/:keyId') ->desc('Get Key') @@ -746,6 +801,8 @@ App::get('/v1/projects/:projectId/keys/:keyId') ->label('sdk.response.model', Response::MODEL_KEY) ->param('projectId', null, new UID(), 'Project unique ID.') ->param('keyId', null, new UID(), 'Key unique ID.') + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $keyId, $response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -760,7 +817,7 @@ App::get('/v1/projects/:projectId/keys/:keyId') } $response->dynamic($key, Response::MODEL_KEY); - }, ['response', 'consoleDB']); + }); App::put('/v1/projects/:projectId/keys/:keyId') ->desc('Update Key') @@ -775,6 +832,8 @@ App::put('/v1/projects/:projectId/keys/:keyId') ->param('keyId', null, new UID(), 'Key unique ID.') ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') ->param('scopes', null, new ArrayList(new WhiteList(Config::getParam('scopes'), true)), 'Key scopes list') + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $keyId, $name, $scopes, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -801,7 +860,7 @@ App::put('/v1/projects/:projectId/keys/:keyId') } $response->dynamic($key, Response::MODEL_KEY); - }, ['response', 'consoleDB']); + }); App::delete('/v1/projects/:projectId/keys/:keyId') ->desc('Delete Key') @@ -814,6 +873,8 @@ App::delete('/v1/projects/:projectId/keys/:keyId') ->label('sdk.response.model', Response::MODEL_NONE) ->param('projectId', null, new UID(), 'Project unique ID.') ->param('keyId', null, new UID(), 'Key unique ID.') + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $keyId, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -835,7 +896,7 @@ App::delete('/v1/projects/:projectId/keys/:keyId') } $response->noContent(); - }, ['response', 'consoleDB']); + }); // Tasks @@ -858,6 +919,8 @@ App::post('/v1/projects/:projectId/tasks') ->param('httpHeaders', null, new ArrayList(new Text(256)), 'Task HTTP headers list.', true) ->param('httpUser', '', new Text(256), 'Task HTTP user. Max length: 256 chars.', true) ->param('httpPass', '', new Text(256), 'Task HTTP password. Max length: 256 chars.', true) + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $name, $status, $schedule, $security, $httpMethod, $httpUrl, $httpHeaders, $httpUser, $httpPass, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -915,7 +978,7 @@ App::post('/v1/projects/:projectId/tasks') ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($task, Response::MODEL_TASK) ; - }, ['response', 'consoleDB']); + }); App::get('/v1/projects/:projectId/tasks') ->desc('List Tasks') @@ -927,6 +990,8 @@ App::get('/v1/projects/:projectId/tasks') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_TASK_LIST) ->param('projectId', '', new UID(), 'Project unique ID.') + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -944,7 +1009,7 @@ App::get('/v1/projects/:projectId/tasks') 'tasks' => $tasks ]), Response::MODEL_TASK_LIST); - }, ['response', 'consoleDB']); + }); App::get('/v1/projects/:projectId/tasks/:taskId') ->desc('Get Task') @@ -957,6 +1022,8 @@ App::get('/v1/projects/:projectId/tasks/:taskId') ->label('sdk.response.model', Response::MODEL_TASK) ->param('projectId', null, new UID(), 'Project unique ID.') ->param('taskId', null, new UID(), 'Task unique ID.') + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $taskId, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -974,7 +1041,7 @@ App::get('/v1/projects/:projectId/tasks/:taskId') } $response->dynamic($task, Response::MODEL_TASK); - }, ['response', 'consoleDB']); + }); App::put('/v1/projects/:projectId/tasks/:taskId') ->desc('Update Task') @@ -996,6 +1063,8 @@ App::put('/v1/projects/:projectId/tasks/:taskId') ->param('httpHeaders', null, new ArrayList(new Text(256)), 'Task HTTP headers list.', true) ->param('httpUser', '', new Text(256), 'Task HTTP user. Max length: 256 chars.', true) ->param('httpPass', '', new Text(256), 'Task HTTP password. Max length: 256 chars.', true) + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $taskId, $name, $status, $schedule, $security, $httpMethod, $httpUrl, $httpHeaders, $httpUser, $httpPass, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -1040,7 +1109,7 @@ App::put('/v1/projects/:projectId/tasks/:taskId') } $response->dynamic($task, Response::MODEL_TASK); - }, ['response', 'consoleDB']); + }); App::delete('/v1/projects/:projectId/tasks/:taskId') ->desc('Delete Task') @@ -1053,6 +1122,8 @@ App::delete('/v1/projects/:projectId/tasks/:taskId') ->label('sdk.response.model', Response::MODEL_NONE) ->param('projectId', null, new UID(), 'Project unique ID.') ->param('taskId', null, new UID(), 'Task unique ID.') + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $taskId, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -1074,7 +1145,7 @@ App::delete('/v1/projects/:projectId/tasks/:taskId') } $response->noContent(); - }, ['response', 'consoleDB']); + }); // Platforms @@ -1093,6 +1164,8 @@ App::post('/v1/projects/:projectId/platforms') ->param('key', '', new Text(256), 'Package name for android or bundle ID for iOS. Max length: 256 chars.', true) ->param('store', '', new Text(256), 'App store or Google Play store ID. Max length: 256 chars.', true) ->param('hostname', '', new Text(256), 'Platform client hostname. Max length: 256 chars.', true) + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $type, $name, $key, $store, $hostname, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -1134,7 +1207,7 @@ App::post('/v1/projects/:projectId/platforms') ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($platform, Response::MODEL_PLATFORM) ; - }, ['response', 'consoleDB']); + }); App::get('/v1/projects/:projectId/platforms') ->desc('List Platforms') @@ -1146,6 +1219,8 @@ App::get('/v1/projects/:projectId/platforms') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_PLATFORM_LIST) ->param('projectId', '', new UID(), 'Project unique ID.') + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -1162,7 +1237,7 @@ App::get('/v1/projects/:projectId/platforms') 'sum' => count($platforms), 'platforms' => $platforms ]), Response::MODEL_PLATFORM_LIST); - }, ['response', 'consoleDB']); + }); App::get('/v1/projects/:projectId/platforms/:platformId') ->desc('Get Platform') @@ -1175,6 +1250,8 @@ App::get('/v1/projects/:projectId/platforms/:platformId') ->label('sdk.response.model', Response::MODEL_PLATFORM) ->param('projectId', null, new UID(), 'Project unique ID.') ->param('platformId', null, new UID(), 'Platform unique ID.') + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $platformId, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -1192,7 +1269,7 @@ App::get('/v1/projects/:projectId/platforms/:platformId') } $response->dynamic($platform, Response::MODEL_PLATFORM); - }, ['response', 'consoleDB']); + }); App::put('/v1/projects/:projectId/platforms/:platformId') ->desc('Update Platform') @@ -1209,6 +1286,8 @@ App::put('/v1/projects/:projectId/platforms/:platformId') ->param('key', '', new Text(256), 'Package name for android or bundle ID for iOS. Max length: 256 chars.', true) ->param('store', '', new Text(256), 'App store or Google Play store ID. Max length: 256 chars.', true) ->param('hostname', '', new Text(256), 'Platform client URL. Max length: 256 chars.', true) + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $platformId, $name, $key, $store, $hostname, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -1238,7 +1317,7 @@ App::put('/v1/projects/:projectId/platforms/:platformId') } $response->dynamic($platform, Response::MODEL_PLATFORM); - }, ['response', 'consoleDB']); + }); App::delete('/v1/projects/:projectId/platforms/:platformId') ->desc('Delete Platform') @@ -1251,6 +1330,8 @@ App::delete('/v1/projects/:projectId/platforms/:platformId') ->label('sdk.response.model', Response::MODEL_NONE) ->param('projectId', null, new UID(), 'Project unique ID.') ->param('platformId', null, new UID(), 'Platform unique ID.') + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $platformId, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -1272,7 +1353,7 @@ App::delete('/v1/projects/:projectId/platforms/:platformId') } $response->noContent(); - }, ['response', 'consoleDB']); + }); // Domains @@ -1287,6 +1368,8 @@ App::post('/v1/projects/:projectId/domains') ->label('sdk.response.model', Response::MODEL_DOMAIN) ->param('projectId', null, new UID(), 'Project unique ID.') ->param('domain', null, new DomainValidator(), 'Domain name.') + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $domain, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -1341,7 +1424,7 @@ App::post('/v1/projects/:projectId/domains') ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($domain, Response::MODEL_DOMAIN) ; - }, ['response', 'consoleDB']); + }); App::get('/v1/projects/:projectId/domains') ->desc('List Domains') @@ -1353,6 +1436,8 @@ App::get('/v1/projects/:projectId/domains') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_DOMAIN_LIST) ->param('projectId', '', new UID(), 'Project unique ID.') + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -1369,7 +1454,7 @@ App::get('/v1/projects/:projectId/domains') 'sum' => count($domains), 'domains' => $domains ]), Response::MODEL_DOMAIN_LIST); - }, ['response', 'consoleDB']); + }); App::get('/v1/projects/:projectId/domains/:domainId') ->desc('Get Domain') @@ -1382,6 +1467,8 @@ App::get('/v1/projects/:projectId/domains/:domainId') ->label('sdk.response.model', Response::MODEL_DOMAIN) ->param('projectId', null, new UID(), 'Project unique ID.') ->param('domainId', null, new UID(), 'Domain unique ID.') + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $domainId, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -1399,7 +1486,7 @@ App::get('/v1/projects/:projectId/domains/:domainId') } $response->dynamic($domain, Response::MODEL_DOMAIN); - }, ['response', 'consoleDB']); + }); App::patch('/v1/projects/:projectId/domains/:domainId/verification') ->desc('Update Domain Verification Status') @@ -1412,6 +1499,8 @@ App::patch('/v1/projects/:projectId/domains/:domainId/verification') ->label('sdk.response.model', Response::MODEL_DOMAIN) ->param('projectId', null, new UID(), 'Project unique ID.') ->param('domainId', null, new UID(), 'Domain unique ID.') + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $domainId, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -1460,7 +1549,7 @@ App::patch('/v1/projects/:projectId/domains/:domainId/verification') ]); $response->dynamic($domain, Response::MODEL_DOMAIN); - }, ['response', 'consoleDB']); + }); App::delete('/v1/projects/:projectId/domains/:domainId') ->desc('Delete Domain') @@ -1473,6 +1562,8 @@ App::delete('/v1/projects/:projectId/domains/:domainId') ->label('sdk.response.model', Response::MODEL_NONE) ->param('projectId', null, new UID(), 'Project unique ID.') ->param('domainId', null, new UID(), 'Domain unique ID.') + ->inject('response') + ->inject('consoleDB') ->action(function ($projectId, $domainId, $response, $consoleDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $consoleDB */ @@ -1494,4 +1585,4 @@ App::delete('/v1/projects/:projectId/domains/:domainId') } $response->noContent(); - }, ['response', 'consoleDB']); \ No newline at end of file + }); \ No newline at end of file diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index db40959a9a..b7628e320b 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -40,10 +40,14 @@ App::post('/v1/storage/files') ->param('file', [], new File(), 'Binary file.', false) ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') - ->action(function ($file, $read, $write, $request, $response, $user, $projectDB, $audits, $usage) { + ->inject('request') + ->inject('response') + ->inject('projectDB') + ->inject('audits') + ->inject('usage') + ->action(function ($file, $read, $write, $request, $response, $projectDB, $audits, $usage) { /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ - /** @var Appwrite\Database\Document $user */ /** @var Appwrite\Database\Database $projectDB */ /** @var Appwrite\Event\Event $audits */ /** @var Appwrite\Event\Event $usage */ @@ -154,7 +158,7 @@ App::post('/v1/storage/files') ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($file, Response::MODEL_FILE) ; - }, ['request', 'response', 'user', 'projectDB', 'audits', 'usage']); + }); App::get('/v1/storage/files') ->desc('List Files') @@ -171,6 +175,8 @@ App::get('/v1/storage/files') ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true) ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true) + ->inject('response') + ->inject('projectDB') ->action(function ($search, $limit, $offset, $orderType, $response, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -189,7 +195,7 @@ App::get('/v1/storage/files') 'sum' => $projectDB->getSum(), 'files' => $results ]), Response::MODEL_FILE_LIST); - }, ['response', 'projectDB']); + }); App::get('/v1/storage/files/:fileId') ->desc('Get File') @@ -203,6 +209,8 @@ App::get('/v1/storage/files/:fileId') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_FILE) ->param('fileId', '', new UID(), 'File unique ID.') + ->inject('response') + ->inject('projectDB') ->action(function ($fileId, $response, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -214,7 +222,7 @@ App::get('/v1/storage/files/:fileId') } $response->dynamic($file, Response::MODEL_FILE); - }, ['response', 'projectDB']); + }); App::get('/v1/storage/files/:fileId/preview') ->desc('Get File Preview') @@ -233,6 +241,10 @@ App::get('/v1/storage/files/:fileId/preview') ->param('quality', 100, new Range(0, 100), 'Preview image quality. Pass an integer between 0 to 100. Defaults to 100.', true) ->param('background', '', new HexColor(), 'Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.', true) ->param('output', '', new WhiteList(\array_keys(Config::getParam('storage-outputs')), true), 'Output format type (jpeg, jpg, png, gif and webp).', true) + ->inject('request') + ->inject('response') + ->inject('project') + ->inject('projectDB') ->action(function ($fileId, $width, $height, $quality, $background, $output, $request, $response, $project, $projectDB) { /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ @@ -341,7 +353,7 @@ App::get('/v1/storage/files/:fileId/preview') ; unset($resize); - }, ['request', 'response', 'project', 'projectDB']); + }); App::get('/v1/storage/files/:fileId/download') ->desc('Get File for Download') @@ -355,6 +367,8 @@ App::get('/v1/storage/files/:fileId/download') ->label('sdk.response.type', '*/*') ->label('sdk.methodType', 'location') ->param('fileId', '', new UID(), 'File unique ID.') + ->inject('response') + ->inject('projectDB') ->action(function ($fileId, $response, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -397,7 +411,7 @@ App::get('/v1/storage/files/:fileId/download') ->addHeader('X-Peak', \memory_get_peak_usage()) ->send($source) ; - }, ['response', 'projectDB']); + }); App::get('/v1/storage/files/:fileId/view') ->desc('Get File for View') @@ -411,8 +425,9 @@ App::get('/v1/storage/files/:fileId/view') ->label('sdk.response.type', '*/*') ->label('sdk.methodType', 'location') ->param('fileId', '', new UID(), 'File unique ID.') - ->param('as', '', new WhiteList(['pdf', /*'html',*/ 'text'], true), 'Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.', true) - ->action(function ($fileId, $as, $response, $projectDB) { + ->inject('response') + ->inject('projectDB') + ->action(function ($fileId, $response, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -454,13 +469,6 @@ App::get('/v1/storage/files/:fileId/view') $output = $compressor->decompress($source); $fileName = $file->getAttribute('name', ''); - $contentTypes = [ - 'pdf' => 'application/pdf', - 'text' => 'text/plain', - ]; - - $contentType = (\array_key_exists($as, $contentTypes)) ? $contentTypes[$as] : $contentType; - // Response $response ->setContentType($contentType) @@ -471,7 +479,7 @@ App::get('/v1/storage/files/:fileId/view') ->addHeader('X-Peak', \memory_get_peak_usage()) ->send($output) ; - }, ['response', 'projectDB']); + }); App::put('/v1/storage/files/:fileId') ->desc('Update File') @@ -488,6 +496,9 @@ App::put('/v1/storage/files/:fileId') ->param('fileId', '', new UID(), 'File unique ID.') ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') + ->inject('response') + ->inject('projectDB') + ->inject('audits') ->action(function ($fileId, $read, $write, $response, $projectDB, $audits) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -517,7 +528,7 @@ App::put('/v1/storage/files/:fileId') ; $response->dynamic($file, Response::MODEL_FILE); - }, ['response', 'projectDB', 'audits']); + }); App::delete('/v1/storage/files/:fileId') ->desc('Delete File') @@ -532,6 +543,11 @@ App::delete('/v1/storage/files/:fileId') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_NONE) ->param('fileId', '', new UID(), 'File unique ID.') + ->inject('response') + ->inject('projectDB') + ->inject('events') + ->inject('audits') + ->inject('usage') ->action(function ($fileId, $response, $projectDB, $events, $audits, $usage) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -567,7 +583,7 @@ App::delete('/v1/storage/files/:fileId') ; $response->noContent(); - }, ['response', 'projectDB', 'events', 'audits', 'usage']); + }); // App::get('/v1/storage/files/:fileId/scan') // ->desc('Scan Storage') diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index d1109db320..084bdeeb1b 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -34,6 +34,9 @@ App::post('/v1/teams') ->label('sdk.response.model', Response::MODEL_TEAM) ->param('name', null, new Text(128), 'Team name. Max length: 128 chars.') ->param('roles', ['owner'], new ArrayList(new Key()), '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](/docs/permissions). Max length for each role is 32 chars.', true) + ->inject('response') + ->inject('user') + ->inject('projectDB') ->action(function ($name, $roles, $response, $user, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Document $user */ @@ -91,7 +94,7 @@ App::post('/v1/teams') ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($team, Response::MODEL_TEAM) ; - }, ['response', 'user', 'projectDB']); + }); App::get('/v1/teams') ->desc('List Teams') @@ -108,6 +111,8 @@ App::get('/v1/teams') ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true) ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true) + ->inject('response') + ->inject('projectDB') ->action(function ($search, $limit, $offset, $orderType, $response, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -126,7 +131,7 @@ App::get('/v1/teams') 'sum' => $projectDB->getSum(), 'teams' => $results ]), Response::MODEL_TEAM_LIST); - }, ['response', 'projectDB']); + }); App::get('/v1/teams/:teamId') ->desc('Get Team') @@ -140,6 +145,8 @@ App::get('/v1/teams/:teamId') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_TEAM) ->param('teamId', '', new UID(), 'Team unique ID.') + ->inject('response') + ->inject('projectDB') ->action(function ($teamId, $response, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -151,7 +158,7 @@ App::get('/v1/teams/:teamId') } $response->dynamic($team, Response::MODEL_TEAM); - }, ['response', 'projectDB']); + }); App::put('/v1/teams/:teamId') ->desc('Update Team') @@ -167,6 +174,8 @@ App::put('/v1/teams/:teamId') ->label('sdk.response.model', Response::MODEL_TEAM) ->param('teamId', '', new UID(), 'Team unique ID.') ->param('name', null, new Text(128), 'Team name. Max length: 128 chars.') + ->inject('response') + ->inject('projectDB') ->action(function ($teamId, $name, $response, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -186,7 +195,7 @@ App::put('/v1/teams/:teamId') } $response->dynamic($team, Response::MODEL_TEAM); - }, ['response', 'projectDB']); + }); App::delete('/v1/teams/:teamId') ->desc('Delete Team') @@ -201,6 +210,9 @@ App::delete('/v1/teams/:teamId') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_NONE) ->param('teamId', '', new UID(), 'Team unique ID.') + ->inject('response') + ->inject('projectDB') + ->inject('events') ->action(function ($teamId, $response, $projectDB, $events) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -236,7 +248,7 @@ App::delete('/v1/teams/:teamId') ; $response->noContent(); - }, ['response', 'projectDB', 'events']); + }); App::post('/v1/teams/:teamId/memberships') ->desc('Create Team Membership') @@ -255,6 +267,13 @@ App::post('/v1/teams/:teamId/memberships') ->param('name', '', new Text(128), 'New team member name. Max length: 128 chars.', true) ->param('roles', [], new ArrayList(new Key()), '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](/docs/permissions). Max length for each role is 32 chars.') ->param('url', '', function ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the invitation 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']) // TODO add our own built-in confirm page + ->inject('response') + ->inject('project') + ->inject('user') + ->inject('projectDB') + ->inject('locale') + ->inject('audits') + ->inject('mails') ->action(function ($teamId, $email, $name, $roles, $url, $response, $project, $user, $projectDB, $locale, $audits, $mails) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Document $project */ @@ -431,7 +450,7 @@ App::post('/v1/teams/:teamId/memberships') 'name' => $name, ])), Response::MODEL_MEMBERSHIP) ; - }, ['response', 'project', 'user', 'projectDB', 'locale', 'audits', 'mails']); + }); App::get('/v1/teams/:teamId/memberships') ->desc('Get Team Memberships') @@ -449,6 +468,8 @@ App::get('/v1/teams/:teamId/memberships') ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true) ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true) + ->inject('response') + ->inject('projectDB') ->action(function ($teamId, $search, $limit, $offset, $orderType, $response, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -469,7 +490,6 @@ App::get('/v1/teams/:teamId/memberships') 'teamId='.$teamId, ], ]); - $users = []; foreach ($memberships as $membership) { @@ -483,7 +503,7 @@ App::get('/v1/teams/:teamId/memberships') } $response->dynamic(new Document(['sum' => $projectDB->getSum(), 'memberships' => $users]), Response::MODEL_MEMBERSHIP_LIST); - }, ['response', 'projectDB']); + }); App::patch('/v1/teams/:teamId/memberships/:inviteId/status') ->desc('Update Team Membership Status') @@ -501,6 +521,12 @@ App::patch('/v1/teams/:teamId/memberships/:inviteId/status') ->param('inviteId', '', new UID(), 'Invite unique ID.') ->param('userId', '', new UID(), 'User unique ID.') ->param('secret', '', new Text(256), 'Secret key.') + ->inject('request') + ->inject('response') + ->inject('user') + ->inject('projectDB') + ->inject('geodb') + ->inject('audits') ->action(function ($teamId, $inviteId, $userId, $secret, $request, $response, $user, $projectDB, $geodb, $audits) { /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ @@ -663,7 +689,7 @@ App::patch('/v1/teams/:teamId/memberships/:inviteId/status') 'email' => $user->getAttribute('email'), 'name' => $user->getAttribute('name'), ])), Response::MODEL_MEMBERSHIP); - }, ['request', 'response', 'user', 'projectDB', 'geodb', 'audits']); + }); App::delete('/v1/teams/:teamId/memberships/:inviteId') ->desc('Delete Team Membership') @@ -679,6 +705,10 @@ App::delete('/v1/teams/:teamId/memberships/:inviteId') ->label('sdk.response.model', Response::MODEL_NONE) ->param('teamId', '', new UID(), 'Team unique ID.') ->param('inviteId', '', new UID(), 'Invite unique ID.') + ->inject('response') + ->inject('projectDB') + ->inject('audits') + ->inject('events') ->action(function ($teamId, $inviteId, $response, $projectDB, $audits, $events) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -726,4 +756,4 @@ App::delete('/v1/teams/:teamId/memberships/:inviteId') ; $response->noContent(); - }, ['response', 'projectDB', 'audits', 'events']); + }); diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index dd49e52f88..90c232b21c 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -33,6 +33,8 @@ App::post('/v1/users') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password. Must be between 6 to 32 chars.') ->param('name', '', new Text(128), 'User name. Max length: 128 chars.', true) + ->inject('response') + ->inject('projectDB') ->action(function ($email, $password, $name, $response, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -73,7 +75,7 @@ App::post('/v1/users') ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($user, Response::MODEL_USER) ; - }, ['response', 'projectDB']); + }); App::get('/v1/users') ->desc('List Users') @@ -90,6 +92,8 @@ App::get('/v1/users') ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true) ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true) + ->inject('response') + ->inject('projectDB') ->action(function ($search, $limit, $offset, $orderType, $response, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -108,7 +112,7 @@ App::get('/v1/users') 'sum' => $projectDB->getSum(), 'users' => $results ]), Response::MODEL_USER_LIST); - }, ['response', 'projectDB']); + }); App::get('/v1/users/:userId') ->desc('Get User') @@ -122,6 +126,8 @@ App::get('/v1/users/:userId') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_USER) ->param('userId', '', new UID(), 'User unique ID.') + ->inject('response') + ->inject('projectDB') ->action(function ($userId, $response, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -133,7 +139,7 @@ App::get('/v1/users/:userId') } $response->dynamic($user, Response::MODEL_USER); - }, ['response', 'projectDB']); + }); App::get('/v1/users/:userId/prefs') ->desc('Get User Preferences') @@ -147,6 +153,8 @@ App::get('/v1/users/:userId/prefs') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_ANY) ->param('userId', '', new UID(), 'User unique ID.') + ->inject('response') + ->inject('projectDB') ->action(function ($userId, $response, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -160,7 +168,7 @@ App::get('/v1/users/:userId/prefs') $prefs = $user->getAttribute('prefs', ''); $response->dynamic(new Document($prefs), Response::MODEL_ANY); - }, ['response', 'projectDB']); + }); App::get('/v1/users/:userId/sessions') ->desc('Get User Sessions') @@ -174,6 +182,9 @@ App::get('/v1/users/:userId/sessions') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_SESSION_LIST) ->param('userId', '', new UID(), 'User unique ID.') + ->inject('response') + ->inject('projectDB') + ->inject('locale') ->action(function ($userId, $response, $projectDB, $locale) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -220,6 +231,12 @@ App::get('/v1/users/:userId/logs') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_LOG_LIST) ->param('userId', '', new UID(), 'User unique ID.') + ->inject('response') + ->inject('register') + ->inject('project') + ->inject('projectDB') + ->inject('locale') + ->inject('geodb') ->action(function ($userId, $response, $register, $project, $projectDB, $locale, $geodb) { /** @var Appwrite\Utopia\Response $response */ /** @var Utopia\Registry\Registry $register */ @@ -314,7 +331,7 @@ App::get('/v1/users/:userId/logs') } $response->dynamic(new Document(['logs' => $output]), Response::MODEL_LOG_LIST); - }, ['response', 'register', 'project', 'projectDB', 'locale', 'geodb']); + }); App::patch('/v1/users/:userId/status') ->desc('Update User Status') @@ -330,6 +347,8 @@ App::patch('/v1/users/:userId/status') ->label('sdk.response.model', Response::MODEL_USER) ->param('userId', '', new UID(), 'User unique ID.') ->param('status', '', new WhiteList([Auth::USER_STATUS_ACTIVATED, Auth::USER_STATUS_BLOCKED, Auth::USER_STATUS_UNACTIVATED], true), 'User Status code. To activate the user pass '.Auth::USER_STATUS_ACTIVATED.', to block the user pass '.Auth::USER_STATUS_BLOCKED.' and for disabling the user pass '.Auth::USER_STATUS_UNACTIVATED) + ->inject('response') + ->inject('projectDB') ->action(function ($userId, $status, $response, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -349,7 +368,7 @@ App::patch('/v1/users/:userId/status') } $response->dynamic($user, Response::MODEL_USER); - }, ['response', 'projectDB']); + }); App::patch('/v1/users/:userId/prefs') ->desc('Update User Preferences') @@ -364,6 +383,8 @@ App::patch('/v1/users/:userId/prefs') ->label('sdk.response.model', Response::MODEL_ANY) ->param('userId', '', new UID(), 'User unique ID.') ->param('prefs', '', new Assoc(), 'Prefs key-value JSON object.') + ->inject('response') + ->inject('projectDB') ->action(function ($userId, $prefs, $response, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -383,7 +404,7 @@ App::patch('/v1/users/:userId/prefs') } $response->dynamic(new Document($prefs), Response::MODEL_ANY); - }, ['response', 'projectDB']); + }); App::delete('/v1/users/:userId/sessions/:sessionId') ->desc('Delete User Session') @@ -400,6 +421,9 @@ App::delete('/v1/users/:userId/sessions/:sessionId') ->label('abuse-limit', 100) ->param('userId', '', new UID(), 'User unique ID.') ->param('sessionId', null, new UID(), 'User unique session ID.') + ->inject('response') + ->inject('projectDB') + ->inject('events') ->action(function ($userId, $sessionId, $response, $projectDB, $events) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -427,7 +451,7 @@ App::delete('/v1/users/:userId/sessions/:sessionId') // TODO : Response filter implementation $response->noContent(); - }, ['response', 'projectDB', 'events']); + }); App::delete('/v1/users/:userId/sessions') ->desc('Delete User Sessions') @@ -443,6 +467,9 @@ App::delete('/v1/users/:userId/sessions') ->label('sdk.response.model', Response::MODEL_NONE) ->label('abuse-limit', 100) ->param('userId', '', new UID(), 'User unique ID.') + ->inject('response') + ->inject('projectDB') + ->inject('events') ->action(function ($userId, $response, $projectDB, $events) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -468,7 +495,7 @@ App::delete('/v1/users/:userId/sessions') // TODO : Response filter implementation $response->noContent(); - }, ['response', 'projectDB', 'events']); + }); App::delete('/v1/users/:userId') ->desc('Delete User') @@ -484,6 +511,10 @@ App::delete('/v1/users/:userId') ->label('sdk.response.model', Response::MODEL_NONE) ->label('abuse-limit', 100) ->param('userId', '', function () {return new UID();}, 'User unique ID.') + ->inject('response') + ->inject('projectDB') + ->inject('events') + ->inject('deletes') ->action(function ($userId, $response, $projectDB, $events, $deletes) { /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ @@ -516,6 +547,7 @@ App::delete('/v1/users/:userId') } $deletes + ->setParam('type', DELETE_TYPE_DOCUMENT) ->setParam('document', $user) ; @@ -525,4 +557,4 @@ App::delete('/v1/users/:userId') // TODO : Response filter implementation $response->noContent(); - }, ['response', 'projectDB', 'events', 'deletes']); + }); diff --git a/app/controllers/general.php b/app/controllers/general.php index 8c0404ce5f..62ca0be580 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -44,6 +44,8 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo /** @var Appwrite\Event\Event $audits */ /** @var Appwrite\Event\Event $usage */ /** @var Appwrite\Event\Event $deletes */ + /** @var Appwrite\Event\Event $functions */ + /** @var bool $mode */ /** @var array $clients */ @@ -243,11 +245,15 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo /* * Background Jobs */ + $events ->setParam('projectId', $project->getId()) ->setParam('userId', $user->getId()) ->setParam('event', $route->getLabel('event', '')) ->setParam('payload', []) + ->setParam('functionId', null) + ->setParam('executionId', null) + ->setParam('trigger', 'event') ; $audits @@ -273,6 +279,7 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo $deletes ->setParam('projectId', $project->getId()) ; + }, ['utopia', 'request', 'response', 'console', 'project', 'user', 'locale', 'events', 'audits', 'usage', 'deletes', 'clients']); App::shutdown(function ($utopia, $request, $response, $project, $events, $audits, $usage, $deletes, $mode) { @@ -284,6 +291,7 @@ App::shutdown(function ($utopia, $request, $response, $project, $events, $audits /** @var Appwrite\Event\Event $audits */ /** @var Appwrite\Event\Event $usage */ /** @var Appwrite\Event\Event $deletes */ + /** @var Appwrite\Event\Event $functions */ /** @var bool $mode */ if (!empty($events->getParam('event'))) { @@ -291,12 +299,15 @@ App::shutdown(function ($utopia, $request, $response, $project, $events, $audits $events->setParam('payload', $response->getPayload()); } - $events + $webhooks = clone $events; + $functions = clone $events; + + $webhooks ->setQueue('v1-webhooks') ->setClass('WebhooksV1') ->trigger(); - $events + $functions ->setQueue('v1-functions') ->setClass('FunctionsV1') ->trigger(); @@ -306,7 +317,7 @@ App::shutdown(function ($utopia, $request, $response, $project, $events, $audits $audits->trigger(); } - if (!empty($deletes->getParam('document'))) { + if (!empty($deletes->getParam('type')) && !empty($deletes->getParam('document'))) { $deletes->trigger(); } @@ -322,6 +333,7 @@ App::shutdown(function ($utopia, $request, $response, $project, $events, $audits ->trigger() ; } + }, ['utopia', 'request', 'response', 'project', 'events', 'audits', 'usage', 'deletes', 'mode']); App::options(function ($request, $response) { @@ -400,7 +412,7 @@ App::error(function ($error, $utopia, $request, $response, $layout, $project) { ->addHeader('Pragma', 'no-cache') ->setStatusCode($code) ; - + if ($template) { $comp = new View($template); @@ -423,13 +435,14 @@ App::error(function ($error, $utopia, $request, $response, $layout, $project) { } $response->dynamic(new Document($output), - $utopia->isDevelopment() ? Response::MODEL_ERROR_DEV : Response::MODEL_LOCALE); + $utopia->isDevelopment() ? Response::MODEL_ERROR_DEV : Response::MODEL_ERROR); }, ['error', 'utopia', 'request', 'response', 'layout', 'project']); App::get('/manifest.json') ->desc('Progressive app manifest file') ->label('scope', 'public') ->label('docs', false) + ->inject('response') ->action(function ($response) { /** @var Appwrite\Utopia\Response $response */ @@ -450,30 +463,34 @@ App::get('/manifest.json') ], ], ]); - }, ['response']); + }); App::get('/robots.txt') ->desc('Robots.txt File') ->label('scope', 'public') ->label('docs', false) + ->inject('response') ->action(function ($response) { $template = new View(__DIR__.'/../views/general/robots.phtml'); $response->text($template->render(false)); - }, ['response']); + }); App::get('/humans.txt') ->desc('Humans.txt File') ->label('scope', 'public') ->label('docs', false) + ->inject('response') ->action(function ($response) { $template = new View(__DIR__.'/../views/general/humans.phtml'); $response->text($template->render(false)); - }, ['response']); + }); App::get('/.well-known/acme-challenge') ->desc('SSL Verification') ->label('scope', 'public') ->label('docs', false) + ->inject('request') + ->inject('response') ->action(function ($request, $response) { $base = \realpath(APP_STORAGE_CERTIFICATES); $path = \str_replace('/.well-known/acme-challenge/', '', $request->getParam('q')); @@ -502,7 +519,7 @@ App::get('/.well-known/acme-challenge') } $response->text($content); - }, ['request', 'response']); + }); include_once __DIR__ . '/shared/api.php'; include_once __DIR__ . '/shared/web.php'; diff --git a/app/controllers/mock.php b/app/controllers/mock.php index 9c61d92934..ca26867c89 100644 --- a/app/controllers/mock.php +++ b/app/controllers/mock.php @@ -14,6 +14,7 @@ App::get('/v1/mock/tests/foo') ->desc('Mock a get request for SDK tests') ->groups(['mock']) ->label('scope', 'public') + ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'foo') ->label('sdk.method', 'get') ->label('sdk.description', 'Mock a get request for SDK tests') @@ -28,6 +29,7 @@ App::post('/v1/mock/tests/foo') ->desc('Mock a post request for SDK tests') ->groups(['mock']) ->label('scope', 'public') + ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'foo') ->label('sdk.method', 'post') ->label('sdk.description', 'Mock a post request for SDK tests') @@ -42,6 +44,7 @@ App::patch('/v1/mock/tests/foo') ->desc('Mock a patch request for SDK tests') ->groups(['mock']) ->label('scope', 'public') + ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'foo') ->label('sdk.method', 'patch') ->label('sdk.description', 'Mock a get request for SDK tests') @@ -56,6 +59,7 @@ App::put('/v1/mock/tests/foo') ->desc('Mock a put request for SDK tests') ->groups(['mock']) ->label('scope', 'public') + ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'foo') ->label('sdk.method', 'put') ->label('sdk.description', 'Mock a put request for SDK tests') @@ -70,6 +74,7 @@ App::delete('/v1/mock/tests/foo') ->desc('Mock a delete request for SDK tests') ->groups(['mock']) ->label('scope', 'public') + ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'foo') ->label('sdk.method', 'delete') ->label('sdk.description', 'Mock a delete request for SDK tests') @@ -84,6 +89,7 @@ App::get('/v1/mock/tests/bar') ->desc('Mock a get request for SDK tests') ->groups(['mock']) ->label('scope', 'public') + ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'bar') ->label('sdk.method', 'get') ->label('sdk.description', 'Mock a get request for SDK tests') @@ -98,6 +104,7 @@ App::post('/v1/mock/tests/bar') ->desc('Mock a post request for SDK tests') ->groups(['mock']) ->label('scope', 'public') + ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'bar') ->label('sdk.method', 'post') ->label('sdk.description', 'Mock a post request for SDK tests') @@ -112,6 +119,7 @@ App::patch('/v1/mock/tests/bar') ->desc('Mock a patch request for SDK tests') ->groups(['mock']) ->label('scope', 'public') + ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'bar') ->label('sdk.method', 'patch') ->label('sdk.description', 'Mock a get request for SDK tests') @@ -126,6 +134,7 @@ App::put('/v1/mock/tests/bar') ->desc('Mock a put request for SDK tests') ->groups(['mock']) ->label('scope', 'public') + ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'bar') ->label('sdk.method', 'put') ->label('sdk.description', 'Mock a put request for SDK tests') @@ -140,6 +149,7 @@ App::delete('/v1/mock/tests/bar') ->desc('Mock a delete request for SDK tests') ->groups(['mock']) ->label('scope', 'public') + ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'bar') ->label('sdk.method', 'delete') ->label('sdk.description', 'Mock a delete request for SDK tests') @@ -154,6 +164,7 @@ App::post('/v1/mock/tests/general/upload') ->desc('Mock a post request for SDK tests') ->groups(['mock']) ->label('scope', 'public') + ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'general') ->label('sdk.method', 'upload') ->label('sdk.description', 'Mock a delete request for SDK tests') @@ -163,6 +174,7 @@ App::post('/v1/mock/tests/general/upload') ->param('y', '', new Numeric(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->param('file', [], new File(), 'Sample file param', false) + ->inject('request') ->action(function ($x, $y, $z, $file, $request) { /** @var Utopia\Swoole\Request $request */ @@ -188,26 +200,29 @@ App::post('/v1/mock/tests/general/upload') throw new Exception('Wrong file uploaded', 400); } } - }, ['request']); + }); App::get('/v1/mock/tests/general/redirect') ->desc('Mock a post request for SDK tests') ->groups(['mock']) ->label('scope', 'public') + ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'general') ->label('sdk.method', 'redirect') ->label('sdk.description', 'Mock a redirect request for SDK tests') ->label('sdk.mock', true) + ->inject('response') ->action(function ($response) { /** @var Appwrite\Utopia\Response $response */ - $response->redirect('/v1/mock/tests/general/redirected'); - }, ['response']); + $response->redirect('/v1/mock/tests/general/redirect/done'); + }); -App::get('/v1/mock/tests/general/redirected') +App::get('/v1/mock/tests/general/redirect/done') ->desc('Mock a post request for SDK tests') ->groups(['mock']) ->label('scope', 'public') + ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'general') ->label('sdk.method', 'redirected') ->label('sdk.description', 'Mock a redirected request for SDK tests') @@ -219,46 +234,51 @@ App::get('/v1/mock/tests/general/set-cookie') ->desc('Mock a cookie request for SDK tests') ->groups(['mock']) ->label('scope', 'public') + ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'general') ->label('sdk.method', 'setCookie') ->label('sdk.description', 'Mock a set cookie request for SDK tests') ->label('sdk.mock', true) + ->inject('response') ->action(function ($response) { /** @var Appwrite\Utopia\Response $response */ $response->addCookie('cookieName', 'cookieValue', \time() + 31536000, '/', 'localhost', true, true); - }, ['response']); + }); App::get('/v1/mock/tests/general/get-cookie') ->desc('Mock a cookie request for SDK tests') ->groups(['mock']) ->label('scope', 'public') + ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'general') ->label('sdk.method', 'getCookie') ->label('sdk.description', 'Mock a get cookie request for SDK tests') ->label('sdk.mock', true) + ->inject('request') ->action(function ($request) { /** @var Utopia\Swoole\Request $request */ if ($request->getCookie('cookieName', '') !== 'cookieValue') { throw new Exception('Missing cookie value', 400); } - }, ['request']); + }); App::get('/v1/mock/tests/general/empty') ->desc('Mock a post request for SDK tests') ->groups(['mock']) ->label('scope', 'public') + ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'general') ->label('sdk.method', 'empty') ->label('sdk.description', 'Mock a redirected request for SDK tests') ->label('sdk.mock', true) + ->inject('response') ->action(function ($response) { /** @var Appwrite\Utopia\Response $response */ $response->noContent(); - exit(); - }, ['response']); + }); App::get('/v1/mock/tests/general/oauth2') ->desc('Mock an OAuth2 login route') @@ -270,11 +290,12 @@ App::get('/v1/mock/tests/general/oauth2') ->param('redirect_uri', '', new Host(['localhost']), 'OAuth2 Redirect URI.') // Important to deny an open redirect attack ->param('scope', '', new Text(100), 'OAuth2 scope list.') ->param('state', '', new Text(1024), 'OAuth2 state.') + ->inject('response') ->action(function ($clientId, $redirectURI, $scope, $state, $response) { /** @var Appwrite\Utopia\Response $response */ $response->redirect($redirectURI.'?'.\http_build_query(['code' => 'abcdef', 'state' => $state])); - }, ['response']); + }); App::get('/v1/mock/tests/general/oauth2/token') ->desc('Mock an OAuth2 login route') @@ -286,6 +307,7 @@ App::get('/v1/mock/tests/general/oauth2/token') ->param('redirect_uri', '', new Host(['localhost']), 'OAuth2 Redirect URI.') ->param('client_secret', '', new Text(100), 'OAuth2 scope list.') ->param('code', '', new Text(100), 'OAuth2 state.') + ->inject('response') ->action(function ($clientId, $redirectURI, $clientSecret, $code, $response) { /** @var Appwrite\Utopia\Response $response */ @@ -302,7 +324,7 @@ App::get('/v1/mock/tests/general/oauth2/token') } $response->json(['access_token' => '123456']); - }, ['response']); + }); App::get('/v1/mock/tests/general/oauth2/user') ->desc('Mock an OAuth2 user route') @@ -310,6 +332,7 @@ App::get('/v1/mock/tests/general/oauth2/user') ->label('scope', 'public') ->label('docs', false) ->param('token', '', new Text(100), 'OAuth2 Access Token.') + ->inject('response') ->action(function ($token, $response) { /** @var Appwrite\Utopia\Response $response */ @@ -322,24 +345,26 @@ App::get('/v1/mock/tests/general/oauth2/user') 'name' => 'User Name', 'email' => 'user@localhost.test', ]); - }, ['response']); + }); App::get('/v1/mock/tests/general/oauth2/success') ->label('scope', 'public') ->groups(['mock']) ->label('docs', false) + ->inject('response') ->action(function ($response) { /** @var Appwrite\Utopia\Response $response */ $response->json([ 'result' => 'success', ]); - }, ['response']); + }); App::get('/v1/mock/tests/general/oauth2/failure') ->groups(['mock']) ->label('scope', 'public') ->label('docs', false) + ->inject('response') ->action(function ($response) { /** @var Appwrite\Utopia\Response $response */ @@ -348,7 +373,7 @@ App::get('/v1/mock/tests/general/oauth2/failure') ->json([ 'result' => 'failure', ]); - }, ['response']); + }); App::shutdown(function($utopia, $response, $request) { /** @var Utopia\App $utopia */ diff --git a/app/controllers/web/console.php b/app/controllers/web/console.php index a9b50b05bc..9c9a827091 100644 --- a/app/controllers/web/console.php +++ b/app/controllers/web/console.php @@ -43,6 +43,7 @@ App::get('/error/:code') ->label('permission', 'public') ->label('scope', 'home') ->param('code', null, new \Utopia\Validator\Numeric(), 'Valid status code number', false) + ->inject('layout') ->action(function ($code, $layout) { /** @var Utopia\View $layout */ @@ -55,12 +56,13 @@ App::get('/error/:code') $layout ->setParam('title', APP_NAME.' - Error') ->setParam('body', $page); - }, ['layout']); + }); App::get('/console') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ @@ -73,12 +75,13 @@ App::get('/console') $layout ->setParam('title', APP_NAME.' - Console') ->setParam('body', $page); - }, ['layout']); + }); App::get('/console/account') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ @@ -93,12 +96,13 @@ App::get('/console/account') $layout ->setParam('title', 'Account - '.APP_NAME) ->setParam('body', $page); - }, ['layout']); + }); App::get('/console/notifications') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ @@ -107,12 +111,13 @@ App::get('/console/notifications') $layout ->setParam('title', APP_NAME.' - Notifications') ->setParam('body', $page); - }, ['layout']); + }); App::get('/console/home') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ @@ -121,12 +126,13 @@ App::get('/console/home') $layout ->setParam('title', APP_NAME.' - Console') ->setParam('body', $page); - }, ['layout']); + }); App::get('/console/settings') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ @@ -142,12 +148,13 @@ App::get('/console/settings') $layout ->setParam('title', APP_NAME.' - Settings') ->setParam('body', $page); - }, ['layout']); + }); App::get('/console/webhooks') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ @@ -160,12 +167,13 @@ App::get('/console/webhooks') $layout ->setParam('title', APP_NAME.' - Webhooks') ->setParam('body', $page); - }, ['layout']); + }); App::get('/console/keys') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ @@ -177,12 +185,13 @@ App::get('/console/keys') $layout ->setParam('title', APP_NAME.' - API Keys') ->setParam('body', $page); - }, ['layout']); + }); App::get('/console/tasks') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ @@ -191,12 +200,13 @@ App::get('/console/tasks') $layout ->setParam('title', APP_NAME.' - Tasks') ->setParam('body', $page); - }, ['layout']); + }); App::get('/console/database') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ @@ -205,13 +215,16 @@ App::get('/console/database') $layout ->setParam('title', APP_NAME.' - Database') ->setParam('body', $page); - }, ['layout']); + }); App::get('/console/database/collection') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') ->param('id', '', new UID(), 'Collection unique ID.') + ->inject('response') + ->inject('layout') + ->inject('projectDB') ->action(function ($id, $response, $layout, $projectDB) { /** @var Appwrite\Utopia\Response $response */ /** @var Utopia\View $layout */ @@ -241,13 +254,15 @@ App::get('/console/database/collection') ->addHeader('Expires', 0) ->addHeader('Pragma', 'no-cache') ; - }, ['response', 'layout', 'projectDB']); + }); App::get('/console/database/document') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') ->param('collection', '', new UID(), 'Collection unique ID.') + ->inject('layout') + ->inject('projectDB') ->action(function ($collection, $layout, $projectDB) { /** @var Utopia\View $layout */ /** @var Appwrite\Database\Database $projectDB */ @@ -274,12 +289,13 @@ App::get('/console/database/document') $layout ->setParam('title', APP_NAME.' - Database Document') ->setParam('body', $page); - }, ['layout', 'projectDB']); + }); App::get('/console/storage') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ $page = new View(__DIR__.'/../../views/console/storage/index.phtml'); @@ -293,12 +309,13 @@ App::get('/console/storage') $layout ->setParam('title', APP_NAME.' - Storage') ->setParam('body', $page); - }, ['layout']); + }); App::get('/console/users') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ @@ -309,12 +326,13 @@ App::get('/console/users') $layout ->setParam('title', APP_NAME.' - Users') ->setParam('body', $page); - }, ['layout']); + }); App::get('/console/users/user') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ @@ -323,12 +341,13 @@ App::get('/console/users/user') $layout ->setParam('title', APP_NAME.' - User') ->setParam('body', $page); - }, ['layout']); + }); App::get('/console/users/teams/team') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ @@ -337,13 +356,14 @@ App::get('/console/users/teams/team') $layout ->setParam('title', APP_NAME.' - Team') ->setParam('body', $page); - }, ['layout']); + }); App::get('/console/functions') ->groups(['web', 'console']) ->desc('Platform console project functions') ->label('permission', 'public') ->label('scope', 'console') + ->inject('layout') ->action(function ($layout) { $page = new View(__DIR__.'/../../views/console/functions/index.phtml'); @@ -354,13 +374,14 @@ App::get('/console/functions') $layout ->setParam('title', APP_NAME.' - Functions') ->setParam('body', $page); - }, ['layout']); + }); App::get('/console/functions/function') ->groups(['web', 'console']) ->desc('Platform console project function') ->label('permission', 'public') ->label('scope', 'console') + ->inject('layout') ->action(function ($layout) { $page = new View(__DIR__.'/../../views/console/functions/function.phtml'); @@ -374,13 +395,14 @@ App::get('/console/functions/function') $layout ->setParam('title', APP_NAME.' - Function') ->setParam('body', $page); - }, ['layout']); + }); App::get('/console/version') ->groups(['web', 'console']) ->desc('Check for new version') ->label('permission', 'public') ->label('scope', 'console') + ->inject('response') ->action(function ($response) { try { $version = \json_decode(@\file_get_contents(App::getEnv('_APP_HOME', 'http://localhost').'/v1/health/version'), true); @@ -393,4 +415,4 @@ App::get('/console/version') } catch (\Throwable $th) { throw new Exception('Failed to check for a newer version', 500); } - }, ['response']); \ No newline at end of file + }); \ No newline at end of file diff --git a/app/controllers/web/home.php b/app/controllers/web/home.php index e57a6abb88..5b4e9b7314 100644 --- a/app/controllers/web/home.php +++ b/app/controllers/web/home.php @@ -7,6 +7,7 @@ use Utopia\App; use Utopia\View; use Utopia\Config\Config; use Utopia\Exception; +use Utopia\Validator\Range; use Utopia\Validator\WhiteList; App::init(function ($layout) { @@ -40,16 +41,18 @@ App::get('/') ->groups(['web', 'home']) ->label('permission', 'public') ->label('scope', 'home') + ->inject('response') ->action(function ($response) { /** @var Appwrite\Utopia\Response $response */ $response->redirect('/auth/signin'); - }, ['response']); + }); App::get('/auth/signin') ->groups(['web', 'home']) ->label('permission', 'public') ->label('scope', 'home') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ @@ -58,12 +61,13 @@ App::get('/auth/signin') $layout ->setParam('title', 'Sign In - '.APP_NAME) ->setParam('body', $page); - }, ['layout']); + }); App::get('/auth/signup') ->groups(['web', 'home']) ->label('permission', 'public') ->label('scope', 'home') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ $page = new View(__DIR__.'/../../views/home/auth/signup.phtml'); @@ -71,12 +75,13 @@ App::get('/auth/signup') $layout ->setParam('title', 'Sign Up - '.APP_NAME) ->setParam('body', $page); - }, ['layout']); + }); App::get('/auth/recovery') ->groups(['web', 'home']) ->label('permission', 'public') ->label('scope', 'home') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ @@ -85,12 +90,13 @@ App::get('/auth/recovery') $layout ->setParam('title', 'Password Recovery - '.APP_NAME) ->setParam('body', $page); - }, ['layout']); + }); App::get('/auth/confirm') ->groups(['web', 'home']) ->label('permission', 'public') ->label('scope', 'home') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ @@ -99,12 +105,13 @@ App::get('/auth/confirm') $layout ->setParam('title', 'Account Confirmation - '.APP_NAME) ->setParam('body', $page); - }, ['layout']); + }); App::get('/auth/join') ->groups(['web', 'home']) ->label('permission', 'public') ->label('scope', 'home') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ @@ -113,12 +120,13 @@ App::get('/auth/join') $layout ->setParam('title', 'Invitation - '.APP_NAME) ->setParam('body', $page); - }, ['layout']); + }); App::get('/auth/recovery/reset') ->groups(['web', 'home']) ->label('permission', 'public') ->label('scope', 'home') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ @@ -127,12 +135,13 @@ App::get('/auth/recovery/reset') $layout ->setParam('title', 'Password Reset - '.APP_NAME) ->setParam('body', $page); - }, ['layout']); + }); App::get('/auth/oauth2/success') ->groups(['web', 'home']) ->label('permission', 'public') ->label('scope', 'home') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ @@ -144,12 +153,13 @@ App::get('/auth/oauth2/success') ->setParam('header', []) ->setParam('footer', []) ; - }, ['layout']); + }); App::get('/auth/oauth2/failure') ->groups(['web', 'home']) ->label('permission', 'public') ->label('scope', 'home') + ->inject('layout') ->action(function ($layout) { /** @var Utopia\View $layout */ @@ -161,13 +171,14 @@ App::get('/auth/oauth2/failure') ->setParam('header', []) ->setParam('footer', []) ; - }, ['layout']); + }); App::get('/error/:code') ->groups(['web', 'home']) ->label('permission', 'public') ->label('scope', 'home') ->param('code', null, new \Utopia\Validator\Numeric(), 'Valid status code number', false) + ->inject('layout') ->action(function ($code, $layout) { /** @var Utopia\View $layout */ @@ -180,7 +191,7 @@ App::get('/error/:code') $layout ->setParam('title', 'Error'.' - '.APP_NAME) ->setParam('body', $page); - }, ['layout']); + }, ['']); App::get('/specs/:format') ->groups(['web', 'home']) @@ -188,7 +199,11 @@ App::get('/specs/:format') ->label('docs', false) ->param('format', 'swagger2', new WhiteList(['swagger2', 'open-api3'], true), 'Spec format.', true) ->param('platform', APP_PLATFORM_CLIENT, new WhiteList([APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER, APP_PLATFORM_CONSOLE], true), 'Choose target platform.', true) - ->action(function ($format, $platform, $utopia, $request, $response) { + ->param('tests', 0, function () {return new Range(0, 1);}, 'Include only test services.', true) + ->inject('utopia') + ->inject('request') + ->inject('response') + ->action(function ($format, $platform, $tests, $utopia, $request, $response) { /** @var Utopia\App $utopia */ /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ @@ -277,7 +292,11 @@ App::get('/specs/:format') continue; } - if ($route->getLabel('sdk.mock', false)) { + if ($route->getLabel('sdk.mock', false) && !$tests) { + continue; + } + + if (!$route->getLabel('sdk.mock', false) && $tests) { continue; } @@ -341,4 +360,4 @@ App::get('/specs/:format') $response ->json($specs->parse()); - }, ['utopia', 'request', 'response']); \ No newline at end of file + }); \ No newline at end of file diff --git a/app/http.php b/app/http.php index a28af328fe..c409230418 100644 --- a/app/http.php +++ b/app/http.php @@ -115,8 +115,9 @@ $http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swo if(App::isDevelopment()) { $swooleResponse->end('error: '.$th->getMessage()); } - - $swooleResponse->end('500: Server Error'); + else { + $swooleResponse->end('500: Server Error'); + } } }); diff --git a/app/init.php b/app/init.php index acaf6277d9..887cac9b23 100644 --- a/app/init.php +++ b/app/init.php @@ -4,7 +4,7 @@ * Init * * Initializes both Appwrite API entry point, queue workers, and CLI tasks. - * Set configuration, framework resources, app constants + * Set configuration, framework resources & app constants * */ if (\file_exists(__DIR__.'/../vendor/autoload.php')) { @@ -37,7 +37,7 @@ const APP_USERAGENT = APP_NAME.'-Server v%s. Please report abuse at %s'; const APP_MODE_DEFAULT = 'default'; const APP_MODE_ADMIN = 'admin'; const APP_PAGING_LIMIT = 12; -const APP_CACHE_BUSTER = 141; +const APP_CACHE_BUSTER = 142; const APP_VERSION_STABLE = '0.7.0'; const APP_STORAGE_UPLOADS = '/storage/uploads'; const APP_STORAGE_FUNCTIONS = '/storage/functions'; @@ -52,7 +52,12 @@ const APP_SOCIAL_INSTAGRAM = 'https://www.instagram.com/appwrite.io'; const APP_SOCIAL_GITHUB = 'https://github.com/appwrite'; const APP_SOCIAL_DISCORD = 'https://appwrite.io/discord'; const APP_SOCIAL_DEV = 'https://dev.to/appwrite'; -const APP_SOCIAL_STACKSHARE = 'https://stackshare.io/appwrite'; +const APP_SOCIAL_STACKSHARE = 'https://stackshare.io/appwrite'; +// Deletion Types +const DELETE_TYPE_DOCUMENT = 'document'; +const DELETE_TYPE_EXECUTIONS = 'executions'; +const DELETE_TYPE_AUDIT = 'audit'; +const DELETE_TYPE_ABUSE = 'abuse'; $register = new Registry(); @@ -298,19 +303,19 @@ App::setResource('events', function($register) { }, ['register']); App::setResource('audits', function($register) { - return new Event('v1-audits', 'AuditsV1'); + return new Event(Event::AUDITS_QUEUE_NAME, Event::AUDITS_CLASS_NAME); }, ['register']); App::setResource('usage', function($register) { - return new Event('v1-usage', 'UsageV1'); + return new Event(Event::USAGE_QUEUE_NAME, Event::USAGE_CLASS_NAME); }, ['register']); App::setResource('mails', function($register) { - return new Event('v1-mails', 'MailsV1'); + return new Event(Event::MAILS_QUEUE_NAME, Event::MAILS_CLASS_NAME); }, ['register']); App::setResource('deletes', function($register) { - return new Event('v1-deletes', 'DeletesV1'); + return new Event(Event::DELETE_QUEUE_NAME, Event::DELETE_CLASS_NAME); }, ['register']); // Test Mock diff --git a/app/preload.php b/app/preload.php index bbfc142f0d..f73aaea61a 100644 --- a/app/preload.php +++ b/app/preload.php @@ -43,4 +43,4 @@ $preloader ->paths(realpath(__DIR__ . '/../app/config')) ->paths(realpath(__DIR__ . '/../app/controllers')) ->paths(realpath(__DIR__ . '/../src')) - ->load(); \ No newline at end of file + ->load(); diff --git a/app/sdks/client-flutter-dev/CHANGELOG.md b/app/sdks/client-flutter-dev/CHANGELOG.md deleted file mode 100644 index 2e9b0e0a91..0000000000 --- a/app/sdks/client-flutter-dev/CHANGELOG.md +++ /dev/null @@ -1,64 +0,0 @@ -## 0.3.2 - -- Fixed package namespaces - -## 0.3.1 - -- Downgraded meta package version to 1.1.8 - -## 0.3.0 - -- Updated package dependencies (@lohanidamodar) -- Added Flutter for Web compatibility (@lohanidamodar) - -## 0.2.3 - -- Fixed OAuth2 cookie bug, where a new session cookie couldn't overwrite an old cookie - -## 0.2.2 - -- Fixed an error that happend when the OAuth session creation request was sent before any other API call -- Fixed a bug in the Avatars service where location URL generation had syntax error - -## 0.2.1 - -- Fixed callback scheme - -## 0.2.0 - -- Updated flutter_web_auth plugin to version 0.2.4 -- Added per project unique callback for OAuth2 redirects to aviod conflicts between multiple Appwrite projects - -## 0.1.1 - -- Updated flutter_web_auth version - -## 0.1.0 - -- Added examples file -- Some minor style fixes - -## 0.0.14 - -- Using MultipartFile for file uploads - -## 0.0.13 - -- Fix for file upload method - -## 0.0.12 - -- Added file upload support for storage service - -## 0.0.11 - -- Added integration with web auth plugin to support Appwrite OAuth API - -## 0.0.9 - -- Updated deafult params - -## 0.0.8 - -- Fixed compilation error in Client class -- Shorter description for package \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/LICENSE b/app/sdks/client-flutter-dev/LICENSE deleted file mode 100644 index fc7c051a91..0000000000 --- a/app/sdks/client-flutter-dev/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/README.md b/app/sdks/client-flutter-dev/README.md deleted file mode 100644 index 2c0ba754c3..0000000000 --- a/app/sdks/client-flutter-dev/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# Appwrite Flutter (Dev Channel) SDK - -[![pub package](https://img.shields.io/pub/v/appwrite.svg)](https://pub.dartlang.org/packages/appwrite) -![License](https://img.shields.io/github/license/appwrite/sdk-for-flutter-dev.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.6.2-blue.svg?v=1) - -**This SDK is compatible with Appwrite server version 0.6.2. For older versions, please check previous releases.** - -Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. - Use the Flutter (Dev Channel) SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. - For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) - - - -![Appwrite](https://appwrite.io/images/github.png) - -## Installation - -Add this to your package's `pubspec.yaml` file: - -```yml -dependencies: - appwrite_dev: ^0.3.2 -``` - -You can install packages from the command line: - -```bash -pub get appwrite_dev -``` - -## Contribution - -This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request. - -## License - -Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/docs/examples/account/delete-sessions.md b/app/sdks/client-flutter-dev/docs/examples/account/delete-sessions.md deleted file mode 100644 index b9cbb46fd2..0000000000 --- a/app/sdks/client-flutter-dev/docs/examples/account/delete-sessions.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; - -void main() { // Init SDK - Client client = Client(); - Account account = Account(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - ; - - Future result = account.deleteSessions( ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/docs/examples/account/delete.md b/app/sdks/client-flutter-dev/docs/examples/account/delete.md deleted file mode 100644 index 8c99b2ac61..0000000000 --- a/app/sdks/client-flutter-dev/docs/examples/account/delete.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; - -void main() { // Init SDK - Client client = Client(); - Account account = Account(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - ; - - Future result = account.delete( ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/docs/examples/account/get-logs.md b/app/sdks/client-flutter-dev/docs/examples/account/get-logs.md deleted file mode 100644 index 2ed66d88ce..0000000000 --- a/app/sdks/client-flutter-dev/docs/examples/account/get-logs.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; - -void main() { // Init SDK - Client client = Client(); - Account account = Account(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - ; - - Future result = account.getLogs( ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/docs/examples/account/get-prefs.md b/app/sdks/client-flutter-dev/docs/examples/account/get-prefs.md deleted file mode 100644 index 961a24dc19..0000000000 --- a/app/sdks/client-flutter-dev/docs/examples/account/get-prefs.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; - -void main() { // Init SDK - Client client = Client(); - Account account = Account(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - ; - - Future result = account.getPrefs( ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/docs/examples/account/get-sessions.md b/app/sdks/client-flutter-dev/docs/examples/account/get-sessions.md deleted file mode 100644 index 76a566b959..0000000000 --- a/app/sdks/client-flutter-dev/docs/examples/account/get-sessions.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; - -void main() { // Init SDK - Client client = Client(); - Account account = Account(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - ; - - Future result = account.getSessions( ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/docs/examples/account/get.md b/app/sdks/client-flutter-dev/docs/examples/account/get.md deleted file mode 100644 index cd05062a69..0000000000 --- a/app/sdks/client-flutter-dev/docs/examples/account/get.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; - -void main() { // Init SDK - Client client = Client(); - Account account = Account(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - ; - - Future result = account.get( ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/docs/examples/locale/get-continents.md b/app/sdks/client-flutter-dev/docs/examples/locale/get-continents.md deleted file mode 100644 index 2c6bd7389f..0000000000 --- a/app/sdks/client-flutter-dev/docs/examples/locale/get-continents.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; - -void main() { // Init SDK - Client client = Client(); - Locale locale = Locale(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - ; - - Future result = locale.getContinents( ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/docs/examples/locale/get-countries-e-u.md b/app/sdks/client-flutter-dev/docs/examples/locale/get-countries-e-u.md deleted file mode 100644 index 443fb2d115..0000000000 --- a/app/sdks/client-flutter-dev/docs/examples/locale/get-countries-e-u.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; - -void main() { // Init SDK - Client client = Client(); - Locale locale = Locale(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - ; - - Future result = locale.getCountriesEU( ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/docs/examples/locale/get-countries-phones.md b/app/sdks/client-flutter-dev/docs/examples/locale/get-countries-phones.md deleted file mode 100644 index e08e2bca47..0000000000 --- a/app/sdks/client-flutter-dev/docs/examples/locale/get-countries-phones.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; - -void main() { // Init SDK - Client client = Client(); - Locale locale = Locale(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - ; - - Future result = locale.getCountriesPhones( ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/docs/examples/locale/get-countries.md b/app/sdks/client-flutter-dev/docs/examples/locale/get-countries.md deleted file mode 100644 index a64a23c666..0000000000 --- a/app/sdks/client-flutter-dev/docs/examples/locale/get-countries.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; - -void main() { // Init SDK - Client client = Client(); - Locale locale = Locale(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - ; - - Future result = locale.getCountries( ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/docs/examples/locale/get-currencies.md b/app/sdks/client-flutter-dev/docs/examples/locale/get-currencies.md deleted file mode 100644 index e086245ffd..0000000000 --- a/app/sdks/client-flutter-dev/docs/examples/locale/get-currencies.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; - -void main() { // Init SDK - Client client = Client(); - Locale locale = Locale(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - ; - - Future result = locale.getCurrencies( ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/docs/examples/locale/get.md b/app/sdks/client-flutter-dev/docs/examples/locale/get.md deleted file mode 100644 index 5cb8ae176e..0000000000 --- a/app/sdks/client-flutter-dev/docs/examples/locale/get.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; - -void main() { // Init SDK - Client client = Client(); - Locale locale = Locale(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - ; - - Future result = locale.get( ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/example/README.md b/app/sdks/client-flutter-dev/example/README.md deleted file mode 100644 index f6768a5f85..0000000000 --- a/app/sdks/client-flutter-dev/example/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# Examples - -Init your Appwrite client: - -```dart - Client client = Client(); - - client - .setEndpoint('https://localhost/v1') // Your Appwrite Endpoint - .setProject('5e8cf4f46b5e8') // Your project ID - .setSelfSigned() // Remove in production - ; - -``` - -Create a new user and session: - -```dart -Account account = Account(client); - -Response user = await account.create(email: 'me@appwrite.io', password: 'password', name: 'My Name'); - -Response session = await account.createSession(email: 'me@appwrite.io', password: 'password'); - -``` - -Fetch user profile: - -```dart -Account account = Account(client); - -Response profile = await account.get(); -``` - -Upload File: - -```dart -Storage storage = Storage(client); - -MultipartFile file = MultipartFile.fromFile('./path-to-file/image.jpg', filename: 'image.jpg'); - -storage.createFile( - file: file, - read: ['*'], - write: [] -) -.then((response) { - print(response); // File uploaded! -}) -.catchError((error) { - print(error.response); -}); -``` - -All examples and API features are available at the [official Appwrite docs](https://appwrite.io/docs) \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/lib/appwrite.dart b/app/sdks/client-flutter-dev/lib/appwrite.dart deleted file mode 100644 index 95d0b72cfe..0000000000 --- a/app/sdks/client-flutter-dev/lib/appwrite.dart +++ /dev/null @@ -1,10 +0,0 @@ -export 'package:dio/dio.dart' show Response; - -export 'client.dart'; -export 'enums.dart'; -export 'services/account.dart'; -export 'services/avatars.dart'; -export 'services/database.dart'; -export 'services/locale.dart'; -export 'services/storage.dart'; -export 'services/teams.dart'; diff --git a/app/sdks/client-flutter-dev/lib/appwrite_dev.dart b/app/sdks/client-flutter-dev/lib/appwrite_dev.dart deleted file mode 100644 index 95d0b72cfe..0000000000 --- a/app/sdks/client-flutter-dev/lib/appwrite_dev.dart +++ /dev/null @@ -1,10 +0,0 @@ -export 'package:dio/dio.dart' show Response; - -export 'client.dart'; -export 'enums.dart'; -export 'services/account.dart'; -export 'services/avatars.dart'; -export 'services/database.dart'; -export 'services/locale.dart'; -export 'services/storage.dart'; -export 'services/teams.dart'; diff --git a/app/sdks/client-flutter-dev/lib/client.dart b/app/sdks/client-flutter-dev/lib/client.dart deleted file mode 100644 index a5583fcd00..0000000000 --- a/app/sdks/client-flutter-dev/lib/client.dart +++ /dev/null @@ -1,134 +0,0 @@ -import 'dart:io'; - -import 'package:dio/dio.dart'; -import 'package:flutter/foundation.dart'; -import 'package:dio/adapter.dart'; -import 'package:dio_cookie_manager/dio_cookie_manager.dart'; -import 'package:cookie_jar/cookie_jar.dart'; -import 'package:path_provider/path_provider.dart'; -import 'package:package_info/package_info.dart'; - -import 'enums.dart'; - -class Client { - String endPoint; - String type = 'unknown'; - Map headers; - Map config; - bool selfSigned; - bool initialized = false; - Dio http; - PersistCookieJar cookieJar; - - Client({this.endPoint = 'https://appwrite.io/v1', this.selfSigned = false, Dio http}) : this.http = http ?? Dio() { - // Platform is not supported in web so if web, set type to web automatically and skip Platform check - if(kIsWeb) { - type = 'web'; - }else{ - type = (Platform.isIOS) ? 'ios' : type; - type = (Platform.isMacOS) ? 'macos' : type; - type = (Platform.isAndroid) ? 'android' : type; - type = (Platform.isLinux) ? 'linux' : type; - type = (Platform.isWindows) ? 'windows' : type; - type = (Platform.isFuchsia) ? 'fuchsia' : type; - } - - this.headers = { - 'content-type': 'application/json', - 'x-sdk-version': 'appwrite:flutter:0.3.2', - }; - - this.config = {}; - - assert(endPoint.startsWith(RegExp("http://|https://")), "endPoint $endPoint must start with 'http'"); - } - - Future _getCookiePath() async { - final directory = await getApplicationDocumentsDirectory(); - final path = directory.path; - final Directory dir = new Directory('$path/cookies'); - await dir.create(); - return dir; - } - - /// Your project ID - Client setProject(value) { - config['project'] = value; - addHeader('X-Appwrite-Project', value); - return this; - } - - Client setLocale(value) { - config['locale'] = value; - addHeader('X-Appwrite-Locale', value); - return this; - } - - Client setSelfSigned({bool status = true}) { - selfSigned = status; - return this; - } - - Client setEndpoint(String endPoint) { - this.endPoint = endPoint; - this.http.options.baseUrl = this.endPoint; - return this; - } - - Client addHeader(String key, String value) { - headers[key] = value; - - return this; - } - - Future init() async { - if(!initialized) { - // if web skip cookie implementation and origin header as those are automatically handled by browsers - if(!kIsWeb) { - final Directory cookieDir = await _getCookiePath(); - cookieJar = new PersistCookieJar(dir:cookieDir.path); - this.http.interceptors.add(CookieManager(cookieJar)); - PackageInfo packageInfo = await PackageInfo.fromPlatform(); - addHeader('Origin', 'appwrite-' + type + '://' + packageInfo.packageName); - }else{ - // if web set httpClientAdapter as BrowserHttpClientAdapter with withCredentials true to make cookies work - this.http.options.extra['withCredentials'] = true; - } - - this.http.options.baseUrl = this.endPoint; - this.http.options.validateStatus = (status) => status < 400; - } - } - - Future call(HttpMethod method, {String path = '', Map headers = const {}, Map params = const {}}) async { - if(selfSigned) { - // Allow self signed requests - (http.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (HttpClient client) { - client.badCertificateCallback = (X509Certificate cert, String host, int port) => true; - return client; - }; - } - - await this.init(); - - // Origin is hardcoded for testing - Options options = Options( - headers: {...this.headers, ...headers}, - method: method.name(), - ); - - if(headers['content-type'] == 'multipart/form-data') { - return http.request(path, data: FormData.fromMap(params), options: options); - } - - if (method == HttpMethod.get) { - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - return http.get(path, queryParameters: params, options: options); - } else { - return http.request(path, data: params, options: options); - } - } -} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/lib/enums.dart b/app/sdks/client-flutter-dev/lib/enums.dart deleted file mode 100644 index 2757f6073e..0000000000 --- a/app/sdks/client-flutter-dev/lib/enums.dart +++ /dev/null @@ -1,15 +0,0 @@ -enum HttpMethod { get, post, put, delete, patch } - -extension HttpMethodString on HttpMethod { - String name() { - return this.toString().split('.').last.toUpperCase(); - } -} - -enum OrderType { asc, desc } - -extension OrderTypeString on OrderType { - String name() { - return this.toString().split('.').last.toUpperCase(); - } -} diff --git a/app/sdks/client-flutter-dev/lib/service.dart b/app/sdks/client-flutter-dev/lib/service.dart deleted file mode 100644 index 1ae319b705..0000000000 --- a/app/sdks/client-flutter-dev/lib/service.dart +++ /dev/null @@ -1,7 +0,0 @@ -import 'client.dart'; - -class Service { - final Client client; - - const Service(this.client); -} diff --git a/app/sdks/client-flutter-dev/lib/services/account.dart b/app/sdks/client-flutter-dev/lib/services/account.dart deleted file mode 100644 index 02fc33400e..0000000000 --- a/app/sdks/client-flutter-dev/lib/services/account.dart +++ /dev/null @@ -1,424 +0,0 @@ - -import 'dart:io'; - -import 'package:dio/dio.dart'; -import 'package:meta/meta.dart'; -import 'package:flutter_web_auth/flutter_web_auth.dart'; - -import "../client.dart"; -import '../enums.dart'; -import "../service.dart"; - -class Account extends Service { - Account(Client client): super(client); - - /// Get Account - /// - /// Get currently logged in user data as JSON object. - /// - Future get() { - final String path = '/account'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Create Account - /// - /// 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](/docs/client/account#createVerification) route - /// to start verifying the user email address. To allow your new user to login - /// to his new account, you need to create a new [account - /// session](/docs/client/account#createSession). - /// - Future create({@required String email, @required String password, String name = ''}) { - final String path = '/account'; - - final Map params = { - 'email': email, - 'password': password, - 'name': name, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.post, path: path, params: params, headers: headers); - } - - /// Delete Account - /// - /// Delete a currently logged in user account. Behind the scene, the user - /// record is not deleted but permanently blocked from any access. This is done - /// to avoid deleted accounts being overtaken by new users with the same email - /// address. Any user-related resources like documents or storage files should - /// be deleted separately. - /// - Future delete() { - final String path = '/account'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.delete, path: path, params: params, headers: headers); - } - - /// Update Account Email - /// - /// Update currently logged in user account email address. After changing user - /// address, user confirmation status is being reset and a new confirmation - /// mail is sent. For security measures, user password is required to complete - /// this request. - /// - Future updateEmail({@required String email, @required String password}) { - final String path = '/account/email'; - - final Map params = { - 'email': email, - 'password': password, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.patch, path: path, params: params, headers: headers); - } - - /// Get Account Logs - /// - /// Get currently logged in user list of latest security activity logs. Each - /// log returns user IP address, location and date and time of log. - /// - Future getLogs() { - final String path = '/account/logs'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Update Account Name - /// - /// Update currently logged in user account name. - /// - Future updateName({@required String name}) { - final String path = '/account/name'; - - final Map params = { - 'name': name, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.patch, path: path, params: params, headers: headers); - } - - /// Update Account Password - /// - /// Update currently logged in user password. For validation, user is required - /// to pass the password twice. - /// - Future updatePassword({@required String password, @required String oldPassword}) { - final String path = '/account/password'; - - final Map params = { - 'password': password, - 'oldPassword': oldPassword, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.patch, path: path, params: params, headers: headers); - } - - /// Get Account Preferences - /// - /// Get currently logged in user preferences as a key-value object. - /// - Future getPrefs() { - final String path = '/account/prefs'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Update Account Preferences - /// - /// Update currently logged in user account preferences. You can pass only the - /// specific settings you wish to update. - /// - Future updatePrefs({@required dynamic prefs}) { - final String path = '/account/prefs'; - - final Map params = { - 'prefs': prefs, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.patch, path: path, params: params, headers: headers); - } - - /// Create Password Recovery - /// - /// 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](/docs/client/account#updateRecovery) - /// endpoint to complete the process. - /// - Future createRecovery({@required String email, @required String url}) { - final String path = '/account/recovery'; - - final Map params = { - 'email': email, - 'url': url, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.post, path: path, params: params, headers: headers); - } - - /// Complete Password Recovery - /// - /// 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](/docs/client/account#createRecovery) endpoint. - /// - /// Please 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. - /// - Future updateRecovery({@required String userId, @required String secret, @required String password, @required String passwordAgain}) { - final String path = '/account/recovery'; - - final Map params = { - 'userId': userId, - 'secret': secret, - 'password': password, - 'passwordAgain': passwordAgain, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.put, path: path, params: params, headers: headers); - } - - /// Get Account Sessions - /// - /// Get currently logged in user list of active sessions across different - /// devices. - /// - Future getSessions() { - final String path = '/account/sessions'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Create Account Session - /// - /// Allow the user to login into his account by providing a valid email and - /// password combination. This route will create a new session for the user. - /// - Future createSession({@required String email, @required String password}) { - final String path = '/account/sessions'; - - final Map params = { - 'email': email, - 'password': password, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.post, path: path, params: params, headers: headers); - } - - /// Delete All Account Sessions - /// - /// Delete all sessions from the user account and remove any sessions cookies - /// from the end client. - /// - Future deleteSessions() { - final String path = '/account/sessions'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.delete, path: path, params: params, headers: headers); - } - - /// Create Account Session with OAuth2 - /// - /// Allow the user to login to his account using the OAuth2 provider of his - /// 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. - /// - Future createOAuth2Session({@required String provider, String success = 'https://appwrite.io/auth/oauth2/success', String failure = 'https://appwrite.io/auth/oauth2/failure'}) { - final String path = '/account/sessions/oauth2/{provider}'.replaceAll(RegExp('{provider}'), provider); - - final Map params = { - 'success': success, - 'failure': failure, - 'project': client.config['project'], - }; - - - final List query = []; - - params.forEach((key, value) { - if (value is List) { - for (var item in value) { - query.add(Uri.encodeComponent(key + '[]') + '=' + Uri.encodeComponent(item)); - } - } - else { - query.add(Uri.encodeComponent(key) + '=' + Uri.encodeComponent(value)); - } - }); - - Uri endpoint = Uri.parse(client.endPoint); - Uri url = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - query: query.join('&') - ); - - return FlutterWebAuth.authenticate( - url: url.toString(), - callbackUrlScheme: "appwrite-callback-" + client.config['project'] - ).then((value) async { - Uri url = Uri.parse(value); - Cookie cookie = new Cookie(url.queryParameters['key'], url.queryParameters['secret']); - cookie.domain = Uri.parse(client.endPoint).host; - cookie.httpOnly = true; - cookie.path = '/'; - List cookies = [cookie]; - await client.init(); - client.cookieJar.saveFromResponse(Uri.parse(client.endPoint), cookies); - }); - } - - /// Delete Account Session - /// - /// Use this endpoint to log out the currently logged in user from all his - /// account sessions across all his different devices. When using the option id - /// argument, only the session unique ID provider will be deleted. - /// - Future deleteSession({@required String sessionId}) { - final String path = '/account/sessions/{sessionId}'.replaceAll(RegExp('{sessionId}'), sessionId); - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.delete, path: path, params: params, headers: headers); - } - - /// Create Email Verification - /// - /// 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 provider to be attached to the verification email. The provided URL - /// should redirect the user back for 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](/docs/client/account#updateAccountVerification). - /// - /// Please 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. - /// - Future createVerification({@required String url}) { - final String path = '/account/verification'; - - final Map params = { - 'url': url, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.post, path: path, params: params, headers: headers); - } - - /// Complete Email Verification - /// - /// 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. - /// - Future updateVerification({@required String userId, @required String secret}) { - final String path = '/account/verification'; - - final Map params = { - 'userId': userId, - 'secret': secret, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.put, path: path, params: params, headers: headers); - } -} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/lib/services/avatars.dart b/app/sdks/client-flutter-dev/lib/services/avatars.dart deleted file mode 100644 index 828ea7dfb0..0000000000 --- a/app/sdks/client-flutter-dev/lib/services/avatars.dart +++ /dev/null @@ -1,198 +0,0 @@ - - -import 'package:dio/dio.dart'; -import 'package:meta/meta.dart'; - -import "../client.dart"; -import '../enums.dart'; -import "../service.dart"; - -class Avatars extends Service { - Avatars(Client client): super(client); - - /// Get Browser Icon - /// - /// 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 - /// /account/sessions endpoint. Use width, height and quality arguments to - /// change the output settings. - /// - String getBrowser({@required String code, int width = 100, int height = 100, int quality = 100}) { - final String path = '/avatars/browsers/{code}'.replaceAll(RegExp('{code}'), code); - - final Map params = { - 'width': width, - 'height': height, - 'quality': quality, - 'project': client.config['project'], - }; - - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - Uri endpoint = Uri.parse(client.endPoint); - Uri location = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - queryParameters:params, - ); - - return location.toString(); - } - - /// Get Credit Card Icon - /// - /// Need to display your users with your billing method or their payment - /// methods? 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. - /// - String getCreditCard({@required String code, int width = 100, int height = 100, int quality = 100}) { - final String path = '/avatars/credit-cards/{code}'.replaceAll(RegExp('{code}'), code); - - final Map params = { - 'width': width, - 'height': height, - 'quality': quality, - 'project': client.config['project'], - }; - - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - Uri endpoint = Uri.parse(client.endPoint); - Uri location = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - queryParameters:params, - ); - - return location.toString(); - } - - /// Get Favicon - /// - /// Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote - /// website URL. - /// - String getFavicon({@required String url}) { - final String path = '/avatars/favicon'; - - final Map params = { - 'url': url, - 'project': client.config['project'], - }; - - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - Uri endpoint = Uri.parse(client.endPoint); - Uri location = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - queryParameters:params, - ); - - return location.toString(); - } - - /// Get Country Flag - /// - /// 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. - /// - String getFlag({@required String code, int width = 100, int height = 100, int quality = 100}) { - final String path = '/avatars/flags/{code}'.replaceAll(RegExp('{code}'), code); - - final Map params = { - 'width': width, - 'height': height, - 'quality': quality, - 'project': client.config['project'], - }; - - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - Uri endpoint = Uri.parse(client.endPoint); - Uri location = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - queryParameters:params, - ); - - return location.toString(); - } - - /// Get Image from URL - /// - /// 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. - /// - String getImage({@required String url, int width = 400, int height = 400}) { - final String path = '/avatars/image'; - - final Map params = { - 'url': url, - 'width': width, - 'height': height, - 'project': client.config['project'], - }; - - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - Uri endpoint = Uri.parse(client.endPoint); - Uri location = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - queryParameters:params, - ); - - return location.toString(); - } - - /// Get QR Code - /// - /// 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. - /// - String getQR({@required String text, int size = 400, int margin = 1, int download = 0}) { - final String path = '/avatars/qr'; - - final Map params = { - 'text': text, - 'size': size, - 'margin': margin, - 'download': download, - 'project': client.config['project'], - }; - - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - Uri endpoint = Uri.parse(client.endPoint); - Uri location = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - queryParameters:params, - ); - - return location.toString(); - } -} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/lib/services/database.dart b/app/sdks/client-flutter-dev/lib/services/database.dart deleted file mode 100644 index 88082feef7..0000000000 --- a/app/sdks/client-flutter-dev/lib/services/database.dart +++ /dev/null @@ -1,121 +0,0 @@ - - -import 'package:dio/dio.dart'; -import 'package:meta/meta.dart'; - -import "../client.dart"; -import '../enums.dart'; -import "../service.dart"; - -class Database extends Service { - Database(Client client): super(client); - - /// List Documents - /// - /// Get a list of all the user documents. You can use the query params to - /// filter your results. On admin mode, this endpoint will return a list of all - /// of the project documents. [Learn more about different API - /// modes](/docs/admin). - /// - Future listDocuments({@required String collectionId, List filters = const [], int offset = 0, int limit = 50, String orderField = '\$id', OrderType orderType = OrderType.asc, String orderCast = 'string', String search = '', int first = 0, int last = 0}) { - final String path = '/database/collections/{collectionId}/documents'.replaceAll(RegExp('{collectionId}'), collectionId); - - final Map params = { - 'filters': filters, - 'offset': offset, - 'limit': limit, - 'orderField': orderField, - 'orderType': orderType.name(), - 'orderCast': orderCast, - 'search': search, - 'first': first, - 'last': last, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Create Document - /// - /// Create a new Document. Before using this route, you should create a new - /// collection resource using either a [server - /// integration](/docs/server/database?sdk=nodejs#createCollection) API or - /// directly from your database console. - /// - Future createDocument({@required String collectionId, @required dynamic data, @required List read, @required List write, String parentDocument = '', String parentProperty = '', String parentPropertyType = 'assign'}) { - final String path = '/database/collections/{collectionId}/documents'.replaceAll(RegExp('{collectionId}'), collectionId); - - final Map params = { - 'data': data, - 'read': read, - 'write': write, - 'parentDocument': parentDocument, - 'parentProperty': parentProperty, - 'parentPropertyType': parentPropertyType, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.post, path: path, params: params, headers: headers); - } - - /// Get Document - /// - /// Get document by its unique ID. This endpoint response returns a JSON object - /// with the document data. - /// - Future getDocument({@required String collectionId, @required String documentId}) { - final String path = '/database/collections/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId); - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Update Document - Future updateDocument({@required String collectionId, @required String documentId, @required dynamic data, @required List read, @required List write}) { - final String path = '/database/collections/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId); - - final Map params = { - 'data': data, - 'read': read, - 'write': write, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.patch, path: path, params: params, headers: headers); - } - - /// Delete Document - /// - /// Delete document by its unique ID. This endpoint deletes only the parent - /// documents, his attributes and relations to other documents. Child documents - /// **will not** be deleted. - /// - Future deleteDocument({@required String collectionId, @required String documentId}) { - final String path = '/database/collections/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId); - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.delete, path: path, params: params, headers: headers); - } -} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/lib/services/locale.dart b/app/sdks/client-flutter-dev/lib/services/locale.dart deleted file mode 100644 index 91ea1567ef..0000000000 --- a/app/sdks/client-flutter-dev/lib/services/locale.dart +++ /dev/null @@ -1,125 +0,0 @@ - - -import 'package:dio/dio.dart'; -import 'package:meta/meta.dart'; - -import "../client.dart"; -import '../enums.dart'; -import "../service.dart"; - -class Locale extends Service { - Locale(Client client): super(client); - - /// Get User Locale - /// - /// 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. - /// - /// ([IP Geolocation by DB-IP](https://db-ip.com)) - /// - Future get() { - final String path = '/locale'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// List Continents - /// - /// List of all continents. You can use the locale header to get the data in a - /// supported language. - /// - Future getContinents() { - final String path = '/locale/continents'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// List Countries - /// - /// List of all countries. You can use the locale header to get the data in a - /// supported language. - /// - Future getCountries() { - final String path = '/locale/countries'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// List EU Countries - /// - /// 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. - /// - Future getCountriesEU() { - final String path = '/locale/countries/eu'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// List Countries Phone Codes - /// - /// List of all countries phone codes. You can use the locale header to get the - /// data in a supported language. - /// - Future getCountriesPhones() { - final String path = '/locale/countries/phones'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// List Currencies - /// - /// List of all currencies, including currency symol, 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. - /// - Future getCurrencies() { - final String path = '/locale/currencies'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } -} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/lib/services/storage.dart b/app/sdks/client-flutter-dev/lib/services/storage.dart deleted file mode 100644 index 51f9345050..0000000000 --- a/app/sdks/client-flutter-dev/lib/services/storage.dart +++ /dev/null @@ -1,203 +0,0 @@ - - -import 'package:dio/dio.dart'; -import 'package:meta/meta.dart'; - -import "../client.dart"; -import '../enums.dart'; -import "../service.dart"; - -class Storage extends Service { - Storage(Client client): super(client); - - /// List Files - /// - /// Get a list of all the user files. You can use the query params to filter - /// your results. On admin mode, this endpoint will return a list of all of the - /// project files. [Learn more about different API modes](/docs/admin). - /// - Future listFiles({String search = '', int limit = 25, int offset = 0, OrderType orderType = OrderType.asc}) { - final String path = '/storage/files'; - - final Map params = { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType.name(), - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Create File - /// - /// Create a new file. The user who creates the file will automatically be - /// assigned to read and write access unless he has passed custom values for - /// read and write arguments. - /// - Future createFile({@required MultipartFile file, @required List read, @required List write}) { - final String path = '/storage/files'; - - final Map params = { - 'file': file, - 'read': read, - 'write': write, - }; - - final Map headers = { - 'content-type': 'multipart/form-data', - }; - - return client.call(HttpMethod.post, path: path, params: params, headers: headers); - } - - /// Get File - /// - /// Get file by its unique ID. This endpoint response returns a JSON object - /// with the file metadata. - /// - Future getFile({@required String fileId}) { - final String path = '/storage/files/{fileId}'.replaceAll(RegExp('{fileId}'), fileId); - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Update File - /// - /// Update file by its unique ID. Only users with write permissions have access - /// to update this resource. - /// - Future updateFile({@required String fileId, @required List read, @required List write}) { - final String path = '/storage/files/{fileId}'.replaceAll(RegExp('{fileId}'), fileId); - - final Map params = { - 'read': read, - 'write': write, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.put, path: path, params: params, headers: headers); - } - - /// Delete File - /// - /// Delete a file by its unique ID. Only users with write permissions have - /// access to delete this resource. - /// - Future deleteFile({@required String fileId}) { - final String path = '/storage/files/{fileId}'.replaceAll(RegExp('{fileId}'), fileId); - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.delete, path: path, params: params, headers: headers); - } - - /// Get File for Download - /// - /// Get 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. - /// - String getFileDownload({@required String fileId}) { - final String path = '/storage/files/{fileId}/download'.replaceAll(RegExp('{fileId}'), fileId); - - final Map params = { - 'project': client.config['project'], - }; - - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - Uri endpoint = Uri.parse(client.endPoint); - Uri location = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - queryParameters:params, - ); - - return location.toString(); - } - - /// Get File Preview - /// - /// 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. - /// - String getFilePreview({@required String fileId, int width = 0, int height = 0, int quality = 100, String background = '', String output = ''}) { - final String path = '/storage/files/{fileId}/preview'.replaceAll(RegExp('{fileId}'), fileId); - - final Map params = { - 'width': width, - 'height': height, - 'quality': quality, - 'background': background, - 'output': output, - 'project': client.config['project'], - }; - - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - Uri endpoint = Uri.parse(client.endPoint); - Uri location = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - queryParameters:params, - ); - - return location.toString(); - } - - /// Get File for View - /// - /// Get file content by its unique ID. This endpoint is similar to the download - /// method but returns with no 'Content-Disposition: attachment' header. - /// - String getFileView({@required String fileId, String as = ''}) { - final String path = '/storage/files/{fileId}/view'.replaceAll(RegExp('{fileId}'), fileId); - - final Map params = { - 'as': as, - 'project': client.config['project'], - }; - - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - Uri endpoint = Uri.parse(client.endPoint); - Uri location = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - queryParameters:params, - ); - - return location.toString(); - } -} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/lib/services/teams.dart b/app/sdks/client-flutter-dev/lib/services/teams.dart deleted file mode 100644 index b98590b33d..0000000000 --- a/app/sdks/client-flutter-dev/lib/services/teams.dart +++ /dev/null @@ -1,203 +0,0 @@ - - -import 'package:dio/dio.dart'; -import 'package:meta/meta.dart'; - -import "../client.dart"; -import '../enums.dart'; -import "../service.dart"; - -class Teams extends Service { - Teams(Client client): super(client); - - /// List Teams - /// - /// Get a list of all the current user teams. You can use the query params to - /// filter your results. On admin mode, this endpoint will return a list of all - /// of the project teams. [Learn more about different API modes](/docs/admin). - /// - Future list({String search = '', int limit = 25, int offset = 0, OrderType orderType = OrderType.asc}) { - final String path = '/teams'; - - final Map params = { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType.name(), - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Create Team - /// - /// Create a new team. The user who creates the team will automatically be - /// assigned as the owner of the team. The team owner can invite new members, - /// who will be able add new owners and update or delete the team from your - /// project. - /// - Future create({@required String name, List roles = const ["owner"]}) { - final String path = '/teams'; - - final Map params = { - 'name': name, - 'roles': roles, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.post, path: path, params: params, headers: headers); - } - - /// Get Team - /// - /// Get team by its unique ID. All team members have read access for this - /// resource. - /// - Future get({@required String teamId}) { - final String path = '/teams/{teamId}'.replaceAll(RegExp('{teamId}'), teamId); - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Update Team - /// - /// Update team by its unique ID. Only team owners have write access for this - /// resource. - /// - Future update({@required String teamId, @required String name}) { - final String path = '/teams/{teamId}'.replaceAll(RegExp('{teamId}'), teamId); - - final Map params = { - 'name': name, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.put, path: path, params: params, headers: headers); - } - - /// Delete Team - /// - /// Delete team by its unique ID. Only team owners have write access for this - /// resource. - /// - Future delete({@required String teamId}) { - final String path = '/teams/{teamId}'.replaceAll(RegExp('{teamId}'), teamId); - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.delete, path: path, params: params, headers: headers); - } - - /// Get Team Memberships - /// - /// Get team members by the team unique ID. All team members have read access - /// for this list of resources. - /// - Future getMemberships({@required String teamId}) { - final String path = '/teams/{teamId}/memberships'.replaceAll(RegExp('{teamId}'), teamId); - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Create Team Membership - /// - /// Use this endpoint to invite a new member to join your team. An email with a - /// link to join the team will be sent to the new member email address if the - /// member doesn't exist in the project it will be created automatically. - /// - /// Use the 'URL' parameter to redirect the user from the invitation email back - /// to your app. When the user is redirected, use the [Update Team Membership - /// Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the - /// user to accept the invitation to the team. - /// - /// Please note that in order to avoid a [Redirect - /// Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) - /// the only valid redirect URL's are the once from domains you have set when - /// added your platforms in the console interface. - /// - Future createMembership({@required String teamId, @required String email, @required List roles, @required String url, String name = ''}) { - final String path = '/teams/{teamId}/memberships'.replaceAll(RegExp('{teamId}'), teamId); - - final Map params = { - 'email': email, - 'name': name, - 'roles': roles, - 'url': url, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.post, path: path, params: params, headers: headers); - } - - /// Delete Team Membership - /// - /// 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 he didn't accept it. - /// - Future deleteMembership({@required String teamId, @required String inviteId}) { - final String path = '/teams/{teamId}/memberships/{inviteId}'.replaceAll(RegExp('{teamId}'), teamId).replaceAll(RegExp('{inviteId}'), inviteId); - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.delete, path: path, params: params, headers: headers); - } - - /// Update Team Membership Status - /// - /// Use this endpoint to allow a user to accept an invitation to join a team - /// after he is being redirected back to your app from the invitation email he - /// was sent. - /// - Future updateMembershipStatus({@required String teamId, @required String inviteId, @required String userId, @required String secret}) { - final String path = '/teams/{teamId}/memberships/{inviteId}/status'.replaceAll(RegExp('{teamId}'), teamId).replaceAll(RegExp('{inviteId}'), inviteId); - - final Map params = { - 'userId': userId, - 'secret': secret, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.patch, path: path, params: params, headers: headers); - } -} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/pubspec.yaml b/app/sdks/client-flutter-dev/pubspec.yaml deleted file mode 100644 index 7d3646b8ee..0000000000 --- a/app/sdks/client-flutter-dev/pubspec.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: appwrite_dev -version: 0.3.2 -description: Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API -homepage: https://appwrite.io -repository: https://github.com/appwrite/sdk-for-flutter-dev -issue_tracker: https://github.com/appwrite/sdk-generator/issues -documentation: https://appwrite.io/support -environment: - sdk: '>=2.6.0 <3.0.0' -dependencies: - meta: ^1.1.8 - path_provider: ^1.6.14 - package_info: ^0.4.3 - dio: ^3.0.10 - cookie_jar: ^1.0.1 - dio_cookie_manager: ^1.0.0 - flutter_web_auth: ^0.2.4 - flutter: - sdk: flutter - -dev_dependencies: - flutter_test: - sdk: flutter \ No newline at end of file diff --git a/app/sdks/client-flutter/CHANGELOG.md b/app/sdks/client-flutter/CHANGELOG.md deleted file mode 100644 index a584ad8b9a..0000000000 --- a/app/sdks/client-flutter/CHANGELOG.md +++ /dev/null @@ -1,60 +0,0 @@ -## 0.3.0-dev.2 - -- Fix for an error when using a self-signed certificate for Web - -## 0.3.0-dev.1 - -- Updated package dependencies (@lohanidamodar) -- Added Flutter for Web compatibility (@lohanidamodar) - -## 0.2.3 - -- Fixed OAuth2 cookie bug, where a new session cookie couldn't overwrite an old cookie - -## 0.2.2 - -- Fixed an error that happend when the OAuth session creation request was sent before any other API call -- Fixed a bug in the Avatars service where location URL generation had syntax error - -## 0.2.1 - -- Fixed callback scheme - -## 0.2.0 - -- Updated flutter_web_auth plugin to version 0.2.4 -- Added per project unique callback for OAuth2 redirects to aviod conflicts between multiple Appwrite projects - -## 0.1.1 - -- Updated flutter_web_auth version - -## 0.1.0 - -- Added examples file -- Some minor style fixes - -## 0.0.14 - -- Using MultipartFile for file uploads - -## 0.0.13 - -- Fix for file upload method - -## 0.0.12 - -- Added file upload support for storage service - -## 0.0.11 - -- Added integration with web auth plugin to support Appwrite OAuth API - -## 0.0.9 - -- Updated deafult params - -## 0.0.8 - -- Fixed compilation error in Client class -- Shorter description for package \ No newline at end of file diff --git a/app/sdks/client-flutter/LICENSE b/app/sdks/client-flutter/LICENSE deleted file mode 100644 index fc7c051a91..0000000000 --- a/app/sdks/client-flutter/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/app/sdks/client-flutter/README.md b/app/sdks/client-flutter/README.md deleted file mode 100644 index d272426ee3..0000000000 --- a/app/sdks/client-flutter/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# Appwrite Flutter SDK - -[![pub package](https://img.shields.io/pub/v/appwrite.svg)](https://pub.dartlang.org/packages/appwrite) -![License](https://img.shields.io/github/license/appwrite/sdk-for-flutter.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.6.2-blue.svg?v=1) - -**This SDK is compatible with Appwrite server version 0.6.2. For older versions, please check previous releases.** - -Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. - Use the Flutter SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. - For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) - - - -![Appwrite](https://appwrite.io/images/github.png) - -## Installation - -Add this to your package's `pubspec.yaml` file: - -```yml -dependencies: - appwrite: ^0.3.0-dev.2 -``` - -You can install packages from the command line: - -```bash -pub get appwrite -``` - -## Contribution - -This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request. - -## License - -Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. \ No newline at end of file diff --git a/app/sdks/client-flutter/docs/examples/account/delete-sessions.md b/app/sdks/client-flutter/docs/examples/account/delete-sessions.md deleted file mode 100644 index 5e947fabc2..0000000000 --- a/app/sdks/client-flutter/docs/examples/account/delete-sessions.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Account account = Account(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - ; - - Future result = account.deleteSessions( ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/app/sdks/client-flutter/docs/examples/locale/get-countries-phones.md b/app/sdks/client-flutter/docs/examples/locale/get-countries-phones.md deleted file mode 100644 index f6b1f58749..0000000000 --- a/app/sdks/client-flutter/docs/examples/locale/get-countries-phones.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Locale locale = Locale(client); - - client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - ; - - Future result = locale.getCountriesPhones( ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} \ No newline at end of file diff --git a/app/sdks/client-flutter/example/README.md b/app/sdks/client-flutter/example/README.md deleted file mode 100644 index f6768a5f85..0000000000 --- a/app/sdks/client-flutter/example/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# Examples - -Init your Appwrite client: - -```dart - Client client = Client(); - - client - .setEndpoint('https://localhost/v1') // Your Appwrite Endpoint - .setProject('5e8cf4f46b5e8') // Your project ID - .setSelfSigned() // Remove in production - ; - -``` - -Create a new user and session: - -```dart -Account account = Account(client); - -Response user = await account.create(email: 'me@appwrite.io', password: 'password', name: 'My Name'); - -Response session = await account.createSession(email: 'me@appwrite.io', password: 'password'); - -``` - -Fetch user profile: - -```dart -Account account = Account(client); - -Response profile = await account.get(); -``` - -Upload File: - -```dart -Storage storage = Storage(client); - -MultipartFile file = MultipartFile.fromFile('./path-to-file/image.jpg', filename: 'image.jpg'); - -storage.createFile( - file: file, - read: ['*'], - write: [] -) -.then((response) { - print(response); // File uploaded! -}) -.catchError((error) { - print(error.response); -}); -``` - -All examples and API features are available at the [official Appwrite docs](https://appwrite.io/docs) \ No newline at end of file diff --git a/app/sdks/client-flutter/lib/appwrite.dart b/app/sdks/client-flutter/lib/appwrite.dart deleted file mode 100644 index 95d0b72cfe..0000000000 --- a/app/sdks/client-flutter/lib/appwrite.dart +++ /dev/null @@ -1,10 +0,0 @@ -export 'package:dio/dio.dart' show Response; - -export 'client.dart'; -export 'enums.dart'; -export 'services/account.dart'; -export 'services/avatars.dart'; -export 'services/database.dart'; -export 'services/locale.dart'; -export 'services/storage.dart'; -export 'services/teams.dart'; diff --git a/app/sdks/client-flutter/lib/client.dart b/app/sdks/client-flutter/lib/client.dart deleted file mode 100644 index ee55d8ba18..0000000000 --- a/app/sdks/client-flutter/lib/client.dart +++ /dev/null @@ -1,134 +0,0 @@ -import 'dart:io'; - -import 'package:dio/dio.dart'; -import 'package:flutter/foundation.dart'; -import 'package:dio/adapter.dart'; -import 'package:dio_cookie_manager/dio_cookie_manager.dart'; -import 'package:cookie_jar/cookie_jar.dart'; -import 'package:path_provider/path_provider.dart'; -import 'package:package_info/package_info.dart'; - -import 'enums.dart'; - -class Client { - String endPoint; - String type = 'unknown'; - Map headers; - Map config; - bool selfSigned; - bool initialized = false; - Dio http; - PersistCookieJar cookieJar; - - Client({this.endPoint = 'https://appwrite.io/v1', this.selfSigned = false, Dio http}) : this.http = http ?? Dio() { - // Platform is not supported in web so if web, set type to web automatically and skip Platform check - if(kIsWeb) { - type = 'web'; - }else{ - type = (Platform.isIOS) ? 'ios' : type; - type = (Platform.isMacOS) ? 'macos' : type; - type = (Platform.isAndroid) ? 'android' : type; - type = (Platform.isLinux) ? 'linux' : type; - type = (Platform.isWindows) ? 'windows' : type; - type = (Platform.isFuchsia) ? 'fuchsia' : type; - } - - this.headers = { - 'content-type': 'application/json', - 'x-sdk-version': 'appwrite:flutter:0.3.0-dev.2', - }; - - this.config = {}; - - assert(endPoint.startsWith(RegExp("http://|https://")), "endPoint $endPoint must start with 'http'"); - } - - Future _getCookiePath() async { - final directory = await getApplicationDocumentsDirectory(); - final path = directory.path; - final Directory dir = new Directory('$path/cookies'); - await dir.create(); - return dir; - } - - /// Your project ID - Client setProject(value) { - config['project'] = value; - addHeader('X-Appwrite-Project', value); - return this; - } - - Client setLocale(value) { - config['locale'] = value; - addHeader('X-Appwrite-Locale', value); - return this; - } - - Client setSelfSigned({bool status = true}) { - selfSigned = status; - return this; - } - - Client setEndpoint(String endPoint) { - this.endPoint = endPoint; - this.http.options.baseUrl = this.endPoint; - return this; - } - - Client addHeader(String key, String value) { - headers[key] = value; - - return this; - } - - Future init() async { - if(!initialized) { - // if web skip cookie implementation and origin header as those are automatically handled by browsers - if(!kIsWeb) { - final Directory cookieDir = await _getCookiePath(); - cookieJar = new PersistCookieJar(dir:cookieDir.path); - this.http.interceptors.add(CookieManager(cookieJar)); - PackageInfo packageInfo = await PackageInfo.fromPlatform(); - addHeader('Origin', 'appwrite-' + type + '://' + packageInfo.packageName); - }else{ - // if web set httpClientAdapter as BrowserHttpClientAdapter with withCredentials true to make cookies work - this.http.options.extra['withCredentials'] = true; - } - - this.http.options.baseUrl = this.endPoint; - this.http.options.validateStatus = (status) => status < 400; - } - } - - Future call(HttpMethod method, {String path = '', Map headers = const {}, Map params = const {}}) async { - if(selfSigned && !kIsWeb) { - // Allow self signed requests - (http.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (HttpClient client) { - client.badCertificateCallback = (X509Certificate cert, String host, int port) => true; - return client; - }; - } - - await this.init(); - - // Origin is hardcoded for testing - Options options = Options( - headers: {...this.headers, ...headers}, - method: method.name(), - ); - - if(headers['content-type'] == 'multipart/form-data') { - return http.request(path, data: FormData.fromMap(params), options: options); - } - - if (method == HttpMethod.get) { - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - return http.get(path, queryParameters: params, options: options); - } else { - return http.request(path, data: params, options: options); - } - } -} \ No newline at end of file diff --git a/app/sdks/client-flutter/lib/enums.dart b/app/sdks/client-flutter/lib/enums.dart deleted file mode 100644 index 2757f6073e..0000000000 --- a/app/sdks/client-flutter/lib/enums.dart +++ /dev/null @@ -1,15 +0,0 @@ -enum HttpMethod { get, post, put, delete, patch } - -extension HttpMethodString on HttpMethod { - String name() { - return this.toString().split('.').last.toUpperCase(); - } -} - -enum OrderType { asc, desc } - -extension OrderTypeString on OrderType { - String name() { - return this.toString().split('.').last.toUpperCase(); - } -} diff --git a/app/sdks/client-flutter/lib/service.dart b/app/sdks/client-flutter/lib/service.dart deleted file mode 100644 index 1ae319b705..0000000000 --- a/app/sdks/client-flutter/lib/service.dart +++ /dev/null @@ -1,7 +0,0 @@ -import 'client.dart'; - -class Service { - final Client client; - - const Service(this.client); -} diff --git a/app/sdks/client-flutter/lib/services/account.dart b/app/sdks/client-flutter/lib/services/account.dart deleted file mode 100644 index 890303a9d6..0000000000 --- a/app/sdks/client-flutter/lib/services/account.dart +++ /dev/null @@ -1,435 +0,0 @@ - -import 'dart:io'; -import 'package:universal_html/html.dart' as html; - -import 'package:dio/dio.dart'; -import 'package:meta/meta.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter_web_auth/flutter_web_auth.dart'; - -import "../client.dart"; -import '../enums.dart'; -import "../service.dart"; - -class Account extends Service { - Account(Client client): super(client); - - /// Get Account - /// - /// Get currently logged in user data as JSON object. - /// - Future get() { - final String path = '/account'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Create Account - /// - /// 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](/docs/client/account#createVerification) route - /// to start verifying the user email address. To allow your new user to login - /// to his new account, you need to create a new [account - /// session](/docs/client/account#createSession). - /// - Future create({@required String email, @required String password, String name = ''}) { - final String path = '/account'; - - final Map params = { - 'email': email, - 'password': password, - 'name': name, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.post, path: path, params: params, headers: headers); - } - - /// Delete Account - /// - /// Delete a currently logged in user account. Behind the scene, the user - /// record is not deleted but permanently blocked from any access. This is done - /// to avoid deleted accounts being overtaken by new users with the same email - /// address. Any user-related resources like documents or storage files should - /// be deleted separately. - /// - Future delete() { - final String path = '/account'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.delete, path: path, params: params, headers: headers); - } - - /// Update Account Email - /// - /// Update currently logged in user account email address. After changing user - /// address, user confirmation status is being reset and a new confirmation - /// mail is sent. For security measures, user password is required to complete - /// this request. - /// - Future updateEmail({@required String email, @required String password}) { - final String path = '/account/email'; - - final Map params = { - 'email': email, - 'password': password, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.patch, path: path, params: params, headers: headers); - } - - /// Get Account Logs - /// - /// Get currently logged in user list of latest security activity logs. Each - /// log returns user IP address, location and date and time of log. - /// - Future getLogs() { - final String path = '/account/logs'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Update Account Name - /// - /// Update currently logged in user account name. - /// - Future updateName({@required String name}) { - final String path = '/account/name'; - - final Map params = { - 'name': name, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.patch, path: path, params: params, headers: headers); - } - - /// Update Account Password - /// - /// Update currently logged in user password. For validation, user is required - /// to pass the password twice. - /// - Future updatePassword({@required String password, @required String oldPassword}) { - final String path = '/account/password'; - - final Map params = { - 'password': password, - 'oldPassword': oldPassword, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.patch, path: path, params: params, headers: headers); - } - - /// Get Account Preferences - /// - /// Get currently logged in user preferences as a key-value object. - /// - Future getPrefs() { - final String path = '/account/prefs'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Update Account Preferences - /// - /// Update currently logged in user account preferences. You can pass only the - /// specific settings you wish to update. - /// - Future updatePrefs({@required dynamic prefs}) { - final String path = '/account/prefs'; - - final Map params = { - 'prefs': prefs, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.patch, path: path, params: params, headers: headers); - } - - /// Create Password Recovery - /// - /// 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](/docs/client/account#updateRecovery) - /// endpoint to complete the process. - /// - Future createRecovery({@required String email, @required String url}) { - final String path = '/account/recovery'; - - final Map params = { - 'email': email, - 'url': url, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.post, path: path, params: params, headers: headers); - } - - /// Complete Password Recovery - /// - /// 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](/docs/client/account#createRecovery) endpoint. - /// - /// Please 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. - /// - Future updateRecovery({@required String userId, @required String secret, @required String password, @required String passwordAgain}) { - final String path = '/account/recovery'; - - final Map params = { - 'userId': userId, - 'secret': secret, - 'password': password, - 'passwordAgain': passwordAgain, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.put, path: path, params: params, headers: headers); - } - - /// Get Account Sessions - /// - /// Get currently logged in user list of active sessions across different - /// devices. - /// - Future getSessions() { - final String path = '/account/sessions'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Create Account Session - /// - /// Allow the user to login into his account by providing a valid email and - /// password combination. This route will create a new session for the user. - /// - Future createSession({@required String email, @required String password}) { - final String path = '/account/sessions'; - - final Map params = { - 'email': email, - 'password': password, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.post, path: path, params: params, headers: headers); - } - - /// Delete All Account Sessions - /// - /// Delete all sessions from the user account and remove any sessions cookies - /// from the end client. - /// - Future deleteSessions() { - final String path = '/account/sessions'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.delete, path: path, params: params, headers: headers); - } - - /// Create Account Session with OAuth2 - /// - /// Allow the user to login to his account using the OAuth2 provider of his - /// 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. - /// - Future createOAuth2Session({@required String provider, String success = 'https://appwrite.io/auth/oauth2/success', String failure = 'https://appwrite.io/auth/oauth2/failure', List scopes = const []}) { - final String path = '/account/sessions/oauth2/{provider}'.replaceAll(RegExp('{provider}'), provider); - - final Map params = { - 'success': success, - 'failure': failure, - 'scopes': scopes, - 'project': client.config['project'], - }; - - - final List query = []; - - params.forEach((key, value) { - if (value is List) { - for (var item in value) { - query.add(Uri.encodeComponent(key + '[]') + '=' + Uri.encodeComponent(item)); - } - } - else { - query.add(Uri.encodeComponent(key) + '=' + Uri.encodeComponent(value)); - } - }); - - Uri endpoint = Uri.parse(client.endPoint); - Uri url = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - query: query.join('&') - ); - - if(kIsWeb) { - html.window.location.href = url.toString(); - return null; - }else{ - - return FlutterWebAuth.authenticate( - url: url.toString(), - callbackUrlScheme: "appwrite-callback-" + client.config['project'] - ).then((value) async { - Uri url = Uri.parse(value); - Cookie cookie = new Cookie(url.queryParameters['key'], url.queryParameters['secret']); - cookie.domain = Uri.parse(client.endPoint).host; - cookie.httpOnly = true; - cookie.path = '/'; - List cookies = [cookie]; - await client.init(); - client.cookieJar.saveFromResponse(Uri.parse(client.endPoint), cookies); - }); - } - - } - - /// Delete Account Session - /// - /// Use this endpoint to log out the currently logged in user from all his - /// account sessions across all his different devices. When using the option id - /// argument, only the session unique ID provider will be deleted. - /// - Future deleteSession({@required String sessionId}) { - final String path = '/account/sessions/{sessionId}'.replaceAll(RegExp('{sessionId}'), sessionId); - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.delete, path: path, params: params, headers: headers); - } - - /// Create Email Verification - /// - /// 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](/docs/client/account#updateAccountVerification). - /// - /// Please 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. - /// - /// - Future createVerification({@required String url}) { - final String path = '/account/verification'; - - final Map params = { - 'url': url, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.post, path: path, params: params, headers: headers); - } - - /// Complete Email Verification - /// - /// 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. - /// - Future updateVerification({@required String userId, @required String secret}) { - final String path = '/account/verification'; - - final Map params = { - 'userId': userId, - 'secret': secret, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.put, path: path, params: params, headers: headers); - } -} \ No newline at end of file diff --git a/app/sdks/client-flutter/lib/services/avatars.dart b/app/sdks/client-flutter/lib/services/avatars.dart deleted file mode 100644 index b7fa6393ef..0000000000 --- a/app/sdks/client-flutter/lib/services/avatars.dart +++ /dev/null @@ -1,238 +0,0 @@ - - -import 'package:dio/dio.dart'; -import 'package:meta/meta.dart'; - -import "../client.dart"; -import '../enums.dart'; -import "../service.dart"; - -class Avatars extends Service { - Avatars(Client client): super(client); - - /// Get Browser Icon - /// - /// 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 - /// /account/sessions endpoint. Use width, height and quality arguments to - /// change the output settings. - /// - String getBrowser({@required String code, int width = 100, int height = 100, int quality = 100}) { - final String path = '/avatars/browsers/{code}'.replaceAll(RegExp('{code}'), code); - - final Map params = { - 'width': width, - 'height': height, - 'quality': quality, - 'project': client.config['project'], - }; - - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - Uri endpoint = Uri.parse(client.endPoint); - Uri location = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - queryParameters:params, - ); - - return location.toString(); - } - - /// Get Credit Card Icon - /// - /// Need to display your users with your billing method or their payment - /// methods? 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. - /// - String getCreditCard({@required String code, int width = 100, int height = 100, int quality = 100}) { - final String path = '/avatars/credit-cards/{code}'.replaceAll(RegExp('{code}'), code); - - final Map params = { - 'width': width, - 'height': height, - 'quality': quality, - 'project': client.config['project'], - }; - - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - Uri endpoint = Uri.parse(client.endPoint); - Uri location = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - queryParameters:params, - ); - - return location.toString(); - } - - /// Get Favicon - /// - /// Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote - /// website URL. - /// - String getFavicon({@required String url}) { - final String path = '/avatars/favicon'; - - final Map params = { - 'url': url, - 'project': client.config['project'], - }; - - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - Uri endpoint = Uri.parse(client.endPoint); - Uri location = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - queryParameters:params, - ); - - return location.toString(); - } - - /// Get Country Flag - /// - /// 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. - /// - String getFlag({@required String code, int width = 100, int height = 100, int quality = 100}) { - final String path = '/avatars/flags/{code}'.replaceAll(RegExp('{code}'), code); - - final Map params = { - 'width': width, - 'height': height, - 'quality': quality, - 'project': client.config['project'], - }; - - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - Uri endpoint = Uri.parse(client.endPoint); - Uri location = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - queryParameters:params, - ); - - return location.toString(); - } - - /// Get Image from URL - /// - /// 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. - /// - String getImage({@required String url, int width = 400, int height = 400}) { - final String path = '/avatars/image'; - - final Map params = { - 'url': url, - 'width': width, - 'height': height, - 'project': client.config['project'], - }; - - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - Uri endpoint = Uri.parse(client.endPoint); - Uri location = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - queryParameters:params, - ); - - return location.toString(); - } - - /// Get User Initials - /// - /// 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. - /// - /// You 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. - /// - String getInitials({String name = '', int width = 500, int height = 500, String color = '', String background = ''}) { - final String path = '/avatars/initials'; - - final Map params = { - 'name': name, - 'width': width, - 'height': height, - 'color': color, - 'background': background, - 'project': client.config['project'], - }; - - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - Uri endpoint = Uri.parse(client.endPoint); - Uri location = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - queryParameters:params, - ); - - return location.toString(); - } - - /// Get QR Code - /// - /// 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. - /// - String getQR({@required String text, int size = 400, int margin = 1, bool download = false}) { - final String path = '/avatars/qr'; - - final Map params = { - 'text': text, - 'size': size, - 'margin': margin, - 'download': download, - 'project': client.config['project'], - }; - - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - Uri endpoint = Uri.parse(client.endPoint); - Uri location = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - queryParameters:params, - ); - - return location.toString(); - } -} \ No newline at end of file diff --git a/app/sdks/client-flutter/lib/services/database.dart b/app/sdks/client-flutter/lib/services/database.dart deleted file mode 100644 index 0fec1fb4d6..0000000000 --- a/app/sdks/client-flutter/lib/services/database.dart +++ /dev/null @@ -1,119 +0,0 @@ - - -import 'package:dio/dio.dart'; -import 'package:meta/meta.dart'; - -import "../client.dart"; -import '../enums.dart'; -import "../service.dart"; - -class Database extends Service { - Database(Client client): super(client); - - /// List Documents - /// - /// Get a list of all the user documents. You can use the query params to - /// filter your results. On admin mode, this endpoint will return a list of all - /// of the project documents. [Learn more about different API - /// modes](/docs/admin). - /// - Future listDocuments({@required String collectionId, List filters = const [], int offset = 0, int limit = 50, String orderField = '\$id', OrderType orderType = OrderType.asc, String orderCast = 'string', String search = ''}) { - final String path = '/database/collections/{collectionId}/documents'.replaceAll(RegExp('{collectionId}'), collectionId); - - final Map params = { - 'filters': filters, - 'offset': offset, - 'limit': limit, - 'orderField': orderField, - 'orderType': orderType.name(), - 'orderCast': orderCast, - 'search': search, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Create Document - /// - /// Create a new Document. Before using this route, you should create a new - /// collection resource using either a [server - /// integration](/docs/server/database?sdk=nodejs#createCollection) API or - /// directly from your database console. - /// - Future createDocument({@required String collectionId, @required dynamic data, @required List read, @required List write, String parentDocument = '', String parentProperty = '', String parentPropertyType = 'assign'}) { - final String path = '/database/collections/{collectionId}/documents'.replaceAll(RegExp('{collectionId}'), collectionId); - - final Map params = { - 'data': data, - 'read': read, - 'write': write, - 'parentDocument': parentDocument, - 'parentProperty': parentProperty, - 'parentPropertyType': parentPropertyType, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.post, path: path, params: params, headers: headers); - } - - /// Get Document - /// - /// Get document by its unique ID. This endpoint response returns a JSON object - /// with the document data. - /// - Future getDocument({@required String collectionId, @required String documentId}) { - final String path = '/database/collections/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId); - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Update Document - Future updateDocument({@required String collectionId, @required String documentId, @required dynamic data, @required List read, @required List write}) { - final String path = '/database/collections/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId); - - final Map params = { - 'data': data, - 'read': read, - 'write': write, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.patch, path: path, params: params, headers: headers); - } - - /// Delete Document - /// - /// Delete document by its unique ID. This endpoint deletes only the parent - /// documents, his attributes and relations to other documents. Child documents - /// **will not** be deleted. - /// - Future deleteDocument({@required String collectionId, @required String documentId}) { - final String path = '/database/collections/{collectionId}/documents/{documentId}'.replaceAll(RegExp('{collectionId}'), collectionId).replaceAll(RegExp('{documentId}'), documentId); - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.delete, path: path, params: params, headers: headers); - } -} \ No newline at end of file diff --git a/app/sdks/client-flutter/lib/services/locale.dart b/app/sdks/client-flutter/lib/services/locale.dart deleted file mode 100644 index 095af4792c..0000000000 --- a/app/sdks/client-flutter/lib/services/locale.dart +++ /dev/null @@ -1,143 +0,0 @@ - - -import 'package:dio/dio.dart'; -import 'package:meta/meta.dart'; - -import "../client.dart"; -import '../enums.dart'; -import "../service.dart"; - -class Locale extends Service { - Locale(Client client): super(client); - - /// Get User Locale - /// - /// 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. - /// - /// ([IP Geolocation by DB-IP](https://db-ip.com)) - /// - Future get() { - final String path = '/locale'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// List Continents - /// - /// List of all continents. You can use the locale header to get the data in a - /// supported language. - /// - Future getContinents() { - final String path = '/locale/continents'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// List Countries - /// - /// List of all countries. You can use the locale header to get the data in a - /// supported language. - /// - Future getCountries() { - final String path = '/locale/countries'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// List EU Countries - /// - /// 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. - /// - Future getCountriesEU() { - final String path = '/locale/countries/eu'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// List Countries Phone Codes - /// - /// List of all countries phone codes. You can use the locale header to get the - /// data in a supported language. - /// - Future getCountriesPhones() { - final String path = '/locale/countries/phones'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// List Currencies - /// - /// 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. - /// - Future getCurrencies() { - final String path = '/locale/currencies'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// List Languages - /// - /// List of all languages classified by ISO 639-1 including 2-letter code, name - /// in English, and name in the respective language. - /// - Future getLanguages() { - final String path = '/locale/languages'; - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } -} \ No newline at end of file diff --git a/app/sdks/client-flutter/lib/services/storage.dart b/app/sdks/client-flutter/lib/services/storage.dart deleted file mode 100644 index 51f9345050..0000000000 --- a/app/sdks/client-flutter/lib/services/storage.dart +++ /dev/null @@ -1,203 +0,0 @@ - - -import 'package:dio/dio.dart'; -import 'package:meta/meta.dart'; - -import "../client.dart"; -import '../enums.dart'; -import "../service.dart"; - -class Storage extends Service { - Storage(Client client): super(client); - - /// List Files - /// - /// Get a list of all the user files. You can use the query params to filter - /// your results. On admin mode, this endpoint will return a list of all of the - /// project files. [Learn more about different API modes](/docs/admin). - /// - Future listFiles({String search = '', int limit = 25, int offset = 0, OrderType orderType = OrderType.asc}) { - final String path = '/storage/files'; - - final Map params = { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType.name(), - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Create File - /// - /// Create a new file. The user who creates the file will automatically be - /// assigned to read and write access unless he has passed custom values for - /// read and write arguments. - /// - Future createFile({@required MultipartFile file, @required List read, @required List write}) { - final String path = '/storage/files'; - - final Map params = { - 'file': file, - 'read': read, - 'write': write, - }; - - final Map headers = { - 'content-type': 'multipart/form-data', - }; - - return client.call(HttpMethod.post, path: path, params: params, headers: headers); - } - - /// Get File - /// - /// Get file by its unique ID. This endpoint response returns a JSON object - /// with the file metadata. - /// - Future getFile({@required String fileId}) { - final String path = '/storage/files/{fileId}'.replaceAll(RegExp('{fileId}'), fileId); - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Update File - /// - /// Update file by its unique ID. Only users with write permissions have access - /// to update this resource. - /// - Future updateFile({@required String fileId, @required List read, @required List write}) { - final String path = '/storage/files/{fileId}'.replaceAll(RegExp('{fileId}'), fileId); - - final Map params = { - 'read': read, - 'write': write, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.put, path: path, params: params, headers: headers); - } - - /// Delete File - /// - /// Delete a file by its unique ID. Only users with write permissions have - /// access to delete this resource. - /// - Future deleteFile({@required String fileId}) { - final String path = '/storage/files/{fileId}'.replaceAll(RegExp('{fileId}'), fileId); - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.delete, path: path, params: params, headers: headers); - } - - /// Get File for Download - /// - /// Get 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. - /// - String getFileDownload({@required String fileId}) { - final String path = '/storage/files/{fileId}/download'.replaceAll(RegExp('{fileId}'), fileId); - - final Map params = { - 'project': client.config['project'], - }; - - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - Uri endpoint = Uri.parse(client.endPoint); - Uri location = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - queryParameters:params, - ); - - return location.toString(); - } - - /// Get File Preview - /// - /// 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. - /// - String getFilePreview({@required String fileId, int width = 0, int height = 0, int quality = 100, String background = '', String output = ''}) { - final String path = '/storage/files/{fileId}/preview'.replaceAll(RegExp('{fileId}'), fileId); - - final Map params = { - 'width': width, - 'height': height, - 'quality': quality, - 'background': background, - 'output': output, - 'project': client.config['project'], - }; - - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - Uri endpoint = Uri.parse(client.endPoint); - Uri location = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - queryParameters:params, - ); - - return location.toString(); - } - - /// Get File for View - /// - /// Get file content by its unique ID. This endpoint is similar to the download - /// method but returns with no 'Content-Disposition: attachment' header. - /// - String getFileView({@required String fileId, String as = ''}) { - final String path = '/storage/files/{fileId}/view'.replaceAll(RegExp('{fileId}'), fileId); - - final Map params = { - 'as': as, - 'project': client.config['project'], - }; - - params.keys.forEach((key) {if (params[key] is int || params[key] is double) { - params[key] = params[key].toString(); - }}); - - Uri endpoint = Uri.parse(client.endPoint); - Uri location = new Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - queryParameters:params, - ); - - return location.toString(); - } -} \ No newline at end of file diff --git a/app/sdks/client-flutter/lib/services/teams.dart b/app/sdks/client-flutter/lib/services/teams.dart deleted file mode 100644 index b9205da455..0000000000 --- a/app/sdks/client-flutter/lib/services/teams.dart +++ /dev/null @@ -1,207 +0,0 @@ - - -import 'package:dio/dio.dart'; -import 'package:meta/meta.dart'; - -import "../client.dart"; -import '../enums.dart'; -import "../service.dart"; - -class Teams extends Service { - Teams(Client client): super(client); - - /// List Teams - /// - /// Get a list of all the current user teams. You can use the query params to - /// filter your results. On admin mode, this endpoint will return a list of all - /// of the project teams. [Learn more about different API modes](/docs/admin). - /// - Future list({String search = '', int limit = 25, int offset = 0, OrderType orderType = OrderType.asc}) { - final String path = '/teams'; - - final Map params = { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType.name(), - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Create Team - /// - /// Create a new team. The user who creates the team will automatically be - /// assigned as the owner of the team. The team owner can invite new members, - /// who will be able add new owners and update or delete the team from your - /// project. - /// - Future create({@required String name, List roles = const ["owner"]}) { - final String path = '/teams'; - - final Map params = { - 'name': name, - 'roles': roles, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.post, path: path, params: params, headers: headers); - } - - /// Get Team - /// - /// Get team by its unique ID. All team members have read access for this - /// resource. - /// - Future get({@required String teamId}) { - final String path = '/teams/{teamId}'.replaceAll(RegExp('{teamId}'), teamId); - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Update Team - /// - /// Update team by its unique ID. Only team owners have write access for this - /// resource. - /// - Future update({@required String teamId, @required String name}) { - final String path = '/teams/{teamId}'.replaceAll(RegExp('{teamId}'), teamId); - - final Map params = { - 'name': name, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.put, path: path, params: params, headers: headers); - } - - /// Delete Team - /// - /// Delete team by its unique ID. Only team owners have write access for this - /// resource. - /// - Future delete({@required String teamId}) { - final String path = '/teams/{teamId}'.replaceAll(RegExp('{teamId}'), teamId); - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.delete, path: path, params: params, headers: headers); - } - - /// Get Team Memberships - /// - /// Get team members by the team unique ID. All team members have read access - /// for this list of resources. - /// - Future getMemberships({@required String teamId, String search = '', int limit = 25, int offset = 0, OrderType orderType = OrderType.asc}) { - final String path = '/teams/{teamId}/memberships'.replaceAll(RegExp('{teamId}'), teamId); - - final Map params = { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType.name(), - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.get, path: path, params: params, headers: headers); - } - - /// Create Team Membership - /// - /// Use this endpoint to invite a new member to join your team. An email with a - /// link to join the team will be sent to the new member email address if the - /// member doesn't exist in the project it will be created automatically. - /// - /// Use the 'URL' parameter to redirect the user from the invitation email back - /// to your app. When the user is redirected, use the [Update Team Membership - /// Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the - /// user to accept the invitation to the team. - /// - /// Please note that in order to avoid a [Redirect - /// Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) - /// the only valid redirect URL's are the once from domains you have set when - /// added your platforms in the console interface. - /// - Future createMembership({@required String teamId, @required String email, @required List roles, @required String url, String name = ''}) { - final String path = '/teams/{teamId}/memberships'.replaceAll(RegExp('{teamId}'), teamId); - - final Map params = { - 'email': email, - 'name': name, - 'roles': roles, - 'url': url, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.post, path: path, params: params, headers: headers); - } - - /// Delete Team Membership - /// - /// 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 he didn't accept it. - /// - Future deleteMembership({@required String teamId, @required String inviteId}) { - final String path = '/teams/{teamId}/memberships/{inviteId}'.replaceAll(RegExp('{teamId}'), teamId).replaceAll(RegExp('{inviteId}'), inviteId); - - final Map params = { - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.delete, path: path, params: params, headers: headers); - } - - /// Update Team Membership Status - /// - /// Use this endpoint to allow a user to accept an invitation to join a team - /// after he is being redirected back to your app from the invitation email he - /// was sent. - /// - Future updateMembershipStatus({@required String teamId, @required String inviteId, @required String userId, @required String secret}) { - final String path = '/teams/{teamId}/memberships/{inviteId}/status'.replaceAll(RegExp('{teamId}'), teamId).replaceAll(RegExp('{inviteId}'), inviteId); - - final Map params = { - 'userId': userId, - 'secret': secret, - }; - - final Map headers = { - 'content-type': 'application/json', - }; - - return client.call(HttpMethod.patch, path: path, params: params, headers: headers); - } -} \ No newline at end of file diff --git a/app/sdks/client-flutter/pubspec.yaml b/app/sdks/client-flutter/pubspec.yaml deleted file mode 100644 index cabc271c5e..0000000000 --- a/app/sdks/client-flutter/pubspec.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: appwrite -version: 0.3.0-dev.2 -description: Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API -homepage: https://appwrite.io -repository: https://github.com/appwrite/sdk-for-flutter -issue_tracker: https://github.com/appwrite/sdk-generator/issues -documentation: https://appwrite.io/support -environment: - sdk: '>=2.6.0 <3.0.0' -dependencies: - meta: ^1.1.8 - path_provider: ^1.6.14 - package_info: ^0.4.3 - dio: ^3.0.10 - cookie_jar: ^1.0.1 - dio_cookie_manager: ^1.0.0 - flutter_web_auth: ^0.2.4 - universal_html: ^1.2.3 - flutter: - sdk: flutter - -dev_dependencies: - flutter_test: - sdk: flutter \ No newline at end of file diff --git a/app/sdks/client-swift/LICENSE b/app/sdks/client-swift/LICENSE deleted file mode 100644 index fc7c051a91..0000000000 --- a/app/sdks/client-swift/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/app/sdks/client-swift/Package.swift b/app/sdks/client-swift/Package.swift deleted file mode 100644 index 5bea7f1c50..0000000000 --- a/app/sdks/client-swift/Package.swift +++ /dev/null @@ -1,35 +0,0 @@ -// swift-tools-version:5.1 -// The swift-tools-version declares the minimum version of Swift required to build this package. -// -// Created by Armino -// GitHub: https://github.com/armino-dev/sdk-generator -// - -import PackageDescription - -let package = Package( - name: "Appwrite", - products: [ - // Products define the executables and libraries produced by a package, - // and make them visible to other packages. - .library( - name: "Appwrite", - targets: ["Appwrite"]), - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), - ], - targets: [ - // Targets are the basic building blocks of a package. - // A target can define a module or a test suite. - // Targets can depend on other targets in this package, - // and on products in packages which this package depends on. - .target( - name: "Appwrite", - dependencies: []), - .testTarget( - name: "AppwriteTests", - dependencies: [Appwrite]), - ] -) diff --git a/app/sdks/client-swift/README.md b/app/sdks/client-swift/README.md deleted file mode 100644 index d46757f068..0000000000 --- a/app/sdks/client-swift/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Appwrite Swift SDK - -![License](https://img.shields.io/github/license/appwrite/sdk-for-swift.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.7.0-blue.svg?v=1) - -Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. - Use the Swift SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. - For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) - - - -![Appwrite](https://appwrite.io/images/github.png) - -## Installation - -``` - git clone appwrite/sdk-for-swift - cd sdk-for-swift - swift run -``` - -## License - -Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. diff --git a/app/sdks/client-swift/Sources/Appwrite/Client.swift b/app/sdks/client-swift/Sources/Appwrite/Client.swift deleted file mode 100644 index 8748fbc0f9..0000000000 --- a/app/sdks/client-swift/Sources/Appwrite/Client.swift +++ /dev/null @@ -1,231 +0,0 @@ -// -// Client.swift -// -// Created by Armino -// GitHub: https://github.com/armino-dev/sdk-generator -// - -import Foundation - -open class Client { - - // MARK: Properties - - open var selfSigned = false - - open var endpoint = "https://appwrite.io/v1" - - open var headers: [String: String] = [ - "content-type": "", - "x-sdk-version": "appwrite:swift:" - ] - - - // MARK: Methods - - // default constructor - public init() { - - } - - /// - /// Set Project - /// - /// Your project ID - /// - /// @param String value - /// - /// @return Client - /// - open func setProject(value: String) -> Client { - - self.addHeader(key: "X-Appwrite-Project", value: value) - return self - } - - /// - /// Set Locale - /// - /// @param String value - /// - /// @return Client - /// - open func setLocale(value: String) -> Client { - - self.addHeader(key: "X-Appwrite-Locale", value: value) - return self - } - - - /// - /// @param Bool status - /// @return Client - /// - open func setSelfSigned(status: Bool = true) -> Client { - - self.selfSigned = status - return self - } - - /// - /// @param String endpoint - /// @return Client - /// - open func setEndpoint(endpoint: String) -> Client { - - self.endpoint = endpoint - return self - } - - /// - /// @param String key - /// @param String value - /// - open func addHeader(key: String, value: String) -> Client { - - self.headers[key.lowercased()] = value.lowercased() - - return self - } - - /// - open func httpBuildQuery(params: [String: Any], prefix: String = "") -> String { - var output: String = "" - for (key, value) in params { - let finalKey: String = prefix.isEmpty ? key : (prefix + "[" + key + "]") - if (value is AnyCollection) { - output += self.httpBuildQuery(params: value as! [String : Any], prefix: finalKey) - } else { - output += "\(value)" - } - output += "&" - } - return output - } - - /// - /// Make an API call - /// - /// @param String method - /// @param String path - /// @param Array params - /// @param Array headers - /// @return Array|String - /// @throws Exception - /// - func call(method:String, path:String = "", headers:[String: String] = [:], params:[String: Any] = [:]) -> Any { - - self.headers.merge(headers){(_, new) in new} - let targetURL:URL = URL(string: self.endpoint + path + (( method == HTTPMethod.get.rawValue && !params.isEmpty ) ? "?" + httpBuildQuery(params: params) : ""))! - - var query: String = "" - - var responseStatus: Int = HTTPStatus.unknown.rawValue - var responseType: String = "" - var responseBody: Any = "" - - switch (self.headers["content-type"]) { - case "application/json": - do { - let json = try JSONSerialization.data(withJSONObject:params, options: []) - query = String( data: json, encoding: String.Encoding.utf8)! - } catch { - print("Failed to parse json: \(error.localizedDescription)") - } - break - default: - query = self.httpBuildQuery(params: params) - break - } - - var request = URLRequest(url: targetURL) - let session = URLSession.shared - - for (key, value) in self.headers { - request.setValue(value, forHTTPHeaderField: key) - } - - request.httpMethod = method - if (method.uppercased() == "POST") { - request.httpBody = query.data(using: .utf8) - } - - let semaphore = DispatchSemaphore(value: 0) - - session.dataTask(with: request) { data, response, error in - if (error != nil) { - print(error!) - return - } - do { - let httpResponse = response as! HTTPURLResponse - responseStatus = httpResponse.statusCode - - if (responseStatus == HTTPStatus.internalServerError.rawValue) { - print(responseStatus) - return - } - - responseType = httpResponse.mimeType ?? "" - - if (responseType == "application/json") { - let json = try JSONSerialization.jsonObject(with: data!, options: []) - responseBody = json - } else { - responseBody = String(data: data!, encoding: String.Encoding.utf8)! - } - } catch { - print(error) - } - - semaphore.signal() - }.resume() - - _ = semaphore.wait(wallTimeout: .distantFuture) - - return responseBody - } - -} - -extension Client { - - public enum HTTPStatus: Int { - case unknown = -1 - - case ok = 200 - case created = 201 - case accepted = 202 - - case movedPermanently = 301 - case found = 302 - - case badRequest = 400 - case notAuthorized = 401 - case paymentRequired = 402 - case forbidden = 403 - case notFound = 404 - case methodNotAllowed = 405 - case notAcceptable = 406 - - case internalServerError = 500 - case notImplemented = 501 - } - - public enum HTTPMethod: String { - case get - - case post - case put - case patch - - case delete - - case head - case options - case connect - case trace - } - - -} diff --git a/app/sdks/client-swift/Sources/Appwrite/Service.swift b/app/sdks/client-swift/Sources/Appwrite/Service.swift deleted file mode 100644 index b11a067a5d..0000000000 --- a/app/sdks/client-swift/Sources/Appwrite/Service.swift +++ /dev/null @@ -1,16 +0,0 @@ -// -// Service.swift -// -// Created by Armino -// GitHub: https://github.com/armino-dev/sdk-generator -// - -open class Service { - - open var client: Client; - - public init(client: Client) - { - self.client = client - } -} diff --git a/app/sdks/client-swift/Sources/Appwrite/Services/Account.swift b/app/sdks/client-swift/Sources/Appwrite/Services/Account.swift deleted file mode 100644 index 0ffb74df52..0000000000 --- a/app/sdks/client-swift/Sources/Appwrite/Services/Account.swift +++ /dev/null @@ -1,491 +0,0 @@ - - -class Account: Service -{ - /** - * Get Account - * - * Get currently logged in user data as JSON object. - * - * @throws Exception - * @return array - */ - - func get() -> Array { - let path: String = "/account" - - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Create Account - * - * 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](/docs/client/account#createVerification) route - * to start verifying the user email address. To allow your new user to login - * to his new account, you need to create a new [account - * session](/docs/client/account#createSession). - * - * @param String _email - * @param String _password - * @param String _name - * @throws Exception - * @return array - */ - - func create(_email: String, _password: String, _name: String = "") -> Array { - let path: String = "/account" - - - var params: [String: Any] = [:] - - params["email"] = _email - params["password"] = _password - params["name"] = _name - - return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Delete Account - * - * Delete a currently logged in user account. Behind the scene, the user - * record is not deleted but permanently blocked from any access. This is done - * to avoid deleted accounts being overtaken by new users with the same email - * address. Any user-related resources like documents or storage files should - * be deleted separately. - * - * @throws Exception - * @return array - */ - - func delete() -> Array { - let path: String = "/account" - - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Update Account Email - * - * Update currently logged in user account email address. After changing user - * address, user confirmation status is being reset and a new confirmation - * mail is sent. For security measures, user password is required to complete - * this request. - * - * @param String _email - * @param String _password - * @throws Exception - * @return array - */ - - func updateEmail(_email: String, _password: String) -> Array { - let path: String = "/account/email" - - - var params: [String: Any] = [:] - - params["email"] = _email - params["password"] = _password - - return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Get Account Logs - * - * Get currently logged in user list of latest security activity logs. Each - * log returns user IP address, location and date and time of log. - * - * @throws Exception - * @return array - */ - - func getLogs() -> Array { - let path: String = "/account/logs" - - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Update Account Name - * - * Update currently logged in user account name. - * - * @param String _name - * @throws Exception - * @return array - */ - - func updateName(_name: String) -> Array { - let path: String = "/account/name" - - - var params: [String: Any] = [:] - - params["name"] = _name - - return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Update Account Password - * - * Update currently logged in user password. For validation, user is required - * to pass the password twice. - * - * @param String _password - * @param String _oldPassword - * @throws Exception - * @return array - */ - - func updatePassword(_password: String, _oldPassword: String) -> Array { - let path: String = "/account/password" - - - var params: [String: Any] = [:] - - params["password"] = _password - params["oldPassword"] = _oldPassword - - return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Get Account Preferences - * - * Get currently logged in user preferences as a key-value object. - * - * @throws Exception - * @return array - */ - - func getPrefs() -> Array { - let path: String = "/account/prefs" - - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Update Account Preferences - * - * Update currently logged in user account preferences. You can pass only the - * specific settings you wish to update. - * - * @param object _prefs - * @throws Exception - * @return array - */ - - func updatePrefs(_prefs: object) -> Array { - let path: String = "/account/prefs" - - - var params: [String: Any] = [:] - - params["prefs"] = _prefs - - return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Create Password Recovery - * - * 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](/docs/client/account#updateRecovery) - * endpoint to complete the process. - * - * @param String _email - * @param String _url - * @throws Exception - * @return array - */ - - func createRecovery(_email: String, _url: String) -> Array { - let path: String = "/account/recovery" - - - var params: [String: Any] = [:] - - params["email"] = _email - params["url"] = _url - - return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Complete Password Recovery - * - * 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](/docs/client/account#createRecovery) endpoint. - * - * Please 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. - * - * @param String _userId - * @param String _secret - * @param String _password - * @param String _passwordAgain - * @throws Exception - * @return array - */ - - func updateRecovery(_userId: String, _secret: String, _password: String, _passwordAgain: String) -> Array { - let path: String = "/account/recovery" - - - var params: [String: Any] = [:] - - params["userId"] = _userId - params["secret"] = _secret - params["password"] = _password - params["passwordAgain"] = _passwordAgain - - return [self.client.call(method: Client.HTTPMethod.put.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Get Account Sessions - * - * Get currently logged in user list of active sessions across different - * devices. - * - * @throws Exception - * @return array - */ - - func getSessions() -> Array { - let path: String = "/account/sessions" - - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Create Account Session - * - * Allow the user to login into his account by providing a valid email and - * password combination. This route will create a new session for the user. - * - * @param String _email - * @param String _password - * @throws Exception - * @return array - */ - - func createSession(_email: String, _password: String) -> Array { - let path: String = "/account/sessions" - - - var params: [String: Any] = [:] - - params["email"] = _email - params["password"] = _password - - return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Delete All Account Sessions - * - * Delete all sessions from the user account and remove any sessions cookies - * from the end client. - * - * @throws Exception - * @return array - */ - - func deleteSessions() -> Array { - let path: String = "/account/sessions" - - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Create Account Session with OAuth2 - * - * Allow the user to login to his account using the OAuth2 provider of his - * 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. - * - * @param String _provider - * @param String _success - * @param String _failure - * @param Array _scopes - * @throws Exception - * @return array - */ - - func createOAuth2Session(_provider: String, _success: String = "https://appwrite.io/auth/oauth2/success", _failure: String = "https://appwrite.io/auth/oauth2/failure", _scopes: Array = []) -> Array { - var path: String = "/account/sessions/oauth2/{provider}" - - path = path.replacingOccurrences( - of: "{provider}", - with: _provider - ) - - var params: [String: Any] = [:] - - params["success"] = _success - params["failure"] = _failure - params["scopes"] = _scopes - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Delete Account Session - * - * Use this endpoint to log out the currently logged in user from all his - * account sessions across all his different devices. When using the option id - * argument, only the session unique ID provider will be deleted. - * - * @param String _sessionId - * @throws Exception - * @return array - */ - - func deleteSession(_sessionId: String) -> Array { - var path: String = "/account/sessions/{sessionId}" - - path = path.replacingOccurrences( - of: "{sessionId}", - with: _sessionId - ) - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Create Email Verification - * - * 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](/docs/client/account#updateAccountVerification). - * - * Please 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. - * - * - * @param String _url - * @throws Exception - * @return array - */ - - func createVerification(_url: String) -> Array { - let path: String = "/account/verification" - - - var params: [String: Any] = [:] - - params["url"] = _url - - return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Complete Email Verification - * - * 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. - * - * @param String _userId - * @param String _secret - * @throws Exception - * @return array - */ - - func updateVerification(_userId: String, _secret: String) -> Array { - let path: String = "/account/verification" - - - var params: [String: Any] = [:] - - params["userId"] = _userId - params["secret"] = _secret - - return [self.client.call(method: Client.HTTPMethod.put.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - -} diff --git a/app/sdks/client-swift/Sources/Appwrite/Services/Avatars.swift b/app/sdks/client-swift/Sources/Appwrite/Services/Avatars.swift deleted file mode 100644 index 867841bafd..0000000000 --- a/app/sdks/client-swift/Sources/Appwrite/Services/Avatars.swift +++ /dev/null @@ -1,233 +0,0 @@ - - -class Avatars: Service -{ - /** - * Get Browser Icon - * - * 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 - * /account/sessions endpoint. Use width, height and quality arguments to - * change the output settings. - * - * @param String _code - * @param Int _width - * @param Int _height - * @param Int _quality - * @throws Exception - * @return array - */ - - func getBrowser(_code: String, _width: Int = 100, _height: Int = 100, _quality: Int = 100) -> Array { - var path: String = "/avatars/browsers/{code}" - - path = path.replacingOccurrences( - of: "{code}", - with: _code - ) - - var params: [String: Any] = [:] - - params["width"] = _width - params["height"] = _height - params["quality"] = _quality - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Get Credit Card Icon - * - * Need to display your users with your billing method or their payment - * methods? 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. - * - * @param String _code - * @param Int _width - * @param Int _height - * @param Int _quality - * @throws Exception - * @return array - */ - - func getCreditCard(_code: String, _width: Int = 100, _height: Int = 100, _quality: Int = 100) -> Array { - var path: String = "/avatars/credit-cards/{code}" - - path = path.replacingOccurrences( - of: "{code}", - with: _code - ) - - var params: [String: Any] = [:] - - params["width"] = _width - params["height"] = _height - params["quality"] = _quality - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Get Favicon - * - * Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote - * website URL. - * - * @param String _url - * @throws Exception - * @return array - */ - - func getFavicon(_url: String) -> Array { - let path: String = "/avatars/favicon" - - - var params: [String: Any] = [:] - - params["url"] = _url - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Get Country Flag - * - * 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. - * - * @param String _code - * @param Int _width - * @param Int _height - * @param Int _quality - * @throws Exception - * @return array - */ - - func getFlag(_code: String, _width: Int = 100, _height: Int = 100, _quality: Int = 100) -> Array { - var path: String = "/avatars/flags/{code}" - - path = path.replacingOccurrences( - of: "{code}", - with: _code - ) - - var params: [String: Any] = [:] - - params["width"] = _width - params["height"] = _height - params["quality"] = _quality - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Get Image from URL - * - * 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. - * - * @param String _url - * @param Int _width - * @param Int _height - * @throws Exception - * @return array - */ - - func getImage(_url: String, _width: Int = 400, _height: Int = 400) -> Array { - let path: String = "/avatars/image" - - - var params: [String: Any] = [:] - - params["url"] = _url - params["width"] = _width - params["height"] = _height - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Get User Initials - * - * 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. - * - * You 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. - * - * @param String _name - * @param Int _width - * @param Int _height - * @param String _color - * @param String _background - * @throws Exception - * @return array - */ - - func getInitials(_name: String = "", _width: Int = 500, _height: Int = 500, _color: String = "", _background: String = "") -> Array { - let path: String = "/avatars/initials" - - - var params: [String: Any] = [:] - - params["name"] = _name - params["width"] = _width - params["height"] = _height - params["color"] = _color - params["background"] = _background - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Get QR Code - * - * 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. - * - * @param String _text - * @param Int _size - * @param Int _margin - * @param Bool _download - * @throws Exception - * @return array - */ - - func getQR(_text: String, _size: Int = 400, _margin: Int = 1, _download: Bool = false) -> Array { - let path: String = "/avatars/qr" - - - var params: [String: Any] = [:] - - params["text"] = _text - params["size"] = _size - params["margin"] = _margin - params["download"] = _download - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - -} diff --git a/app/sdks/client-swift/Sources/Appwrite/Services/Database.swift b/app/sdks/client-swift/Sources/Appwrite/Services/Database.swift deleted file mode 100644 index 8436985582..0000000000 --- a/app/sdks/client-swift/Sources/Appwrite/Services/Database.swift +++ /dev/null @@ -1,183 +0,0 @@ - - -class Database: Service -{ - /** - * List Documents - * - * Get a list of all the user documents. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project documents. [Learn more about different API - * modes](/docs/admin). - * - * @param String _collectionId - * @param Array _filters - * @param Int _limit - * @param Int _offset - * @param String _orderField - * @param String _orderType - * @param String _orderCast - * @param String _search - * @throws Exception - * @return array - */ - - func listDocuments(_collectionId: String, _filters: Array = [], _limit: Int = 25, _offset: Int = 0, _orderField: String = "$id", _orderType: String = "ASC", _orderCast: String = "string", _search: String = "") -> Array { - var path: String = "/database/collections/{collectionId}/documents" - - path = path.replacingOccurrences( - of: "{collectionId}", - with: _collectionId - ) - - var params: [String: Any] = [:] - - params["filters"] = _filters - params["limit"] = _limit - params["offset"] = _offset - params["orderField"] = _orderField - params["orderType"] = _orderType - params["orderCast"] = _orderCast - params["search"] = _search - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Create Document - * - * Create a new Document. Before using this route, you should create a new - * collection resource using either a [server - * integration](/docs/server/database?sdk=nodejs#createCollection) API or - * directly from your database console. - * - * @param String _collectionId - * @param object _data - * @param Array _read - * @param Array _write - * @throws Exception - * @return array - */ - - func createDocument(_collectionId: String, _data: object, _read: Array, _write: Array) -> Array { - var path: String = "/database/collections/{collectionId}/documents" - - path = path.replacingOccurrences( - of: "{collectionId}", - with: _collectionId - ) - - var params: [String: Any] = [:] - - params["data"] = _data - params["read"] = _read - params["write"] = _write - - return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Get Document - * - * Get document by its unique ID. This endpoint response returns a JSON object - * with the document data. - * - * @param String _collectionId - * @param String _documentId - * @throws Exception - * @return array - */ - - func getDocument(_collectionId: String, _documentId: String) -> Array { - var path: String = "/database/collections/{collectionId}/documents/{documentId}" - - path = path.replacingOccurrences( - of: "{collectionId}", - with: _collectionId - ) - path = path.replacingOccurrences( - of: "{documentId}", - with: _documentId - ) - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Update Document - * - * @param String _collectionId - * @param String _documentId - * @param object _data - * @param Array _read - * @param Array _write - * @throws Exception - * @return array - */ - - func updateDocument(_collectionId: String, _documentId: String, _data: object, _read: Array, _write: Array) -> Array { - var path: String = "/database/collections/{collectionId}/documents/{documentId}" - - path = path.replacingOccurrences( - of: "{collectionId}", - with: _collectionId - ) - path = path.replacingOccurrences( - of: "{documentId}", - with: _documentId - ) - - var params: [String: Any] = [:] - - params["data"] = _data - params["read"] = _read - params["write"] = _write - - return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Delete Document - * - * Delete document by its unique ID. This endpoint deletes only the parent - * documents, his attributes and relations to other documents. Child documents - * **will not** be deleted. - * - * @param String _collectionId - * @param String _documentId - * @throws Exception - * @return array - */ - - func deleteDocument(_collectionId: String, _documentId: String) -> Array { - var path: String = "/database/collections/{collectionId}/documents/{documentId}" - - path = path.replacingOccurrences( - of: "{collectionId}", - with: _collectionId - ) - path = path.replacingOccurrences( - of: "{documentId}", - with: _documentId - ) - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - -} diff --git a/app/sdks/client-swift/Sources/Appwrite/Services/Locale.swift b/app/sdks/client-swift/Sources/Appwrite/Services/Locale.swift deleted file mode 100644 index ef21554cbc..0000000000 --- a/app/sdks/client-swift/Sources/Appwrite/Services/Locale.swift +++ /dev/null @@ -1,164 +0,0 @@ - - -class Locale: Service -{ - /** - * Get User Locale - * - * 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. - * - * ([IP Geolocation by DB-IP](https://db-ip.com)) - * - * @throws Exception - * @return array - */ - - func get() -> Array { - let path: String = "/locale" - - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * List Continents - * - * List of all continents. You can use the locale header to get the data in a - * supported language. - * - * @throws Exception - * @return array - */ - - func getContinents() -> Array { - let path: String = "/locale/continents" - - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * List Countries - * - * List of all countries. You can use the locale header to get the data in a - * supported language. - * - * @throws Exception - * @return array - */ - - func getCountries() -> Array { - let path: String = "/locale/countries" - - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * List EU Countries - * - * 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. - * - * @throws Exception - * @return array - */ - - func getCountriesEU() -> Array { - let path: String = "/locale/countries/eu" - - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * List Countries Phone Codes - * - * List of all countries phone codes. You can use the locale header to get the - * data in a supported language. - * - * @throws Exception - * @return array - */ - - func getCountriesPhones() -> Array { - let path: String = "/locale/countries/phones" - - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * List Currencies - * - * 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. - * - * @throws Exception - * @return array - */ - - func getCurrencies() -> Array { - let path: String = "/locale/currencies" - - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * List Languages - * - * List of all languages classified by ISO 639-1 including 2-letter code, name - * in English, and name in the respective language. - * - * @throws Exception - * @return array - */ - - func getLanguages() -> Array { - let path: String = "/locale/languages" - - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - -} diff --git a/app/sdks/client-swift/Sources/Appwrite/Services/Storage.swift b/app/sdks/client-swift/Sources/Appwrite/Services/Storage.swift deleted file mode 100644 index b6e98145f7..0000000000 --- a/app/sdks/client-swift/Sources/Appwrite/Services/Storage.swift +++ /dev/null @@ -1,246 +0,0 @@ - - -class Storage: Service -{ - /** - * List Files - * - * Get a list of all the user files. You can use the query params to filter - * your results. On admin mode, this endpoint will return a list of all of the - * project files. [Learn more about different API modes](/docs/admin). - * - * @param String _search - * @param Int _limit - * @param Int _offset - * @param String _orderType - * @throws Exception - * @return array - */ - - func listFiles(_search: String = "", _limit: Int = 25, _offset: Int = 0, _orderType: String = "ASC") -> Array { - let path: String = "/storage/files" - - - var params: [String: Any] = [:] - - params["search"] = _search - params["limit"] = _limit - params["offset"] = _offset - params["orderType"] = _orderType - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Create File - * - * Create a new file. The user who creates the file will automatically be - * assigned to read and write access unless he has passed custom values for - * read and write arguments. - * - * @param Array _file - * @param Array _read - * @param Array _write - * @throws Exception - * @return array - */ - - func createFile(_file: Array, _read: Array, _write: Array) -> Array { - let path: String = "/storage/files" - - - var params: [String: Any] = [:] - - params["file"] = _file - params["read"] = _read - params["write"] = _write - - return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [ - "content-type": "multipart/form-data", - ], params: params)]; - } - - /** - * Get File - * - * Get file by its unique ID. This endpoint response returns a JSON object - * with the file metadata. - * - * @param String _fileId - * @throws Exception - * @return array - */ - - func getFile(_fileId: String) -> Array { - var path: String = "/storage/files/{fileId}" - - path = path.replacingOccurrences( - of: "{fileId}", - with: _fileId - ) - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Update File - * - * Update file by its unique ID. Only users with write permissions have access - * to update this resource. - * - * @param String _fileId - * @param Array _read - * @param Array _write - * @throws Exception - * @return array - */ - - func updateFile(_fileId: String, _read: Array, _write: Array) -> Array { - var path: String = "/storage/files/{fileId}" - - path = path.replacingOccurrences( - of: "{fileId}", - with: _fileId - ) - - var params: [String: Any] = [:] - - params["read"] = _read - params["write"] = _write - - return [self.client.call(method: Client.HTTPMethod.put.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Delete File - * - * Delete a file by its unique ID. Only users with write permissions have - * access to delete this resource. - * - * @param String _fileId - * @throws Exception - * @return array - */ - - func deleteFile(_fileId: String) -> Array { - var path: String = "/storage/files/{fileId}" - - path = path.replacingOccurrences( - of: "{fileId}", - with: _fileId - ) - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Get File for Download - * - * Get 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. - * - * @param String _fileId - * @throws Exception - * @return array - */ - - func getFileDownload(_fileId: String) -> Array { - var path: String = "/storage/files/{fileId}/download" - - path = path.replacingOccurrences( - of: "{fileId}", - with: _fileId - ) - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Get File Preview - * - * 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. - * - * @param String _fileId - * @param Int _width - * @param Int _height - * @param Int _quality - * @param String _background - * @param String _output - * @throws Exception - * @return array - */ - - func getFilePreview(_fileId: String, _width: Int = 0, _height: Int = 0, _quality: Int = 100, _background: String = "", _output: String = "") -> Array { - var path: String = "/storage/files/{fileId}/preview" - - path = path.replacingOccurrences( - of: "{fileId}", - with: _fileId - ) - - var params: [String: Any] = [:] - - params["width"] = _width - params["height"] = _height - params["quality"] = _quality - params["background"] = _background - params["output"] = _output - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Get File for View - * - * Get file content by its unique ID. This endpoint is similar to the download - * method but returns with no 'Content-Disposition: attachment' header. - * - * @param String _fileId - * @param String _as - * @throws Exception - * @return array - */ - - func getFileView(_fileId: String, _as: String = "") -> Array { - var path: String = "/storage/files/{fileId}/view" - - path = path.replacingOccurrences( - of: "{fileId}", - with: _fileId - ) - - var params: [String: Any] = [:] - - params["as"] = _as - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - -} diff --git a/app/sdks/client-swift/Sources/Appwrite/Services/Teams.swift b/app/sdks/client-swift/Sources/Appwrite/Services/Teams.swift deleted file mode 100644 index 50bee60273..0000000000 --- a/app/sdks/client-swift/Sources/Appwrite/Services/Teams.swift +++ /dev/null @@ -1,298 +0,0 @@ - - -class Teams: Service -{ - /** - * List Teams - * - * Get a list of all the current user teams. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project teams. [Learn more about different API modes](/docs/admin). - * - * @param String _search - * @param Int _limit - * @param Int _offset - * @param String _orderType - * @throws Exception - * @return array - */ - - func list(_search: String = "", _limit: Int = 25, _offset: Int = 0, _orderType: String = "ASC") -> Array { - let path: String = "/teams" - - - var params: [String: Any] = [:] - - params["search"] = _search - params["limit"] = _limit - params["offset"] = _offset - params["orderType"] = _orderType - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Create Team - * - * Create a new team. The user who creates the team will automatically be - * assigned as the owner of the team. The team owner can invite new members, - * who will be able add new owners and update or delete the team from your - * project. - * - * @param String _name - * @param Array _roles - * @throws Exception - * @return array - */ - - func create(_name: String, _roles: Array = ["owner"]) -> Array { - let path: String = "/teams" - - - var params: [String: Any] = [:] - - params["name"] = _name - params["roles"] = _roles - - return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Get Team - * - * Get team by its unique ID. All team members have read access for this - * resource. - * - * @param String _teamId - * @throws Exception - * @return array - */ - - func get(_teamId: String) -> Array { - var path: String = "/teams/{teamId}" - - path = path.replacingOccurrences( - of: "{teamId}", - with: _teamId - ) - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Update Team - * - * Update team by its unique ID. Only team owners have write access for this - * resource. - * - * @param String _teamId - * @param String _name - * @throws Exception - * @return array - */ - - func update(_teamId: String, _name: String) -> Array { - var path: String = "/teams/{teamId}" - - path = path.replacingOccurrences( - of: "{teamId}", - with: _teamId - ) - - var params: [String: Any] = [:] - - params["name"] = _name - - return [self.client.call(method: Client.HTTPMethod.put.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Delete Team - * - * Delete team by its unique ID. Only team owners have write access for this - * resource. - * - * @param String _teamId - * @throws Exception - * @return array - */ - - func delete(_teamId: String) -> Array { - var path: String = "/teams/{teamId}" - - path = path.replacingOccurrences( - of: "{teamId}", - with: _teamId - ) - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Get Team Memberships - * - * Get team members by the team unique ID. All team members have read access - * for this list of resources. - * - * @param String _teamId - * @param String _search - * @param Int _limit - * @param Int _offset - * @param String _orderType - * @throws Exception - * @return array - */ - - func getMemberships(_teamId: String, _search: String = "", _limit: Int = 25, _offset: Int = 0, _orderType: String = "ASC") -> Array { - var path: String = "/teams/{teamId}/memberships" - - path = path.replacingOccurrences( - of: "{teamId}", - with: _teamId - ) - - var params: [String: Any] = [:] - - params["search"] = _search - params["limit"] = _limit - params["offset"] = _offset - params["orderType"] = _orderType - - return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Create Team Membership - * - * Use this endpoint to invite a new member to join your team. An email with a - * link to join the team will be sent to the new member email address if the - * member doesn't exist in the project it will be created automatically. - * - * Use the 'URL' parameter to redirect the user from the invitation email back - * to your app. When the user is redirected, use the [Update Team Membership - * Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the - * user to accept the invitation to the team. - * - * Please note that in order to avoid a [Redirect - * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) - * the only valid redirect URL's are the once from domains you have set when - * added your platforms in the console interface. - * - * @param String _teamId - * @param String _email - * @param Array _roles - * @param String _url - * @param String _name - * @throws Exception - * @return array - */ - - func createMembership(_teamId: String, _email: String, _roles: Array, _url: String, _name: String = "") -> Array { - var path: String = "/teams/{teamId}/memberships" - - path = path.replacingOccurrences( - of: "{teamId}", - with: _teamId - ) - - var params: [String: Any] = [:] - - params["email"] = _email - params["name"] = _name - params["roles"] = _roles - params["url"] = _url - - return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Delete Team Membership - * - * 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 he didn't accept it. - * - * @param String _teamId - * @param String _inviteId - * @throws Exception - * @return array - */ - - func deleteMembership(_teamId: String, _inviteId: String) -> Array { - var path: String = "/teams/{teamId}/memberships/{inviteId}" - - path = path.replacingOccurrences( - of: "{teamId}", - with: _teamId - ) - path = path.replacingOccurrences( - of: "{inviteId}", - with: _inviteId - ) - - let params: [String: Any] = [:] - - - return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - - /** - * Update Team Membership Status - * - * Use this endpoint to allow a user to accept an invitation to join a team - * after he is being redirected back to your app from the invitation email he - * was sent. - * - * @param String _teamId - * @param String _inviteId - * @param String _userId - * @param String _secret - * @throws Exception - * @return array - */ - - func updateMembershipStatus(_teamId: String, _inviteId: String, _userId: String, _secret: String) -> Array { - var path: String = "/teams/{teamId}/memberships/{inviteId}/status" - - path = path.replacingOccurrences( - of: "{teamId}", - with: _teamId - ) - path = path.replacingOccurrences( - of: "{inviteId}", - with: _inviteId - ) - - var params: [String: Any] = [:] - - params["userId"] = _userId - params["secret"] = _secret - - return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [ - "content-type": "application/json", - ], params: params)]; - } - -} diff --git a/app/sdks/client-swift/docs/account.md b/app/sdks/client-swift/docs/account.md deleted file mode 100644 index 48bc91d213..0000000000 --- a/app/sdks/client-swift/docs/account.md +++ /dev/null @@ -1,240 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - -# Account Service - -## Get Account - -```http request -GET https://appwrite.io/v1/account -``` - -** Get currently logged in user data as JSON object. ** - -## Create Account - -```http request -POST https://appwrite.io/v1/account -``` - -** 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](/docs/client/account#createVerification) route to start verifying the user email address. To allow your new user to login to his new account, you need to create a new [account session](/docs/client/account#createSession). ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| email | string | User email. | | -| password | string | User password. Must be between 6 to 32 chars. | | -| name | string | User name. | | - -## Delete Account - -```http request -DELETE https://appwrite.io/v1/account -``` - -** Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately. ** - -## Update Account Email - -```http request -PATCH https://appwrite.io/v1/account/email -``` - -** Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| email | string | User email. | | -| password | string | User password. Must be between 6 to 32 chars. | | - -## Get Account Logs - -```http request -GET https://appwrite.io/v1/account/logs -``` - -** Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log. ** - -## Update Account Name - -```http request -PATCH https://appwrite.io/v1/account/name -``` - -** Update currently logged in user account name. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| name | string | User name. | | - -## Update Account Password - -```http request -PATCH https://appwrite.io/v1/account/password -``` - -** Update currently logged in user password. For validation, user is required to pass the password twice. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| password | string | New user password. Must be between 6 to 32 chars. | | -| oldPassword | string | Old user password. Must be between 6 to 32 chars. | | - -## Get Account Preferences - -```http request -GET https://appwrite.io/v1/account/prefs -``` - -** Get currently logged in user preferences as a key-value object. ** - -## Update Account Preferences - -```http request -PATCH https://appwrite.io/v1/account/prefs -``` - -** Update currently logged in user account preferences. You can pass only the specific settings you wish to update. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| prefs | object | Prefs key-value JSON object. | | - -## Create Password Recovery - -```http request -POST https://appwrite.io/v1/account/recovery -``` - -** 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](/docs/client/account#updateRecovery) endpoint to complete the process. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| email | string | User email. | | -| url | string | 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. | | - -## Complete Password Recovery - -```http request -PUT https://appwrite.io/v1/account/recovery -``` - -** 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](/docs/client/account#createRecovery) endpoint. - -Please 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| userId | string | User account UID address. | | -| secret | string | Valid reset token. | | -| password | string | New password. Must be between 6 to 32 chars. | | -| passwordAgain | string | New password again. Must be between 6 to 32 chars. | | - -## Get Account Sessions - -```http request -GET https://appwrite.io/v1/account/sessions -``` - -** Get currently logged in user list of active sessions across different devices. ** - -## Create Account Session - -```http request -POST https://appwrite.io/v1/account/sessions -``` - -** Allow the user to login into his account by providing a valid email and password combination. This route will create a new session for the user. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| email | string | User email. | | -| password | string | User password. Must be between 6 to 32 chars. | | - -## Delete All Account Sessions - -```http request -DELETE https://appwrite.io/v1/account/sessions -``` - -** Delete all sessions from the user account and remove any sessions cookies from the end client. ** - -## Create Account Session with OAuth2 - -```http request -GET https://appwrite.io/v1/account/sessions/oauth2/{provider} -``` - -** Allow the user to login to his account using the OAuth2 provider of his 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| provider | string | **Required** OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, twitch, vk, yahoo, yandex. | | -| success | string | URL to redirect back to your app after a successful login attempt. 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. | https://appwrite.io/auth/oauth2/success | -| failure | string | URL to redirect back to your app after a failed login attempt. 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. | https://appwrite.io/auth/oauth2/failure | -| scopes | array | A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. | [] | - -## Delete Account Session - -```http request -DELETE https://appwrite.io/v1/account/sessions/{sessionId} -``` - -** Use this endpoint to log out the currently logged in user from all his account sessions across all his different devices. When using the option id argument, only the session unique ID provider will be deleted. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| sessionId | string | **Required** Session unique ID. Use the string 'current' to delete the current device session. | | - -## Create Email Verification - -```http request -POST https://appwrite.io/v1/account/verification -``` - -** 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](/docs/client/account#updateAccountVerification). - -Please 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. - ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| url | string | 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. | | - -## Complete Email Verification - -```http request -PUT https://appwrite.io/v1/account/verification -``` - -** 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| userId | string | User unique ID. | | -| secret | string | Valid verification token. | | - diff --git a/app/sdks/client-swift/docs/avatars.md b/app/sdks/client-swift/docs/avatars.md deleted file mode 100644 index 1e17a8e14a..0000000000 --- a/app/sdks/client-swift/docs/avatars.md +++ /dev/null @@ -1,124 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - -# Avatars Service - -## Get Browser Icon - -```http request -GET https://appwrite.io/v1/avatars/browsers/{code} -``` - -** 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 /account/sessions endpoint. Use width, height and quality arguments to change the output settings. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| code | string | **Required** Browser Code. | | -| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 | -| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 | -| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 | - -## Get Credit Card Icon - -```http request -GET https://appwrite.io/v1/avatars/credit-cards/{code} -``` - -** Need to display your users with your billing method or their payment methods? 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| code | string | **Required** Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa. | | -| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 | -| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 | -| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 | - -## Get Favicon - -```http request -GET https://appwrite.io/v1/avatars/favicon -``` - -** Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| url | string | **Required** Website URL which you want to fetch the favicon from. | | - -## Get Country Flag - -```http request -GET https://appwrite.io/v1/avatars/flags/{code} -``` - -** 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| code | string | **Required** Country Code. ISO Alpha-2 country code format. | | -| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 | -| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 | -| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 | - -## Get Image from URL - -```http request -GET https://appwrite.io/v1/avatars/image -``` - -** 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| url | string | **Required** Image URL which you want to crop. | | -| width | integer | Resize preview image width, Pass an integer between 0 to 2000. | 400 | -| height | integer | Resize preview image height, Pass an integer between 0 to 2000. | 400 | - -## Get User Initials - -```http request -GET https://appwrite.io/v1/avatars/initials -``` - -** 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. - -You 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| name | string | Full Name. When empty, current user name or email will be used. | | -| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 500 | -| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 500 | -| color | string | Changes text color. By default a random color will be picked and stay will persistent to the given name. | | -| background | string | Changes background color. By default a random color will be picked and stay will persistent to the given name. | | - -## Get QR Code - -```http request -GET https://appwrite.io/v1/avatars/qr -``` - -** 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| text | string | **Required** Plain text to be converted to QR code image. | | -| size | integer | QR code size. Pass an integer between 0 to 1000. Defaults to 400. | 400 | -| margin | integer | Margin from edge. Pass an integer between 0 to 10. Defaults to 1. | 1 | -| download | boolean | 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. | | - diff --git a/app/sdks/client-swift/docs/database.md b/app/sdks/client-swift/docs/database.md deleted file mode 100644 index d734cb3c1c..0000000000 --- a/app/sdks/client-swift/docs/database.md +++ /dev/null @@ -1,90 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - -# Database Service - -## List Documents - -```http request -GET https://appwrite.io/v1/database/collections/{collectionId}/documents -``` - -** Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](/docs/admin). ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). | | -| filters | array | Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'. | [] | -| limit | integer | Maximum number of documents to return in response. Use this value to manage pagination. | 25 | -| offset | integer | Offset value. Use this value to manage pagination. | 0 | -| orderField | string | Document field that results will be sorted by. | $id | -| orderType | string | Order direction. Possible values are DESC for descending order, or ASC for ascending order. | ASC | -| orderCast | string | Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string. | string | -| search | string | Search query. Enter any free text search. The database will try to find a match against all document attributes and children. | | - -## Create Document - -```http request -POST https://appwrite.io/v1/database/collections/{collectionId}/documents -``` - -** Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](/docs/server/database?sdk=nodejs#createCollection) API or directly from your database console. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). | | -| data | object | Document data as JSON object. | | -| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | -| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | - -## Get Document - -```http request -GET https://appwrite.io/v1/database/collections/{collectionId}/documents/{documentId} -``` - -** Get document by its unique ID. This endpoint response returns a JSON object with the document data. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). | | -| documentId | string | **Required** Document unique ID. | | - -## Update Document - -```http request -PATCH https://appwrite.io/v1/database/collections/{collectionId}/documents/{documentId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). | | -| documentId | string | **Required** Document unique ID. | | -| data | object | Document data as JSON object. | | -| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | -| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | - -## Delete Document - -```http request -DELETE https://appwrite.io/v1/database/collections/{collectionId}/documents/{documentId} -``` - -** Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). | | -| documentId | string | **Required** Document unique ID. | | - diff --git a/app/sdks/client-swift/docs/examples/account/create-o-auth2session.md b/app/sdks/client-swift/docs/examples/account/create-o-auth2session.md deleted file mode 100644 index 0b67257890..0000000000 --- a/app/sdks/client-swift/docs/examples/account/create-o-auth2session.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var account: Account = Account(client: client); - -var result = account.createOAuth2Session(_provider: "amazon"); diff --git a/app/sdks/client-swift/docs/examples/account/create-recovery.md b/app/sdks/client-swift/docs/examples/account/create-recovery.md deleted file mode 100644 index 04fdcae541..0000000000 --- a/app/sdks/client-swift/docs/examples/account/create-recovery.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var account: Account = Account(client: client); - -var result = account.createRecovery(_email: "email@example.com", _url: "https://example.com"); diff --git a/app/sdks/client-swift/docs/examples/account/create-session.md b/app/sdks/client-swift/docs/examples/account/create-session.md deleted file mode 100644 index 477b20199c..0000000000 --- a/app/sdks/client-swift/docs/examples/account/create-session.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var account: Account = Account(client: client); - -var result = account.createSession(_email: "email@example.com", _password: "password"); diff --git a/app/sdks/client-swift/docs/examples/account/create-verification.md b/app/sdks/client-swift/docs/examples/account/create-verification.md deleted file mode 100644 index b0f8d6444e..0000000000 --- a/app/sdks/client-swift/docs/examples/account/create-verification.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var account: Account = Account(client: client); - -var result = account.createVerification(_url: "https://example.com"); diff --git a/app/sdks/client-swift/docs/examples/account/create.md b/app/sdks/client-swift/docs/examples/account/create.md deleted file mode 100644 index 176b192c5e..0000000000 --- a/app/sdks/client-swift/docs/examples/account/create.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var account: Account = Account(client: client); - -var result = account.create(_email: "email@example.com", _password: "password"); diff --git a/app/sdks/client-swift/docs/examples/account/delete-session.md b/app/sdks/client-swift/docs/examples/account/delete-session.md deleted file mode 100644 index 6f2373dc79..0000000000 --- a/app/sdks/client-swift/docs/examples/account/delete-session.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var account: Account = Account(client: client); - -var result = account.deleteSession(_sessionId: "[SESSION_ID]"); diff --git a/app/sdks/client-swift/docs/examples/account/delete-sessions.md b/app/sdks/client-swift/docs/examples/account/delete-sessions.md deleted file mode 100644 index 6df71814c6..0000000000 --- a/app/sdks/client-swift/docs/examples/account/delete-sessions.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var account: Account = Account(client: client); - -var result = account.deleteSessions(); diff --git a/app/sdks/client-swift/docs/examples/account/delete.md b/app/sdks/client-swift/docs/examples/account/delete.md deleted file mode 100644 index f4123b0197..0000000000 --- a/app/sdks/client-swift/docs/examples/account/delete.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var account: Account = Account(client: client); - -var result = account.delete(); diff --git a/app/sdks/client-swift/docs/examples/account/get-logs.md b/app/sdks/client-swift/docs/examples/account/get-logs.md deleted file mode 100644 index 8d3d965723..0000000000 --- a/app/sdks/client-swift/docs/examples/account/get-logs.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var account: Account = Account(client: client); - -var result = account.getLogs(); diff --git a/app/sdks/client-swift/docs/examples/account/get-prefs.md b/app/sdks/client-swift/docs/examples/account/get-prefs.md deleted file mode 100644 index e9746ab34b..0000000000 --- a/app/sdks/client-swift/docs/examples/account/get-prefs.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var account: Account = Account(client: client); - -var result = account.getPrefs(); diff --git a/app/sdks/client-swift/docs/examples/account/get-sessions.md b/app/sdks/client-swift/docs/examples/account/get-sessions.md deleted file mode 100644 index 988e91c8e5..0000000000 --- a/app/sdks/client-swift/docs/examples/account/get-sessions.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var account: Account = Account(client: client); - -var result = account.getSessions(); diff --git a/app/sdks/client-swift/docs/examples/account/get.md b/app/sdks/client-swift/docs/examples/account/get.md deleted file mode 100644 index b84096bdb8..0000000000 --- a/app/sdks/client-swift/docs/examples/account/get.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var account: Account = Account(client: client); - -var result = account.get(); diff --git a/app/sdks/client-swift/docs/examples/account/update-email.md b/app/sdks/client-swift/docs/examples/account/update-email.md deleted file mode 100644 index cec700b330..0000000000 --- a/app/sdks/client-swift/docs/examples/account/update-email.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var account: Account = Account(client: client); - -var result = account.updateEmail(_email: "email@example.com", _password: "password"); diff --git a/app/sdks/client-swift/docs/examples/account/update-name.md b/app/sdks/client-swift/docs/examples/account/update-name.md deleted file mode 100644 index dbc6f7d2b8..0000000000 --- a/app/sdks/client-swift/docs/examples/account/update-name.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var account: Account = Account(client: client); - -var result = account.updateName(_name: "[NAME]"); diff --git a/app/sdks/client-swift/docs/examples/account/update-password.md b/app/sdks/client-swift/docs/examples/account/update-password.md deleted file mode 100644 index 1346102a32..0000000000 --- a/app/sdks/client-swift/docs/examples/account/update-password.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var account: Account = Account(client: client); - -var result = account.updatePassword(_password: "password", _oldPassword: "password"); diff --git a/app/sdks/client-swift/docs/examples/account/update-prefs.md b/app/sdks/client-swift/docs/examples/account/update-prefs.md deleted file mode 100644 index fea1a8d6ff..0000000000 --- a/app/sdks/client-swift/docs/examples/account/update-prefs.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var account: Account = Account(client: client); - -var result = account.updatePrefs(_prefs: ); diff --git a/app/sdks/client-swift/docs/examples/account/update-recovery.md b/app/sdks/client-swift/docs/examples/account/update-recovery.md deleted file mode 100644 index 6009d62e2c..0000000000 --- a/app/sdks/client-swift/docs/examples/account/update-recovery.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var account: Account = Account(client: client); - -var result = account.updateRecovery(_userId: "[USER_ID]", _secret: "[SECRET]", _password: "password", _passwordAgain: "password"); diff --git a/app/sdks/client-swift/docs/examples/account/update-verification.md b/app/sdks/client-swift/docs/examples/account/update-verification.md deleted file mode 100644 index 376a87a9c3..0000000000 --- a/app/sdks/client-swift/docs/examples/account/update-verification.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var account: Account = Account(client: client); - -var result = account.updateVerification(_userId: "[USER_ID]", _secret: "[SECRET]"); diff --git a/app/sdks/client-swift/docs/examples/avatars/get-browser.md b/app/sdks/client-swift/docs/examples/avatars/get-browser.md deleted file mode 100644 index 874ef96d31..0000000000 --- a/app/sdks/client-swift/docs/examples/avatars/get-browser.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var avatars: Avatars = Avatars(client: client); - -var result = avatars.getBrowser(_code: "aa"); diff --git a/app/sdks/client-swift/docs/examples/avatars/get-credit-card.md b/app/sdks/client-swift/docs/examples/avatars/get-credit-card.md deleted file mode 100644 index 797431f3dc..0000000000 --- a/app/sdks/client-swift/docs/examples/avatars/get-credit-card.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var avatars: Avatars = Avatars(client: client); - -var result = avatars.getCreditCard(_code: "amex"); diff --git a/app/sdks/client-swift/docs/examples/avatars/get-favicon.md b/app/sdks/client-swift/docs/examples/avatars/get-favicon.md deleted file mode 100644 index 5623468481..0000000000 --- a/app/sdks/client-swift/docs/examples/avatars/get-favicon.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var avatars: Avatars = Avatars(client: client); - -var result = avatars.getFavicon(_url: "https://example.com"); diff --git a/app/sdks/client-swift/docs/examples/avatars/get-flag.md b/app/sdks/client-swift/docs/examples/avatars/get-flag.md deleted file mode 100644 index fba93ae4d4..0000000000 --- a/app/sdks/client-swift/docs/examples/avatars/get-flag.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var avatars: Avatars = Avatars(client: client); - -var result = avatars.getFlag(_code: "af"); diff --git a/app/sdks/client-swift/docs/examples/avatars/get-image.md b/app/sdks/client-swift/docs/examples/avatars/get-image.md deleted file mode 100644 index 4ebe561b3b..0000000000 --- a/app/sdks/client-swift/docs/examples/avatars/get-image.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var avatars: Avatars = Avatars(client: client); - -var result = avatars.getImage(_url: "https://example.com"); diff --git a/app/sdks/client-swift/docs/examples/avatars/get-initials.md b/app/sdks/client-swift/docs/examples/avatars/get-initials.md deleted file mode 100644 index d317cfc5a8..0000000000 --- a/app/sdks/client-swift/docs/examples/avatars/get-initials.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var avatars: Avatars = Avatars(client: client); - -var result = avatars.getInitials(); diff --git a/app/sdks/client-swift/docs/examples/avatars/get-q-r.md b/app/sdks/client-swift/docs/examples/avatars/get-q-r.md deleted file mode 100644 index 737acfc258..0000000000 --- a/app/sdks/client-swift/docs/examples/avatars/get-q-r.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var avatars: Avatars = Avatars(client: client); - -var result = avatars.getQR(_text: "[TEXT]"); diff --git a/app/sdks/client-swift/docs/examples/database/create-document.md b/app/sdks/client-swift/docs/examples/database/create-document.md deleted file mode 100644 index ebd59adc47..0000000000 --- a/app/sdks/client-swift/docs/examples/database/create-document.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var database: Database = Database(client: client); - -var result = database.createDocument(_collectionId: "[COLLECTION_ID]", _data: , _read: [], _write: []); diff --git a/app/sdks/client-swift/docs/examples/database/delete-document.md b/app/sdks/client-swift/docs/examples/database/delete-document.md deleted file mode 100644 index faec2ceee9..0000000000 --- a/app/sdks/client-swift/docs/examples/database/delete-document.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var database: Database = Database(client: client); - -var result = database.deleteDocument(_collectionId: "[COLLECTION_ID]", _documentId: "[DOCUMENT_ID]"); diff --git a/app/sdks/client-swift/docs/examples/database/get-document.md b/app/sdks/client-swift/docs/examples/database/get-document.md deleted file mode 100644 index 0f3a05bfa5..0000000000 --- a/app/sdks/client-swift/docs/examples/database/get-document.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var database: Database = Database(client: client); - -var result = database.getDocument(_collectionId: "[COLLECTION_ID]", _documentId: "[DOCUMENT_ID]"); diff --git a/app/sdks/client-swift/docs/examples/database/list-documents.md b/app/sdks/client-swift/docs/examples/database/list-documents.md deleted file mode 100644 index 2c9f4a2efa..0000000000 --- a/app/sdks/client-swift/docs/examples/database/list-documents.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var database: Database = Database(client: client); - -var result = database.listDocuments(_collectionId: "[COLLECTION_ID]"); diff --git a/app/sdks/client-swift/docs/examples/database/update-document.md b/app/sdks/client-swift/docs/examples/database/update-document.md deleted file mode 100644 index bddaf61111..0000000000 --- a/app/sdks/client-swift/docs/examples/database/update-document.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var database: Database = Database(client: client); - -var result = database.updateDocument(_collectionId: "[COLLECTION_ID]", _documentId: "[DOCUMENT_ID]", _data: , _read: [], _write: []); diff --git a/app/sdks/client-swift/docs/examples/locale/get-continents.md b/app/sdks/client-swift/docs/examples/locale/get-continents.md deleted file mode 100644 index 3f57d5eb0d..0000000000 --- a/app/sdks/client-swift/docs/examples/locale/get-continents.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var locale: Locale = Locale(client: client); - -var result = locale.getContinents(); diff --git a/app/sdks/client-swift/docs/examples/locale/get-countries-e-u.md b/app/sdks/client-swift/docs/examples/locale/get-countries-e-u.md deleted file mode 100644 index 9f2a26213c..0000000000 --- a/app/sdks/client-swift/docs/examples/locale/get-countries-e-u.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var locale: Locale = Locale(client: client); - -var result = locale.getCountriesEU(); diff --git a/app/sdks/client-swift/docs/examples/locale/get-countries-phones.md b/app/sdks/client-swift/docs/examples/locale/get-countries-phones.md deleted file mode 100644 index 2cc9c4a9a0..0000000000 --- a/app/sdks/client-swift/docs/examples/locale/get-countries-phones.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var locale: Locale = Locale(client: client); - -var result = locale.getCountriesPhones(); diff --git a/app/sdks/client-swift/docs/examples/locale/get-countries.md b/app/sdks/client-swift/docs/examples/locale/get-countries.md deleted file mode 100644 index df52194af1..0000000000 --- a/app/sdks/client-swift/docs/examples/locale/get-countries.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var locale: Locale = Locale(client: client); - -var result = locale.getCountries(); diff --git a/app/sdks/client-swift/docs/examples/locale/get-currencies.md b/app/sdks/client-swift/docs/examples/locale/get-currencies.md deleted file mode 100644 index cf5f403eba..0000000000 --- a/app/sdks/client-swift/docs/examples/locale/get-currencies.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var locale: Locale = Locale(client: client); - -var result = locale.getCurrencies(); diff --git a/app/sdks/client-swift/docs/examples/locale/get-languages.md b/app/sdks/client-swift/docs/examples/locale/get-languages.md deleted file mode 100644 index e8296dd7ca..0000000000 --- a/app/sdks/client-swift/docs/examples/locale/get-languages.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var locale: Locale = Locale(client: client); - -var result = locale.getLanguages(); diff --git a/app/sdks/client-swift/docs/examples/locale/get.md b/app/sdks/client-swift/docs/examples/locale/get.md deleted file mode 100644 index 5685e89440..0000000000 --- a/app/sdks/client-swift/docs/examples/locale/get.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var locale: Locale = Locale(client: client); - -var result = locale.get(); diff --git a/app/sdks/client-swift/docs/examples/storage/create-file.md b/app/sdks/client-swift/docs/examples/storage/create-file.md deleted file mode 100644 index b4e15a4ec1..0000000000 --- a/app/sdks/client-swift/docs/examples/storage/create-file.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var storage: Storage = Storage(client: client); - -var result = storage.createFile(_file: nil, _read: [], _write: []); diff --git a/app/sdks/client-swift/docs/examples/storage/delete-file.md b/app/sdks/client-swift/docs/examples/storage/delete-file.md deleted file mode 100644 index 83152d9194..0000000000 --- a/app/sdks/client-swift/docs/examples/storage/delete-file.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var storage: Storage = Storage(client: client); - -var result = storage.deleteFile(_fileId: "[FILE_ID]"); diff --git a/app/sdks/client-swift/docs/examples/storage/get-file-download.md b/app/sdks/client-swift/docs/examples/storage/get-file-download.md deleted file mode 100644 index 023f1a2243..0000000000 --- a/app/sdks/client-swift/docs/examples/storage/get-file-download.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var storage: Storage = Storage(client: client); - -var result = storage.getFileDownload(_fileId: "[FILE_ID]"); diff --git a/app/sdks/client-swift/docs/examples/storage/get-file-preview.md b/app/sdks/client-swift/docs/examples/storage/get-file-preview.md deleted file mode 100644 index faaacd8e8c..0000000000 --- a/app/sdks/client-swift/docs/examples/storage/get-file-preview.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var storage: Storage = Storage(client: client); - -var result = storage.getFilePreview(_fileId: "[FILE_ID]"); diff --git a/app/sdks/client-swift/docs/examples/storage/get-file-view.md b/app/sdks/client-swift/docs/examples/storage/get-file-view.md deleted file mode 100644 index d480377b06..0000000000 --- a/app/sdks/client-swift/docs/examples/storage/get-file-view.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var storage: Storage = Storage(client: client); - -var result = storage.getFileView(_fileId: "[FILE_ID]"); diff --git a/app/sdks/client-swift/docs/examples/storage/get-file.md b/app/sdks/client-swift/docs/examples/storage/get-file.md deleted file mode 100644 index 15bf5f7241..0000000000 --- a/app/sdks/client-swift/docs/examples/storage/get-file.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var storage: Storage = Storage(client: client); - -var result = storage.getFile(_fileId: "[FILE_ID]"); diff --git a/app/sdks/client-swift/docs/examples/storage/list-files.md b/app/sdks/client-swift/docs/examples/storage/list-files.md deleted file mode 100644 index bfce4293e5..0000000000 --- a/app/sdks/client-swift/docs/examples/storage/list-files.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var storage: Storage = Storage(client: client); - -var result = storage.listFiles(); diff --git a/app/sdks/client-swift/docs/examples/storage/update-file.md b/app/sdks/client-swift/docs/examples/storage/update-file.md deleted file mode 100644 index 6a14e47773..0000000000 --- a/app/sdks/client-swift/docs/examples/storage/update-file.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var storage: Storage = Storage(client: client); - -var result = storage.updateFile(_fileId: "[FILE_ID]", _read: [], _write: []); diff --git a/app/sdks/client-swift/docs/examples/teams/create-membership.md b/app/sdks/client-swift/docs/examples/teams/create-membership.md deleted file mode 100644 index 4af13ae6ee..0000000000 --- a/app/sdks/client-swift/docs/examples/teams/create-membership.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var teams: Teams = Teams(client: client); - -var result = teams.createMembership(_teamId: "[TEAM_ID]", _email: "email@example.com", _roles: [], _url: "https://example.com"); diff --git a/app/sdks/client-swift/docs/examples/teams/create.md b/app/sdks/client-swift/docs/examples/teams/create.md deleted file mode 100644 index a5cf829019..0000000000 --- a/app/sdks/client-swift/docs/examples/teams/create.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var teams: Teams = Teams(client: client); - -var result = teams.create(_name: "[NAME]"); diff --git a/app/sdks/client-swift/docs/examples/teams/delete-membership.md b/app/sdks/client-swift/docs/examples/teams/delete-membership.md deleted file mode 100644 index 19bf8b2f7d..0000000000 --- a/app/sdks/client-swift/docs/examples/teams/delete-membership.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var teams: Teams = Teams(client: client); - -var result = teams.deleteMembership(_teamId: "[TEAM_ID]", _inviteId: "[INVITE_ID]"); diff --git a/app/sdks/client-swift/docs/examples/teams/delete.md b/app/sdks/client-swift/docs/examples/teams/delete.md deleted file mode 100644 index 50cc25892b..0000000000 --- a/app/sdks/client-swift/docs/examples/teams/delete.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var teams: Teams = Teams(client: client); - -var result = teams.delete(_teamId: "[TEAM_ID]"); diff --git a/app/sdks/client-swift/docs/examples/teams/get-memberships.md b/app/sdks/client-swift/docs/examples/teams/get-memberships.md deleted file mode 100644 index 089ea8f717..0000000000 --- a/app/sdks/client-swift/docs/examples/teams/get-memberships.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var teams: Teams = Teams(client: client); - -var result = teams.getMemberships(_teamId: "[TEAM_ID]"); diff --git a/app/sdks/client-swift/docs/examples/teams/get.md b/app/sdks/client-swift/docs/examples/teams/get.md deleted file mode 100644 index 25bf212a45..0000000000 --- a/app/sdks/client-swift/docs/examples/teams/get.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var teams: Teams = Teams(client: client); - -var result = teams.get(_teamId: "[TEAM_ID]"); diff --git a/app/sdks/client-swift/docs/examples/teams/list.md b/app/sdks/client-swift/docs/examples/teams/list.md deleted file mode 100644 index 8333d1fe43..0000000000 --- a/app/sdks/client-swift/docs/examples/teams/list.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var teams: Teams = Teams(client: client); - -var result = teams.list(); diff --git a/app/sdks/client-swift/docs/examples/teams/update-membership-status.md b/app/sdks/client-swift/docs/examples/teams/update-membership-status.md deleted file mode 100644 index ae72e4c799..0000000000 --- a/app/sdks/client-swift/docs/examples/teams/update-membership-status.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var teams: Teams = Teams(client: client); - -var result = teams.updateMembershipStatus(_teamId: "[TEAM_ID]", _inviteId: "[INVITE_ID]", _userId: "[USER_ID]", _secret: "[SECRET]"); diff --git a/app/sdks/client-swift/docs/examples/teams/update.md b/app/sdks/client-swift/docs/examples/teams/update.md deleted file mode 100644 index fafd98b881..0000000000 --- a/app/sdks/client-swift/docs/examples/teams/update.md +++ /dev/null @@ -1,14 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - - -var client: Client = Client() - -client - .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint - .setProject(value: "5df5acd0d48c2") // Your project ID - -var teams: Teams = Teams(client: client); - -var result = teams.update(_teamId: "[TEAM_ID]", _name: "[NAME]"); diff --git a/app/sdks/client-swift/docs/locale.md b/app/sdks/client-swift/docs/locale.md deleted file mode 100644 index efe5a690e2..0000000000 --- a/app/sdks/client-swift/docs/locale.md +++ /dev/null @@ -1,64 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - -# Locale Service - -## Get User Locale - -```http request -GET https://appwrite.io/v1/locale -``` - -** 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. - -([IP Geolocation by DB-IP](https://db-ip.com)) ** - -## List Continents - -```http request -GET https://appwrite.io/v1/locale/continents -``` - -** List of all continents. You can use the locale header to get the data in a supported language. ** - -## List Countries - -```http request -GET https://appwrite.io/v1/locale/countries -``` - -** List of all countries. You can use the locale header to get the data in a supported language. ** - -## List EU Countries - -```http request -GET https://appwrite.io/v1/locale/countries/eu -``` - -** 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. ** - -## List Countries Phone Codes - -```http request -GET https://appwrite.io/v1/locale/countries/phones -``` - -** List of all countries phone codes. You can use the locale header to get the data in a supported language. ** - -## List Currencies - -```http request -GET https://appwrite.io/v1/locale/currencies -``` - -** 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. ** - -## List Languages - -```http request -GET https://appwrite.io/v1/locale/languages -``` - -** List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language. ** - diff --git a/app/sdks/client-swift/docs/storage.md b/app/sdks/client-swift/docs/storage.md deleted file mode 100644 index f902ebd2e9..0000000000 --- a/app/sdks/client-swift/docs/storage.md +++ /dev/null @@ -1,131 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - -# Storage Service - -## List Files - -```http request -GET https://appwrite.io/v1/storage/files -``` - -** Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](/docs/admin). ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| search | string | Search term to filter your list results. | | -| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 | -| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 | -| orderType | string | Order result by ASC or DESC order. | ASC | - -## Create File - -```http request -POST https://appwrite.io/v1/storage/files -``` - -** Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| file | file | Binary file. | | -| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | -| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | - -## Get File - -```http request -GET https://appwrite.io/v1/storage/files/{fileId} -``` - -** Get file by its unique ID. This endpoint response returns a JSON object with the file metadata. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| fileId | string | **Required** File unique ID. | | - -## Update File - -```http request -PUT https://appwrite.io/v1/storage/files/{fileId} -``` - -** Update file by its unique ID. Only users with write permissions have access to update this resource. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| fileId | string | **Required** File unique ID. | | -| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | -| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | - -## Delete File - -```http request -DELETE https://appwrite.io/v1/storage/files/{fileId} -``` - -** Delete a file by its unique ID. Only users with write permissions have access to delete this resource. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| fileId | string | **Required** File unique ID. | | - -## Get File for Download - -```http request -GET https://appwrite.io/v1/storage/files/{fileId}/download -``` - -** Get 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| fileId | string | **Required** File unique ID. | | - -## Get File Preview - -```http request -GET https://appwrite.io/v1/storage/files/{fileId}/preview -``` - -** 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| fileId | string | **Required** File unique ID | | -| width | integer | Resize preview image width, Pass an integer between 0 to 4000. | 0 | -| height | integer | Resize preview image height, Pass an integer between 0 to 4000. | 0 | -| quality | integer | Preview image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 | -| background | string | Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix. | | -| output | string | Output format type (jpeg, jpg, png, gif and webp). | | - -## Get File for View - -```http request -GET https://appwrite.io/v1/storage/files/{fileId}/view -``` - -** Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| fileId | string | **Required** File unique ID. | | -| as | string | Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk. | | - diff --git a/app/sdks/client-swift/docs/teams.md b/app/sdks/client-swift/docs/teams.md deleted file mode 100644 index 7f8b4238a7..0000000000 --- a/app/sdks/client-swift/docs/teams.md +++ /dev/null @@ -1,153 +0,0 @@ -/// Swift Appwrite SDK -/// Produced by Appwrite SDK Generator -/// - -# Teams Service - -## List Teams - -```http request -GET https://appwrite.io/v1/teams -``` - -** Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](/docs/admin). ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| search | string | Search term to filter your list results. | | -| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 | -| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 | -| orderType | string | Order result by ASC or DESC order. | ASC | - -## Create Team - -```http request -POST https://appwrite.io/v1/teams -``` - -** Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| name | string | Team name. | | -| roles | array | 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](/docs/permissions). | ["owner"] | - -## Get Team - -```http request -GET https://appwrite.io/v1/teams/{teamId} -``` - -** Get team by its unique ID. All team members have read access for this resource. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| teamId | string | **Required** Team unique ID. | | - -## Update Team - -```http request -PUT https://appwrite.io/v1/teams/{teamId} -``` - -** Update team by its unique ID. Only team owners have write access for this resource. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| teamId | string | **Required** Team unique ID. | | -| name | string | Team name. | | - -## Delete Team - -```http request -DELETE https://appwrite.io/v1/teams/{teamId} -``` - -** Delete team by its unique ID. Only team owners have write access for this resource. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| teamId | string | **Required** Team unique ID. | | - -## Get Team Memberships - -```http request -GET https://appwrite.io/v1/teams/{teamId}/memberships -``` - -** Get team members by the team unique ID. All team members have read access for this list of resources. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| teamId | string | **Required** Team unique ID. | | -| search | string | Search term to filter your list results. | | -| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 | -| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 | -| orderType | string | Order result by ASC or DESC order. | ASC | - -## Create Team Membership - -```http request -POST https://appwrite.io/v1/teams/{teamId}/memberships -``` - -** Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically. - -Use the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. - -Please note that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| teamId | string | **Required** Team unique ID. | | -| email | string | New team member email. | | -| name | string | New team member name. | | -| roles | array | 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](/docs/permissions). | | -| url | string | URL to redirect the user back to your app from the invitation 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. | | - -## Delete Team Membership - -```http request -DELETE https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId} -``` - -** 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 he didn't accept it. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| teamId | string | **Required** Team unique ID. | | -| inviteId | string | **Required** Invite unique ID. | | - -## Update Team Membership Status - -```http request -PATCH https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}/status -``` - -** Use this endpoint to allow a user to accept an invitation to join a team after he is being redirected back to your app from the invitation email he was sent. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| teamId | string | **Required** Team unique ID. | | -| inviteId | string | **Required** Invite unique ID. | | -| userId | string | User unique ID. | | -| secret | string | Secret key. | | - diff --git a/app/sdks/client-web/CHANGELOG.md b/app/sdks/client-web/CHANGELOG.md deleted file mode 100644 index fa4d35e687..0000000000 --- a/app/sdks/client-web/CHANGELOG.md +++ /dev/null @@ -1 +0,0 @@ -# Change Log \ No newline at end of file diff --git a/app/sdks/client-web/LICENSE b/app/sdks/client-web/LICENSE deleted file mode 100644 index fc7c051a91..0000000000 --- a/app/sdks/client-web/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/app/sdks/client-web/README.md b/app/sdks/client-web/README.md deleted file mode 100644 index 41e939b017..0000000000 --- a/app/sdks/client-web/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# Appwrite Web SDK - -![License](https://img.shields.io/github/license/appwrite/sdk-for-js.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.7.0-blue.svg?v=1) - -Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. - Use the Web SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. - For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) - -![Appwrite](https://appwrite.io/images/github.png) - -## Installation - -### NPM - -To install via [NPM](https://www.npmjs.com/): - -```bash -npm install appwrite --save -``` - -If you're using a bundler (like [Browserify](http://browserify.org/) or [webpack](https://webpack.js.org/)), you can import the Appwrite module when you need it: - -```js -import * as Appwrite from "appwrite"; -``` - -### CDN - -To install with a CDN (content delivery network) add the following scripts to the bottom of your tag, but before you use any Appwrite services: - -```html - -``` - - - -## Contribution - -This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request. - -## License - -Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. \ No newline at end of file diff --git a/app/sdks/client-web/package.json b/app/sdks/client-web/package.json deleted file mode 100644 index 26dd06fb94..0000000000 --- a/app/sdks/client-web/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "appwrite", - "homepage": "https://appwrite.io/support", - "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", - "version": "1.1.0", - "license": "BSD-3-Clause", - "main": "src/sdk.js", - "types": "types/index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/appwrite/sdk-for-js" - }, - "devDependencies": { - "typescript": "^3.6.4" - }, - "dependencies": {} -} \ No newline at end of file diff --git a/app/sdks/client-web/src/sdk.js b/app/sdks/client-web/src/sdk.js deleted file mode 100644 index 90c9b8021b..0000000000 --- a/app/sdks/client-web/src/sdk.js +++ /dev/null @@ -1,2386 +0,0 @@ -(function (window) { - - 'use strict'; - - window.Appwrite = function () { - - let config = { - endpoint: 'https://appwrite.io/v1', - project: '', - locale: '', - }; - - /** - * @param {string} endpoint - * @returns {this} - */ - let setEndpoint = function(endpoint) { - config.endpoint = endpoint; - - return this; - }; - - /** - * Set Project - * - * Your project ID - * - * @param value string - * - * @return this - */ - let setProject = function (value) - { - http.addGlobalHeader('X-Appwrite-Project', value); - - config.project = value; - - return this; - }; - - /** - * Set Locale - * - * @param value string - * - * @return this - */ - let setLocale = function (value) - { - http.addGlobalHeader('X-Appwrite-Locale', value); - - config.locale = value; - - return this; - }; - - let http = function(document) { - let globalParams = [], - globalHeaders = []; - - let addParam = function (url, param, value) { - let a = document.createElement('a'), regex = /(?:\?|&|&)+([^=]+)(?:=([^&]*))*/g; - let match, str = []; - a.href = url; - param = encodeURIComponent(param); - - while (match = regex.exec(a.search)) if (param !== match[1]) str.push(match[1] + (match[2] ? "=" + match[2] : "")); - - str.push(param + (value ? "=" + encodeURIComponent(value) : "")); - - a.search = str.join("&"); - - return a.href; - }; - - /** - * @param {Object} params - * @returns {string} - */ - let buildQuery = function(params) { - let str = []; - - for (let p in params) { - if(Array.isArray(params[p])) { - for (let index = 0; index < params[p].length; index++) { - let param = params[p][index]; - str.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(params[p])); - } - } - - return str.join("&"); - }; - - let addGlobalHeader = function(key, value) { - globalHeaders[key] = {key: key.toLowerCase(), value: value.toLowerCase()}; - }; - - let addGlobalParam = function(key, value) { - globalParams.push({key: key, value: value}); - }; - - addGlobalHeader('x-sdk-version', 'appwrite:javascript:1.1.0'); - addGlobalHeader('content-type', ''); - - /** - * @param {string} method - * @param {string} path string - * @param {Object} headers - * @param {Object} params - * @param {function} progress - * @returns {Promise} - */ - let call = function (method, path, headers = {}, params = {}, progress = null) { - let i; - - path = config.endpoint + path; - - if (-1 === ['GET', 'POST', 'PUT', 'DELETE', 'TRACE', 'HEAD', 'OPTIONS', 'CONNECT', 'PATCH'].indexOf(method)) { - throw new Error('var method must contain a valid HTTP method name'); - } - - if (typeof path !== 'string') { - throw new Error('var path must be of type string'); - } - - if (typeof headers !== 'object') { - throw new Error('var headers must be of type object'); - } - - for (i = 0; i < globalParams.length; i++) { // Add global params to URL - path = addParam(path, globalParams[i].key, globalParams[i].value); - } - - if(window.localStorage && window.localStorage.getItem('cookieFallback')) { - headers['X-Fallback-Cookies'] = window.localStorage.getItem('cookieFallback'); - } - - for (let key in globalHeaders) { // Add Global Headers - if (globalHeaders.hasOwnProperty(key)) { - if (!headers[globalHeaders[key].key]) { - headers[globalHeaders[key].key] = globalHeaders[key].value; - } - } - } - - if(method === 'GET') { - for (let param in params) { - if (param.hasOwnProperty(key)) { - path = addParam(path, key + (Array.isArray(param) ? '[]' : ''), params[key]); - } - } - } - - switch (headers['content-type']) { // Parse request by content type - case 'application/json': - params = JSON.stringify(params); - break; - - case 'multipart/form-data': - let formData = new FormData(); - - Object.keys(params).forEach(function(key) { - let param = params[key]; - formData.append(key + (Array.isArray(param) ? '[]' : ''), param); - }); - - params = formData; - break; - } - - return new Promise(function (resolve, reject) { - - let request = new XMLHttpRequest(), key; - - request.withCredentials = true; - request.open(method, path, true); - - for (key in headers) { // Set Headers - if (headers.hasOwnProperty(key)) { - if (key === 'content-type' && headers[key] === 'multipart/form-data') { // Skip to avoid missing boundary - continue; - } - - request.setRequestHeader(key, headers[key]); - } - } - - request.onload = function () { - let data = request.response; - let contentType = this.getResponseHeader('content-type') || ''; - contentType = contentType.substring(0, contentType.indexOf(';')); - - switch (contentType) { - case 'application/json': - data = JSON.parse(data); - break; - } - - let cookieFallback = this.getResponseHeader('X-Fallback-Cookies') || ''; - - if(window.localStorage && cookieFallback) { - window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.'); - window.localStorage.setItem('cookieFallback', cookieFallback); - } - - if (4 === request.readyState && 399 >= request.status) { - resolve(data); - } else { - reject(data); - } - }; - - if (progress) { - request.addEventListener('progress', progress); - request.upload.addEventListener('progress', progress, false); - } - - // Handle network errors - request.onerror = function () { - reject(new Error("Network Error")); - }; - - request.send(params); - }) - }; - - return { - 'get': function(path, headers = {}, params = {}) { - return call('GET', path + ((Object.keys(params).length > 0) ? '?' + buildQuery(params) : ''), headers, {}); - }, - 'post': function(path, headers = {}, params = {}, progress = null) { - return call('POST', path, headers, params, progress); - }, - 'put': function(path, headers = {}, params = {}, progress = null) { - return call('PUT', path, headers, params, progress); - }, - 'patch': function(path, headers = {}, params = {}, progress = null) { - return call('PATCH', path, headers, params, progress); - }, - 'delete': function(path, headers = {}, params = {}, progress = null) { - return call('DELETE', path, headers, params, progress); - }, - 'addGlobalParam': addGlobalParam, - 'addGlobalHeader': addGlobalHeader - } - }(window.document); - - let account = { - - /** - * Get Account - * - * Get currently logged in user data as JSON object. - * - * @throws {Error} - * @return {Promise} - */ - get: function() { - let path = '/account'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Account - * - * 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](/docs/client/account#createVerification) route - * to start verifying the user email address. To allow your new user to login - * to his new account, you need to create a new [account - * session](/docs/client/account#createSession). - * - * @param {string} email - * @param {string} password - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - create: function(email, password, name = '') { - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - let path = '/account'; - - let payload = {}; - - if(email) { - payload['email'] = email; - } - - if(password) { - payload['password'] = password; - } - - if(name) { - payload['name'] = name; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Account - * - * Delete a currently logged in user account. Behind the scene, the user - * record is not deleted but permanently blocked from any access. This is done - * to avoid deleted accounts being overtaken by new users with the same email - * address. Any user-related resources like documents or storage files should - * be deleted separately. - * - * @throws {Error} - * @return {Promise} - */ - delete: function() { - let path = '/account'; - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Account Email - * - * Update currently logged in user account email address. After changing user - * address, user confirmation status is being reset and a new confirmation - * mail is sent. For security measures, user password is required to complete - * this request. - * - * @param {string} email - * @param {string} password - * @throws {Error} - * @return {Promise} - */ - updateEmail: function(email, password) { - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - let path = '/account/email'; - - let payload = {}; - - if(email) { - payload['email'] = email; - } - - if(password) { - payload['password'] = password; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Account Logs - * - * Get currently logged in user list of latest security activity logs. Each - * log returns user IP address, location and date and time of log. - * - * @throws {Error} - * @return {Promise} - */ - getLogs: function() { - let path = '/account/logs'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Account Name - * - * Update currently logged in user account name. - * - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - updateName: function(name) { - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/account/name'; - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Account Password - * - * Update currently logged in user password. For validation, user is required - * to pass the password twice. - * - * @param {string} password - * @param {string} oldPassword - * @throws {Error} - * @return {Promise} - */ - updatePassword: function(password, oldPassword) { - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - if(oldPassword === undefined) { - throw new Error('Missing required parameter: "oldPassword"'); - } - - let path = '/account/password'; - - let payload = {}; - - if(password) { - payload['password'] = password; - } - - if(oldPassword) { - payload['oldPassword'] = oldPassword; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Account Preferences - * - * Get currently logged in user preferences as a key-value object. - * - * @throws {Error} - * @return {Promise} - */ - getPrefs: function() { - let path = '/account/prefs'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Account Preferences - * - * Update currently logged in user account preferences. You can pass only the - * specific settings you wish to update. - * - * @param {object} prefs - * @throws {Error} - * @return {Promise} - */ - updatePrefs: function(prefs) { - if(prefs === undefined) { - throw new Error('Missing required parameter: "prefs"'); - } - - let path = '/account/prefs'; - - let payload = {}; - - if(prefs) { - payload['prefs'] = prefs; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Password Recovery - * - * 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](/docs/client/account#updateRecovery) - * endpoint to complete the process. - * - * @param {string} email - * @param {string} url - * @throws {Error} - * @return {Promise} - */ - createRecovery: function(email, url) { - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - let path = '/account/recovery'; - - let payload = {}; - - if(email) { - payload['email'] = email; - } - - if(url) { - payload['url'] = url; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Complete Password Recovery - * - * 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](/docs/client/account#createRecovery) endpoint. - * - * Please 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. - * - * @param {string} userId - * @param {string} secret - * @param {string} password - * @param {string} passwordAgain - * @throws {Error} - * @return {Promise} - */ - updateRecovery: function(userId, secret, password, passwordAgain) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(secret === undefined) { - throw new Error('Missing required parameter: "secret"'); - } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - if(passwordAgain === undefined) { - throw new Error('Missing required parameter: "passwordAgain"'); - } - - let path = '/account/recovery'; - - let payload = {}; - - if(userId) { - payload['userId'] = userId; - } - - if(secret) { - payload['secret'] = secret; - } - - if(password) { - payload['password'] = password; - } - - if(passwordAgain) { - payload['passwordAgain'] = passwordAgain; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Account Sessions - * - * Get currently logged in user list of active sessions across different - * devices. - * - * @throws {Error} - * @return {Promise} - */ - getSessions: function() { - let path = '/account/sessions'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Account Session - * - * Allow the user to login into his account by providing a valid email and - * password combination. This route will create a new session for the user. - * - * @param {string} email - * @param {string} password - * @throws {Error} - * @return {Promise} - */ - createSession: function(email, password) { - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - let path = '/account/sessions'; - - let payload = {}; - - if(email) { - payload['email'] = email; - } - - if(password) { - payload['password'] = password; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete All Account Sessions - * - * Delete all sessions from the user account and remove any sessions cookies - * from the end client. - * - * @throws {Error} - * @return {Promise} - */ - deleteSessions: function() { - let path = '/account/sessions'; - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Account Session with OAuth2 - * - * Allow the user to login to his account using the OAuth2 provider of his - * 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. - * - * @param {string} provider - * @param {string} success - * @param {string} failure - * @param {string[]} scopes - * @throws {Error} - * @return {Promise} - */ - createOAuth2Session: function(provider, success = 'https://appwrite.io/auth/oauth2/success', failure = 'https://appwrite.io/auth/oauth2/failure', scopes = []) { - if(provider === undefined) { - throw new Error('Missing required parameter: "provider"'); - } - - let path = '/account/sessions/oauth2/{provider}'.replace(new RegExp('{provider}', 'g'), provider); - - let payload = {}; - - if(success) { - payload['success'] = success; - } - - if(failure) { - payload['failure'] = failure; - } - - if(scopes) { - payload['scopes'] = scopes; - } - - payload['project'] = config.project; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - window.location = config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Delete Account Session - * - * Use this endpoint to log out the currently logged in user from all his - * account sessions across all his different devices. When using the option id - * argument, only the session unique ID provider will be deleted. - * - * @param {string} sessionId - * @throws {Error} - * @return {Promise} - */ - deleteSession: function(sessionId) { - if(sessionId === undefined) { - throw new Error('Missing required parameter: "sessionId"'); - } - - let path = '/account/sessions/{sessionId}'.replace(new RegExp('{sessionId}', 'g'), sessionId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Email Verification - * - * 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](/docs/client/account#updateAccountVerification). - * - * Please 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. - * - * - * @param {string} url - * @throws {Error} - * @return {Promise} - */ - createVerification: function(url) { - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - let path = '/account/verification'; - - let payload = {}; - - if(url) { - payload['url'] = url; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Complete Email Verification - * - * 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. - * - * @param {string} userId - * @param {string} secret - * @throws {Error} - * @return {Promise} - */ - updateVerification: function(userId, secret) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(secret === undefined) { - throw new Error('Missing required parameter: "secret"'); - } - - let path = '/account/verification'; - - let payload = {}; - - if(userId) { - payload['userId'] = userId; - } - - if(secret) { - payload['secret'] = secret; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let avatars = { - - /** - * Get Browser Icon - * - * 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 - * /account/sessions endpoint. Use width, height and quality arguments to - * change the output settings. - * - * @param {string} code - * @param {number} width - * @param {number} height - * @param {number} quality - * @throws {Error} - * @return {string} - */ - getBrowser: function(code, width = 100, height = 100, quality = 100) { - if(code === undefined) { - throw new Error('Missing required parameter: "code"'); - } - - let path = '/avatars/browsers/{code}'.replace(new RegExp('{code}', 'g'), code); - - let payload = {}; - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - if(quality) { - payload['quality'] = quality; - } - - payload['project'] = config.project; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get Credit Card Icon - * - * Need to display your users with your billing method or their payment - * methods? 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. - * - * @param {string} code - * @param {number} width - * @param {number} height - * @param {number} quality - * @throws {Error} - * @return {string} - */ - getCreditCard: function(code, width = 100, height = 100, quality = 100) { - if(code === undefined) { - throw new Error('Missing required parameter: "code"'); - } - - let path = '/avatars/credit-cards/{code}'.replace(new RegExp('{code}', 'g'), code); - - let payload = {}; - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - if(quality) { - payload['quality'] = quality; - } - - payload['project'] = config.project; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get Favicon - * - * Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote - * website URL. - * - * @param {string} url - * @throws {Error} - * @return {string} - */ - getFavicon: function(url) { - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - let path = '/avatars/favicon'; - - let payload = {}; - - if(url) { - payload['url'] = url; - } - - payload['project'] = config.project; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get Country Flag - * - * 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. - * - * @param {string} code - * @param {number} width - * @param {number} height - * @param {number} quality - * @throws {Error} - * @return {string} - */ - getFlag: function(code, width = 100, height = 100, quality = 100) { - if(code === undefined) { - throw new Error('Missing required parameter: "code"'); - } - - let path = '/avatars/flags/{code}'.replace(new RegExp('{code}', 'g'), code); - - let payload = {}; - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - if(quality) { - payload['quality'] = quality; - } - - payload['project'] = config.project; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get Image from URL - * - * 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. - * - * @param {string} url - * @param {number} width - * @param {number} height - * @throws {Error} - * @return {string} - */ - getImage: function(url, width = 400, height = 400) { - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - let path = '/avatars/image'; - - let payload = {}; - - if(url) { - payload['url'] = url; - } - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - payload['project'] = config.project; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get User Initials - * - * 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. - * - * You 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. - * - * @param {string} name - * @param {number} width - * @param {number} height - * @param {string} color - * @param {string} background - * @throws {Error} - * @return {string} - */ - getInitials: function(name = '', width = 500, height = 500, color = '', background = '') { - let path = '/avatars/initials'; - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - if(color) { - payload['color'] = color; - } - - if(background) { - payload['background'] = background; - } - - payload['project'] = config.project; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get QR Code - * - * 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. - * - * @param {string} text - * @param {number} size - * @param {number} margin - * @param {boolean} download - * @throws {Error} - * @return {string} - */ - getQR: function(text, size = 400, margin = 1, download = false) { - if(text === undefined) { - throw new Error('Missing required parameter: "text"'); - } - - let path = '/avatars/qr'; - - let payload = {}; - - if(text) { - payload['text'] = text; - } - - if(size) { - payload['size'] = size; - } - - if(margin) { - payload['margin'] = margin; - } - - if(download) { - payload['download'] = download; - } - - payload['project'] = config.project; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - } - }; - - let database = { - - /** - * List Documents - * - * Get a list of all the user documents. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project documents. [Learn more about different API - * modes](/docs/admin). - * - * @param {string} collectionId - * @param {string[]} filters - * @param {number} limit - * @param {number} offset - * @param {string} orderField - * @param {string} orderType - * @param {string} orderCast - * @param {string} search - * @throws {Error} - * @return {Promise} - */ - listDocuments: function(collectionId, filters = [], limit = 25, offset = 0, orderField = '$id', orderType = 'ASC', orderCast = 'string', search = '') { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - let path = '/database/collections/{collectionId}/documents'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - let payload = {}; - - if(filters) { - payload['filters'] = filters; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderField) { - payload['orderField'] = orderField; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - if(orderCast) { - payload['orderCast'] = orderCast; - } - - if(search) { - payload['search'] = search; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Document - * - * Create a new Document. Before using this route, you should create a new - * collection resource using either a [server - * integration](/docs/server/database?sdk=nodejs#createCollection) API or - * directly from your database console. - * - * @param {string} collectionId - * @param {object} data - * @param {string[]} read - * @param {string[]} write - * @param {string} parentDocument - * @param {string} parentProperty - * @param {string} parentPropertyType - * @throws {Error} - * @return {Promise} - */ - createDocument: function(collectionId, data, read, write, parentDocument = '', parentProperty = '', parentPropertyType = 'assign') { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - if(data === undefined) { - throw new Error('Missing required parameter: "data"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - let path = '/database/collections/{collectionId}/documents'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - let payload = {}; - - if(data) { - payload['data'] = data; - } - - if(read) { - payload['read'] = read; - } - - if(write) { - payload['write'] = write; - } - - if(parentDocument) { - payload['parentDocument'] = parentDocument; - } - - if(parentProperty) { - payload['parentProperty'] = parentProperty; - } - - if(parentPropertyType) { - payload['parentPropertyType'] = parentPropertyType; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Document - * - * Get document by its unique ID. This endpoint response returns a JSON object - * with the document data. - * - * @param {string} collectionId - * @param {string} documentId - * @throws {Error} - * @return {Promise} - */ - getDocument: function(collectionId, documentId) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - if(documentId === undefined) { - throw new Error('Missing required parameter: "documentId"'); - } - - let path = '/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Document - * - * - * @param {string} collectionId - * @param {string} documentId - * @param {object} data - * @param {string[]} read - * @param {string[]} write - * @throws {Error} - * @return {Promise} - */ - updateDocument: function(collectionId, documentId, data, read, write) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - if(documentId === undefined) { - throw new Error('Missing required parameter: "documentId"'); - } - - if(data === undefined) { - throw new Error('Missing required parameter: "data"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - let path = '/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - let payload = {}; - - if(data) { - payload['data'] = data; - } - - if(read) { - payload['read'] = read; - } - - if(write) { - payload['write'] = write; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Document - * - * Delete document by its unique ID. This endpoint deletes only the parent - * documents, his attributes and relations to other documents. Child documents - * **will not** be deleted. - * - * @param {string} collectionId - * @param {string} documentId - * @throws {Error} - * @return {Promise} - */ - deleteDocument: function(collectionId, documentId) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - if(documentId === undefined) { - throw new Error('Missing required parameter: "documentId"'); - } - - let path = '/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let locale = { - - /** - * Get User Locale - * - * 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. - * - * ([IP Geolocation by DB-IP](https://db-ip.com)) - * - * @throws {Error} - * @return {Promise} - */ - get: function() { - let path = '/locale'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Continents - * - * List of all continents. You can use the locale header to get the data in a - * supported language. - * - * @throws {Error} - * @return {Promise} - */ - getContinents: function() { - let path = '/locale/continents'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Countries - * - * List of all countries. You can use the locale header to get the data in a - * supported language. - * - * @throws {Error} - * @return {Promise} - */ - getCountries: function() { - let path = '/locale/countries'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List EU Countries - * - * 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. - * - * @throws {Error} - * @return {Promise} - */ - getCountriesEU: function() { - let path = '/locale/countries/eu'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Countries Phone Codes - * - * List of all countries phone codes. You can use the locale header to get the - * data in a supported language. - * - * @throws {Error} - * @return {Promise} - */ - getCountriesPhones: function() { - let path = '/locale/countries/phones'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Currencies - * - * 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. - * - * @throws {Error} - * @return {Promise} - */ - getCurrencies: function() { - let path = '/locale/currencies'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Languages - * - * List of all languages classified by ISO 639-1 including 2-letter code, name - * in English, and name in the respective language. - * - * @throws {Error} - * @return {Promise} - */ - getLanguages: function() { - let path = '/locale/languages'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let storage = { - - /** - * List Files - * - * Get a list of all the user files. You can use the query params to filter - * your results. On admin mode, this endpoint will return a list of all of the - * project files. [Learn more about different API modes](/docs/admin). - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - listFiles: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/storage/files'; - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create File - * - * Create a new file. The user who creates the file will automatically be - * assigned to read and write access unless he has passed custom values for - * read and write arguments. - * - * @param {File} file - * @param {string[]} read - * @param {string[]} write - * @throws {Error} - * @return {Promise} - */ - createFile: function(file, read, write) { - if(file === undefined) { - throw new Error('Missing required parameter: "file"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - let path = '/storage/files'; - - let payload = {}; - - if(file) { - payload['file'] = file; - } - - if(read) { - payload['read'] = read; - } - - if(write) { - payload['write'] = write; - } - - return http - .post(path, { - 'content-type': 'multipart/form-data', - }, payload); - }, - - /** - * Get File - * - * Get file by its unique ID. This endpoint response returns a JSON object - * with the file metadata. - * - * @param {string} fileId - * @throws {Error} - * @return {Promise} - */ - getFile: function(fileId) { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update File - * - * Update file by its unique ID. Only users with write permissions have access - * to update this resource. - * - * @param {string} fileId - * @param {string[]} read - * @param {string[]} write - * @throws {Error} - * @return {Promise} - */ - updateFile: function(fileId, read, write) { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - if(read) { - payload['read'] = read; - } - - if(write) { - payload['write'] = write; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete File - * - * Delete a file by its unique ID. Only users with write permissions have - * access to delete this resource. - * - * @param {string} fileId - * @throws {Error} - * @return {Promise} - */ - deleteFile: function(fileId) { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get File for Download - * - * Get 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. - * - * @param {string} fileId - * @throws {Error} - * @return {string} - */ - getFileDownload: function(fileId) { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - let path = '/storage/files/{fileId}/download'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - payload['project'] = config.project; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get File Preview - * - * 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. - * - * @param {string} fileId - * @param {number} width - * @param {number} height - * @param {number} quality - * @param {string} background - * @param {string} output - * @throws {Error} - * @return {string} - */ - getFilePreview: function(fileId, width = 0, height = 0, quality = 100, background = '', output = '') { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - let path = '/storage/files/{fileId}/preview'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - if(quality) { - payload['quality'] = quality; - } - - if(background) { - payload['background'] = background; - } - - if(output) { - payload['output'] = output; - } - - payload['project'] = config.project; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get File for View - * - * Get file content by its unique ID. This endpoint is similar to the download - * method but returns with no 'Content-Disposition: attachment' header. - * - * @param {string} fileId - * @param {string} as - * @throws {Error} - * @return {string} - */ - getFileView: function(fileId, as = '') { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - let path = '/storage/files/{fileId}/view'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - if(as) { - payload['as'] = as; - } - - payload['project'] = config.project; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - } - }; - - let teams = { - - /** - * List Teams - * - * Get a list of all the current user teams. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project teams. [Learn more about different API modes](/docs/admin). - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - list: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/teams'; - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Team - * - * Create a new team. The user who creates the team will automatically be - * assigned as the owner of the team. The team owner can invite new members, - * who will be able add new owners and update or delete the team from your - * project. - * - * @param {string} name - * @param {string[]} roles - * @throws {Error} - * @return {Promise} - */ - create: function(name, roles = ["owner"]) { - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/teams'; - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(roles) { - payload['roles'] = roles; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Team - * - * Get team by its unique ID. All team members have read access for this - * resource. - * - * @param {string} teamId - * @throws {Error} - * @return {Promise} - */ - get: function(teamId) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Team - * - * Update team by its unique ID. Only team owners have write access for this - * resource. - * - * @param {string} teamId - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - update: function(teamId, name) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Team - * - * Delete team by its unique ID. Only team owners have write access for this - * resource. - * - * @param {string} teamId - * @throws {Error} - * @return {Promise} - */ - delete: function(teamId) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Team Memberships - * - * Get team members by the team unique ID. All team members have read access - * for this list of resources. - * - * @param {string} teamId - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - getMemberships: function(teamId, search = '', limit = 25, offset = 0, orderType = 'ASC') { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - let path = '/teams/{teamId}/memberships'.replace(new RegExp('{teamId}', 'g'), teamId); - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Team Membership - * - * Use this endpoint to invite a new member to join your team. An email with a - * link to join the team will be sent to the new member email address if the - * member doesn't exist in the project it will be created automatically. - * - * Use the 'URL' parameter to redirect the user from the invitation email back - * to your app. When the user is redirected, use the [Update Team Membership - * Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the - * user to accept the invitation to the team. - * - * Please note that in order to avoid a [Redirect - * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) - * the only valid redirect URL's are the once from domains you have set when - * added your platforms in the console interface. - * - * @param {string} teamId - * @param {string} email - * @param {string[]} roles - * @param {string} url - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - createMembership: function(teamId, email, roles, url, name = '') { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(roles === undefined) { - throw new Error('Missing required parameter: "roles"'); - } - - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - let path = '/teams/{teamId}/memberships'.replace(new RegExp('{teamId}', 'g'), teamId); - - let payload = {}; - - if(email) { - payload['email'] = email; - } - - if(name) { - payload['name'] = name; - } - - if(roles) { - payload['roles'] = roles; - } - - if(url) { - payload['url'] = url; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Team Membership - * - * 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 he didn't accept it. - * - * @param {string} teamId - * @param {string} inviteId - * @throws {Error} - * @return {Promise} - */ - deleteMembership: function(teamId, inviteId) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - if(inviteId === undefined) { - throw new Error('Missing required parameter: "inviteId"'); - } - - let path = '/teams/{teamId}/memberships/{inviteId}'.replace(new RegExp('{teamId}', 'g'), teamId).replace(new RegExp('{inviteId}', 'g'), inviteId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Team Membership Status - * - * Use this endpoint to allow a user to accept an invitation to join a team - * after he is being redirected back to your app from the invitation email he - * was sent. - * - * @param {string} teamId - * @param {string} inviteId - * @param {string} userId - * @param {string} secret - * @throws {Error} - * @return {Promise} - */ - updateMembershipStatus: function(teamId, inviteId, userId, secret) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - if(inviteId === undefined) { - throw new Error('Missing required parameter: "inviteId"'); - } - - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(secret === undefined) { - throw new Error('Missing required parameter: "secret"'); - } - - let path = '/teams/{teamId}/memberships/{inviteId}/status'.replace(new RegExp('{teamId}', 'g'), teamId).replace(new RegExp('{inviteId}', 'g'), inviteId); - - let payload = {}; - - if(userId) { - payload['userId'] = userId; - } - - if(secret) { - payload['secret'] = secret; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - return { - setEndpoint: setEndpoint, - setProject: setProject, - setLocale: setLocale, - account: account, - avatars: avatars, - database: database, - locale: locale, - storage: storage, - teams: teams - }; - }; - - if(typeof module !== "undefined") { - module.exports = window.Appwrite; - } - -})((typeof window !== "undefined") ? window : {}); \ No newline at end of file diff --git a/app/sdks/client-web/src/sdk.min.js b/app/sdks/client-web/src/sdk.min.js deleted file mode 100644 index 2bc06cc935..0000000000 --- a/app/sdks/client-web/src/sdk.min.js +++ /dev/null @@ -1,187 +0,0 @@ -(function(window){'use strict';window.Appwrite=function(){let config={endpoint:'https://appwrite.io/v1',project:'',locale:'',};let setEndpoint=function(endpoint){config.endpoint=endpoint;return this};let setProject=function(value){http.addGlobalHeader('X-Appwrite-Project',value);config.project=value;return this};let setLocale=function(value){http.addGlobalHeader('X-Appwrite-Locale',value);config.locale=value;return this};let http=function(document){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){let a=document.createElement('a'),regex=/(?:\?|&|&)+([^=]+)(?:=([^&]*))*/g;let match,str=[];a.href=url;param=encodeURIComponent(param);while(match=regex.exec(a.search))if(param!==match[1])str.push(match[1]+(match[2]?"="+match[2]:""));str.push(param+(value?"="+encodeURIComponent(value):""));a.search=str.join("&");return a.href};let buildQuery=function(params){let str=[];for(let p in params){if(Array.isArray(params[p])){for(let index=0;index=request.status){resolve(data)}else{reject(data)}};if(progress){request.addEventListener('progress',progress);request.upload.addEventListener('progress',progress,!1)} -request.onerror=function(){reject(new Error("Network Error"))};request.send(params)})};return{'get':function(path,headers={},params={}){return call('GET',path+((Object.keys(params).length>0)?'?'+buildQuery(params):''),headers,{})},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress)},'put':function(path,headers={},params={},progress=null){return call('PUT',path,headers,params,progress)},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress)},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress)},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let account={get:function(){let path='/account';let payload={};return http.get(path,{'content-type':'application/json',},payload)},create:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"')} -if(password===undefined){throw new Error('Missing required parameter: "password"')} -let path='/account';let payload={};if(email){payload.email=email} -if(password){payload.password=password} -if(name){payload.name=name} -return http.post(path,{'content-type':'application/json',},payload)},delete:function(){let path='/account';let payload={};return http.delete(path,{'content-type':'application/json',},payload)},updateEmail:function(email,password){if(email===undefined){throw new Error('Missing required parameter: "email"')} -if(password===undefined){throw new Error('Missing required parameter: "password"')} -let path='/account/email';let payload={};if(email){payload.email=email} -if(password){payload.password=password} -return http.patch(path,{'content-type':'application/json',},payload)},getLogs:function(){let path='/account/logs';let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateName:function(name){if(name===undefined){throw new Error('Missing required parameter: "name"')} -let path='/account/name';let payload={};if(name){payload.name=name} -return http.patch(path,{'content-type':'application/json',},payload)},updatePassword:function(password,oldPassword){if(password===undefined){throw new Error('Missing required parameter: "password"')} -if(oldPassword===undefined){throw new Error('Missing required parameter: "oldPassword"')} -let path='/account/password';let payload={};if(password){payload.password=password} -if(oldPassword){payload.oldPassword=oldPassword} -return http.patch(path,{'content-type':'application/json',},payload)},getPrefs:function(){let path='/account/prefs';let payload={};return http.get(path,{'content-type':'application/json',},payload)},updatePrefs:function(prefs){if(prefs===undefined){throw new Error('Missing required parameter: "prefs"')} -let path='/account/prefs';let payload={};if(prefs){payload.prefs=prefs} -return http.patch(path,{'content-type':'application/json',},payload)},createRecovery:function(email,url){if(email===undefined){throw new Error('Missing required parameter: "email"')} -if(url===undefined){throw new Error('Missing required parameter: "url"')} -let path='/account/recovery';let payload={};if(email){payload.email=email} -if(url){payload.url=url} -return http.post(path,{'content-type':'application/json',},payload)},updateRecovery:function(userId,secret,password,passwordAgain){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -if(secret===undefined){throw new Error('Missing required parameter: "secret"')} -if(password===undefined){throw new Error('Missing required parameter: "password"')} -if(passwordAgain===undefined){throw new Error('Missing required parameter: "passwordAgain"')} -let path='/account/recovery';let payload={};if(userId){payload.userId=userId} -if(secret){payload.secret=secret} -if(password){payload.password=password} -if(passwordAgain){payload.passwordAgain=passwordAgain} -return http.put(path,{'content-type':'application/json',},payload)},getSessions:function(){let path='/account/sessions';let payload={};return http.get(path,{'content-type':'application/json',},payload)},createSession:function(email,password){if(email===undefined){throw new Error('Missing required parameter: "email"')} -if(password===undefined){throw new Error('Missing required parameter: "password"')} -let path='/account/sessions';let payload={};if(email){payload.email=email} -if(password){payload.password=password} -return http.post(path,{'content-type':'application/json',},payload)},deleteSessions:function(){let path='/account/sessions';let payload={};return http.delete(path,{'content-type':'application/json',},payload)},createOAuth2Session:function(provider,success='https://appwrite.io/auth/oauth2/success',failure='https://appwrite.io/auth/oauth2/failure',scopes=[]){if(provider===undefined){throw new Error('Missing required parameter: "provider"')} -let path='/account/sessions/oauth2/{provider}'.replace(new RegExp('{provider}','g'),provider);let payload={};if(success){payload.success=success} -if(failure){payload.failure=failure} -if(scopes){payload.scopes=scopes} -payload.project=config.project;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index; - - /** - * Create Account - * - * 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](/docs/client/account#createVerification) route - * to start verifying the user email address. To allow your new user to login - * to his new account, you need to create a new [account - * session](/docs/client/account#createSession). - * - * @param {string} email - * @param {string} password - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - create(email: string, password: string, name: string): Promise; - - /** - * Delete Account - * - * Delete a currently logged in user account. Behind the scene, the user - * record is not deleted but permanently blocked from any access. This is done - * to avoid deleted accounts being overtaken by new users with the same email - * address. Any user-related resources like documents or storage files should - * be deleted separately. - * - * @throws {Error} - * @return {Promise} - */ - delete(): Promise; - - /** - * Update Account Email - * - * Update currently logged in user account email address. After changing user - * address, user confirmation status is being reset and a new confirmation - * mail is sent. For security measures, user password is required to complete - * this request. - * - * @param {string} email - * @param {string} password - * @throws {Error} - * @return {Promise} - */ - updateEmail(email: string, password: string): Promise; - - /** - * Get Account Logs - * - * Get currently logged in user list of latest security activity logs. Each - * log returns user IP address, location and date and time of log. - * - * @throws {Error} - * @return {Promise} - */ - getLogs(): Promise; - - /** - * Update Account Name - * - * Update currently logged in user account name. - * - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - updateName(name: string): Promise; - - /** - * Update Account Password - * - * Update currently logged in user password. For validation, user is required - * to pass the password twice. - * - * @param {string} password - * @param {string} oldPassword - * @throws {Error} - * @return {Promise} - */ - updatePassword(password: string, oldPassword: string): Promise; - - /** - * Get Account Preferences - * - * Get currently logged in user preferences as a key-value object. - * - * @throws {Error} - * @return {Promise} - */ - getPrefs(): Promise; - - /** - * Update Account Preferences - * - * Update currently logged in user account preferences. You can pass only the - * specific settings you wish to update. - * - * @param {object} prefs - * @throws {Error} - * @return {Promise} - */ - updatePrefs(prefs: object): Promise; - - /** - * Create Password Recovery - * - * 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](/docs/client/account#updateRecovery) - * endpoint to complete the process. - * - * @param {string} email - * @param {string} url - * @throws {Error} - * @return {Promise} - */ - createRecovery(email: string, url: string): Promise; - - /** - * Complete Password Recovery - * - * 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](/docs/client/account#createRecovery) endpoint. - * - * Please 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. - * - * @param {string} userId - * @param {string} secret - * @param {string} password - * @param {string} passwordAgain - * @throws {Error} - * @return {Promise} - */ - updateRecovery(userId: string, secret: string, password: string, passwordAgain: string): Promise; - - /** - * Get Account Sessions - * - * Get currently logged in user list of active sessions across different - * devices. - * - * @throws {Error} - * @return {Promise} - */ - getSessions(): Promise; - - /** - * Create Account Session - * - * Allow the user to login into his account by providing a valid email and - * password combination. This route will create a new session for the user. - * - * @param {string} email - * @param {string} password - * @throws {Error} - * @return {Promise} - */ - createSession(email: string, password: string): Promise; - - /** - * Delete All Account Sessions - * - * Delete all sessions from the user account and remove any sessions cookies - * from the end client. - * - * @throws {Error} - * @return {Promise} - */ - deleteSessions(): Promise; - - /** - * Create Account Session with OAuth2 - * - * Allow the user to login to his account using the OAuth2 provider of his - * 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. - * - * @param {string} provider - * @param {string} success - * @param {string} failure - * @param {string[]} scopes - * @throws {Error} - * @return {Promise} - */ - createOAuth2Session(provider: string, success: string, failure: string, scopes: string[]): Promise; - - /** - * Delete Account Session - * - * Use this endpoint to log out the currently logged in user from all his - * account sessions across all his different devices. When using the option id - * argument, only the session unique ID provider will be deleted. - * - * @param {string} sessionId - * @throws {Error} - * @return {Promise} - */ - deleteSession(sessionId: string): Promise; - - /** - * Create Email Verification - * - * 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](/docs/client/account#updateAccountVerification). - * - * Please 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. - * - * - * @param {string} url - * @throws {Error} - * @return {Promise} - */ - createVerification(url: string): Promise; - - /** - * Complete Email Verification - * - * 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. - * - * @param {string} userId - * @param {string} secret - * @throws {Error} - * @return {Promise} - */ - updateVerification(userId: string, secret: string): Promise; - - } - - export interface Avatars { - - /** - * Get Browser Icon - * - * 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 - * /account/sessions endpoint. Use width, height and quality arguments to - * change the output settings. - * - * @param {string} code - * @param {number} width - * @param {number} height - * @param {number} quality - * @throws {Error} - * @return {string} - */ - getBrowser(code: string, width: number, height: number, quality: number): string; - - /** - * Get Credit Card Icon - * - * Need to display your users with your billing method or their payment - * methods? 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. - * - * @param {string} code - * @param {number} width - * @param {number} height - * @param {number} quality - * @throws {Error} - * @return {string} - */ - getCreditCard(code: string, width: number, height: number, quality: number): string; - - /** - * Get Favicon - * - * Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote - * website URL. - * - * @param {string} url - * @throws {Error} - * @return {string} - */ - getFavicon(url: string): string; - - /** - * Get Country Flag - * - * 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. - * - * @param {string} code - * @param {number} width - * @param {number} height - * @param {number} quality - * @throws {Error} - * @return {string} - */ - getFlag(code: string, width: number, height: number, quality: number): string; - - /** - * Get Image from URL - * - * 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. - * - * @param {string} url - * @param {number} width - * @param {number} height - * @throws {Error} - * @return {string} - */ - getImage(url: string, width: number, height: number): string; - - /** - * Get User Initials - * - * 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. - * - * You 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. - * - * @param {string} name - * @param {number} width - * @param {number} height - * @param {string} color - * @param {string} background - * @throws {Error} - * @return {string} - */ - getInitials(name: string, width: number, height: number, color: string, background: string): string; - - /** - * Get QR Code - * - * 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. - * - * @param {string} text - * @param {number} size - * @param {number} margin - * @param {boolean} download - * @throws {Error} - * @return {string} - */ - getQR(text: string, size: number, margin: number, download: boolean): string; - - } - - export interface Database { - - /** - * List Documents - * - * Get a list of all the user documents. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project documents. [Learn more about different API - * modes](/docs/admin). - * - * @param {string} collectionId - * @param {string[]} filters - * @param {number} limit - * @param {number} offset - * @param {string} orderField - * @param {string} orderType - * @param {string} orderCast - * @param {string} search - * @throws {Error} - * @return {Promise} - */ - listDocuments(collectionId: string, filters: string[], limit: number, offset: number, orderField: string, orderType: string, orderCast: string, search: string): Promise; - - /** - * Create Document - * - * Create a new Document. Before using this route, you should create a new - * collection resource using either a [server - * integration](/docs/server/database?sdk=nodejs#createCollection) API or - * directly from your database console. - * - * @param {string} collectionId - * @param {object} data - * @param {string[]} read - * @param {string[]} write - * @param {string} parentDocument - * @param {string} parentProperty - * @param {string} parentPropertyType - * @throws {Error} - * @return {Promise} - */ - createDocument(collectionId: string, data: object, read: string[], write: string[], parentDocument: string, parentProperty: string, parentPropertyType: string): Promise; - - /** - * Get Document - * - * Get document by its unique ID. This endpoint response returns a JSON object - * with the document data. - * - * @param {string} collectionId - * @param {string} documentId - * @throws {Error} - * @return {Promise} - */ - getDocument(collectionId: string, documentId: string): Promise; - - /** - * Update Document - * - * - * @param {string} collectionId - * @param {string} documentId - * @param {object} data - * @param {string[]} read - * @param {string[]} write - * @throws {Error} - * @return {Promise} - */ - updateDocument(collectionId: string, documentId: string, data: object, read: string[], write: string[]): Promise; - - /** - * Delete Document - * - * Delete document by its unique ID. This endpoint deletes only the parent - * documents, his attributes and relations to other documents. Child documents - * **will not** be deleted. - * - * @param {string} collectionId - * @param {string} documentId - * @throws {Error} - * @return {Promise} - */ - deleteDocument(collectionId: string, documentId: string): Promise; - - } - - export interface Locale { - - /** - * Get User Locale - * - * 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. - * - * ([IP Geolocation by DB-IP](https://db-ip.com)) - * - * @throws {Error} - * @return {Promise} - */ - get(): Promise; - - /** - * List Continents - * - * List of all continents. You can use the locale header to get the data in a - * supported language. - * - * @throws {Error} - * @return {Promise} - */ - getContinents(): Promise; - - /** - * List Countries - * - * List of all countries. You can use the locale header to get the data in a - * supported language. - * - * @throws {Error} - * @return {Promise} - */ - getCountries(): Promise; - - /** - * List EU Countries - * - * 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. - * - * @throws {Error} - * @return {Promise} - */ - getCountriesEU(): Promise; - - /** - * List Countries Phone Codes - * - * List of all countries phone codes. You can use the locale header to get the - * data in a supported language. - * - * @throws {Error} - * @return {Promise} - */ - getCountriesPhones(): Promise; - - /** - * List Currencies - * - * 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. - * - * @throws {Error} - * @return {Promise} - */ - getCurrencies(): Promise; - - /** - * List Languages - * - * List of all languages classified by ISO 639-1 including 2-letter code, name - * in English, and name in the respective language. - * - * @throws {Error} - * @return {Promise} - */ - getLanguages(): Promise; - - } - - export interface Storage { - - /** - * List Files - * - * Get a list of all the user files. You can use the query params to filter - * your results. On admin mode, this endpoint will return a list of all of the - * project files. [Learn more about different API modes](/docs/admin). - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - listFiles(search: string, limit: number, offset: number, orderType: string): Promise; - - /** - * Create File - * - * Create a new file. The user who creates the file will automatically be - * assigned to read and write access unless he has passed custom values for - * read and write arguments. - * - * @param {File} file - * @param {string[]} read - * @param {string[]} write - * @throws {Error} - * @return {Promise} - */ - createFile(file: File, read: string[], write: string[]): Promise; - - /** - * Get File - * - * Get file by its unique ID. This endpoint response returns a JSON object - * with the file metadata. - * - * @param {string} fileId - * @throws {Error} - * @return {Promise} - */ - getFile(fileId: string): Promise; - - /** - * Update File - * - * Update file by its unique ID. Only users with write permissions have access - * to update this resource. - * - * @param {string} fileId - * @param {string[]} read - * @param {string[]} write - * @throws {Error} - * @return {Promise} - */ - updateFile(fileId: string, read: string[], write: string[]): Promise; - - /** - * Delete File - * - * Delete a file by its unique ID. Only users with write permissions have - * access to delete this resource. - * - * @param {string} fileId - * @throws {Error} - * @return {Promise} - */ - deleteFile(fileId: string): Promise; - - /** - * Get File for Download - * - * Get 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. - * - * @param {string} fileId - * @throws {Error} - * @return {string} - */ - getFileDownload(fileId: string): string; - - /** - * Get File Preview - * - * 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. - * - * @param {string} fileId - * @param {number} width - * @param {number} height - * @param {number} quality - * @param {string} background - * @param {string} output - * @throws {Error} - * @return {string} - */ - getFilePreview(fileId: string, width: number, height: number, quality: number, background: string, output: string): string; - - /** - * Get File for View - * - * Get file content by its unique ID. This endpoint is similar to the download - * method but returns with no 'Content-Disposition: attachment' header. - * - * @param {string} fileId - * @param {string} as - * @throws {Error} - * @return {string} - */ - getFileView(fileId: string, as: string): string; - - } - - export interface Teams { - - /** - * List Teams - * - * Get a list of all the current user teams. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project teams. [Learn more about different API modes](/docs/admin). - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - list(search: string, limit: number, offset: number, orderType: string): Promise; - - /** - * Create Team - * - * Create a new team. The user who creates the team will automatically be - * assigned as the owner of the team. The team owner can invite new members, - * who will be able add new owners and update or delete the team from your - * project. - * - * @param {string} name - * @param {string[]} roles - * @throws {Error} - * @return {Promise} - */ - create(name: string, roles: string[]): Promise; - - /** - * Get Team - * - * Get team by its unique ID. All team members have read access for this - * resource. - * - * @param {string} teamId - * @throws {Error} - * @return {Promise} - */ - get(teamId: string): Promise; - - /** - * Update Team - * - * Update team by its unique ID. Only team owners have write access for this - * resource. - * - * @param {string} teamId - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - update(teamId: string, name: string): Promise; - - /** - * Delete Team - * - * Delete team by its unique ID. Only team owners have write access for this - * resource. - * - * @param {string} teamId - * @throws {Error} - * @return {Promise} - */ - delete(teamId: string): Promise; - - /** - * Get Team Memberships - * - * Get team members by the team unique ID. All team members have read access - * for this list of resources. - * - * @param {string} teamId - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - getMemberships(teamId: string, search: string, limit: number, offset: number, orderType: string): Promise; - - /** - * Create Team Membership - * - * Use this endpoint to invite a new member to join your team. An email with a - * link to join the team will be sent to the new member email address if the - * member doesn't exist in the project it will be created automatically. - * - * Use the 'URL' parameter to redirect the user from the invitation email back - * to your app. When the user is redirected, use the [Update Team Membership - * Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the - * user to accept the invitation to the team. - * - * Please note that in order to avoid a [Redirect - * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) - * the only valid redirect URL's are the once from domains you have set when - * added your platforms in the console interface. - * - * @param {string} teamId - * @param {string} email - * @param {string[]} roles - * @param {string} url - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - createMembership(teamId: string, email: string, roles: string[], url: string, name: string): Promise; - - /** - * Delete Team Membership - * - * 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 he didn't accept it. - * - * @param {string} teamId - * @param {string} inviteId - * @throws {Error} - * @return {Promise} - */ - deleteMembership(teamId: string, inviteId: string): Promise; - - /** - * Update Team Membership Status - * - * Use this endpoint to allow a user to accept an invitation to join a team - * after he is being redirected back to your app from the invitation email he - * was sent. - * - * @param {string} teamId - * @param {string} inviteId - * @param {string} userId - * @param {string} secret - * @throws {Error} - * @return {Promise} - */ - updateMembershipStatus(teamId: string, inviteId: string, userId: string, secret: string): Promise; - - } - - -} \ No newline at end of file diff --git a/app/sdks/console-web/CHANGELOG.md b/app/sdks/console-web/CHANGELOG.md deleted file mode 100644 index fa4d35e687..0000000000 --- a/app/sdks/console-web/CHANGELOG.md +++ /dev/null @@ -1 +0,0 @@ -# Change Log \ No newline at end of file diff --git a/app/sdks/console-web/LICENSE b/app/sdks/console-web/LICENSE deleted file mode 100644 index fc7c051a91..0000000000 --- a/app/sdks/console-web/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/app/sdks/console-web/README.md b/app/sdks/console-web/README.md deleted file mode 100644 index 000e4988f1..0000000000 --- a/app/sdks/console-web/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# Appwrite Console SDK - -![License](https://img.shields.io/github/license/appwrite/sdk-for-console.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.7.0-blue.svg?v=1) - -Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. - Use the Console SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. - For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) - -![Appwrite](https://appwrite.io/images/github.png) - -## Installation - -### NPM - -To install via [NPM](https://www.npmjs.com/): - -```bash -npm install appwrite --save -``` - -If you're using a bundler (like [Browserify](http://browserify.org/) or [webpack](https://webpack.js.org/)), you can import the Appwrite module when you need it: - -```js -import * as Appwrite from "appwrite"; -``` - -### CDN - -To install with a CDN (content delivery network) add the following scripts to the bottom of your tag, but before you use any Appwrite services: - -```html - -``` - - - -## Contribution - -This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request. - -## License - -Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. \ No newline at end of file diff --git a/app/sdks/console-web/package.json b/app/sdks/console-web/package.json deleted file mode 100644 index 6c53a70307..0000000000 --- a/app/sdks/console-web/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "appwrite", - "homepage": "https://appwrite.io/support", - "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", - "version": "1.0.0", - "license": "BSD-3-Clause", - "main": "src/sdk.js", - "types": "types/index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/appwrite/sdk-for-console" - }, - "devDependencies": { - "typescript": "^3.6.4" - }, - "dependencies": {} -} \ No newline at end of file diff --git a/app/sdks/console-web/src/sdk.js b/app/sdks/console-web/src/sdk.js deleted file mode 100644 index fc8da5a1c2..0000000000 --- a/app/sdks/console-web/src/sdk.js +++ /dev/null @@ -1,4993 +0,0 @@ -(function (window) { - - 'use strict'; - - window.Appwrite = function () { - - let config = { - endpoint: 'https://appwrite.io/v1', - project: '', - key: '', - locale: '', - mode: '', - }; - - /** - * @param {string} endpoint - * @returns {this} - */ - let setEndpoint = function(endpoint) { - config.endpoint = endpoint; - - return this; - }; - - /** - * Set Project - * - * Your project ID - * - * @param value string - * - * @return this - */ - let setProject = function (value) - { - http.addGlobalHeader('X-Appwrite-Project', value); - - config.project = value; - - return this; - }; - - /** - * Set Key - * - * Your secret API key - * - * @param value string - * - * @return this - */ - let setKey = function (value) - { - http.addGlobalHeader('X-Appwrite-Key', value); - - config.key = value; - - return this; - }; - - /** - * Set Locale - * - * @param value string - * - * @return this - */ - let setLocale = function (value) - { - http.addGlobalHeader('X-Appwrite-Locale', value); - - config.locale = value; - - return this; - }; - - /** - * Set Mode - * - * @param value string - * - * @return this - */ - let setMode = function (value) - { - http.addGlobalHeader('X-Appwrite-Mode', value); - - config.mode = value; - - return this; - }; - - let http = function(document) { - let globalParams = [], - globalHeaders = []; - - let addParam = function (url, param, value) { - let a = document.createElement('a'), regex = /(?:\?|&|&)+([^=]+)(?:=([^&]*))*/g; - let match, str = []; - a.href = url; - param = encodeURIComponent(param); - - while (match = regex.exec(a.search)) if (param !== match[1]) str.push(match[1] + (match[2] ? "=" + match[2] : "")); - - str.push(param + (value ? "=" + encodeURIComponent(value) : "")); - - a.search = str.join("&"); - - return a.href; - }; - - /** - * @param {Object} params - * @returns {string} - */ - let buildQuery = function(params) { - let str = []; - - for (let p in params) { - if(Array.isArray(params[p])) { - for (let index = 0; index < params[p].length; index++) { - let param = params[p][index]; - str.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(params[p])); - } - } - - return str.join("&"); - }; - - let addGlobalHeader = function(key, value) { - globalHeaders[key] = {key: key.toLowerCase(), value: value.toLowerCase()}; - }; - - let addGlobalParam = function(key, value) { - globalParams.push({key: key, value: value}); - }; - - addGlobalHeader('x-sdk-version', 'appwrite:javascript:1.0.0'); - addGlobalHeader('content-type', ''); - - /** - * @param {string} method - * @param {string} path string - * @param {Object} headers - * @param {Object} params - * @param {function} progress - * @returns {Promise} - */ - let call = function (method, path, headers = {}, params = {}, progress = null) { - let i; - - path = config.endpoint + path; - - if (-1 === ['GET', 'POST', 'PUT', 'DELETE', 'TRACE', 'HEAD', 'OPTIONS', 'CONNECT', 'PATCH'].indexOf(method)) { - throw new Error('var method must contain a valid HTTP method name'); - } - - if (typeof path !== 'string') { - throw new Error('var path must be of type string'); - } - - if (typeof headers !== 'object') { - throw new Error('var headers must be of type object'); - } - - for (i = 0; i < globalParams.length; i++) { // Add global params to URL - path = addParam(path, globalParams[i].key, globalParams[i].value); - } - - if(window.localStorage && window.localStorage.getItem('cookieFallback')) { - headers['X-Fallback-Cookies'] = window.localStorage.getItem('cookieFallback'); - } - - for (let key in globalHeaders) { // Add Global Headers - if (globalHeaders.hasOwnProperty(key)) { - if (!headers[globalHeaders[key].key]) { - headers[globalHeaders[key].key] = globalHeaders[key].value; - } - } - } - - if(method === 'GET') { - for (let param in params) { - if (param.hasOwnProperty(key)) { - path = addParam(path, key + (Array.isArray(param) ? '[]' : ''), params[key]); - } - } - } - - switch (headers['content-type']) { // Parse request by content type - case 'application/json': - params = JSON.stringify(params); - break; - - case 'multipart/form-data': - let formData = new FormData(); - - Object.keys(params).forEach(function(key) { - let param = params[key]; - formData.append(key + (Array.isArray(param) ? '[]' : ''), param); - }); - - params = formData; - break; - } - - return new Promise(function (resolve, reject) { - - let request = new XMLHttpRequest(), key; - - request.withCredentials = true; - request.open(method, path, true); - - for (key in headers) { // Set Headers - if (headers.hasOwnProperty(key)) { - if (key === 'content-type' && headers[key] === 'multipart/form-data') { // Skip to avoid missing boundary - continue; - } - - request.setRequestHeader(key, headers[key]); - } - } - - request.onload = function () { - let data = request.response; - let contentType = this.getResponseHeader('content-type') || ''; - contentType = contentType.substring(0, contentType.indexOf(';')); - - switch (contentType) { - case 'application/json': - data = JSON.parse(data); - break; - } - - let cookieFallback = this.getResponseHeader('X-Fallback-Cookies') || ''; - - if(window.localStorage && cookieFallback) { - window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.'); - window.localStorage.setItem('cookieFallback', cookieFallback); - } - - if (4 === request.readyState && 399 >= request.status) { - resolve(data); - } else { - reject(data); - } - }; - - if (progress) { - request.addEventListener('progress', progress); - request.upload.addEventListener('progress', progress, false); - } - - // Handle network errors - request.onerror = function () { - reject(new Error("Network Error")); - }; - - request.send(params); - }) - }; - - return { - 'get': function(path, headers = {}, params = {}) { - return call('GET', path + ((Object.keys(params).length > 0) ? '?' + buildQuery(params) : ''), headers, {}); - }, - 'post': function(path, headers = {}, params = {}, progress = null) { - return call('POST', path, headers, params, progress); - }, - 'put': function(path, headers = {}, params = {}, progress = null) { - return call('PUT', path, headers, params, progress); - }, - 'patch': function(path, headers = {}, params = {}, progress = null) { - return call('PATCH', path, headers, params, progress); - }, - 'delete': function(path, headers = {}, params = {}, progress = null) { - return call('DELETE', path, headers, params, progress); - }, - 'addGlobalParam': addGlobalParam, - 'addGlobalHeader': addGlobalHeader - } - }(window.document); - - let account = { - - /** - * Get Account - * - * Get currently logged in user data as JSON object. - * - * @throws {Error} - * @return {Promise} - */ - get: function() { - let path = '/account'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Account - * - * 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](/docs/client/account#createVerification) route - * to start verifying the user email address. To allow your new user to login - * to his new account, you need to create a new [account - * session](/docs/client/account#createSession). - * - * @param {string} email - * @param {string} password - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - create: function(email, password, name = '') { - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - let path = '/account'; - - let payload = {}; - - if(email) { - payload['email'] = email; - } - - if(password) { - payload['password'] = password; - } - - if(name) { - payload['name'] = name; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Account - * - * Delete a currently logged in user account. Behind the scene, the user - * record is not deleted but permanently blocked from any access. This is done - * to avoid deleted accounts being overtaken by new users with the same email - * address. Any user-related resources like documents or storage files should - * be deleted separately. - * - * @throws {Error} - * @return {Promise} - */ - delete: function() { - let path = '/account'; - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Account Email - * - * Update currently logged in user account email address. After changing user - * address, user confirmation status is being reset and a new confirmation - * mail is sent. For security measures, user password is required to complete - * this request. - * - * @param {string} email - * @param {string} password - * @throws {Error} - * @return {Promise} - */ - updateEmail: function(email, password) { - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - let path = '/account/email'; - - let payload = {}; - - if(email) { - payload['email'] = email; - } - - if(password) { - payload['password'] = password; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Account Logs - * - * Get currently logged in user list of latest security activity logs. Each - * log returns user IP address, location and date and time of log. - * - * @throws {Error} - * @return {Promise} - */ - getLogs: function() { - let path = '/account/logs'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Account Name - * - * Update currently logged in user account name. - * - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - updateName: function(name) { - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/account/name'; - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Account Password - * - * Update currently logged in user password. For validation, user is required - * to pass the password twice. - * - * @param {string} password - * @param {string} oldPassword - * @throws {Error} - * @return {Promise} - */ - updatePassword: function(password, oldPassword) { - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - if(oldPassword === undefined) { - throw new Error('Missing required parameter: "oldPassword"'); - } - - let path = '/account/password'; - - let payload = {}; - - if(password) { - payload['password'] = password; - } - - if(oldPassword) { - payload['oldPassword'] = oldPassword; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Account Preferences - * - * Get currently logged in user preferences as a key-value object. - * - * @throws {Error} - * @return {Promise} - */ - getPrefs: function() { - let path = '/account/prefs'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Account Preferences - * - * Update currently logged in user account preferences. You can pass only the - * specific settings you wish to update. - * - * @param {object} prefs - * @throws {Error} - * @return {Promise} - */ - updatePrefs: function(prefs) { - if(prefs === undefined) { - throw new Error('Missing required parameter: "prefs"'); - } - - let path = '/account/prefs'; - - let payload = {}; - - if(prefs) { - payload['prefs'] = prefs; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Password Recovery - * - * 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](/docs/client/account#updateRecovery) - * endpoint to complete the process. - * - * @param {string} email - * @param {string} url - * @throws {Error} - * @return {Promise} - */ - createRecovery: function(email, url) { - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - let path = '/account/recovery'; - - let payload = {}; - - if(email) { - payload['email'] = email; - } - - if(url) { - payload['url'] = url; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Complete Password Recovery - * - * 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](/docs/client/account#createRecovery) endpoint. - * - * Please 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. - * - * @param {string} userId - * @param {string} secret - * @param {string} password - * @param {string} passwordAgain - * @throws {Error} - * @return {Promise} - */ - updateRecovery: function(userId, secret, password, passwordAgain) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(secret === undefined) { - throw new Error('Missing required parameter: "secret"'); - } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - if(passwordAgain === undefined) { - throw new Error('Missing required parameter: "passwordAgain"'); - } - - let path = '/account/recovery'; - - let payload = {}; - - if(userId) { - payload['userId'] = userId; - } - - if(secret) { - payload['secret'] = secret; - } - - if(password) { - payload['password'] = password; - } - - if(passwordAgain) { - payload['passwordAgain'] = passwordAgain; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Account Sessions - * - * Get currently logged in user list of active sessions across different - * devices. - * - * @throws {Error} - * @return {Promise} - */ - getSessions: function() { - let path = '/account/sessions'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Account Session - * - * Allow the user to login into his account by providing a valid email and - * password combination. This route will create a new session for the user. - * - * @param {string} email - * @param {string} password - * @throws {Error} - * @return {Promise} - */ - createSession: function(email, password) { - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - let path = '/account/sessions'; - - let payload = {}; - - if(email) { - payload['email'] = email; - } - - if(password) { - payload['password'] = password; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete All Account Sessions - * - * Delete all sessions from the user account and remove any sessions cookies - * from the end client. - * - * @throws {Error} - * @return {Promise} - */ - deleteSessions: function() { - let path = '/account/sessions'; - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Account Session with OAuth2 - * - * Allow the user to login to his account using the OAuth2 provider of his - * 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. - * - * @param {string} provider - * @param {string} success - * @param {string} failure - * @param {string[]} scopes - * @throws {Error} - * @return {Promise} - */ - createOAuth2Session: function(provider, success = 'https://appwrite.io/auth/oauth2/success', failure = 'https://appwrite.io/auth/oauth2/failure', scopes = []) { - if(provider === undefined) { - throw new Error('Missing required parameter: "provider"'); - } - - let path = '/account/sessions/oauth2/{provider}'.replace(new RegExp('{provider}', 'g'), provider); - - let payload = {}; - - if(success) { - payload['success'] = success; - } - - if(failure) { - payload['failure'] = failure; - } - - if(scopes) { - payload['scopes'] = scopes; - } - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - window.location = config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Delete Account Session - * - * Use this endpoint to log out the currently logged in user from all his - * account sessions across all his different devices. When using the option id - * argument, only the session unique ID provider will be deleted. - * - * @param {string} sessionId - * @throws {Error} - * @return {Promise} - */ - deleteSession: function(sessionId) { - if(sessionId === undefined) { - throw new Error('Missing required parameter: "sessionId"'); - } - - let path = '/account/sessions/{sessionId}'.replace(new RegExp('{sessionId}', 'g'), sessionId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Email Verification - * - * 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](/docs/client/account#updateAccountVerification). - * - * Please 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. - * - * - * @param {string} url - * @throws {Error} - * @return {Promise} - */ - createVerification: function(url) { - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - let path = '/account/verification'; - - let payload = {}; - - if(url) { - payload['url'] = url; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Complete Email Verification - * - * 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. - * - * @param {string} userId - * @param {string} secret - * @throws {Error} - * @return {Promise} - */ - updateVerification: function(userId, secret) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(secret === undefined) { - throw new Error('Missing required parameter: "secret"'); - } - - let path = '/account/verification'; - - let payload = {}; - - if(userId) { - payload['userId'] = userId; - } - - if(secret) { - payload['secret'] = secret; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let avatars = { - - /** - * Get Browser Icon - * - * 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 - * /account/sessions endpoint. Use width, height and quality arguments to - * change the output settings. - * - * @param {string} code - * @param {number} width - * @param {number} height - * @param {number} quality - * @throws {Error} - * @return {string} - */ - getBrowser: function(code, width = 100, height = 100, quality = 100) { - if(code === undefined) { - throw new Error('Missing required parameter: "code"'); - } - - let path = '/avatars/browsers/{code}'.replace(new RegExp('{code}', 'g'), code); - - let payload = {}; - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - if(quality) { - payload['quality'] = quality; - } - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get Credit Card Icon - * - * Need to display your users with your billing method or their payment - * methods? 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. - * - * @param {string} code - * @param {number} width - * @param {number} height - * @param {number} quality - * @throws {Error} - * @return {string} - */ - getCreditCard: function(code, width = 100, height = 100, quality = 100) { - if(code === undefined) { - throw new Error('Missing required parameter: "code"'); - } - - let path = '/avatars/credit-cards/{code}'.replace(new RegExp('{code}', 'g'), code); - - let payload = {}; - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - if(quality) { - payload['quality'] = quality; - } - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get Favicon - * - * Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote - * website URL. - * - * @param {string} url - * @throws {Error} - * @return {string} - */ - getFavicon: function(url) { - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - let path = '/avatars/favicon'; - - let payload = {}; - - if(url) { - payload['url'] = url; - } - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get Country Flag - * - * 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. - * - * @param {string} code - * @param {number} width - * @param {number} height - * @param {number} quality - * @throws {Error} - * @return {string} - */ - getFlag: function(code, width = 100, height = 100, quality = 100) { - if(code === undefined) { - throw new Error('Missing required parameter: "code"'); - } - - let path = '/avatars/flags/{code}'.replace(new RegExp('{code}', 'g'), code); - - let payload = {}; - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - if(quality) { - payload['quality'] = quality; - } - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get Image from URL - * - * 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. - * - * @param {string} url - * @param {number} width - * @param {number} height - * @throws {Error} - * @return {string} - */ - getImage: function(url, width = 400, height = 400) { - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - let path = '/avatars/image'; - - let payload = {}; - - if(url) { - payload['url'] = url; - } - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get User Initials - * - * 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. - * - * You 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. - * - * @param {string} name - * @param {number} width - * @param {number} height - * @param {string} color - * @param {string} background - * @throws {Error} - * @return {string} - */ - getInitials: function(name = '', width = 500, height = 500, color = '', background = '') { - let path = '/avatars/initials'; - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - if(color) { - payload['color'] = color; - } - - if(background) { - payload['background'] = background; - } - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get QR Code - * - * 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. - * - * @param {string} text - * @param {number} size - * @param {number} margin - * @param {boolean} download - * @throws {Error} - * @return {string} - */ - getQR: function(text, size = 400, margin = 1, download = false) { - if(text === undefined) { - throw new Error('Missing required parameter: "text"'); - } - - let path = '/avatars/qr'; - - let payload = {}; - - if(text) { - payload['text'] = text; - } - - if(size) { - payload['size'] = size; - } - - if(margin) { - payload['margin'] = margin; - } - - if(download) { - payload['download'] = download; - } - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - } - }; - - let database = { - - /** - * List Collections - * - * Get a list of all the user collections. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project collections. [Learn more about different API - * modes](/docs/admin). - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - listCollections: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/database/collections'; - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Collection - * - * Create a new Collection. - * - * @param {string} name - * @param {string[]} read - * @param {string[]} write - * @param {string[]} rules - * @throws {Error} - * @return {Promise} - */ - createCollection: function(name, read, write, rules) { - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - if(rules === undefined) { - throw new Error('Missing required parameter: "rules"'); - } - - let path = '/database/collections'; - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(read) { - payload['read'] = read; - } - - if(write) { - payload['write'] = write; - } - - if(rules) { - payload['rules'] = rules; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Collection - * - * Get collection by its unique ID. This endpoint response returns a JSON - * object with the collection metadata. - * - * @param {string} collectionId - * @throws {Error} - * @return {Promise} - */ - getCollection: function(collectionId) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - let path = '/database/collections/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Collection - * - * Update collection by its unique ID. - * - * @param {string} collectionId - * @param {string} name - * @param {string[]} read - * @param {string[]} write - * @param {string[]} rules - * @throws {Error} - * @return {Promise} - */ - updateCollection: function(collectionId, name, read, write, rules = []) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - let path = '/database/collections/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(read) { - payload['read'] = read; - } - - if(write) { - payload['write'] = write; - } - - if(rules) { - payload['rules'] = rules; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Collection - * - * Delete a collection by its unique ID. Only users with write permissions - * have access to delete this resource. - * - * @param {string} collectionId - * @throws {Error} - * @return {Promise} - */ - deleteCollection: function(collectionId) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - let path = '/database/collections/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Documents - * - * Get a list of all the user documents. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project documents. [Learn more about different API - * modes](/docs/admin). - * - * @param {string} collectionId - * @param {string[]} filters - * @param {number} limit - * @param {number} offset - * @param {string} orderField - * @param {string} orderType - * @param {string} orderCast - * @param {string} search - * @throws {Error} - * @return {Promise} - */ - listDocuments: function(collectionId, filters = [], limit = 25, offset = 0, orderField = '$id', orderType = 'ASC', orderCast = 'string', search = '') { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - let path = '/database/collections/{collectionId}/documents'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - let payload = {}; - - if(filters) { - payload['filters'] = filters; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderField) { - payload['orderField'] = orderField; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - if(orderCast) { - payload['orderCast'] = orderCast; - } - - if(search) { - payload['search'] = search; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Document - * - * Create a new Document. Before using this route, you should create a new - * collection resource using either a [server - * integration](/docs/server/database?sdk=nodejs#createCollection) API or - * directly from your database console. - * - * @param {string} collectionId - * @param {object} data - * @param {string[]} read - * @param {string[]} write - * @param {string} parentDocument - * @param {string} parentProperty - * @param {string} parentPropertyType - * @throws {Error} - * @return {Promise} - */ - createDocument: function(collectionId, data, read, write, parentDocument = '', parentProperty = '', parentPropertyType = 'assign') { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - if(data === undefined) { - throw new Error('Missing required parameter: "data"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - let path = '/database/collections/{collectionId}/documents'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - let payload = {}; - - if(data) { - payload['data'] = data; - } - - if(read) { - payload['read'] = read; - } - - if(write) { - payload['write'] = write; - } - - if(parentDocument) { - payload['parentDocument'] = parentDocument; - } - - if(parentProperty) { - payload['parentProperty'] = parentProperty; - } - - if(parentPropertyType) { - payload['parentPropertyType'] = parentPropertyType; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Document - * - * Get document by its unique ID. This endpoint response returns a JSON object - * with the document data. - * - * @param {string} collectionId - * @param {string} documentId - * @throws {Error} - * @return {Promise} - */ - getDocument: function(collectionId, documentId) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - if(documentId === undefined) { - throw new Error('Missing required parameter: "documentId"'); - } - - let path = '/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Document - * - * - * @param {string} collectionId - * @param {string} documentId - * @param {object} data - * @param {string[]} read - * @param {string[]} write - * @throws {Error} - * @return {Promise} - */ - updateDocument: function(collectionId, documentId, data, read, write) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - if(documentId === undefined) { - throw new Error('Missing required parameter: "documentId"'); - } - - if(data === undefined) { - throw new Error('Missing required parameter: "data"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - let path = '/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - let payload = {}; - - if(data) { - payload['data'] = data; - } - - if(read) { - payload['read'] = read; - } - - if(write) { - payload['write'] = write; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Document - * - * Delete document by its unique ID. This endpoint deletes only the parent - * documents, his attributes and relations to other documents. Child documents - * **will not** be deleted. - * - * @param {string} collectionId - * @param {string} documentId - * @throws {Error} - * @return {Promise} - */ - deleteDocument: function(collectionId, documentId) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - if(documentId === undefined) { - throw new Error('Missing required parameter: "documentId"'); - } - - let path = '/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let functions = { - - /** - * List Functions - * - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - list: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/functions'; - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Function - * - * - * @param {string} name - * @param {string} env - * @param {object} vars - * @param {string[]} events - * @param {string} schedule - * @param {number} timeout - * @throws {Error} - * @return {Promise} - */ - create: function(name, env, vars = [], events = [], schedule = '', timeout = 15) { - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(env === undefined) { - throw new Error('Missing required parameter: "env"'); - } - - let path = '/functions'; - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(env) { - payload['env'] = env; - } - - if(vars) { - payload['vars'] = vars; - } - - if(events) { - payload['events'] = events; - } - - if(schedule) { - payload['schedule'] = schedule; - } - - if(timeout) { - payload['timeout'] = timeout; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Function - * - * - * @param {string} functionId - * @throws {Error} - * @return {Promise} - */ - get: function(functionId) { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - let path = '/functions/{functionId}'.replace(new RegExp('{functionId}', 'g'), functionId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Function - * - * - * @param {string} functionId - * @param {string} name - * @param {object} vars - * @param {string[]} events - * @param {string} schedule - * @param {number} timeout - * @throws {Error} - * @return {Promise} - */ - update: function(functionId, name, vars = [], events = [], schedule = '', timeout = 15) { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/functions/{functionId}'.replace(new RegExp('{functionId}', 'g'), functionId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(vars) { - payload['vars'] = vars; - } - - if(events) { - payload['events'] = events; - } - - if(schedule) { - payload['schedule'] = schedule; - } - - if(timeout) { - payload['timeout'] = timeout; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Function - * - * - * @param {string} functionId - * @throws {Error} - * @return {Promise} - */ - delete: function(functionId) { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - let path = '/functions/{functionId}'.replace(new RegExp('{functionId}', 'g'), functionId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Executions - * - * - * @param {string} functionId - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - listExecutions: function(functionId, search = '', limit = 25, offset = 0, orderType = 'ASC') { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - let path = '/functions/{functionId}/executions'.replace(new RegExp('{functionId}', 'g'), functionId); - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Execution - * - * - * @param {string} functionId - * @param {number} async - * @throws {Error} - * @return {Promise} - */ - createExecution: function(functionId, async = 1) { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - let path = '/functions/{functionId}/executions'.replace(new RegExp('{functionId}', 'g'), functionId); - - let payload = {}; - - if(async) { - payload['async'] = async; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Execution - * - * - * @param {string} functionId - * @param {string} executionId - * @throws {Error} - * @return {Promise} - */ - getExecution: function(functionId, executionId) { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - if(executionId === undefined) { - throw new Error('Missing required parameter: "executionId"'); - } - - let path = '/functions/{functionId}/executions/{executionId}'.replace(new RegExp('{functionId}', 'g'), functionId).replace(new RegExp('{executionId}', 'g'), executionId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Function Tag - * - * - * @param {string} functionId - * @param {string} tag - * @throws {Error} - * @return {Promise} - */ - updateTag: function(functionId, tag) { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - if(tag === undefined) { - throw new Error('Missing required parameter: "tag"'); - } - - let path = '/functions/{functionId}/tag'.replace(new RegExp('{functionId}', 'g'), functionId); - - let payload = {}; - - if(tag) { - payload['tag'] = tag; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Tags - * - * - * @param {string} functionId - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - listTags: function(functionId, search = '', limit = 25, offset = 0, orderType = 'ASC') { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - let path = '/functions/{functionId}/tags'.replace(new RegExp('{functionId}', 'g'), functionId); - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Tag - * - * - * @param {string} functionId - * @param {string} command - * @param {File} code - * @throws {Error} - * @return {Promise} - */ - createTag: function(functionId, command, code) { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - if(command === undefined) { - throw new Error('Missing required parameter: "command"'); - } - - if(code === undefined) { - throw new Error('Missing required parameter: "code"'); - } - - let path = '/functions/{functionId}/tags'.replace(new RegExp('{functionId}', 'g'), functionId); - - let payload = {}; - - if(command) { - payload['command'] = command; - } - - if(code) { - payload['code'] = code; - } - - return http - .post(path, { - 'content-type': 'multipart/form-data', - }, payload); - }, - - /** - * Get Tag - * - * - * @param {string} functionId - * @param {string} tagId - * @throws {Error} - * @return {Promise} - */ - getTag: function(functionId, tagId) { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - if(tagId === undefined) { - throw new Error('Missing required parameter: "tagId"'); - } - - let path = '/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}', 'g'), functionId).replace(new RegExp('{tagId}', 'g'), tagId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Tag - * - * - * @param {string} functionId - * @param {string} tagId - * @throws {Error} - * @return {Promise} - */ - deleteTag: function(functionId, tagId) { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - if(tagId === undefined) { - throw new Error('Missing required parameter: "tagId"'); - } - - let path = '/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}', 'g'), functionId).replace(new RegExp('{tagId}', 'g'), tagId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let health = { - - /** - * Get HTTP - * - * Check the Appwrite HTTP server is up and responsive. - * - * @throws {Error} - * @return {Promise} - */ - get: function() { - let path = '/health'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Anti virus - * - * Check the Appwrite Anti Virus server is up and connection is successful. - * - * @throws {Error} - * @return {Promise} - */ - getAntiVirus: function() { - let path = '/health/anti-virus'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Cache - * - * Check the Appwrite in-memory cache server is up and connection is - * successful. - * - * @throws {Error} - * @return {Promise} - */ - getCache: function() { - let path = '/health/cache'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get DB - * - * Check the Appwrite database server is up and connection is successful. - * - * @throws {Error} - * @return {Promise} - */ - getDB: function() { - let path = '/health/db'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Certificate Queue - * - * Get the number of certificates that are waiting to be issued against - * [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue - * server. - * - * @throws {Error} - * @return {Promise} - */ - getQueueCertificates: function() { - let path = '/health/queue/certificates'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Functions Queue - * - * - * @throws {Error} - * @return {Promise} - */ - getQueueFunctions: function() { - let path = '/health/queue/functions'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Logs Queue - * - * Get the number of logs that are waiting to be processed in the Appwrite - * internal queue server. - * - * @throws {Error} - * @return {Promise} - */ - getQueueLogs: function() { - let path = '/health/queue/logs'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Tasks Queue - * - * Get the number of tasks that are waiting to be processed in the Appwrite - * internal queue server. - * - * @throws {Error} - * @return {Promise} - */ - getQueueTasks: function() { - let path = '/health/queue/tasks'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Usage Queue - * - * Get the number of usage stats that are waiting to be processed in the - * Appwrite internal queue server. - * - * @throws {Error} - * @return {Promise} - */ - getQueueUsage: function() { - let path = '/health/queue/usage'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Webhooks Queue - * - * Get the number of webhooks that are waiting to be processed in the Appwrite - * internal queue server. - * - * @throws {Error} - * @return {Promise} - */ - getQueueWebhooks: function() { - let path = '/health/queue/webhooks'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Local Storage - * - * Check the Appwrite local storage device is up and connection is successful. - * - * @throws {Error} - * @return {Promise} - */ - getStorageLocal: function() { - let path = '/health/storage/local'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Time - * - * 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. - * - * @throws {Error} - * @return {Promise} - */ - getTime: function() { - let path = '/health/time'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let locale = { - - /** - * Get User Locale - * - * 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. - * - * ([IP Geolocation by DB-IP](https://db-ip.com)) - * - * @throws {Error} - * @return {Promise} - */ - get: function() { - let path = '/locale'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Continents - * - * List of all continents. You can use the locale header to get the data in a - * supported language. - * - * @throws {Error} - * @return {Promise} - */ - getContinents: function() { - let path = '/locale/continents'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Countries - * - * List of all countries. You can use the locale header to get the data in a - * supported language. - * - * @throws {Error} - * @return {Promise} - */ - getCountries: function() { - let path = '/locale/countries'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List EU Countries - * - * 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. - * - * @throws {Error} - * @return {Promise} - */ - getCountriesEU: function() { - let path = '/locale/countries/eu'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Countries Phone Codes - * - * List of all countries phone codes. You can use the locale header to get the - * data in a supported language. - * - * @throws {Error} - * @return {Promise} - */ - getCountriesPhones: function() { - let path = '/locale/countries/phones'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Currencies - * - * 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. - * - * @throws {Error} - * @return {Promise} - */ - getCurrencies: function() { - let path = '/locale/currencies'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Languages - * - * List of all languages classified by ISO 639-1 including 2-letter code, name - * in English, and name in the respective language. - * - * @throws {Error} - * @return {Promise} - */ - getLanguages: function() { - let path = '/locale/languages'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let projects = { - - /** - * List Projects - * - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - list: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/projects'; - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Project - * - * - * @param {string} name - * @param {string} teamId - * @param {string} description - * @param {string} logo - * @param {string} url - * @param {string} legalName - * @param {string} legalCountry - * @param {string} legalState - * @param {string} legalCity - * @param {string} legalAddress - * @param {string} legalTaxId - * @throws {Error} - * @return {Promise} - */ - create: function(name, teamId, description = '', logo = '', url = '', legalName = '', legalCountry = '', legalState = '', legalCity = '', legalAddress = '', legalTaxId = '') { - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - let path = '/projects'; - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(teamId) { - payload['teamId'] = teamId; - } - - if(description) { - payload['description'] = description; - } - - if(logo) { - payload['logo'] = logo; - } - - if(url) { - payload['url'] = url; - } - - if(legalName) { - payload['legalName'] = legalName; - } - - if(legalCountry) { - payload['legalCountry'] = legalCountry; - } - - if(legalState) { - payload['legalState'] = legalState; - } - - if(legalCity) { - payload['legalCity'] = legalCity; - } - - if(legalAddress) { - payload['legalAddress'] = legalAddress; - } - - if(legalTaxId) { - payload['legalTaxId'] = legalTaxId; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Project - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - get: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Project - * - * - * @param {string} projectId - * @param {string} name - * @param {string} description - * @param {string} logo - * @param {string} url - * @param {string} legalName - * @param {string} legalCountry - * @param {string} legalState - * @param {string} legalCity - * @param {string} legalAddress - * @param {string} legalTaxId - * @throws {Error} - * @return {Promise} - */ - update: function(projectId, name, description = '', logo = '', url = '', legalName = '', legalCountry = '', legalState = '', legalCity = '', legalAddress = '', legalTaxId = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/projects/{projectId}'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(description) { - payload['description'] = description; - } - - if(logo) { - payload['logo'] = logo; - } - - if(url) { - payload['url'] = url; - } - - if(legalName) { - payload['legalName'] = legalName; - } - - if(legalCountry) { - payload['legalCountry'] = legalCountry; - } - - if(legalState) { - payload['legalState'] = legalState; - } - - if(legalCity) { - payload['legalCity'] = legalCity; - } - - if(legalAddress) { - payload['legalAddress'] = legalAddress; - } - - if(legalTaxId) { - payload['legalTaxId'] = legalTaxId; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Project - * - * - * @param {string} projectId - * @param {string} password - * @throws {Error} - * @return {Promise} - */ - delete: function(projectId, password) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - let path = '/projects/{projectId}'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(password) { - payload['password'] = password; - } - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Domains - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listDomains: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/domains'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Domain - * - * - * @param {string} projectId - * @param {string} domain - * @throws {Error} - * @return {Promise} - */ - createDomain: function(projectId, domain) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(domain === undefined) { - throw new Error('Missing required parameter: "domain"'); - } - - let path = '/projects/{projectId}/domains'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(domain) { - payload['domain'] = domain; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Domain - * - * - * @param {string} projectId - * @param {string} domainId - * @throws {Error} - * @return {Promise} - */ - getDomain: function(projectId, domainId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(domainId === undefined) { - throw new Error('Missing required parameter: "domainId"'); - } - - let path = '/projects/{projectId}/domains/{domainId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{domainId}', 'g'), domainId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Domain - * - * - * @param {string} projectId - * @param {string} domainId - * @throws {Error} - * @return {Promise} - */ - deleteDomain: function(projectId, domainId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(domainId === undefined) { - throw new Error('Missing required parameter: "domainId"'); - } - - let path = '/projects/{projectId}/domains/{domainId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{domainId}', 'g'), domainId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Domain Verification Status - * - * - * @param {string} projectId - * @param {string} domainId - * @throws {Error} - * @return {Promise} - */ - updateDomainVerification: function(projectId, domainId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(domainId === undefined) { - throw new Error('Missing required parameter: "domainId"'); - } - - let path = '/projects/{projectId}/domains/{domainId}/verification'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{domainId}', 'g'), domainId); - - let payload = {}; - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Keys - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listKeys: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/keys'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Key - * - * - * @param {string} projectId - * @param {string} name - * @param {string[]} scopes - * @throws {Error} - * @return {Promise} - */ - createKey: function(projectId, name, scopes) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(scopes === undefined) { - throw new Error('Missing required parameter: "scopes"'); - } - - let path = '/projects/{projectId}/keys'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(scopes) { - payload['scopes'] = scopes; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Key - * - * - * @param {string} projectId - * @param {string} keyId - * @throws {Error} - * @return {Promise} - */ - getKey: function(projectId, keyId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(keyId === undefined) { - throw new Error('Missing required parameter: "keyId"'); - } - - let path = '/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{keyId}', 'g'), keyId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Key - * - * - * @param {string} projectId - * @param {string} keyId - * @param {string} name - * @param {string[]} scopes - * @throws {Error} - * @return {Promise} - */ - updateKey: function(projectId, keyId, name, scopes) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(keyId === undefined) { - throw new Error('Missing required parameter: "keyId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(scopes === undefined) { - throw new Error('Missing required parameter: "scopes"'); - } - - let path = '/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{keyId}', 'g'), keyId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(scopes) { - payload['scopes'] = scopes; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Key - * - * - * @param {string} projectId - * @param {string} keyId - * @throws {Error} - * @return {Promise} - */ - deleteKey: function(projectId, keyId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(keyId === undefined) { - throw new Error('Missing required parameter: "keyId"'); - } - - let path = '/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{keyId}', 'g'), keyId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Project OAuth2 - * - * - * @param {string} projectId - * @param {string} provider - * @param {string} appId - * @param {string} secret - * @throws {Error} - * @return {Promise} - */ - updateOAuth2: function(projectId, provider, appId = '', secret = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(provider === undefined) { - throw new Error('Missing required parameter: "provider"'); - } - - let path = '/projects/{projectId}/oauth2'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(provider) { - payload['provider'] = provider; - } - - if(appId) { - payload['appId'] = appId; - } - - if(secret) { - payload['secret'] = secret; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Platforms - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listPlatforms: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/platforms'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Platform - * - * - * @param {string} projectId - * @param {string} type - * @param {string} name - * @param {string} key - * @param {string} store - * @param {string} hostname - * @throws {Error} - * @return {Promise} - */ - createPlatform: function(projectId, type, name, key = '', store = '', hostname = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(type === undefined) { - throw new Error('Missing required parameter: "type"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/projects/{projectId}/platforms'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(type) { - payload['type'] = type; - } - - if(name) { - payload['name'] = name; - } - - if(key) { - payload['key'] = key; - } - - if(store) { - payload['store'] = store; - } - - if(hostname) { - payload['hostname'] = hostname; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Platform - * - * - * @param {string} projectId - * @param {string} platformId - * @throws {Error} - * @return {Promise} - */ - getPlatform: function(projectId, platformId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(platformId === undefined) { - throw new Error('Missing required parameter: "platformId"'); - } - - let path = '/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{platformId}', 'g'), platformId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Platform - * - * - * @param {string} projectId - * @param {string} platformId - * @param {string} name - * @param {string} key - * @param {string} store - * @param {string} hostname - * @throws {Error} - * @return {Promise} - */ - updatePlatform: function(projectId, platformId, name, key = '', store = '', hostname = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(platformId === undefined) { - throw new Error('Missing required parameter: "platformId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{platformId}', 'g'), platformId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(key) { - payload['key'] = key; - } - - if(store) { - payload['store'] = store; - } - - if(hostname) { - payload['hostname'] = hostname; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Platform - * - * - * @param {string} projectId - * @param {string} platformId - * @throws {Error} - * @return {Promise} - */ - deletePlatform: function(projectId, platformId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(platformId === undefined) { - throw new Error('Missing required parameter: "platformId"'); - } - - let path = '/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{platformId}', 'g'), platformId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Tasks - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listTasks: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/tasks'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Task - * - * - * @param {string} projectId - * @param {string} name - * @param {string} status - * @param {string} schedule - * @param {boolean} security - * @param {string} httpMethod - * @param {string} httpUrl - * @param {string[]} httpHeaders - * @param {string} httpUser - * @param {string} httpPass - * @throws {Error} - * @return {Promise} - */ - createTask: function(projectId, name, status, schedule, security, httpMethod, httpUrl, httpHeaders = [], httpUser = '', httpPass = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(status === undefined) { - throw new Error('Missing required parameter: "status"'); - } - - if(schedule === undefined) { - throw new Error('Missing required parameter: "schedule"'); - } - - if(security === undefined) { - throw new Error('Missing required parameter: "security"'); - } - - if(httpMethod === undefined) { - throw new Error('Missing required parameter: "httpMethod"'); - } - - if(httpUrl === undefined) { - throw new Error('Missing required parameter: "httpUrl"'); - } - - let path = '/projects/{projectId}/tasks'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(status) { - payload['status'] = status; - } - - if(schedule) { - payload['schedule'] = schedule; - } - - if(security) { - payload['security'] = security; - } - - if(httpMethod) { - payload['httpMethod'] = httpMethod; - } - - if(httpUrl) { - payload['httpUrl'] = httpUrl; - } - - if(httpHeaders) { - payload['httpHeaders'] = httpHeaders; - } - - if(httpUser) { - payload['httpUser'] = httpUser; - } - - if(httpPass) { - payload['httpPass'] = httpPass; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Task - * - * - * @param {string} projectId - * @param {string} taskId - * @throws {Error} - * @return {Promise} - */ - getTask: function(projectId, taskId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(taskId === undefined) { - throw new Error('Missing required parameter: "taskId"'); - } - - let path = '/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{taskId}', 'g'), taskId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Task - * - * - * @param {string} projectId - * @param {string} taskId - * @param {string} name - * @param {string} status - * @param {string} schedule - * @param {boolean} security - * @param {string} httpMethod - * @param {string} httpUrl - * @param {string[]} httpHeaders - * @param {string} httpUser - * @param {string} httpPass - * @throws {Error} - * @return {Promise} - */ - updateTask: function(projectId, taskId, name, status, schedule, security, httpMethod, httpUrl, httpHeaders = [], httpUser = '', httpPass = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(taskId === undefined) { - throw new Error('Missing required parameter: "taskId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(status === undefined) { - throw new Error('Missing required parameter: "status"'); - } - - if(schedule === undefined) { - throw new Error('Missing required parameter: "schedule"'); - } - - if(security === undefined) { - throw new Error('Missing required parameter: "security"'); - } - - if(httpMethod === undefined) { - throw new Error('Missing required parameter: "httpMethod"'); - } - - if(httpUrl === undefined) { - throw new Error('Missing required parameter: "httpUrl"'); - } - - let path = '/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{taskId}', 'g'), taskId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(status) { - payload['status'] = status; - } - - if(schedule) { - payload['schedule'] = schedule; - } - - if(security) { - payload['security'] = security; - } - - if(httpMethod) { - payload['httpMethod'] = httpMethod; - } - - if(httpUrl) { - payload['httpUrl'] = httpUrl; - } - - if(httpHeaders) { - payload['httpHeaders'] = httpHeaders; - } - - if(httpUser) { - payload['httpUser'] = httpUser; - } - - if(httpPass) { - payload['httpPass'] = httpPass; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Task - * - * - * @param {string} projectId - * @param {string} taskId - * @throws {Error} - * @return {Promise} - */ - deleteTask: function(projectId, taskId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(taskId === undefined) { - throw new Error('Missing required parameter: "taskId"'); - } - - let path = '/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{taskId}', 'g'), taskId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Project - * - * - * @param {string} projectId - * @param {string} range - * @throws {Error} - * @return {Promise} - */ - getUsage: function(projectId, range = 'last30') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/usage'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(range) { - payload['range'] = range; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Webhooks - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listWebhooks: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Webhook - * - * - * @param {string} projectId - * @param {string} name - * @param {string[]} events - * @param {string} url - * @param {boolean} security - * @param {string} httpUser - * @param {string} httpPass - * @throws {Error} - * @return {Promise} - */ - createWebhook: function(projectId, name, events, url, security, httpUser = '', httpPass = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(events === undefined) { - throw new Error('Missing required parameter: "events"'); - } - - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - if(security === undefined) { - throw new Error('Missing required parameter: "security"'); - } - - let path = '/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(events) { - payload['events'] = events; - } - - if(url) { - payload['url'] = url; - } - - if(security) { - payload['security'] = security; - } - - if(httpUser) { - payload['httpUser'] = httpUser; - } - - if(httpPass) { - payload['httpPass'] = httpPass; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Webhook - * - * - * @param {string} projectId - * @param {string} webhookId - * @throws {Error} - * @return {Promise} - */ - getWebhook: function(projectId, webhookId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(webhookId === undefined) { - throw new Error('Missing required parameter: "webhookId"'); - } - - let path = '/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{webhookId}', 'g'), webhookId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Webhook - * - * - * @param {string} projectId - * @param {string} webhookId - * @param {string} name - * @param {string[]} events - * @param {string} url - * @param {boolean} security - * @param {string} httpUser - * @param {string} httpPass - * @throws {Error} - * @return {Promise} - */ - updateWebhook: function(projectId, webhookId, name, events, url, security, httpUser = '', httpPass = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(webhookId === undefined) { - throw new Error('Missing required parameter: "webhookId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(events === undefined) { - throw new Error('Missing required parameter: "events"'); - } - - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - if(security === undefined) { - throw new Error('Missing required parameter: "security"'); - } - - let path = '/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{webhookId}', 'g'), webhookId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(events) { - payload['events'] = events; - } - - if(url) { - payload['url'] = url; - } - - if(security) { - payload['security'] = security; - } - - if(httpUser) { - payload['httpUser'] = httpUser; - } - - if(httpPass) { - payload['httpPass'] = httpPass; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Webhook - * - * - * @param {string} projectId - * @param {string} webhookId - * @throws {Error} - * @return {Promise} - */ - deleteWebhook: function(projectId, webhookId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(webhookId === undefined) { - throw new Error('Missing required parameter: "webhookId"'); - } - - let path = '/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{webhookId}', 'g'), webhookId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let storage = { - - /** - * List Files - * - * Get a list of all the user files. You can use the query params to filter - * your results. On admin mode, this endpoint will return a list of all of the - * project files. [Learn more about different API modes](/docs/admin). - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - listFiles: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/storage/files'; - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create File - * - * Create a new file. The user who creates the file will automatically be - * assigned to read and write access unless he has passed custom values for - * read and write arguments. - * - * @param {File} file - * @param {string[]} read - * @param {string[]} write - * @throws {Error} - * @return {Promise} - */ - createFile: function(file, read, write) { - if(file === undefined) { - throw new Error('Missing required parameter: "file"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - let path = '/storage/files'; - - let payload = {}; - - if(file) { - payload['file'] = file; - } - - if(read) { - payload['read'] = read; - } - - if(write) { - payload['write'] = write; - } - - return http - .post(path, { - 'content-type': 'multipart/form-data', - }, payload); - }, - - /** - * Get File - * - * Get file by its unique ID. This endpoint response returns a JSON object - * with the file metadata. - * - * @param {string} fileId - * @throws {Error} - * @return {Promise} - */ - getFile: function(fileId) { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update File - * - * Update file by its unique ID. Only users with write permissions have access - * to update this resource. - * - * @param {string} fileId - * @param {string[]} read - * @param {string[]} write - * @throws {Error} - * @return {Promise} - */ - updateFile: function(fileId, read, write) { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - if(read) { - payload['read'] = read; - } - - if(write) { - payload['write'] = write; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete File - * - * Delete a file by its unique ID. Only users with write permissions have - * access to delete this resource. - * - * @param {string} fileId - * @throws {Error} - * @return {Promise} - */ - deleteFile: function(fileId) { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get File for Download - * - * Get 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. - * - * @param {string} fileId - * @throws {Error} - * @return {string} - */ - getFileDownload: function(fileId) { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - let path = '/storage/files/{fileId}/download'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get File Preview - * - * 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. - * - * @param {string} fileId - * @param {number} width - * @param {number} height - * @param {number} quality - * @param {string} background - * @param {string} output - * @throws {Error} - * @return {string} - */ - getFilePreview: function(fileId, width = 0, height = 0, quality = 100, background = '', output = '') { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - let path = '/storage/files/{fileId}/preview'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - if(quality) { - payload['quality'] = quality; - } - - if(background) { - payload['background'] = background; - } - - if(output) { - payload['output'] = output; - } - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get File for View - * - * Get file content by its unique ID. This endpoint is similar to the download - * method but returns with no 'Content-Disposition: attachment' header. - * - * @param {string} fileId - * @param {string} as - * @throws {Error} - * @return {string} - */ - getFileView: function(fileId, as = '') { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - let path = '/storage/files/{fileId}/view'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - if(as) { - payload['as'] = as; - } - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - } - }; - - let teams = { - - /** - * List Teams - * - * Get a list of all the current user teams. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project teams. [Learn more about different API modes](/docs/admin). - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - list: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/teams'; - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Team - * - * Create a new team. The user who creates the team will automatically be - * assigned as the owner of the team. The team owner can invite new members, - * who will be able add new owners and update or delete the team from your - * project. - * - * @param {string} name - * @param {string[]} roles - * @throws {Error} - * @return {Promise} - */ - create: function(name, roles = ["owner"]) { - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/teams'; - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(roles) { - payload['roles'] = roles; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Team - * - * Get team by its unique ID. All team members have read access for this - * resource. - * - * @param {string} teamId - * @throws {Error} - * @return {Promise} - */ - get: function(teamId) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Team - * - * Update team by its unique ID. Only team owners have write access for this - * resource. - * - * @param {string} teamId - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - update: function(teamId, name) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Team - * - * Delete team by its unique ID. Only team owners have write access for this - * resource. - * - * @param {string} teamId - * @throws {Error} - * @return {Promise} - */ - delete: function(teamId) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Team Memberships - * - * Get team members by the team unique ID. All team members have read access - * for this list of resources. - * - * @param {string} teamId - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - getMemberships: function(teamId, search = '', limit = 25, offset = 0, orderType = 'ASC') { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - let path = '/teams/{teamId}/memberships'.replace(new RegExp('{teamId}', 'g'), teamId); - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Team Membership - * - * Use this endpoint to invite a new member to join your team. An email with a - * link to join the team will be sent to the new member email address if the - * member doesn't exist in the project it will be created automatically. - * - * Use the 'URL' parameter to redirect the user from the invitation email back - * to your app. When the user is redirected, use the [Update Team Membership - * Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the - * user to accept the invitation to the team. - * - * Please note that in order to avoid a [Redirect - * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) - * the only valid redirect URL's are the once from domains you have set when - * added your platforms in the console interface. - * - * @param {string} teamId - * @param {string} email - * @param {string[]} roles - * @param {string} url - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - createMembership: function(teamId, email, roles, url, name = '') { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(roles === undefined) { - throw new Error('Missing required parameter: "roles"'); - } - - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - let path = '/teams/{teamId}/memberships'.replace(new RegExp('{teamId}', 'g'), teamId); - - let payload = {}; - - if(email) { - payload['email'] = email; - } - - if(name) { - payload['name'] = name; - } - - if(roles) { - payload['roles'] = roles; - } - - if(url) { - payload['url'] = url; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Team Membership - * - * 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 he didn't accept it. - * - * @param {string} teamId - * @param {string} inviteId - * @throws {Error} - * @return {Promise} - */ - deleteMembership: function(teamId, inviteId) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - if(inviteId === undefined) { - throw new Error('Missing required parameter: "inviteId"'); - } - - let path = '/teams/{teamId}/memberships/{inviteId}'.replace(new RegExp('{teamId}', 'g'), teamId).replace(new RegExp('{inviteId}', 'g'), inviteId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Team Membership Status - * - * Use this endpoint to allow a user to accept an invitation to join a team - * after he is being redirected back to your app from the invitation email he - * was sent. - * - * @param {string} teamId - * @param {string} inviteId - * @param {string} userId - * @param {string} secret - * @throws {Error} - * @return {Promise} - */ - updateMembershipStatus: function(teamId, inviteId, userId, secret) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - if(inviteId === undefined) { - throw new Error('Missing required parameter: "inviteId"'); - } - - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(secret === undefined) { - throw new Error('Missing required parameter: "secret"'); - } - - let path = '/teams/{teamId}/memberships/{inviteId}/status'.replace(new RegExp('{teamId}', 'g'), teamId).replace(new RegExp('{inviteId}', 'g'), inviteId); - - let payload = {}; - - if(userId) { - payload['userId'] = userId; - } - - if(secret) { - payload['secret'] = secret; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let users = { - - /** - * List Users - * - * Get a list of all the project users. You can use the query params to filter - * your results. - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - list: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/users'; - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create User - * - * Create a new user. - * - * @param {string} email - * @param {string} password - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - create: function(email, password, name = '') { - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - let path = '/users'; - - let payload = {}; - - if(email) { - payload['email'] = email; - } - - if(password) { - payload['password'] = password; - } - - if(name) { - payload['name'] = name; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get User - * - * Get user by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - get: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete User - * - * Delete a user by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - deleteUser: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get User Logs - * - * Get user activity logs list by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - getLogs: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}/logs'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get User Preferences - * - * Get user preferences by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - getPrefs: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}/prefs'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update User Preferences - * - * Update user preferences by its unique ID. You can pass only the specific - * settings you wish to update. - * - * @param {string} userId - * @param {object} prefs - * @throws {Error} - * @return {Promise} - */ - updatePrefs: function(userId, prefs) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(prefs === undefined) { - throw new Error('Missing required parameter: "prefs"'); - } - - let path = '/users/{userId}/prefs'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - if(prefs) { - payload['prefs'] = prefs; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get User Sessions - * - * Get user sessions list by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - getSessions: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}/sessions'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete User Sessions - * - * Delete all user sessions by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - deleteSessions: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}/sessions'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete User Session - * - * Delete user sessions by its unique ID. - * - * @param {string} userId - * @param {string} sessionId - * @throws {Error} - * @return {Promise} - */ - deleteSession: function(userId, sessionId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(sessionId === undefined) { - throw new Error('Missing required parameter: "sessionId"'); - } - - let path = '/users/{userId}/sessions/{sessionId}'.replace(new RegExp('{userId}', 'g'), userId).replace(new RegExp('{sessionId}', 'g'), sessionId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update User Status - * - * Update user status by its unique ID. - * - * @param {string} userId - * @param {string} status - * @throws {Error} - * @return {Promise} - */ - updateStatus: function(userId, status) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(status === undefined) { - throw new Error('Missing required parameter: "status"'); - } - - let path = '/users/{userId}/status'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - if(status) { - payload['status'] = status; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - return { - setEndpoint: setEndpoint, - setProject: setProject, - setKey: setKey, - setLocale: setLocale, - setMode: setMode, - account: account, - avatars: avatars, - database: database, - functions: functions, - health: health, - locale: locale, - projects: projects, - storage: storage, - teams: teams, - users: users - }; - }; - - if(typeof module !== "undefined") { - module.exports = window.Appwrite; - } - -})((typeof window !== "undefined") ? window : {}); \ No newline at end of file diff --git a/app/sdks/console-web/src/sdk.min.js b/app/sdks/console-web/src/sdk.min.js deleted file mode 100644 index 2413458654..0000000000 --- a/app/sdks/console-web/src/sdk.min.js +++ /dev/null @@ -1,431 +0,0 @@ -(function(window){'use strict';window.Appwrite=function(){let config={endpoint:'https://appwrite.io/v1',project:'',key:'',locale:'',mode:'',};let setEndpoint=function(endpoint){config.endpoint=endpoint;return this};let setProject=function(value){http.addGlobalHeader('X-Appwrite-Project',value);config.project=value;return this};let setKey=function(value){http.addGlobalHeader('X-Appwrite-Key',value);config.key=value;return this};let setLocale=function(value){http.addGlobalHeader('X-Appwrite-Locale',value);config.locale=value;return this};let setMode=function(value){http.addGlobalHeader('X-Appwrite-Mode',value);config.mode=value;return this};let http=function(document){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){let a=document.createElement('a'),regex=/(?:\?|&|&)+([^=]+)(?:=([^&]*))*/g;let match,str=[];a.href=url;param=encodeURIComponent(param);while(match=regex.exec(a.search))if(param!==match[1])str.push(match[1]+(match[2]?"="+match[2]:""));str.push(param+(value?"="+encodeURIComponent(value):""));a.search=str.join("&");return a.href};let buildQuery=function(params){let str=[];for(let p in params){if(Array.isArray(params[p])){for(let index=0;index=request.status){resolve(data)}else{reject(data)}};if(progress){request.addEventListener('progress',progress);request.upload.addEventListener('progress',progress,!1)} -request.onerror=function(){reject(new Error("Network Error"))};request.send(params)})};return{'get':function(path,headers={},params={}){return call('GET',path+((Object.keys(params).length>0)?'?'+buildQuery(params):''),headers,{})},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress)},'put':function(path,headers={},params={},progress=null){return call('PUT',path,headers,params,progress)},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress)},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress)},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let account={get:function(){let path='/account';let payload={};return http.get(path,{'content-type':'application/json',},payload)},create:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"')} -if(password===undefined){throw new Error('Missing required parameter: "password"')} -let path='/account';let payload={};if(email){payload.email=email} -if(password){payload.password=password} -if(name){payload.name=name} -return http.post(path,{'content-type':'application/json',},payload)},delete:function(){let path='/account';let payload={};return http.delete(path,{'content-type':'application/json',},payload)},updateEmail:function(email,password){if(email===undefined){throw new Error('Missing required parameter: "email"')} -if(password===undefined){throw new Error('Missing required parameter: "password"')} -let path='/account/email';let payload={};if(email){payload.email=email} -if(password){payload.password=password} -return http.patch(path,{'content-type':'application/json',},payload)},getLogs:function(){let path='/account/logs';let payload={};return http.get(path,{'content-type':'application/json',},payload)},updateName:function(name){if(name===undefined){throw new Error('Missing required parameter: "name"')} -let path='/account/name';let payload={};if(name){payload.name=name} -return http.patch(path,{'content-type':'application/json',},payload)},updatePassword:function(password,oldPassword){if(password===undefined){throw new Error('Missing required parameter: "password"')} -if(oldPassword===undefined){throw new Error('Missing required parameter: "oldPassword"')} -let path='/account/password';let payload={};if(password){payload.password=password} -if(oldPassword){payload.oldPassword=oldPassword} -return http.patch(path,{'content-type':'application/json',},payload)},getPrefs:function(){let path='/account/prefs';let payload={};return http.get(path,{'content-type':'application/json',},payload)},updatePrefs:function(prefs){if(prefs===undefined){throw new Error('Missing required parameter: "prefs"')} -let path='/account/prefs';let payload={};if(prefs){payload.prefs=prefs} -return http.patch(path,{'content-type':'application/json',},payload)},createRecovery:function(email,url){if(email===undefined){throw new Error('Missing required parameter: "email"')} -if(url===undefined){throw new Error('Missing required parameter: "url"')} -let path='/account/recovery';let payload={};if(email){payload.email=email} -if(url){payload.url=url} -return http.post(path,{'content-type':'application/json',},payload)},updateRecovery:function(userId,secret,password,passwordAgain){if(userId===undefined){throw new Error('Missing required parameter: "userId"')} -if(secret===undefined){throw new Error('Missing required parameter: "secret"')} -if(password===undefined){throw new Error('Missing required parameter: "password"')} -if(passwordAgain===undefined){throw new Error('Missing required parameter: "passwordAgain"')} -let path='/account/recovery';let payload={};if(userId){payload.userId=userId} -if(secret){payload.secret=secret} -if(password){payload.password=password} -if(passwordAgain){payload.passwordAgain=passwordAgain} -return http.put(path,{'content-type':'application/json',},payload)},getSessions:function(){let path='/account/sessions';let payload={};return http.get(path,{'content-type':'application/json',},payload)},createSession:function(email,password){if(email===undefined){throw new Error('Missing required parameter: "email"')} -if(password===undefined){throw new Error('Missing required parameter: "password"')} -let path='/account/sessions';let payload={};if(email){payload.email=email} -if(password){payload.password=password} -return http.post(path,{'content-type':'application/json',},payload)},deleteSessions:function(){let path='/account/sessions';let payload={};return http.delete(path,{'content-type':'application/json',},payload)},createOAuth2Session:function(provider,success='https://appwrite.io/auth/oauth2/success',failure='https://appwrite.io/auth/oauth2/failure',scopes=[]){if(provider===undefined){throw new Error('Missing required parameter: "provider"')} -let path='/account/sessions/oauth2/{provider}'.replace(new RegExp('{provider}','g'),provider);let payload={};if(success){payload.success=success} -if(failure){payload.failure=failure} -if(scopes){payload.scopes=scopes} -payload.project=config.project;payload.key=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index; - - /** - * Create Account - * - * 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](/docs/client/account#createVerification) route - * to start verifying the user email address. To allow your new user to login - * to his new account, you need to create a new [account - * session](/docs/client/account#createSession). - * - * @param {string} email - * @param {string} password - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - create(email: string, password: string, name: string): Promise; - - /** - * Delete Account - * - * Delete a currently logged in user account. Behind the scene, the user - * record is not deleted but permanently blocked from any access. This is done - * to avoid deleted accounts being overtaken by new users with the same email - * address. Any user-related resources like documents or storage files should - * be deleted separately. - * - * @throws {Error} - * @return {Promise} - */ - delete(): Promise; - - /** - * Update Account Email - * - * Update currently logged in user account email address. After changing user - * address, user confirmation status is being reset and a new confirmation - * mail is sent. For security measures, user password is required to complete - * this request. - * - * @param {string} email - * @param {string} password - * @throws {Error} - * @return {Promise} - */ - updateEmail(email: string, password: string): Promise; - - /** - * Get Account Logs - * - * Get currently logged in user list of latest security activity logs. Each - * log returns user IP address, location and date and time of log. - * - * @throws {Error} - * @return {Promise} - */ - getLogs(): Promise; - - /** - * Update Account Name - * - * Update currently logged in user account name. - * - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - updateName(name: string): Promise; - - /** - * Update Account Password - * - * Update currently logged in user password. For validation, user is required - * to pass the password twice. - * - * @param {string} password - * @param {string} oldPassword - * @throws {Error} - * @return {Promise} - */ - updatePassword(password: string, oldPassword: string): Promise; - - /** - * Get Account Preferences - * - * Get currently logged in user preferences as a key-value object. - * - * @throws {Error} - * @return {Promise} - */ - getPrefs(): Promise; - - /** - * Update Account Preferences - * - * Update currently logged in user account preferences. You can pass only the - * specific settings you wish to update. - * - * @param {object} prefs - * @throws {Error} - * @return {Promise} - */ - updatePrefs(prefs: object): Promise; - - /** - * Create Password Recovery - * - * 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](/docs/client/account#updateRecovery) - * endpoint to complete the process. - * - * @param {string} email - * @param {string} url - * @throws {Error} - * @return {Promise} - */ - createRecovery(email: string, url: string): Promise; - - /** - * Complete Password Recovery - * - * 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](/docs/client/account#createRecovery) endpoint. - * - * Please 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. - * - * @param {string} userId - * @param {string} secret - * @param {string} password - * @param {string} passwordAgain - * @throws {Error} - * @return {Promise} - */ - updateRecovery(userId: string, secret: string, password: string, passwordAgain: string): Promise; - - /** - * Get Account Sessions - * - * Get currently logged in user list of active sessions across different - * devices. - * - * @throws {Error} - * @return {Promise} - */ - getSessions(): Promise; - - /** - * Create Account Session - * - * Allow the user to login into his account by providing a valid email and - * password combination. This route will create a new session for the user. - * - * @param {string} email - * @param {string} password - * @throws {Error} - * @return {Promise} - */ - createSession(email: string, password: string): Promise; - - /** - * Delete All Account Sessions - * - * Delete all sessions from the user account and remove any sessions cookies - * from the end client. - * - * @throws {Error} - * @return {Promise} - */ - deleteSessions(): Promise; - - /** - * Create Account Session with OAuth2 - * - * Allow the user to login to his account using the OAuth2 provider of his - * 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. - * - * @param {string} provider - * @param {string} success - * @param {string} failure - * @param {string[]} scopes - * @throws {Error} - * @return {Promise} - */ - createOAuth2Session(provider: string, success: string, failure: string, scopes: string[]): Promise; - - /** - * Delete Account Session - * - * Use this endpoint to log out the currently logged in user from all his - * account sessions across all his different devices. When using the option id - * argument, only the session unique ID provider will be deleted. - * - * @param {string} sessionId - * @throws {Error} - * @return {Promise} - */ - deleteSession(sessionId: string): Promise; - - /** - * Create Email Verification - * - * 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](/docs/client/account#updateAccountVerification). - * - * Please 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. - * - * - * @param {string} url - * @throws {Error} - * @return {Promise} - */ - createVerification(url: string): Promise; - - /** - * Complete Email Verification - * - * 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. - * - * @param {string} userId - * @param {string} secret - * @throws {Error} - * @return {Promise} - */ - updateVerification(userId: string, secret: string): Promise; - - } - - export interface Avatars { - - /** - * Get Browser Icon - * - * 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 - * /account/sessions endpoint. Use width, height and quality arguments to - * change the output settings. - * - * @param {string} code - * @param {number} width - * @param {number} height - * @param {number} quality - * @throws {Error} - * @return {string} - */ - getBrowser(code: string, width: number, height: number, quality: number): string; - - /** - * Get Credit Card Icon - * - * Need to display your users with your billing method or their payment - * methods? 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. - * - * @param {string} code - * @param {number} width - * @param {number} height - * @param {number} quality - * @throws {Error} - * @return {string} - */ - getCreditCard(code: string, width: number, height: number, quality: number): string; - - /** - * Get Favicon - * - * Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote - * website URL. - * - * @param {string} url - * @throws {Error} - * @return {string} - */ - getFavicon(url: string): string; - - /** - * Get Country Flag - * - * 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. - * - * @param {string} code - * @param {number} width - * @param {number} height - * @param {number} quality - * @throws {Error} - * @return {string} - */ - getFlag(code: string, width: number, height: number, quality: number): string; - - /** - * Get Image from URL - * - * 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. - * - * @param {string} url - * @param {number} width - * @param {number} height - * @throws {Error} - * @return {string} - */ - getImage(url: string, width: number, height: number): string; - - /** - * Get User Initials - * - * 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. - * - * You 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. - * - * @param {string} name - * @param {number} width - * @param {number} height - * @param {string} color - * @param {string} background - * @throws {Error} - * @return {string} - */ - getInitials(name: string, width: number, height: number, color: string, background: string): string; - - /** - * Get QR Code - * - * 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. - * - * @param {string} text - * @param {number} size - * @param {number} margin - * @param {boolean} download - * @throws {Error} - * @return {string} - */ - getQR(text: string, size: number, margin: number, download: boolean): string; - - } - - export interface Database { - - /** - * List Collections - * - * Get a list of all the user collections. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project collections. [Learn more about different API - * modes](/docs/admin). - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - listCollections(search: string, limit: number, offset: number, orderType: string): Promise; - - /** - * Create Collection - * - * Create a new Collection. - * - * @param {string} name - * @param {string[]} read - * @param {string[]} write - * @param {string[]} rules - * @throws {Error} - * @return {Promise} - */ - createCollection(name: string, read: string[], write: string[], rules: string[]): Promise; - - /** - * Get Collection - * - * Get collection by its unique ID. This endpoint response returns a JSON - * object with the collection metadata. - * - * @param {string} collectionId - * @throws {Error} - * @return {Promise} - */ - getCollection(collectionId: string): Promise; - - /** - * Update Collection - * - * Update collection by its unique ID. - * - * @param {string} collectionId - * @param {string} name - * @param {string[]} read - * @param {string[]} write - * @param {string[]} rules - * @throws {Error} - * @return {Promise} - */ - updateCollection(collectionId: string, name: string, read: string[], write: string[], rules: string[]): Promise; - - /** - * Delete Collection - * - * Delete a collection by its unique ID. Only users with write permissions - * have access to delete this resource. - * - * @param {string} collectionId - * @throws {Error} - * @return {Promise} - */ - deleteCollection(collectionId: string): Promise; - - /** - * List Documents - * - * Get a list of all the user documents. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project documents. [Learn more about different API - * modes](/docs/admin). - * - * @param {string} collectionId - * @param {string[]} filters - * @param {number} limit - * @param {number} offset - * @param {string} orderField - * @param {string} orderType - * @param {string} orderCast - * @param {string} search - * @throws {Error} - * @return {Promise} - */ - listDocuments(collectionId: string, filters: string[], limit: number, offset: number, orderField: string, orderType: string, orderCast: string, search: string): Promise; - - /** - * Create Document - * - * Create a new Document. Before using this route, you should create a new - * collection resource using either a [server - * integration](/docs/server/database?sdk=nodejs#createCollection) API or - * directly from your database console. - * - * @param {string} collectionId - * @param {object} data - * @param {string[]} read - * @param {string[]} write - * @param {string} parentDocument - * @param {string} parentProperty - * @param {string} parentPropertyType - * @throws {Error} - * @return {Promise} - */ - createDocument(collectionId: string, data: object, read: string[], write: string[], parentDocument: string, parentProperty: string, parentPropertyType: string): Promise; - - /** - * Get Document - * - * Get document by its unique ID. This endpoint response returns a JSON object - * with the document data. - * - * @param {string} collectionId - * @param {string} documentId - * @throws {Error} - * @return {Promise} - */ - getDocument(collectionId: string, documentId: string): Promise; - - /** - * Update Document - * - * - * @param {string} collectionId - * @param {string} documentId - * @param {object} data - * @param {string[]} read - * @param {string[]} write - * @throws {Error} - * @return {Promise} - */ - updateDocument(collectionId: string, documentId: string, data: object, read: string[], write: string[]): Promise; - - /** - * Delete Document - * - * Delete document by its unique ID. This endpoint deletes only the parent - * documents, his attributes and relations to other documents. Child documents - * **will not** be deleted. - * - * @param {string} collectionId - * @param {string} documentId - * @throws {Error} - * @return {Promise} - */ - deleteDocument(collectionId: string, documentId: string): Promise; - - } - - export interface Functions { - - /** - * List Functions - * - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - list(search: string, limit: number, offset: number, orderType: string): Promise; - - /** - * Create Function - * - * - * @param {string} name - * @param {string} env - * @param {object} vars - * @param {string[]} events - * @param {string} schedule - * @param {number} timeout - * @throws {Error} - * @return {Promise} - */ - create(name: string, env: string, vars: object, events: string[], schedule: string, timeout: number): Promise; - - /** - * Get Function - * - * - * @param {string} functionId - * @throws {Error} - * @return {Promise} - */ - get(functionId: string): Promise; - - /** - * Update Function - * - * - * @param {string} functionId - * @param {string} name - * @param {object} vars - * @param {string[]} events - * @param {string} schedule - * @param {number} timeout - * @throws {Error} - * @return {Promise} - */ - update(functionId: string, name: string, vars: object, events: string[], schedule: string, timeout: number): Promise; - - /** - * Delete Function - * - * - * @param {string} functionId - * @throws {Error} - * @return {Promise} - */ - delete(functionId: string): Promise; - - /** - * List Executions - * - * - * @param {string} functionId - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - listExecutions(functionId: string, search: string, limit: number, offset: number, orderType: string): Promise; - - /** - * Create Execution - * - * - * @param {string} functionId - * @param {number} async - * @throws {Error} - * @return {Promise} - */ - createExecution(functionId: string, async: number): Promise; - - /** - * Get Execution - * - * - * @param {string} functionId - * @param {string} executionId - * @throws {Error} - * @return {Promise} - */ - getExecution(functionId: string, executionId: string): Promise; - - /** - * Update Function Tag - * - * - * @param {string} functionId - * @param {string} tag - * @throws {Error} - * @return {Promise} - */ - updateTag(functionId: string, tag: string): Promise; - - /** - * List Tags - * - * - * @param {string} functionId - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - listTags(functionId: string, search: string, limit: number, offset: number, orderType: string): Promise; - - /** - * Create Tag - * - * - * @param {string} functionId - * @param {string} command - * @param {File} code - * @throws {Error} - * @return {Promise} - */ - createTag(functionId: string, command: string, code: File): Promise; - - /** - * Get Tag - * - * - * @param {string} functionId - * @param {string} tagId - * @throws {Error} - * @return {Promise} - */ - getTag(functionId: string, tagId: string): Promise; - - /** - * Delete Tag - * - * - * @param {string} functionId - * @param {string} tagId - * @throws {Error} - * @return {Promise} - */ - deleteTag(functionId: string, tagId: string): Promise; - - } - - export interface Health { - - /** - * Get HTTP - * - * Check the Appwrite HTTP server is up and responsive. - * - * @throws {Error} - * @return {Promise} - */ - get(): Promise; - - /** - * Get Anti virus - * - * Check the Appwrite Anti Virus server is up and connection is successful. - * - * @throws {Error} - * @return {Promise} - */ - getAntiVirus(): Promise; - - /** - * Get Cache - * - * Check the Appwrite in-memory cache server is up and connection is - * successful. - * - * @throws {Error} - * @return {Promise} - */ - getCache(): Promise; - - /** - * Get DB - * - * Check the Appwrite database server is up and connection is successful. - * - * @throws {Error} - * @return {Promise} - */ - getDB(): Promise; - - /** - * Get Certificate Queue - * - * Get the number of certificates that are waiting to be issued against - * [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue - * server. - * - * @throws {Error} - * @return {Promise} - */ - getQueueCertificates(): Promise; - - /** - * Get Functions Queue - * - * - * @throws {Error} - * @return {Promise} - */ - getQueueFunctions(): Promise; - - /** - * Get Logs Queue - * - * Get the number of logs that are waiting to be processed in the Appwrite - * internal queue server. - * - * @throws {Error} - * @return {Promise} - */ - getQueueLogs(): Promise; - - /** - * Get Tasks Queue - * - * Get the number of tasks that are waiting to be processed in the Appwrite - * internal queue server. - * - * @throws {Error} - * @return {Promise} - */ - getQueueTasks(): Promise; - - /** - * Get Usage Queue - * - * Get the number of usage stats that are waiting to be processed in the - * Appwrite internal queue server. - * - * @throws {Error} - * @return {Promise} - */ - getQueueUsage(): Promise; - - /** - * Get Webhooks Queue - * - * Get the number of webhooks that are waiting to be processed in the Appwrite - * internal queue server. - * - * @throws {Error} - * @return {Promise} - */ - getQueueWebhooks(): Promise; - - /** - * Get Local Storage - * - * Check the Appwrite local storage device is up and connection is successful. - * - * @throws {Error} - * @return {Promise} - */ - getStorageLocal(): Promise; - - /** - * Get Time - * - * 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. - * - * @throws {Error} - * @return {Promise} - */ - getTime(): Promise; - - } - - export interface Locale { - - /** - * Get User Locale - * - * 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. - * - * ([IP Geolocation by DB-IP](https://db-ip.com)) - * - * @throws {Error} - * @return {Promise} - */ - get(): Promise; - - /** - * List Continents - * - * List of all continents. You can use the locale header to get the data in a - * supported language. - * - * @throws {Error} - * @return {Promise} - */ - getContinents(): Promise; - - /** - * List Countries - * - * List of all countries. You can use the locale header to get the data in a - * supported language. - * - * @throws {Error} - * @return {Promise} - */ - getCountries(): Promise; - - /** - * List EU Countries - * - * 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. - * - * @throws {Error} - * @return {Promise} - */ - getCountriesEU(): Promise; - - /** - * List Countries Phone Codes - * - * List of all countries phone codes. You can use the locale header to get the - * data in a supported language. - * - * @throws {Error} - * @return {Promise} - */ - getCountriesPhones(): Promise; - - /** - * List Currencies - * - * 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. - * - * @throws {Error} - * @return {Promise} - */ - getCurrencies(): Promise; - - /** - * List Languages - * - * List of all languages classified by ISO 639-1 including 2-letter code, name - * in English, and name in the respective language. - * - * @throws {Error} - * @return {Promise} - */ - getLanguages(): Promise; - - } - - export interface Projects { - - /** - * List Projects - * - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - list(search: string, limit: number, offset: number, orderType: string): Promise; - - /** - * Create Project - * - * - * @param {string} name - * @param {string} teamId - * @param {string} description - * @param {string} logo - * @param {string} url - * @param {string} legalName - * @param {string} legalCountry - * @param {string} legalState - * @param {string} legalCity - * @param {string} legalAddress - * @param {string} legalTaxId - * @throws {Error} - * @return {Promise} - */ - create(name: string, teamId: string, description: string, logo: string, url: string, legalName: string, legalCountry: string, legalState: string, legalCity: string, legalAddress: string, legalTaxId: string): Promise; - - /** - * Get Project - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - get(projectId: string): Promise; - - /** - * Update Project - * - * - * @param {string} projectId - * @param {string} name - * @param {string} description - * @param {string} logo - * @param {string} url - * @param {string} legalName - * @param {string} legalCountry - * @param {string} legalState - * @param {string} legalCity - * @param {string} legalAddress - * @param {string} legalTaxId - * @throws {Error} - * @return {Promise} - */ - update(projectId: string, name: string, description: string, logo: string, url: string, legalName: string, legalCountry: string, legalState: string, legalCity: string, legalAddress: string, legalTaxId: string): Promise; - - /** - * Delete Project - * - * - * @param {string} projectId - * @param {string} password - * @throws {Error} - * @return {Promise} - */ - delete(projectId: string, password: string): Promise; - - /** - * List Domains - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listDomains(projectId: string): Promise; - - /** - * Create Domain - * - * - * @param {string} projectId - * @param {string} domain - * @throws {Error} - * @return {Promise} - */ - createDomain(projectId: string, domain: string): Promise; - - /** - * Get Domain - * - * - * @param {string} projectId - * @param {string} domainId - * @throws {Error} - * @return {Promise} - */ - getDomain(projectId: string, domainId: string): Promise; - - /** - * Delete Domain - * - * - * @param {string} projectId - * @param {string} domainId - * @throws {Error} - * @return {Promise} - */ - deleteDomain(projectId: string, domainId: string): Promise; - - /** - * Update Domain Verification Status - * - * - * @param {string} projectId - * @param {string} domainId - * @throws {Error} - * @return {Promise} - */ - updateDomainVerification(projectId: string, domainId: string): Promise; - - /** - * List Keys - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listKeys(projectId: string): Promise; - - /** - * Create Key - * - * - * @param {string} projectId - * @param {string} name - * @param {string[]} scopes - * @throws {Error} - * @return {Promise} - */ - createKey(projectId: string, name: string, scopes: string[]): Promise; - - /** - * Get Key - * - * - * @param {string} projectId - * @param {string} keyId - * @throws {Error} - * @return {Promise} - */ - getKey(projectId: string, keyId: string): Promise; - - /** - * Update Key - * - * - * @param {string} projectId - * @param {string} keyId - * @param {string} name - * @param {string[]} scopes - * @throws {Error} - * @return {Promise} - */ - updateKey(projectId: string, keyId: string, name: string, scopes: string[]): Promise; - - /** - * Delete Key - * - * - * @param {string} projectId - * @param {string} keyId - * @throws {Error} - * @return {Promise} - */ - deleteKey(projectId: string, keyId: string): Promise; - - /** - * Update Project OAuth2 - * - * - * @param {string} projectId - * @param {string} provider - * @param {string} appId - * @param {string} secret - * @throws {Error} - * @return {Promise} - */ - updateOAuth2(projectId: string, provider: string, appId: string, secret: string): Promise; - - /** - * List Platforms - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listPlatforms(projectId: string): Promise; - - /** - * Create Platform - * - * - * @param {string} projectId - * @param {string} type - * @param {string} name - * @param {string} key - * @param {string} store - * @param {string} hostname - * @throws {Error} - * @return {Promise} - */ - createPlatform(projectId: string, type: string, name: string, key: string, store: string, hostname: string): Promise; - - /** - * Get Platform - * - * - * @param {string} projectId - * @param {string} platformId - * @throws {Error} - * @return {Promise} - */ - getPlatform(projectId: string, platformId: string): Promise; - - /** - * Update Platform - * - * - * @param {string} projectId - * @param {string} platformId - * @param {string} name - * @param {string} key - * @param {string} store - * @param {string} hostname - * @throws {Error} - * @return {Promise} - */ - updatePlatform(projectId: string, platformId: string, name: string, key: string, store: string, hostname: string): Promise; - - /** - * Delete Platform - * - * - * @param {string} projectId - * @param {string} platformId - * @throws {Error} - * @return {Promise} - */ - deletePlatform(projectId: string, platformId: string): Promise; - - /** - * List Tasks - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listTasks(projectId: string): Promise; - - /** - * Create Task - * - * - * @param {string} projectId - * @param {string} name - * @param {string} status - * @param {string} schedule - * @param {boolean} security - * @param {string} httpMethod - * @param {string} httpUrl - * @param {string[]} httpHeaders - * @param {string} httpUser - * @param {string} httpPass - * @throws {Error} - * @return {Promise} - */ - createTask(projectId: string, name: string, status: string, schedule: string, security: boolean, httpMethod: string, httpUrl: string, httpHeaders: string[], httpUser: string, httpPass: string): Promise; - - /** - * Get Task - * - * - * @param {string} projectId - * @param {string} taskId - * @throws {Error} - * @return {Promise} - */ - getTask(projectId: string, taskId: string): Promise; - - /** - * Update Task - * - * - * @param {string} projectId - * @param {string} taskId - * @param {string} name - * @param {string} status - * @param {string} schedule - * @param {boolean} security - * @param {string} httpMethod - * @param {string} httpUrl - * @param {string[]} httpHeaders - * @param {string} httpUser - * @param {string} httpPass - * @throws {Error} - * @return {Promise} - */ - updateTask(projectId: string, taskId: string, name: string, status: string, schedule: string, security: boolean, httpMethod: string, httpUrl: string, httpHeaders: string[], httpUser: string, httpPass: string): Promise; - - /** - * Delete Task - * - * - * @param {string} projectId - * @param {string} taskId - * @throws {Error} - * @return {Promise} - */ - deleteTask(projectId: string, taskId: string): Promise; - - /** - * Get Project - * - * - * @param {string} projectId - * @param {string} range - * @throws {Error} - * @return {Promise} - */ - getUsage(projectId: string, range: string): Promise; - - /** - * List Webhooks - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listWebhooks(projectId: string): Promise; - - /** - * Create Webhook - * - * - * @param {string} projectId - * @param {string} name - * @param {string[]} events - * @param {string} url - * @param {boolean} security - * @param {string} httpUser - * @param {string} httpPass - * @throws {Error} - * @return {Promise} - */ - createWebhook(projectId: string, name: string, events: string[], url: string, security: boolean, httpUser: string, httpPass: string): Promise; - - /** - * Get Webhook - * - * - * @param {string} projectId - * @param {string} webhookId - * @throws {Error} - * @return {Promise} - */ - getWebhook(projectId: string, webhookId: string): Promise; - - /** - * Update Webhook - * - * - * @param {string} projectId - * @param {string} webhookId - * @param {string} name - * @param {string[]} events - * @param {string} url - * @param {boolean} security - * @param {string} httpUser - * @param {string} httpPass - * @throws {Error} - * @return {Promise} - */ - updateWebhook(projectId: string, webhookId: string, name: string, events: string[], url: string, security: boolean, httpUser: string, httpPass: string): Promise; - - /** - * Delete Webhook - * - * - * @param {string} projectId - * @param {string} webhookId - * @throws {Error} - * @return {Promise} - */ - deleteWebhook(projectId: string, webhookId: string): Promise; - - } - - export interface Storage { - - /** - * List Files - * - * Get a list of all the user files. You can use the query params to filter - * your results. On admin mode, this endpoint will return a list of all of the - * project files. [Learn more about different API modes](/docs/admin). - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - listFiles(search: string, limit: number, offset: number, orderType: string): Promise; - - /** - * Create File - * - * Create a new file. The user who creates the file will automatically be - * assigned to read and write access unless he has passed custom values for - * read and write arguments. - * - * @param {File} file - * @param {string[]} read - * @param {string[]} write - * @throws {Error} - * @return {Promise} - */ - createFile(file: File, read: string[], write: string[]): Promise; - - /** - * Get File - * - * Get file by its unique ID. This endpoint response returns a JSON object - * with the file metadata. - * - * @param {string} fileId - * @throws {Error} - * @return {Promise} - */ - getFile(fileId: string): Promise; - - /** - * Update File - * - * Update file by its unique ID. Only users with write permissions have access - * to update this resource. - * - * @param {string} fileId - * @param {string[]} read - * @param {string[]} write - * @throws {Error} - * @return {Promise} - */ - updateFile(fileId: string, read: string[], write: string[]): Promise; - - /** - * Delete File - * - * Delete a file by its unique ID. Only users with write permissions have - * access to delete this resource. - * - * @param {string} fileId - * @throws {Error} - * @return {Promise} - */ - deleteFile(fileId: string): Promise; - - /** - * Get File for Download - * - * Get 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. - * - * @param {string} fileId - * @throws {Error} - * @return {string} - */ - getFileDownload(fileId: string): string; - - /** - * Get File Preview - * - * 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. - * - * @param {string} fileId - * @param {number} width - * @param {number} height - * @param {number} quality - * @param {string} background - * @param {string} output - * @throws {Error} - * @return {string} - */ - getFilePreview(fileId: string, width: number, height: number, quality: number, background: string, output: string): string; - - /** - * Get File for View - * - * Get file content by its unique ID. This endpoint is similar to the download - * method but returns with no 'Content-Disposition: attachment' header. - * - * @param {string} fileId - * @param {string} as - * @throws {Error} - * @return {string} - */ - getFileView(fileId: string, as: string): string; - - } - - export interface Teams { - - /** - * List Teams - * - * Get a list of all the current user teams. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project teams. [Learn more about different API modes](/docs/admin). - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - list(search: string, limit: number, offset: number, orderType: string): Promise; - - /** - * Create Team - * - * Create a new team. The user who creates the team will automatically be - * assigned as the owner of the team. The team owner can invite new members, - * who will be able add new owners and update or delete the team from your - * project. - * - * @param {string} name - * @param {string[]} roles - * @throws {Error} - * @return {Promise} - */ - create(name: string, roles: string[]): Promise; - - /** - * Get Team - * - * Get team by its unique ID. All team members have read access for this - * resource. - * - * @param {string} teamId - * @throws {Error} - * @return {Promise} - */ - get(teamId: string): Promise; - - /** - * Update Team - * - * Update team by its unique ID. Only team owners have write access for this - * resource. - * - * @param {string} teamId - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - update(teamId: string, name: string): Promise; - - /** - * Delete Team - * - * Delete team by its unique ID. Only team owners have write access for this - * resource. - * - * @param {string} teamId - * @throws {Error} - * @return {Promise} - */ - delete(teamId: string): Promise; - - /** - * Get Team Memberships - * - * Get team members by the team unique ID. All team members have read access - * for this list of resources. - * - * @param {string} teamId - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - getMemberships(teamId: string, search: string, limit: number, offset: number, orderType: string): Promise; - - /** - * Create Team Membership - * - * Use this endpoint to invite a new member to join your team. An email with a - * link to join the team will be sent to the new member email address if the - * member doesn't exist in the project it will be created automatically. - * - * Use the 'URL' parameter to redirect the user from the invitation email back - * to your app. When the user is redirected, use the [Update Team Membership - * Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the - * user to accept the invitation to the team. - * - * Please note that in order to avoid a [Redirect - * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) - * the only valid redirect URL's are the once from domains you have set when - * added your platforms in the console interface. - * - * @param {string} teamId - * @param {string} email - * @param {string[]} roles - * @param {string} url - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - createMembership(teamId: string, email: string, roles: string[], url: string, name: string): Promise; - - /** - * Delete Team Membership - * - * 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 he didn't accept it. - * - * @param {string} teamId - * @param {string} inviteId - * @throws {Error} - * @return {Promise} - */ - deleteMembership(teamId: string, inviteId: string): Promise; - - /** - * Update Team Membership Status - * - * Use this endpoint to allow a user to accept an invitation to join a team - * after he is being redirected back to your app from the invitation email he - * was sent. - * - * @param {string} teamId - * @param {string} inviteId - * @param {string} userId - * @param {string} secret - * @throws {Error} - * @return {Promise} - */ - updateMembershipStatus(teamId: string, inviteId: string, userId: string, secret: string): Promise; - - } - - export interface Users { - - /** - * List Users - * - * Get a list of all the project users. You can use the query params to filter - * your results. - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - list(search: string, limit: number, offset: number, orderType: string): Promise; - - /** - * Create User - * - * Create a new user. - * - * @param {string} email - * @param {string} password - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - create(email: string, password: string, name: string): Promise; - - /** - * Get User - * - * Get user by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - get(userId: string): Promise; - - /** - * Delete User - * - * Delete a user by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - deleteUser(userId: string): Promise; - - /** - * Get User Logs - * - * Get user activity logs list by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - getLogs(userId: string): Promise; - - /** - * Get User Preferences - * - * Get user preferences by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - getPrefs(userId: string): Promise; - - /** - * Update User Preferences - * - * Update user preferences by its unique ID. You can pass only the specific - * settings you wish to update. - * - * @param {string} userId - * @param {object} prefs - * @throws {Error} - * @return {Promise} - */ - updatePrefs(userId: string, prefs: object): Promise; - - /** - * Get User Sessions - * - * Get user sessions list by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - getSessions(userId: string): Promise; - - /** - * Delete User Sessions - * - * Delete all user sessions by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - deleteSessions(userId: string): Promise; - - /** - * Delete User Session - * - * Delete user sessions by its unique ID. - * - * @param {string} userId - * @param {string} sessionId - * @throws {Error} - * @return {Promise} - */ - deleteSession(userId: string, sessionId: string): Promise; - - /** - * Update User Status - * - * Update user status by its unique ID. - * - * @param {string} userId - * @param {string} status - * @throws {Error} - * @return {Promise} - */ - updateStatus(userId: string, status: string): Promise; - - } - - -} \ No newline at end of file diff --git a/app/sdks/server-deno/CHANGELOG.md b/app/sdks/server-deno/CHANGELOG.md deleted file mode 100644 index fa4d35e687..0000000000 --- a/app/sdks/server-deno/CHANGELOG.md +++ /dev/null @@ -1 +0,0 @@ -# Change Log \ No newline at end of file diff --git a/app/sdks/server-deno/LICENSE b/app/sdks/server-deno/LICENSE deleted file mode 100644 index fc7c051a91..0000000000 --- a/app/sdks/server-deno/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/app/sdks/server-deno/README.md b/app/sdks/server-deno/README.md deleted file mode 100644 index 82bd02c8ef..0000000000 --- a/app/sdks/server-deno/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Appwrite Deno SDK - -![License](https://img.shields.io/github/license/appwrite/sdk-for-deno.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.6.2-blue.svg?v=1) - -**This SDK is compatible with Appwrite server version 0.6.2. For older versions, please check previous releases.** - -Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. - Use the Deno SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. - For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) - - - -![Appwrite](https://appwrite.io/images/github.png) - -## Installation - -```javascript -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; -``` - -## Contribution - -This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request. - -## License - -Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. \ No newline at end of file diff --git a/app/sdks/server-deno/mod.ts b/app/sdks/server-deno/mod.ts deleted file mode 100644 index 3e51466fe6..0000000000 --- a/app/sdks/server-deno/mod.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Client } from "./src/client.ts"; -import { Avatars } from "./src/services/avatars.ts"; -import { Database } from "./src/services/database.ts"; -import { Health } from "./src/services/health.ts"; -import { Locale } from "./src/services/locale.ts"; -import { Storage } from "./src/services/storage.ts"; -import { Teams } from "./src/services/teams.ts"; -import { Users } from "./src/services/users.ts"; - -export { - Client, - Avatars, - Database, - Health, - Locale, - Storage, - Teams, - Users, -}; \ No newline at end of file diff --git a/app/sdks/server-deno/src/client.ts b/app/sdks/server-deno/src/client.ts deleted file mode 100644 index 3bf22034b8..0000000000 --- a/app/sdks/server-deno/src/client.ts +++ /dev/null @@ -1,138 +0,0 @@ -export interface DocumentData { - [key: string]: any; -} - -export class Client { - - endpoint: string = 'https://appwrite.io/v1'; - headers: DocumentData = { - 'content-type': '', - 'x-sdk-version': 'appwrite:deno:0.0.2', - }; - - /** - * Set Project - * - * Your project ID - * - * @param string value - * - * @return self - */ - setProject(value: string): this { - this.addHeader('X-Appwrite-Project', value); - - return this; - } - - /** - * Set Key - * - * Your secret API key - * - * @param string value - * - * @return self - */ - setKey(value: string): this { - this.addHeader('X-Appwrite-Key', value); - - return this; - } - - /** - * Set Locale - * - * @param string value - * - * @return self - */ - setLocale(value: string): this { - this.addHeader('X-Appwrite-Locale', value); - - return this; - } - - - /*** - * @param endpoint - * @return this - */ - setEndpoint(endpoint: string): this { - this.endpoint = endpoint; - - return this; - } - - /** - * @param key string - * @param value string - */ - addHeader(key: string, value: string): this { - this.headers[key.toLowerCase()] = value.toLowerCase(); - - return this; - } - - withoutHeader(key: string, headers: DocumentData): DocumentData { - return Object.keys(headers).reduce((acc: DocumentData, cv) => { - if (cv == 'content-type') return acc - acc[cv] = headers[cv] - return acc - }, {}) - } - - async call(method: string, path: string = '', headers: DocumentData = {}, params: DocumentData = {}) { - headers = Object.assign(this.headers, headers); - - let body; - const url = new URL(this.endpoint + path) - if (method.toUpperCase() === 'GET') { - url.search = new URLSearchParams(this.flatten(params)).toString() - body = null - } else if (headers['content-type'].toLowerCase().startsWith('multipart/form-data')) { - headers = this.withoutHeader('content-type', headers) - const formData = new FormData() - const flatParams = this.flatten(params) - for (const key in flatParams) { - formData.append(key, flatParams[key]); - } - body = formData - } else { - body = JSON.stringify(params) - } - - const options = { - method: method.toUpperCase(), - headers: headers, - body: body, - }; - - let response = await fetch(url.toString(), options); - const contentType = response.headers.get('content-type'); - - if (contentType && contentType.includes('application/json')) { - return response.json() - } - - return response; - } - - flatten(data: DocumentData, prefix = '') { - let output: DocumentData = {}; - - for (const key in data) { - let value = data[key]; - let finalKey = prefix ? prefix + '[' + key +']' : key; - - if (Array.isArray(value)) { - output = Object.assign(output, this.flatten(value, finalKey)); // @todo: handle name collision here if needed - } - else { - output[finalKey] = value; - } - } - - return output; - } -} \ No newline at end of file diff --git a/app/sdks/server-deno/src/service.ts b/app/sdks/server-deno/src/service.ts deleted file mode 100644 index ceedf1a0c3..0000000000 --- a/app/sdks/server-deno/src/service.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Client } from "./client.ts"; - -export abstract class Service { - - client: Client; - - /** - * @param client - */ - constructor(client: Client) { - this.client = client; - } -} \ No newline at end of file diff --git a/app/sdks/server-deno/src/services/avatars.ts b/app/sdks/server-deno/src/services/avatars.ts deleted file mode 100644 index f70e950bed..0000000000 --- a/app/sdks/server-deno/src/services/avatars.ts +++ /dev/null @@ -1,163 +0,0 @@ -import { Service } from "../service.ts"; -import { DocumentData } from '../client.ts' - -export class Avatars extends Service { - - /** - * Get Browser Icon - * - * 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 - * /account/sessions endpoint. Use width, height and quality arguments to - * change the output settings. - * - * @param string code - * @param number width - * @param number height - * @param number quality - * @throws Exception - * @return Promise - */ - async getBrowser(code: string, width: number = 100, height: number = 100, quality: number = 100): Promise { - let path = '/avatars/browsers/{code}'.replace(new RegExp('{code}', 'g'), code); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'width': width, - 'height': height, - 'quality': quality - }); - } - - /** - * Get Credit Card Icon - * - * Need to display your users with your billing method or their payment - * methods? 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. - * - * @param string code - * @param number width - * @param number height - * @param number quality - * @throws Exception - * @return Promise - */ - async getCreditCard(code: string, width: number = 100, height: number = 100, quality: number = 100): Promise { - let path = '/avatars/credit-cards/{code}'.replace(new RegExp('{code}', 'g'), code); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'width': width, - 'height': height, - 'quality': quality - }); - } - - /** - * Get Favicon - * - * Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote - * website URL. - * - * @param string url - * @throws Exception - * @return Promise - */ - async getFavicon(url: string): Promise { - let path = '/avatars/favicon'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'url': url - }); - } - - /** - * Get Country Flag - * - * 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. - * - * @param string code - * @param number width - * @param number height - * @param number quality - * @throws Exception - * @return Promise - */ - async getFlag(code: string, width: number = 100, height: number = 100, quality: number = 100): Promise { - let path = '/avatars/flags/{code}'.replace(new RegExp('{code}', 'g'), code); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'width': width, - 'height': height, - 'quality': quality - }); - } - - /** - * Get Image from URL - * - * 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. - * - * @param string url - * @param number width - * @param number height - * @throws Exception - * @return Promise - */ - async getImage(url: string, width: number = 400, height: number = 400): Promise { - let path = '/avatars/image'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'url': url, - 'width': width, - 'height': height - }); - } - - /** - * Get QR Code - * - * 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. - * - * @param string text - * @param number size - * @param number margin - * @param number download - * @throws Exception - * @return Promise - */ - async getQR(text: string, size: number = 400, margin: number = 1, download: number = 0): Promise { - let path = '/avatars/qr'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'text': text, - 'size': size, - 'margin': margin, - 'download': download - }); - } -} \ No newline at end of file diff --git a/app/sdks/server-deno/src/services/database.ts b/app/sdks/server-deno/src/services/database.ts deleted file mode 100644 index 164145ef82..0000000000 --- a/app/sdks/server-deno/src/services/database.ts +++ /dev/null @@ -1,285 +0,0 @@ -import { Service } from "../service.ts"; -import { DocumentData } from '../client.ts' - -export class Database extends Service { - - /** - * List Collections - * - * Get a list of all the user collections. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project collections. [Learn more about different API - * modes](/docs/admin). - * - * @param string search - * @param number limit - * @param number offset - * @param string orderType - * @throws Exception - * @return Promise - */ - async listCollections(search: string = '', limit: number = 25, offset: number = 0, orderType: string = 'ASC'): Promise { - let path = '/database/collections'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType - }); - } - - /** - * Create Collection - * - * Create a new Collection. - * - * @param string name - * @param Array read - * @param Array write - * @param Array rules - * @throws Exception - * @return Promise - */ - async createCollection(name: string, read: Array, write: Array, rules: Array): Promise { - let path = '/database/collections'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'read': read, - 'write': write, - 'rules': rules - }); - } - - /** - * Get Collection - * - * Get collection by its unique ID. This endpoint response returns a JSON - * object with the collection metadata. - * - * @param string collectionId - * @throws Exception - * @return Promise - */ - async getCollection(collectionId: string): Promise { - let path = '/database/collections/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Collection - * - * Update collection by its unique ID. - * - * @param string collectionId - * @param string name - * @param Array read - * @param Array write - * @param Array rules - * @throws Exception - * @return Promise - */ - async updateCollection(collectionId: string, name: string, read: Array, write: Array, rules: Array = []): Promise { - let path = '/database/collections/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'read': read, - 'write': write, - 'rules': rules - }); - } - - /** - * Delete Collection - * - * Delete a collection by its unique ID. Only users with write permissions - * have access to delete this resource. - * - * @param string collectionId - * @throws Exception - * @return Promise - */ - async deleteCollection(collectionId: string): Promise { - let path = '/database/collections/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Documents - * - * Get a list of all the user documents. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project documents. [Learn more about different API - * modes](/docs/admin). - * - * @param string collectionId - * @param Array filters - * @param number offset - * @param number limit - * @param string orderField - * @param string orderType - * @param string orderCast - * @param string search - * @param number first - * @param number last - * @throws Exception - * @return Promise - */ - async listDocuments(collectionId: string, filters: Array = [], offset: number = 0, limit: number = 50, orderField: string = '$id', orderType: string = 'ASC', orderCast: string = 'string', search: string = '', first: number = 0, last: number = 0): Promise { - let path = '/database/collections/{collectionId}/documents'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'filters': filters, - 'offset': offset, - 'limit': limit, - 'orderField': orderField, - 'orderType': orderType, - 'orderCast': orderCast, - 'search': search, - 'first': first, - 'last': last - }); - } - - /** - * Create Document - * - * Create a new Document. Before using this route, you should create a new - * collection resource using either a [server - * integration](/docs/server/database?sdk=nodejs#createCollection) API or - * directly from your database console. - * - * @param string collectionId - * @param DocumentData data - * @param Array read - * @param Array write - * @param string parentDocument - * @param string parentProperty - * @param string parentPropertyType - * @throws Exception - * @return Promise - */ - async createDocument(collectionId: string, data: DocumentData, read: Array, write: Array, parentDocument: string = '', parentProperty: string = '', parentPropertyType: string = 'assign'): Promise { - let path = '/database/collections/{collectionId}/documents'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'data': data, - 'read': read, - 'write': write, - 'parentDocument': parentDocument, - 'parentProperty': parentProperty, - 'parentPropertyType': parentPropertyType - }); - } - - /** - * Get Document - * - * Get document by its unique ID. This endpoint response returns a JSON object - * with the document data. - * - * @param string collectionId - * @param string documentId - * @throws Exception - * @return Promise - */ - async getDocument(collectionId: string, documentId: string): Promise { - let path = '/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Document - * - * @param string collectionId - * @param string documentId - * @param DocumentData data - * @param Array read - * @param Array write - * @throws Exception - * @return Promise - */ - async updateDocument(collectionId: string, documentId: string, data: DocumentData, read: Array, write: Array): Promise { - let path = '/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'data': data, - 'read': read, - 'write': write - }); - } - - /** - * Delete Document - * - * Delete document by its unique ID. This endpoint deletes only the parent - * documents, his attributes and relations to other documents. Child documents - * **will not** be deleted. - * - * @param string collectionId - * @param string documentId - * @throws Exception - * @return Promise - */ - async deleteDocument(collectionId: string, documentId: string): Promise { - let path = '/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Collection Logs - * - * @param string collectionId - * @throws Exception - * @return Promise - */ - async getCollectionLogs(collectionId: string): Promise { - let path = '/database/collections/{collectionId}/logs'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } -} \ No newline at end of file diff --git a/app/sdks/server-deno/src/services/health.ts b/app/sdks/server-deno/src/services/health.ts deleted file mode 100644 index df5c18a2cb..0000000000 --- a/app/sdks/server-deno/src/services/health.ts +++ /dev/null @@ -1,232 +0,0 @@ -import { Service } from "../service.ts"; -import { DocumentData } from '../client.ts' - -export class Health extends Service { - - /** - * Get HTTP - * - * Check the Appwrite HTTP server is up and responsive. - * - * @throws Exception - * @return Promise - */ - async get(): Promise { - let path = '/health'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Anti virus - * - * Check the Appwrite Anti Virus server is up and connection is successful. - * - * @throws Exception - * @return Promise - */ - async getAntiVirus(): Promise { - let path = '/health/anti-virus'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Cache - * - * Check the Appwrite in-memory cache server is up and connection is - * successful. - * - * @throws Exception - * @return Promise - */ - async getCache(): Promise { - let path = '/health/cache'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get DB - * - * Check the Appwrite database server is up and connection is successful. - * - * @throws Exception - * @return Promise - */ - async getDB(): Promise { - let path = '/health/db'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Certificate Queue - * - * Get the number of certificates that are waiting to be issued against - * [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue - * server. - * - * @throws Exception - * @return Promise - */ - async getQueueCertificates(): Promise { - let path = '/health/queue/certificates'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Functions Queue - * - * @throws Exception - * @return Promise - */ - async getQueueFunctions(): Promise { - let path = '/health/queue/functions'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Logs Queue - * - * Get the number of logs that are waiting to be processed in the Appwrite - * internal queue server. - * - * @throws Exception - * @return Promise - */ - async getQueueLogs(): Promise { - let path = '/health/queue/logs'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Tasks Queue - * - * Get the number of tasks that are waiting to be processed in the Appwrite - * internal queue server. - * - * @throws Exception - * @return Promise - */ - async getQueueTasks(): Promise { - let path = '/health/queue/tasks'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Usage Queue - * - * Get the number of usage stats that are waiting to be processed in the - * Appwrite internal queue server. - * - * @throws Exception - * @return Promise - */ - async getQueueUsage(): Promise { - let path = '/health/queue/usage'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Webhooks Queue - * - * Get the number of webhooks that are waiting to be processed in the Appwrite - * internal queue server. - * - * @throws Exception - * @return Promise - */ - async getQueueWebhooks(): Promise { - let path = '/health/queue/webhooks'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Local Storage - * - * Check the Appwrite local storage device is up and connection is successful. - * - * @throws Exception - * @return Promise - */ - async getStorageLocal(): Promise { - let path = '/health/storage/local'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Time - * - * 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. - * - * @throws Exception - * @return Promise - */ - async getTime(): Promise { - let path = '/health/time'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } -} \ No newline at end of file diff --git a/app/sdks/server-deno/src/services/locale.ts b/app/sdks/server-deno/src/services/locale.ts deleted file mode 100644 index 0c42ac61d2..0000000000 --- a/app/sdks/server-deno/src/services/locale.ts +++ /dev/null @@ -1,124 +0,0 @@ -import { Service } from "../service.ts"; -import { DocumentData } from '../client.ts' - -export class Locale extends Service { - - /** - * Get User Locale - * - * 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. - * - * ([IP Geolocation by DB-IP](https://db-ip.com)) - * - * @throws Exception - * @return Promise - */ - async get(): Promise { - let path = '/locale'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Continents - * - * List of all continents. You can use the locale header to get the data in a - * supported language. - * - * @throws Exception - * @return Promise - */ - async getContinents(): Promise { - let path = '/locale/continents'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Countries - * - * List of all countries. You can use the locale header to get the data in a - * supported language. - * - * @throws Exception - * @return Promise - */ - async getCountries(): Promise { - let path = '/locale/countries'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List EU Countries - * - * 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. - * - * @throws Exception - * @return Promise - */ - async getCountriesEU(): Promise { - let path = '/locale/countries/eu'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Countries Phone Codes - * - * List of all countries phone codes. You can use the locale header to get the - * data in a supported language. - * - * @throws Exception - * @return Promise - */ - async getCountriesPhones(): Promise { - let path = '/locale/countries/phones'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Currencies - * - * List of all currencies, including currency symol, 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. - * - * @throws Exception - * @return Promise - */ - async getCurrencies(): Promise { - let path = '/locale/currencies'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } -} \ No newline at end of file diff --git a/app/sdks/server-deno/src/services/storage.ts b/app/sdks/server-deno/src/services/storage.ts deleted file mode 100644 index b663739e05..0000000000 --- a/app/sdks/server-deno/src/services/storage.ts +++ /dev/null @@ -1,198 +0,0 @@ -import { Service } from "../service.ts"; -import { DocumentData } from '../client.ts' - -export class Storage extends Service { - - /** - * List Files - * - * Get a list of all the user files. You can use the query params to filter - * your results. On admin mode, this endpoint will return a list of all of the - * project files. [Learn more about different API modes](/docs/admin). - * - * @param string search - * @param number limit - * @param number offset - * @param string orderType - * @throws Exception - * @return Promise - */ - async listFiles(search: string = '', limit: number = 25, offset: number = 0, orderType: string = 'ASC'): Promise { - let path = '/storage/files'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType - }); - } - - /** - * Create File - * - * Create a new file. The user who creates the file will automatically be - * assigned to read and write access unless he has passed custom values for - * read and write arguments. - * - * @param File | Blob file - * @param Array read - * @param Array write - * @throws Exception - * @return Promise - */ - async createFile(file: File | Blob, read: Array, write: Array): Promise { - let path = '/storage/files'; - - return await this.client.call('post', path, { - 'content-type': 'multipart/form-data', - }, - { - 'file': file, - 'read': read, - 'write': write - }); - } - - /** - * Get File - * - * Get file by its unique ID. This endpoint response returns a JSON object - * with the file metadata. - * - * @param string fileId - * @throws Exception - * @return Promise - */ - async getFile(fileId: string): Promise { - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update File - * - * Update file by its unique ID. Only users with write permissions have access - * to update this resource. - * - * @param string fileId - * @param Array read - * @param Array write - * @throws Exception - * @return Promise - */ - async updateFile(fileId: string, read: Array, write: Array): Promise { - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'read': read, - 'write': write - }); - } - - /** - * Delete File - * - * Delete a file by its unique ID. Only users with write permissions have - * access to delete this resource. - * - * @param string fileId - * @throws Exception - * @return Promise - */ - async deleteFile(fileId: string): Promise { - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get File for Download - * - * Get 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. - * - * @param string fileId - * @throws Exception - * @return Promise - */ - async getFileDownload(fileId: string): Promise { - let path = '/storage/files/{fileId}/download'.replace(new RegExp('{fileId}', 'g'), fileId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get File Preview - * - * 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. - * - * @param string fileId - * @param number width - * @param number height - * @param number quality - * @param string background - * @param string output - * @throws Exception - * @return Promise - */ - async getFilePreview(fileId: string, width: number = 0, height: number = 0, quality: number = 100, background: string = '', output: string = ''): Promise { - let path = '/storage/files/{fileId}/preview'.replace(new RegExp('{fileId}', 'g'), fileId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'width': width, - 'height': height, - 'quality': quality, - 'background': background, - 'output': output - }); - } - - /** - * Get File for View - * - * Get file content by its unique ID. This endpoint is similar to the download - * method but returns with no 'Content-Disposition: attachment' header. - * - * @param string fileId - * @param string as - * @throws Exception - * @return Promise - */ - async getFileView(fileId: string, as: string = ''): Promise { - let path = '/storage/files/{fileId}/view'.replace(new RegExp('{fileId}', 'g'), fileId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'as': as - }); - } -} \ No newline at end of file diff --git a/app/sdks/server-deno/src/services/teams.ts b/app/sdks/server-deno/src/services/teams.ts deleted file mode 100644 index b80c2f6714..0000000000 --- a/app/sdks/server-deno/src/services/teams.ts +++ /dev/null @@ -1,201 +0,0 @@ -import { Service } from "../service.ts"; -import { DocumentData } from '../client.ts' - -export class Teams extends Service { - - /** - * List Teams - * - * Get a list of all the current user teams. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project teams. [Learn more about different API modes](/docs/admin). - * - * @param string search - * @param number limit - * @param number offset - * @param string orderType - * @throws Exception - * @return Promise - */ - async list(search: string = '', limit: number = 25, offset: number = 0, orderType: string = 'ASC'): Promise { - let path = '/teams'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType - }); - } - - /** - * Create Team - * - * Create a new team. The user who creates the team will automatically be - * assigned as the owner of the team. The team owner can invite new members, - * who will be able add new owners and update or delete the team from your - * project. - * - * @param string name - * @param Array roles - * @throws Exception - * @return Promise - */ - async create(name: string, roles: Array = ["owner"]): Promise { - let path = '/teams'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'roles': roles - }); - } - - /** - * Get Team - * - * Get team by its unique ID. All team members have read access for this - * resource. - * - * @param string teamId - * @throws Exception - * @return Promise - */ - async get(teamId: string): Promise { - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Team - * - * Update team by its unique ID. Only team owners have write access for this - * resource. - * - * @param string teamId - * @param string name - * @throws Exception - * @return Promise - */ - async update(teamId: string, name: string): Promise { - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'name': name - }); - } - - /** - * Delete Team - * - * Delete team by its unique ID. Only team owners have write access for this - * resource. - * - * @param string teamId - * @throws Exception - * @return Promise - */ - async delete(teamId: string): Promise { - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Team Memberships - * - * Get team members by the team unique ID. All team members have read access - * for this list of resources. - * - * @param string teamId - * @throws Exception - * @return Promise - */ - async getMemberships(teamId: string): Promise { - let path = '/teams/{teamId}/memberships'.replace(new RegExp('{teamId}', 'g'), teamId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Create Team Membership - * - * Use this endpoint to invite a new member to join your team. An email with a - * link to join the team will be sent to the new member email address if the - * member doesn't exist in the project it will be created automatically. - * - * Use the 'URL' parameter to redirect the user from the invitation email back - * to your app. When the user is redirected, use the [Update Team Membership - * Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the - * user to accept the invitation to the team. - * - * Please note that in order to avoid a [Redirect - * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) - * the only valid redirect URL's are the once from domains you have set when - * added your platforms in the console interface. - * - * @param string teamId - * @param string email - * @param Array roles - * @param string url - * @param string name - * @throws Exception - * @return Promise - */ - async createMembership(teamId: string, email: string, roles: Array, url: string, name: string = ''): Promise { - let path = '/teams/{teamId}/memberships'.replace(new RegExp('{teamId}', 'g'), teamId); - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'email': email, - 'name': name, - 'roles': roles, - 'url': url - }); - } - - /** - * Delete Team Membership - * - * 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 he didn't accept it. - * - * @param string teamId - * @param string inviteId - * @throws Exception - * @return Promise - */ - async deleteMembership(teamId: string, inviteId: string): Promise { - let path = '/teams/{teamId}/memberships/{inviteId}'.replace(new RegExp('{teamId}', 'g'), teamId).replace(new RegExp('{inviteId}', 'g'), inviteId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } -} \ No newline at end of file diff --git a/app/sdks/server-deno/src/services/users.ts b/app/sdks/server-deno/src/services/users.ts deleted file mode 100644 index ac48507f08..0000000000 --- a/app/sdks/server-deno/src/services/users.ts +++ /dev/null @@ -1,214 +0,0 @@ -import { Service } from "../service.ts"; -import { DocumentData } from '../client.ts' - -export class Users extends Service { - - /** - * List Users - * - * Get a list of all the project users. You can use the query params to filter - * your results. - * - * @param string search - * @param number limit - * @param number offset - * @param string orderType - * @throws Exception - * @return Promise - */ - async list(search: string = '', limit: number = 25, offset: number = 0, orderType: string = 'ASC'): Promise { - let path = '/users'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType - }); - } - - /** - * Create User - * - * Create a new user. - * - * @param string email - * @param string password - * @param string name - * @throws Exception - * @return Promise - */ - async create(email: string, password: string, name: string = ''): Promise { - let path = '/users'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'email': email, - 'password': password, - 'name': name - }); - } - - /** - * Get User - * - * Get user by its unique ID. - * - * @param string userId - * @throws Exception - * @return Promise - */ - async get(userId: string): Promise { - let path = '/users/{userId}'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get User Logs - * - * Get user activity logs list by its unique ID. - * - * @param string userId - * @throws Exception - * @return Promise - */ - async getLogs(userId: string): Promise { - let path = '/users/{userId}/logs'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get User Preferences - * - * Get user preferences by its unique ID. - * - * @param string userId - * @throws Exception - * @return Promise - */ - async getPrefs(userId: string): Promise { - let path = '/users/{userId}/prefs'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update User Preferences - * - * Update user preferences by its unique ID. You can pass only the specific - * settings you wish to update. - * - * @param string userId - * @param DocumentData prefs - * @throws Exception - * @return Promise - */ - async updatePrefs(userId: string, prefs: DocumentData): Promise { - let path = '/users/{userId}/prefs'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'prefs': prefs - }); - } - - /** - * Get User Sessions - * - * Get user sessions list by its unique ID. - * - * @param string userId - * @throws Exception - * @return Promise - */ - async getSessions(userId: string): Promise { - let path = '/users/{userId}/sessions'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Delete User Sessions - * - * Delete all user sessions by its unique ID. - * - * @param string userId - * @throws Exception - * @return Promise - */ - async deleteSessions(userId: string): Promise { - let path = '/users/{userId}/sessions'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Delete User Session - * - * Delete user sessions by its unique ID. - * - * @param string userId - * @param string sessionId - * @throws Exception - * @return Promise - */ - async deleteSession(userId: string, sessionId: string): Promise { - let path = '/users/{userId}/sessions/{sessionId}'.replace(new RegExp('{userId}', 'g'), userId).replace(new RegExp('{sessionId}', 'g'), sessionId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update User Status - * - * Update user status by its unique ID. - * - * @param string userId - * @param string status - * @throws Exception - * @return Promise - */ - async updateStatus(userId: string, status: string): Promise { - let path = '/users/{userId}/status'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'status': status - }); - } -} \ No newline at end of file diff --git a/app/sdks/server-go/CHANGELOG.md b/app/sdks/server-go/CHANGELOG.md deleted file mode 100644 index fa4d35e687..0000000000 --- a/app/sdks/server-go/CHANGELOG.md +++ /dev/null @@ -1 +0,0 @@ -# Change Log \ No newline at end of file diff --git a/app/sdks/server-go/LICENSE b/app/sdks/server-go/LICENSE deleted file mode 100644 index fc7c051a91..0000000000 --- a/app/sdks/server-go/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/app/sdks/server-go/README.md b/app/sdks/server-go/README.md deleted file mode 100644 index 3b46d51f79..0000000000 --- a/app/sdks/server-go/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# Appwrite SDK for Go - -![License](https://img.shields.io/github/license/appwrite/sdk-for-go.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.6.0-blue.svg?v=1) - -**This SDK is compatible with Appwrite server version 0.6.0. For older versions, please check previous releases.** - -Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. - Use the Go SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. - For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) - - - -![Appwrite](https://appwrite.io/images/github.png) - -## Installation - -To install using `go get`: - -```bash -go get github.com/appwrite/sdk-for-go -``` - -## Contribution - -This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request. - -## License - -Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. \ No newline at end of file diff --git a/app/sdks/server-go/avatars.go b/app/sdks/server-go/avatars.go deleted file mode 100644 index feafa9da31..0000000000 --- a/app/sdks/server-go/avatars.go +++ /dev/null @@ -1,111 +0,0 @@ -package appwrite - -import ( - "strings" -) - -// Avatars service -type Avatars struct { - client Client -} - -func NewAvatars(clt Client) Avatars { - service := Avatars{ - client: clt, - } - - return service -} - -// GetBrowser 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 /account/sessions endpoint. Use width, height and quality -// arguments to change the output settings. -func (srv *Avatars) GetBrowser(Code string, Width int, Height int, Quality int) (map[string]interface{}, error) { - r := strings.NewReplacer("{code}", Code) - path := r.Replace("/avatars/browsers/{code}") - - params := map[string]interface{}{ - "width": Width, - "height": Height, - "quality": Quality, - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetCreditCard need to display your users with your billing method or their -// payment methods? 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. -func (srv *Avatars) GetCreditCard(Code string, Width int, Height int, Quality int) (map[string]interface{}, error) { - r := strings.NewReplacer("{code}", Code) - path := r.Replace("/avatars/credit-cards/{code}") - - params := map[string]interface{}{ - "width": Width, - "height": Height, - "quality": Quality, - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetFavicon use this endpoint to fetch the favorite icon (AKA favicon) of a -// any remote website URL. -func (srv *Avatars) GetFavicon(Url string) (map[string]interface{}, error) { - path := "/avatars/favicon" - - params := map[string]interface{}{ - "url": Url, - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetFlag 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. -func (srv *Avatars) GetFlag(Code string, Width int, Height int, Quality int) (map[string]interface{}, error) { - r := strings.NewReplacer("{code}", Code) - path := r.Replace("/avatars/flags/{code}") - - params := map[string]interface{}{ - "width": Width, - "height": Height, - "quality": Quality, - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetImage 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. -func (srv *Avatars) GetImage(Url string, Width int, Height int) (map[string]interface{}, error) { - path := "/avatars/image" - - params := map[string]interface{}{ - "url": Url, - "width": Width, - "height": Height, - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetQR 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. -func (srv *Avatars) GetQR(Text string, Size int, Margin int, Download int) (map[string]interface{}, error) { - path := "/avatars/qr" - - params := map[string]interface{}{ - "text": Text, - "size": Size, - "margin": Margin, - "download": Download, - } - - return srv.client.Call("GET", path, nil, params) -} diff --git a/app/sdks/server-go/client.go b/app/sdks/server-go/client.go deleted file mode 100644 index bd21f5f347..0000000000 --- a/app/sdks/server-go/client.go +++ /dev/null @@ -1,113 +0,0 @@ -package appwrite - -import ( - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" -) - -// Client is the client struct to access Appwrite services -type Client struct { - client *http.Client - endpoint string - headers map[string]string - selfSigned bool -} - -// SetEndpoint sets the default endpoint to which the Client connects to -func (clt *Client) SetEndpoint(endpoint string) { - clt.endpoint = endpoint -} - -// SetSelfSigned sets the condition that specify if the Client should allow connections to a server using a self-signed certificate -func (clt *Client) SetSelfSigned(status bool) { - clt.selfSigned = status -} - -// AddHeader add a new custom header that the Client should send on each request -func (clt *Client) AddHeader(key string, value string) { - clt.headers[key] = value -} - -// Your project ID -func (clt *Client) SetProject(value string) { - clt.headers["X-Appwrite-Project"] = value -} - -// Your secret API key -func (clt *Client) SetKey(value string) { - clt.headers["X-Appwrite-Key"] = value -} - -func (clt *Client) SetLocale(value string) { - clt.headers["X-Appwrite-Locale"] = value -} - -// Call an API using Client -func (clt *Client) Call(method string, path string, headers map[string]interface{}, params map[string]interface{}) (map[string]interface{}, error) { - if clt.client == nil { - // Create HTTP client - clt.client = &http.Client{} - } - - if clt.selfSigned { - // Allow self signed requests - } - - urlPath := clt.endpoint + path - isGet := strings.ToUpper(method) == "GET" - - var reqBody *strings.Reader - if !isGet { - frm := url.Values{} - for key, val := range params { - frm.Add(key, ToString(val)) - } - reqBody = strings.NewReader(frm.Encode()) - } - - // Create and modify HTTP request before sending - req, err := http.NewRequest(method, urlPath, reqBody) - if err != nil { - return nil, err - } - - // Set Client headers - for key, val := range clt.headers { - req.Header.Set(key, ToString(val)) - } - - // Set Custom headers - for key, val := range headers { - req.Header.Set(key, ToString(val)) - } - - if isGet { - q := req.URL.Query() - for key, val := range params { - q.Add(key, ToString(val)) - } - req.URL.RawQuery = q.Encode() - } - - // Make request - response, err := clt.client.Do(req) - if err != nil { - return nil, err - } - - // Handle response - defer response.Body.Close() - - responseData, err := ioutil.ReadAll(response.Body) - if err != nil { - return nil, err - } - - var jsonResponse map[string]interface{} - json.Unmarshal(responseData, &jsonResponse) - - return jsonResponse, nil -} diff --git a/app/sdks/server-go/database.go b/app/sdks/server-go/database.go deleted file mode 100644 index d420d69fde..0000000000 --- a/app/sdks/server-go/database.go +++ /dev/null @@ -1,178 +0,0 @@ -package appwrite - -import ( - "strings" -) - -// Database service -type Database struct { - client Client -} - -func NewDatabase(clt Client) Database { - service := Database{ - client: clt, - } - - return service -} - -// ListCollections get a list of all the user collections. You can use the -// query params to filter your results. On admin mode, this endpoint will -// return a list of all of the project collections. [Learn more about -// different API modes](/docs/admin). -func (srv *Database) ListCollections(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error) { - path := "/database/collections" - - params := map[string]interface{}{ - "search": Search, - "limit": Limit, - "offset": Offset, - "orderType": OrderType, - } - - return srv.client.Call("GET", path, nil, params) -} - -// CreateCollection create a new Collection. -func (srv *Database) CreateCollection(Name string, Read []interface{}, Write []interface{}, Rules []interface{}) (map[string]interface{}, error) { - path := "/database/collections" - - params := map[string]interface{}{ - "name": Name, - "read": Read, - "write": Write, - "rules": Rules, - } - - return srv.client.Call("POST", path, nil, params) -} - -// GetCollection get collection by its unique ID. This endpoint response -// returns a JSON object with the collection metadata. -func (srv *Database) GetCollection(CollectionId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{collectionId}", CollectionId) - path := r.Replace("/database/collections/{collectionId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// UpdateCollection update collection by its unique ID. -func (srv *Database) UpdateCollection(CollectionId string, Name string, Read []interface{}, Write []interface{}, Rules []interface{}) (map[string]interface{}, error) { - r := strings.NewReplacer("{collectionId}", CollectionId) - path := r.Replace("/database/collections/{collectionId}") - - params := map[string]interface{}{ - "name": Name, - "read": Read, - "write": Write, - "rules": Rules, - } - - return srv.client.Call("PUT", path, nil, params) -} - -// DeleteCollection delete a collection by its unique ID. Only users with -// write permissions have access to delete this resource. -func (srv *Database) DeleteCollection(CollectionId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{collectionId}", CollectionId) - path := r.Replace("/database/collections/{collectionId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// ListDocuments get a list of all the user documents. You can use the query -// params to filter your results. On admin mode, this endpoint will return a -// list of all of the project documents. [Learn more about different API -// modes](/docs/admin). -func (srv *Database) ListDocuments(CollectionId string, Filters []interface{}, Offset int, Limit int, OrderField string, OrderType string, OrderCast string, Search string, First int, Last int) (map[string]interface{}, error) { - r := strings.NewReplacer("{collectionId}", CollectionId) - path := r.Replace("/database/collections/{collectionId}/documents") - - params := map[string]interface{}{ - "filters": Filters, - "offset": Offset, - "limit": Limit, - "orderField": OrderField, - "orderType": OrderType, - "orderCast": OrderCast, - "search": Search, - "first": First, - "last": Last, - } - - return srv.client.Call("GET", path, nil, params) -} - -// CreateDocument create a new Document. -func (srv *Database) CreateDocument(CollectionId string, Data object, Read []interface{}, Write []interface{}, ParentDocument string, ParentProperty string, ParentPropertyType string) (map[string]interface{}, error) { - r := strings.NewReplacer("{collectionId}", CollectionId) - path := r.Replace("/database/collections/{collectionId}/documents") - - params := map[string]interface{}{ - "data": Data, - "read": Read, - "write": Write, - "parentDocument": ParentDocument, - "parentProperty": ParentProperty, - "parentPropertyType": ParentPropertyType, - } - - return srv.client.Call("POST", path, nil, params) -} - -// GetDocument get document by its unique ID. This endpoint response returns a -// JSON object with the document data. -func (srv *Database) GetDocument(CollectionId string, DocumentId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{collectionId}", CollectionId, "{documentId}", DocumentId) - path := r.Replace("/database/collections/{collectionId}/documents/{documentId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// UpdateDocument -func (srv *Database) UpdateDocument(CollectionId string, DocumentId string, Data object, Read []interface{}, Write []interface{}) (map[string]interface{}, error) { - r := strings.NewReplacer("{collectionId}", CollectionId, "{documentId}", DocumentId) - path := r.Replace("/database/collections/{collectionId}/documents/{documentId}") - - params := map[string]interface{}{ - "data": Data, - "read": Read, - "write": Write, - } - - return srv.client.Call("PATCH", path, nil, params) -} - -// DeleteDocument delete document by its unique ID. This endpoint deletes only -// the parent documents, his attributes and relations to other documents. -// Child documents **will not** be deleted. -func (srv *Database) DeleteDocument(CollectionId string, DocumentId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{collectionId}", CollectionId, "{documentId}", DocumentId) - path := r.Replace("/database/collections/{collectionId}/documents/{documentId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// GetCollectionLogs -func (srv *Database) GetCollectionLogs(CollectionId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{collectionId}", CollectionId) - path := r.Replace("/database/collections/{collectionId}/logs") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} diff --git a/app/sdks/server-go/docs/examples/avatars/get-browser.md b/app/sdks/server-go/docs/examples/avatars/get-browser.md deleted file mode 100644 index b307cd8dbc..0000000000 --- a/app/sdks/server-go/docs/examples/avatars/get-browser.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Avatars{ - client: &client - } - - var response, error := service.GetBrowser("aa", 0, 0, 0) - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/avatars/get-credit-card.md b/app/sdks/server-go/docs/examples/avatars/get-credit-card.md deleted file mode 100644 index ffc748d052..0000000000 --- a/app/sdks/server-go/docs/examples/avatars/get-credit-card.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Avatars{ - client: &client - } - - var response, error := service.GetCreditCard("amex", 0, 0, 0) - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/avatars/get-favicon.md b/app/sdks/server-go/docs/examples/avatars/get-favicon.md deleted file mode 100644 index 596a9d9fd3..0000000000 --- a/app/sdks/server-go/docs/examples/avatars/get-favicon.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Avatars{ - client: &client - } - - var response, error := service.GetFavicon("https://example.com") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/avatars/get-flag.md b/app/sdks/server-go/docs/examples/avatars/get-flag.md deleted file mode 100644 index 63042ef0a6..0000000000 --- a/app/sdks/server-go/docs/examples/avatars/get-flag.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Avatars{ - client: &client - } - - var response, error := service.GetFlag("af", 0, 0, 0) - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/avatars/get-image.md b/app/sdks/server-go/docs/examples/avatars/get-image.md deleted file mode 100644 index 7095ee3658..0000000000 --- a/app/sdks/server-go/docs/examples/avatars/get-image.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Avatars{ - client: &client - } - - var response, error := service.GetImage("https://example.com", 0, 0) - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/avatars/get-q-r.md b/app/sdks/server-go/docs/examples/avatars/get-q-r.md deleted file mode 100644 index 37425a463e..0000000000 --- a/app/sdks/server-go/docs/examples/avatars/get-q-r.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Avatars{ - client: &client - } - - var response, error := service.GetQR("[TEXT]", 0, 0, 0) - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/database/create-collection.md b/app/sdks/server-go/docs/examples/database/create-collection.md deleted file mode 100644 index 947ce799ff..0000000000 --- a/app/sdks/server-go/docs/examples/database/create-collection.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Database{ - client: &client - } - - var response, error := service.CreateCollection("[NAME]", [], [], []) - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/database/create-document.md b/app/sdks/server-go/docs/examples/database/create-document.md deleted file mode 100644 index 5b63002464..0000000000 --- a/app/sdks/server-go/docs/examples/database/create-document.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Database{ - client: &client - } - - var response, error := service.CreateDocument("[COLLECTION_ID]", , [], [], "[PARENT_DOCUMENT]", "", "assign") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/database/delete-collection.md b/app/sdks/server-go/docs/examples/database/delete-collection.md deleted file mode 100644 index 2b5744730b..0000000000 --- a/app/sdks/server-go/docs/examples/database/delete-collection.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Database{ - client: &client - } - - var response, error := service.DeleteCollection("[COLLECTION_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/database/delete-document.md b/app/sdks/server-go/docs/examples/database/delete-document.md deleted file mode 100644 index 5dfa23e1b1..0000000000 --- a/app/sdks/server-go/docs/examples/database/delete-document.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Database{ - client: &client - } - - var response, error := service.DeleteDocument("[COLLECTION_ID]", "[DOCUMENT_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/database/get-collection-logs.md b/app/sdks/server-go/docs/examples/database/get-collection-logs.md deleted file mode 100644 index 4427295371..0000000000 --- a/app/sdks/server-go/docs/examples/database/get-collection-logs.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Database{ - client: &client - } - - var response, error := service.GetCollectionLogs("[COLLECTION_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/database/get-collection.md b/app/sdks/server-go/docs/examples/database/get-collection.md deleted file mode 100644 index bc6d9f7746..0000000000 --- a/app/sdks/server-go/docs/examples/database/get-collection.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Database{ - client: &client - } - - var response, error := service.GetCollection("[COLLECTION_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/database/get-document.md b/app/sdks/server-go/docs/examples/database/get-document.md deleted file mode 100644 index ba4b063f57..0000000000 --- a/app/sdks/server-go/docs/examples/database/get-document.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Database{ - client: &client - } - - var response, error := service.GetDocument("[COLLECTION_ID]", "[DOCUMENT_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/database/list-collections.md b/app/sdks/server-go/docs/examples/database/list-collections.md deleted file mode 100644 index 0dda37d5e3..0000000000 --- a/app/sdks/server-go/docs/examples/database/list-collections.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Database{ - client: &client - } - - var response, error := service.ListCollections("[SEARCH]", 0, 0, "ASC") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/database/list-documents.md b/app/sdks/server-go/docs/examples/database/list-documents.md deleted file mode 100644 index 9f2e36d591..0000000000 --- a/app/sdks/server-go/docs/examples/database/list-documents.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Database{ - client: &client - } - - var response, error := service.ListDocuments("[COLLECTION_ID]", [], 0, 0, "[ORDER_FIELD]", "DESC", "int", "[SEARCH]", 0, 0) - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/database/update-collection.md b/app/sdks/server-go/docs/examples/database/update-collection.md deleted file mode 100644 index 2b5e7f6d37..0000000000 --- a/app/sdks/server-go/docs/examples/database/update-collection.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Database{ - client: &client - } - - var response, error := service.UpdateCollection("[COLLECTION_ID]", "[NAME]", [], [], []) - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/database/update-document.md b/app/sdks/server-go/docs/examples/database/update-document.md deleted file mode 100644 index 65a3eefa4a..0000000000 --- a/app/sdks/server-go/docs/examples/database/update-document.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Database{ - client: &client - } - - var response, error := service.UpdateDocument("[COLLECTION_ID]", "[DOCUMENT_ID]", , [], []) - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/create-execution.md b/app/sdks/server-go/docs/examples/functions/create-execution.md deleted file mode 100644 index ea060d6f7f..0000000000 --- a/app/sdks/server-go/docs/examples/functions/create-execution.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Functions{ - client: &client - } - - var response, error := service.CreateExecution("[FUNCTION_ID]", 0) - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/create-tag.md b/app/sdks/server-go/docs/examples/functions/create-tag.md deleted file mode 100644 index 84d5e80787..0000000000 --- a/app/sdks/server-go/docs/examples/functions/create-tag.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Functions{ - client: &client - } - - var response, error := service.CreateTag("[FUNCTION_ID]", "node-14", "[COMMAND]", "[CODE]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/create.md b/app/sdks/server-go/docs/examples/functions/create.md deleted file mode 100644 index a87a23b944..0000000000 --- a/app/sdks/server-go/docs/examples/functions/create.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Functions{ - client: &client - } - - var response, error := service.Create("[NAME]", , [], "", 0) - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/delete-tag.md b/app/sdks/server-go/docs/examples/functions/delete-tag.md deleted file mode 100644 index caf36146da..0000000000 --- a/app/sdks/server-go/docs/examples/functions/delete-tag.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Functions{ - client: &client - } - - var response, error := service.DeleteTag("[FUNCTION_ID]", "[TAG_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/delete.md b/app/sdks/server-go/docs/examples/functions/delete.md deleted file mode 100644 index e49addb2b1..0000000000 --- a/app/sdks/server-go/docs/examples/functions/delete.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Functions{ - client: &client - } - - var response, error := service.Delete("[FUNCTION_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/get-execution.md b/app/sdks/server-go/docs/examples/functions/get-execution.md deleted file mode 100644 index 13a3ad4685..0000000000 --- a/app/sdks/server-go/docs/examples/functions/get-execution.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Functions{ - client: &client - } - - var response, error := service.GetExecution("[FUNCTION_ID]", "[EXECUTION_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/get-tag.md b/app/sdks/server-go/docs/examples/functions/get-tag.md deleted file mode 100644 index 640543d94b..0000000000 --- a/app/sdks/server-go/docs/examples/functions/get-tag.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Functions{ - client: &client - } - - var response, error := service.GetTag("[FUNCTION_ID]", "[TAG_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/get.md b/app/sdks/server-go/docs/examples/functions/get.md deleted file mode 100644 index 2bba5028c0..0000000000 --- a/app/sdks/server-go/docs/examples/functions/get.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Functions{ - client: &client - } - - var response, error := service.Get("[FUNCTION_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/list-executions.md b/app/sdks/server-go/docs/examples/functions/list-executions.md deleted file mode 100644 index 5115928c29..0000000000 --- a/app/sdks/server-go/docs/examples/functions/list-executions.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Functions{ - client: &client - } - - var response, error := service.ListExecutions("[FUNCTION_ID]", "[SEARCH]", 0, 0, "ASC") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/list-tags.md b/app/sdks/server-go/docs/examples/functions/list-tags.md deleted file mode 100644 index b6e495988e..0000000000 --- a/app/sdks/server-go/docs/examples/functions/list-tags.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Functions{ - client: &client - } - - var response, error := service.ListTags("[FUNCTION_ID]", "[SEARCH]", 0, 0, "ASC") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/list.md b/app/sdks/server-go/docs/examples/functions/list.md deleted file mode 100644 index 0a208e367d..0000000000 --- a/app/sdks/server-go/docs/examples/functions/list.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Functions{ - client: &client - } - - var response, error := service.List("[SEARCH]", 0, 0, "ASC") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/update-active.md b/app/sdks/server-go/docs/examples/functions/update-active.md deleted file mode 100644 index da3b0f1227..0000000000 --- a/app/sdks/server-go/docs/examples/functions/update-active.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Functions{ - client: &client - } - - var response, error := service.UpdateActive("[FUNCTION_ID]", "[ACTIVE]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/update-tag.md b/app/sdks/server-go/docs/examples/functions/update-tag.md deleted file mode 100644 index 299b095736..0000000000 --- a/app/sdks/server-go/docs/examples/functions/update-tag.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Functions{ - client: &client - } - - var response, error := service.UpdateTag("[FUNCTION_ID]", "[TAG]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/update.md b/app/sdks/server-go/docs/examples/functions/update.md deleted file mode 100644 index 0f8f9e0190..0000000000 --- a/app/sdks/server-go/docs/examples/functions/update.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Functions{ - client: &client - } - - var response, error := service.Update("[FUNCTION_ID]", "[NAME]", , [], "", 0) - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/health/get-anti-virus.md b/app/sdks/server-go/docs/examples/health/get-anti-virus.md deleted file mode 100644 index a6f363dde1..0000000000 --- a/app/sdks/server-go/docs/examples/health/get-anti-virus.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Health{ - client: &client - } - - var response, error := service.GetAntiVirus() - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/health/get-cache.md b/app/sdks/server-go/docs/examples/health/get-cache.md deleted file mode 100644 index ce7b1c6f93..0000000000 --- a/app/sdks/server-go/docs/examples/health/get-cache.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Health{ - client: &client - } - - var response, error := service.GetCache() - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/health/get-d-b.md b/app/sdks/server-go/docs/examples/health/get-d-b.md deleted file mode 100644 index 6d86894417..0000000000 --- a/app/sdks/server-go/docs/examples/health/get-d-b.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Health{ - client: &client - } - - var response, error := service.GetDB() - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/health/get-queue-certificates.md b/app/sdks/server-go/docs/examples/health/get-queue-certificates.md deleted file mode 100644 index 9954551580..0000000000 --- a/app/sdks/server-go/docs/examples/health/get-queue-certificates.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Health{ - client: &client - } - - var response, error := service.GetQueueCertificates() - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/health/get-queue-functions.md b/app/sdks/server-go/docs/examples/health/get-queue-functions.md deleted file mode 100644 index 5df453068b..0000000000 --- a/app/sdks/server-go/docs/examples/health/get-queue-functions.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Health{ - client: &client - } - - var response, error := service.GetQueueFunctions() - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/health/get-queue-logs.md b/app/sdks/server-go/docs/examples/health/get-queue-logs.md deleted file mode 100644 index 0b6280a42a..0000000000 --- a/app/sdks/server-go/docs/examples/health/get-queue-logs.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Health{ - client: &client - } - - var response, error := service.GetQueueLogs() - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/health/get-queue-tasks.md b/app/sdks/server-go/docs/examples/health/get-queue-tasks.md deleted file mode 100644 index 28d615dc2c..0000000000 --- a/app/sdks/server-go/docs/examples/health/get-queue-tasks.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Health{ - client: &client - } - - var response, error := service.GetQueueTasks() - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/health/get-queue-usage.md b/app/sdks/server-go/docs/examples/health/get-queue-usage.md deleted file mode 100644 index e9fe988aa2..0000000000 --- a/app/sdks/server-go/docs/examples/health/get-queue-usage.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Health{ - client: &client - } - - var response, error := service.GetQueueUsage() - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/health/get-queue-webhooks.md b/app/sdks/server-go/docs/examples/health/get-queue-webhooks.md deleted file mode 100644 index 2f92835a12..0000000000 --- a/app/sdks/server-go/docs/examples/health/get-queue-webhooks.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Health{ - client: &client - } - - var response, error := service.GetQueueWebhooks() - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/health/get-storage-anti-virus.md b/app/sdks/server-go/docs/examples/health/get-storage-anti-virus.md deleted file mode 100644 index 8369b5ba07..0000000000 --- a/app/sdks/server-go/docs/examples/health/get-storage-anti-virus.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Health{ - client: &client - } - - var response, error := service.GetStorageAntiVirus() - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/health/get-storage-local.md b/app/sdks/server-go/docs/examples/health/get-storage-local.md deleted file mode 100644 index db0d5a5b21..0000000000 --- a/app/sdks/server-go/docs/examples/health/get-storage-local.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Health{ - client: &client - } - - var response, error := service.GetStorageLocal() - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/health/get-time.md b/app/sdks/server-go/docs/examples/health/get-time.md deleted file mode 100644 index dd8486a484..0000000000 --- a/app/sdks/server-go/docs/examples/health/get-time.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Health{ - client: &client - } - - var response, error := service.GetTime() - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/health/get.md b/app/sdks/server-go/docs/examples/health/get.md deleted file mode 100644 index df1cb27243..0000000000 --- a/app/sdks/server-go/docs/examples/health/get.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Health{ - client: &client - } - - var response, error := service.Get() - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/locale/get-continents.md b/app/sdks/server-go/docs/examples/locale/get-continents.md deleted file mode 100644 index dd9b96ca66..0000000000 --- a/app/sdks/server-go/docs/examples/locale/get-continents.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Locale{ - client: &client - } - - var response, error := service.GetContinents() - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/locale/get-countries-e-u.md b/app/sdks/server-go/docs/examples/locale/get-countries-e-u.md deleted file mode 100644 index 01a2fedc1b..0000000000 --- a/app/sdks/server-go/docs/examples/locale/get-countries-e-u.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Locale{ - client: &client - } - - var response, error := service.GetCountriesEU() - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/locale/get-countries-phones.md b/app/sdks/server-go/docs/examples/locale/get-countries-phones.md deleted file mode 100644 index 87de9bb2f5..0000000000 --- a/app/sdks/server-go/docs/examples/locale/get-countries-phones.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Locale{ - client: &client - } - - var response, error := service.GetCountriesPhones() - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/locale/get-countries.md b/app/sdks/server-go/docs/examples/locale/get-countries.md deleted file mode 100644 index 58c74f5f73..0000000000 --- a/app/sdks/server-go/docs/examples/locale/get-countries.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Locale{ - client: &client - } - - var response, error := service.GetCountries() - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/locale/get-currencies.md b/app/sdks/server-go/docs/examples/locale/get-currencies.md deleted file mode 100644 index c736db8336..0000000000 --- a/app/sdks/server-go/docs/examples/locale/get-currencies.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Locale{ - client: &client - } - - var response, error := service.GetCurrencies() - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/locale/get.md b/app/sdks/server-go/docs/examples/locale/get.md deleted file mode 100644 index 3245b79cb5..0000000000 --- a/app/sdks/server-go/docs/examples/locale/get.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Locale{ - client: &client - } - - var response, error := service.Get() - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/storage/create-file.md b/app/sdks/server-go/docs/examples/storage/create-file.md deleted file mode 100644 index 1348acb40b..0000000000 --- a/app/sdks/server-go/docs/examples/storage/create-file.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Storage{ - client: &client - } - - var response, error := service.CreateFile(file, [], []) - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/storage/delete-file.md b/app/sdks/server-go/docs/examples/storage/delete-file.md deleted file mode 100644 index 6b00581d75..0000000000 --- a/app/sdks/server-go/docs/examples/storage/delete-file.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Storage{ - client: &client - } - - var response, error := service.DeleteFile("[FILE_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/storage/get-file-download.md b/app/sdks/server-go/docs/examples/storage/get-file-download.md deleted file mode 100644 index 6c68b14c3b..0000000000 --- a/app/sdks/server-go/docs/examples/storage/get-file-download.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Storage{ - client: &client - } - - var response, error := service.GetFileDownload("[FILE_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/storage/get-file-preview.md b/app/sdks/server-go/docs/examples/storage/get-file-preview.md deleted file mode 100644 index 86212c82d3..0000000000 --- a/app/sdks/server-go/docs/examples/storage/get-file-preview.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Storage{ - client: &client - } - - var response, error := service.GetFilePreview("[FILE_ID]", 0, 0, 0, "", "jpg") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/storage/get-file-view.md b/app/sdks/server-go/docs/examples/storage/get-file-view.md deleted file mode 100644 index b9ddb637de..0000000000 --- a/app/sdks/server-go/docs/examples/storage/get-file-view.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Storage{ - client: &client - } - - var response, error := service.GetFileView("[FILE_ID]", "pdf") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/storage/get-file.md b/app/sdks/server-go/docs/examples/storage/get-file.md deleted file mode 100644 index f9aaa6eb81..0000000000 --- a/app/sdks/server-go/docs/examples/storage/get-file.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Storage{ - client: &client - } - - var response, error := service.GetFile("[FILE_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/storage/list-files.md b/app/sdks/server-go/docs/examples/storage/list-files.md deleted file mode 100644 index 53e7e37d5c..0000000000 --- a/app/sdks/server-go/docs/examples/storage/list-files.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Storage{ - client: &client - } - - var response, error := service.ListFiles("[SEARCH]", 0, 0, "ASC") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/storage/update-file.md b/app/sdks/server-go/docs/examples/storage/update-file.md deleted file mode 100644 index 1ec409de9f..0000000000 --- a/app/sdks/server-go/docs/examples/storage/update-file.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Storage{ - client: &client - } - - var response, error := service.UpdateFile("[FILE_ID]", [], []) - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/teams/create-membership.md b/app/sdks/server-go/docs/examples/teams/create-membership.md deleted file mode 100644 index a346deaa64..0000000000 --- a/app/sdks/server-go/docs/examples/teams/create-membership.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Teams{ - client: &client - } - - var response, error := service.CreateMembership("[TEAM_ID]", "email@example.com", [], "https://example.com", "[NAME]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/teams/create.md b/app/sdks/server-go/docs/examples/teams/create.md deleted file mode 100644 index 8e3a100573..0000000000 --- a/app/sdks/server-go/docs/examples/teams/create.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Teams{ - client: &client - } - - var response, error := service.Create("[NAME]", []) - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/teams/delete-membership.md b/app/sdks/server-go/docs/examples/teams/delete-membership.md deleted file mode 100644 index 809413a3bf..0000000000 --- a/app/sdks/server-go/docs/examples/teams/delete-membership.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Teams{ - client: &client - } - - var response, error := service.DeleteMembership("[TEAM_ID]", "[INVITE_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/teams/delete.md b/app/sdks/server-go/docs/examples/teams/delete.md deleted file mode 100644 index 5cf65c2f6f..0000000000 --- a/app/sdks/server-go/docs/examples/teams/delete.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Teams{ - client: &client - } - - var response, error := service.Delete("[TEAM_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/teams/get-memberships.md b/app/sdks/server-go/docs/examples/teams/get-memberships.md deleted file mode 100644 index b59a8ff33b..0000000000 --- a/app/sdks/server-go/docs/examples/teams/get-memberships.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Teams{ - client: &client - } - - var response, error := service.GetMemberships("[TEAM_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/teams/get.md b/app/sdks/server-go/docs/examples/teams/get.md deleted file mode 100644 index 2920f547f2..0000000000 --- a/app/sdks/server-go/docs/examples/teams/get.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Teams{ - client: &client - } - - var response, error := service.Get("[TEAM_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/teams/list.md b/app/sdks/server-go/docs/examples/teams/list.md deleted file mode 100644 index 5cd9e3e29e..0000000000 --- a/app/sdks/server-go/docs/examples/teams/list.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Teams{ - client: &client - } - - var response, error := service.List("[SEARCH]", 0, 0, "ASC") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/teams/update.md b/app/sdks/server-go/docs/examples/teams/update.md deleted file mode 100644 index 40178c8424..0000000000 --- a/app/sdks/server-go/docs/examples/teams/update.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Teams{ - client: &client - } - - var response, error := service.Update("[TEAM_ID]", "[NAME]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/users/create.md b/app/sdks/server-go/docs/examples/users/create.md deleted file mode 100644 index 3a27b00f54..0000000000 --- a/app/sdks/server-go/docs/examples/users/create.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Users{ - client: &client - } - - var response, error := service.Create("email@example.com", "password", "[NAME]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/users/delete-session.md b/app/sdks/server-go/docs/examples/users/delete-session.md deleted file mode 100644 index e1840ba133..0000000000 --- a/app/sdks/server-go/docs/examples/users/delete-session.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Users{ - client: &client - } - - var response, error := service.DeleteSession("[USER_ID]", "[SESSION_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/users/delete-sessions.md b/app/sdks/server-go/docs/examples/users/delete-sessions.md deleted file mode 100644 index 682ea0cada..0000000000 --- a/app/sdks/server-go/docs/examples/users/delete-sessions.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Users{ - client: &client - } - - var response, error := service.DeleteSessions("[USER_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/users/get-logs.md b/app/sdks/server-go/docs/examples/users/get-logs.md deleted file mode 100644 index 6917cc71db..0000000000 --- a/app/sdks/server-go/docs/examples/users/get-logs.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Users{ - client: &client - } - - var response, error := service.GetLogs("[USER_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/users/get-prefs.md b/app/sdks/server-go/docs/examples/users/get-prefs.md deleted file mode 100644 index 17676eaa36..0000000000 --- a/app/sdks/server-go/docs/examples/users/get-prefs.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Users{ - client: &client - } - - var response, error := service.GetPrefs("[USER_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/users/get-sessions.md b/app/sdks/server-go/docs/examples/users/get-sessions.md deleted file mode 100644 index cc53abfdab..0000000000 --- a/app/sdks/server-go/docs/examples/users/get-sessions.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Users{ - client: &client - } - - var response, error := service.GetSessions("[USER_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/users/get.md b/app/sdks/server-go/docs/examples/users/get.md deleted file mode 100644 index 8809d1b29b..0000000000 --- a/app/sdks/server-go/docs/examples/users/get.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Users{ - client: &client - } - - var response, error := service.Get("[USER_ID]") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/users/list.md b/app/sdks/server-go/docs/examples/users/list.md deleted file mode 100644 index ad37e72219..0000000000 --- a/app/sdks/server-go/docs/examples/users/list.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Users{ - client: &client - } - - var response, error := service.List("[SEARCH]", 0, 0, "ASC") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/users/update-prefs.md b/app/sdks/server-go/docs/examples/users/update-prefs.md deleted file mode 100644 index 9789b90f25..0000000000 --- a/app/sdks/server-go/docs/examples/users/update-prefs.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Users{ - client: &client - } - - var response, error := service.UpdatePrefs("[USER_ID]", ) - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/users/update-status.md b/app/sdks/server-go/docs/examples/users/update-status.md deleted file mode 100644 index eff2fb5072..0000000000 --- a/app/sdks/server-go/docs/examples/users/update-status.md +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - "github.com/appwrite/sdk-for-go" -) - -func main() { - var client := appwrite.Client{} - - client.SetProject("5df5acd0d48c2") // Your project ID - client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key - - var service := appwrite.Users{ - client: &client - } - - var response, error := service.UpdateStatus("[USER_ID]", "1") - - if error != nil { - panic(error) - } - - fmt.Println(response) -} \ No newline at end of file diff --git a/app/sdks/server-go/functions.go b/app/sdks/server-go/functions.go deleted file mode 100644 index 3f82eb1fb2..0000000000 --- a/app/sdks/server-go/functions.go +++ /dev/null @@ -1,186 +0,0 @@ -package appwrite - -import ( - "strings" -) - -// Functions service -type Functions struct { - client Client -} - -func NewFunctions(clt Client) Functions { - service := Functions{ - client: clt, - } - - return service -} - -// List -func (srv *Functions) List(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error) { - path := "/functions" - - params := map[string]interface{}{ - "search": Search, - "limit": Limit, - "offset": Offset, - "orderType": OrderType, - } - - return srv.client.Call("GET", path, nil, params) -} - -// Create -func (srv *Functions) Create(Name string, Vars object, Events []interface{}, Schedule string, Timeout int) (map[string]interface{}, error) { - path := "/functions" - - params := map[string]interface{}{ - "name": Name, - "vars": Vars, - "events": Events, - "schedule": Schedule, - "timeout": Timeout, - } - - return srv.client.Call("POST", path, nil, params) -} - -// Get -func (srv *Functions) Get(FunctionId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{functionId}", FunctionId) - path := r.Replace("/functions/{functionId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// Update -func (srv *Functions) Update(FunctionId string, Name string, Vars object, Events []interface{}, Schedule string, Timeout int) (map[string]interface{}, error) { - r := strings.NewReplacer("{functionId}", FunctionId) - path := r.Replace("/functions/{functionId}") - - params := map[string]interface{}{ - "name": Name, - "vars": Vars, - "events": Events, - "schedule": Schedule, - "timeout": Timeout, - } - - return srv.client.Call("PUT", path, nil, params) -} - -// Delete -func (srv *Functions) Delete(FunctionId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{functionId}", FunctionId) - path := r.Replace("/functions/{functionId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// ListExecutions -func (srv *Functions) ListExecutions(FunctionId string, Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error) { - r := strings.NewReplacer("{functionId}", FunctionId) - path := r.Replace("/functions/{functionId}/executions") - - params := map[string]interface{}{ - "search": Search, - "limit": Limit, - "offset": Offset, - "orderType": OrderType, - } - - return srv.client.Call("GET", path, nil, params) -} - -// CreateExecution -func (srv *Functions) CreateExecution(FunctionId string, Async int) (map[string]interface{}, error) { - r := strings.NewReplacer("{functionId}", FunctionId) - path := r.Replace("/functions/{functionId}/executions") - - params := map[string]interface{}{ - "async": Async, - } - - return srv.client.Call("POST", path, nil, params) -} - -// GetExecution -func (srv *Functions) GetExecution(FunctionId string, ExecutionId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{functionId}", FunctionId, "{executionId}", ExecutionId) - path := r.Replace("/functions/{functionId}/executions/{executionId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// UpdateTag -func (srv *Functions) UpdateTag(FunctionId string, Tag string) (map[string]interface{}, error) { - r := strings.NewReplacer("{functionId}", FunctionId) - path := r.Replace("/functions/{functionId}/tag") - - params := map[string]interface{}{ - "tag": Tag, - } - - return srv.client.Call("PATCH", path, nil, params) -} - -// ListTags -func (srv *Functions) ListTags(FunctionId string, Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error) { - r := strings.NewReplacer("{functionId}", FunctionId) - path := r.Replace("/functions/{functionId}/tags") - - params := map[string]interface{}{ - "search": Search, - "limit": Limit, - "offset": Offset, - "orderType": OrderType, - } - - return srv.client.Call("GET", path, nil, params) -} - -// CreateTag -func (srv *Functions) CreateTag(FunctionId string, Env string, Command string, Code string) (map[string]interface{}, error) { - r := strings.NewReplacer("{functionId}", FunctionId) - path := r.Replace("/functions/{functionId}/tags") - - params := map[string]interface{}{ - "env": Env, - "command": Command, - "code": Code, - } - - return srv.client.Call("POST", path, nil, params) -} - -// GetTag -func (srv *Functions) GetTag(FunctionId string, TagId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{functionId}", FunctionId, "{tagId}", TagId) - path := r.Replace("/functions/{functionId}/tags/{tagId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// DeleteTag -func (srv *Functions) DeleteTag(FunctionId string, TagId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{functionId}", FunctionId, "{tagId}", TagId) - path := r.Replace("/functions/{functionId}/tags/{tagId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} diff --git a/app/sdks/server-go/health.go b/app/sdks/server-go/health.go deleted file mode 100644 index d3b6b3a926..0000000000 --- a/app/sdks/server-go/health.go +++ /dev/null @@ -1,153 +0,0 @@ -package appwrite - -import ( -) - -// Health service -type Health struct { - client Client -} - -func NewHealth(clt Client) Health { - service := Health{ - client: clt, - } - - return service -} - -// Get check the Appwrite HTTP server is up and responsive. -func (srv *Health) Get() (map[string]interface{}, error) { - path := "/health" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetAntiVirus check the Appwrite Anti Virus server is up and connection is -// successful. -func (srv *Health) GetAntiVirus() (map[string]interface{}, error) { - path := "/health/anti-virus" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetCache check the Appwrite in-memory cache server is up and connection is -// successful. -func (srv *Health) GetCache() (map[string]interface{}, error) { - path := "/health/cache" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetDB check the Appwrite database server is up and connection is -// successful. -func (srv *Health) GetDB() (map[string]interface{}, error) { - path := "/health/db" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetQueueCertificates get the number of certificates that are waiting to be -// issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite -// internal queue server. -func (srv *Health) GetQueueCertificates() (map[string]interface{}, error) { - path := "/health/queue/certificates" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetQueueFunctions -func (srv *Health) GetQueueFunctions() (map[string]interface{}, error) { - path := "/health/queue/functions" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetQueueLogs get the number of logs that are waiting to be processed in the -// Appwrite internal queue server. -func (srv *Health) GetQueueLogs() (map[string]interface{}, error) { - path := "/health/queue/logs" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetQueueTasks get the number of tasks that are waiting to be processed in -// the Appwrite internal queue server. -func (srv *Health) GetQueueTasks() (map[string]interface{}, error) { - path := "/health/queue/tasks" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetQueueUsage get the number of usage stats that are waiting to be -// processed in the Appwrite internal queue server. -func (srv *Health) GetQueueUsage() (map[string]interface{}, error) { - path := "/health/queue/usage" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetQueueWebhooks get the number of webhooks that are waiting to be -// processed in the Appwrite internal queue server. -func (srv *Health) GetQueueWebhooks() (map[string]interface{}, error) { - path := "/health/queue/webhooks" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetStorageLocal check the Appwrite local storage device is up and -// connection is successful. -func (srv *Health) GetStorageLocal() (map[string]interface{}, error) { - path := "/health/storage/local" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetTime 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. -func (srv *Health) GetTime() (map[string]interface{}, error) { - path := "/health/time" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} diff --git a/app/sdks/server-go/locale.go b/app/sdks/server-go/locale.go deleted file mode 100644 index ecadd889cb..0000000000 --- a/app/sdks/server-go/locale.go +++ /dev/null @@ -1,88 +0,0 @@ -package appwrite - -import ( -) - -// Locale service -type Locale struct { - client Client -} - -func NewLocale(clt Client) Locale { - service := Locale{ - client: clt, - } - - return service -} - -// Get 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. -// -// ([IP Geolocation by DB-IP](https://db-ip.com)) -func (srv *Locale) Get() (map[string]interface{}, error) { - path := "/locale" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetContinents list of all continents. You can use the locale header to get -// the data in a supported language. -func (srv *Locale) GetContinents() (map[string]interface{}, error) { - path := "/locale/continents" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetCountries list of all countries. You can use the locale header to get -// the data in a supported language. -func (srv *Locale) GetCountries() (map[string]interface{}, error) { - path := "/locale/countries" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetCountriesEU 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. -func (srv *Locale) GetCountriesEU() (map[string]interface{}, error) { - path := "/locale/countries/eu" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetCountriesPhones list of all countries phone codes. You can use the -// locale header to get the data in a supported language. -func (srv *Locale) GetCountriesPhones() (map[string]interface{}, error) { - path := "/locale/countries/phones" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetCurrencies list of all currencies, including currency symol, 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. -func (srv *Locale) GetCurrencies() (map[string]interface{}, error) { - path := "/locale/currencies" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} diff --git a/app/sdks/server-go/main.go b/app/sdks/server-go/main.go deleted file mode 100644 index 13df7fc1b5..0000000000 --- a/app/sdks/server-go/main.go +++ /dev/null @@ -1,6 +0,0 @@ -package appwrite - -// NewClient initializes a new Appwrite client -func NewClient() Client { - return Client{} -} diff --git a/app/sdks/server-go/storage.go b/app/sdks/server-go/storage.go deleted file mode 100644 index 7ede9c3255..0000000000 --- a/app/sdks/server-go/storage.go +++ /dev/null @@ -1,134 +0,0 @@ -package appwrite - -import ( - "strings" -) - -// Storage service -type Storage struct { - client Client -} - -func NewStorage(clt Client) Storage { - service := Storage{ - client: clt, - } - - return service -} - -// ListFiles get a list of all the user files. You can use the query params to -// filter your results. On admin mode, this endpoint will return a list of all -// of the project files. [Learn more about different API modes](/docs/admin). -func (srv *Storage) ListFiles(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error) { - path := "/storage/files" - - params := map[string]interface{}{ - "search": Search, - "limit": Limit, - "offset": Offset, - "orderType": OrderType, - } - - return srv.client.Call("GET", path, nil, params) -} - -// CreateFile create a new file. The user who creates the file will -// automatically be assigned to read and write access unless he has passed -// custom values for read and write arguments. -func (srv *Storage) CreateFile(File string, Read []interface{}, Write []interface{}) (map[string]interface{}, error) { - path := "/storage/files" - - params := map[string]interface{}{ - "file": File, - "read": Read, - "write": Write, - } - - return srv.client.Call("POST", path, nil, params) -} - -// GetFile get file by its unique ID. This endpoint response returns a JSON -// object with the file metadata. -func (srv *Storage) GetFile(FileId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{fileId}", FileId) - path := r.Replace("/storage/files/{fileId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// UpdateFile update file by its unique ID. Only users with write permissions -// have access to update this resource. -func (srv *Storage) UpdateFile(FileId string, Read []interface{}, Write []interface{}) (map[string]interface{}, error) { - r := strings.NewReplacer("{fileId}", FileId) - path := r.Replace("/storage/files/{fileId}") - - params := map[string]interface{}{ - "read": Read, - "write": Write, - } - - return srv.client.Call("PUT", path, nil, params) -} - -// DeleteFile delete a file by its unique ID. Only users with write -// permissions have access to delete this resource. -func (srv *Storage) DeleteFile(FileId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{fileId}", FileId) - path := r.Replace("/storage/files/{fileId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// GetFileDownload get 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. -func (srv *Storage) GetFileDownload(FileId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{fileId}", FileId) - path := r.Replace("/storage/files/{fileId}/download") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetFilePreview 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. -func (srv *Storage) GetFilePreview(FileId string, Width int, Height int, Quality int, Background string, Output string) (map[string]interface{}, error) { - r := strings.NewReplacer("{fileId}", FileId) - path := r.Replace("/storage/files/{fileId}/preview") - - params := map[string]interface{}{ - "width": Width, - "height": Height, - "quality": Quality, - "background": Background, - "output": Output, - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetFileView get file content by its unique ID. This endpoint is similar to -// the download method but returns with no 'Content-Disposition: attachment' -// header. -func (srv *Storage) GetFileView(FileId string, As string) (map[string]interface{}, error) { - r := strings.NewReplacer("{fileId}", FileId) - path := r.Replace("/storage/files/{fileId}/view") - - params := map[string]interface{}{ - "as": As, - } - - return srv.client.Call("GET", path, nil, params) -} diff --git a/app/sdks/server-go/teams.go b/app/sdks/server-go/teams.go deleted file mode 100644 index 14b89e0dda..0000000000 --- a/app/sdks/server-go/teams.go +++ /dev/null @@ -1,140 +0,0 @@ -package appwrite - -import ( - "strings" -) - -// Teams service -type Teams struct { - client Client -} - -func NewTeams(clt Client) Teams { - service := Teams{ - client: clt, - } - - return service -} - -// List get a list of all the current user teams. You can use the query params -// to filter your results. On admin mode, this endpoint will return a list of -// all of the project teams. [Learn more about different API -// modes](/docs/admin). -func (srv *Teams) List(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error) { - path := "/teams" - - params := map[string]interface{}{ - "search": Search, - "limit": Limit, - "offset": Offset, - "orderType": OrderType, - } - - return srv.client.Call("GET", path, nil, params) -} - -// Create create a new team. The user who creates the team will automatically -// be assigned as the owner of the team. The team owner can invite new -// members, who will be able add new owners and update or delete the team from -// your project. -func (srv *Teams) Create(Name string, Roles []interface{}) (map[string]interface{}, error) { - path := "/teams" - - params := map[string]interface{}{ - "name": Name, - "roles": Roles, - } - - return srv.client.Call("POST", path, nil, params) -} - -// Get get team by its unique ID. All team members have read access for this -// resource. -func (srv *Teams) Get(TeamId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{teamId}", TeamId) - path := r.Replace("/teams/{teamId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// Update update team by its unique ID. Only team owners have write access for -// this resource. -func (srv *Teams) Update(TeamId string, Name string) (map[string]interface{}, error) { - r := strings.NewReplacer("{teamId}", TeamId) - path := r.Replace("/teams/{teamId}") - - params := map[string]interface{}{ - "name": Name, - } - - return srv.client.Call("PUT", path, nil, params) -} - -// Delete delete team by its unique ID. Only team owners have write access for -// this resource. -func (srv *Teams) Delete(TeamId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{teamId}", TeamId) - path := r.Replace("/teams/{teamId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// GetMemberships get team members by the team unique ID. All team members -// have read access for this list of resources. -func (srv *Teams) GetMemberships(TeamId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{teamId}", TeamId) - path := r.Replace("/teams/{teamId}/memberships") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// CreateMembership use this endpoint to invite a new member to join your -// team. An email with a link to join the team will be sent to the new member -// email address if the member doesn't exist in the project it will be created -// automatically. -// -// Use the 'URL' parameter to redirect the user from the invitation email back -// to your app. When the user is redirected, use the [Update Team Membership -// Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to -// accept the invitation to the team. -// -// Please note that in order to avoid a [Redirect -// Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) -// the only valid redirect URL's are the once from domains you have set when -// added your platforms in the console interface. -func (srv *Teams) CreateMembership(TeamId string, Email string, Roles []interface{}, Url string, Name string) (map[string]interface{}, error) { - r := strings.NewReplacer("{teamId}", TeamId) - path := r.Replace("/teams/{teamId}/memberships") - - params := map[string]interface{}{ - "email": Email, - "name": Name, - "roles": Roles, - "url": Url, - } - - return srv.client.Call("POST", path, nil, params) -} - -// DeleteMembership 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 he didn't accept it. -func (srv *Teams) DeleteMembership(TeamId string, InviteId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{teamId}", TeamId, "{inviteId}", InviteId) - path := r.Replace("/teams/{teamId}/memberships/{inviteId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} diff --git a/app/sdks/server-go/users.go b/app/sdks/server-go/users.go deleted file mode 100644 index 405b5a3209..0000000000 --- a/app/sdks/server-go/users.go +++ /dev/null @@ -1,137 +0,0 @@ -package appwrite - -import ( - "strings" -) - -// Users service -type Users struct { - client Client -} - -func NewUsers(clt Client) Users { - service := Users{ - client: clt, - } - - return service -} - -// List get a list of all the project users. You can use the query params to -// filter your results. -func (srv *Users) List(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error) { - path := "/users" - - params := map[string]interface{}{ - "search": Search, - "limit": Limit, - "offset": Offset, - "orderType": OrderType, - } - - return srv.client.Call("GET", path, nil, params) -} - -// Create create a new user. -func (srv *Users) Create(Email string, Password string, Name string) (map[string]interface{}, error) { - path := "/users" - - params := map[string]interface{}{ - "email": Email, - "password": Password, - "name": Name, - } - - return srv.client.Call("POST", path, nil, params) -} - -// Get get user by its unique ID. -func (srv *Users) Get(UserId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{userId}", UserId) - path := r.Replace("/users/{userId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetLogs get user activity logs list by its unique ID. -func (srv *Users) GetLogs(UserId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{userId}", UserId) - path := r.Replace("/users/{userId}/logs") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetPrefs get user preferences by its unique ID. -func (srv *Users) GetPrefs(UserId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{userId}", UserId) - path := r.Replace("/users/{userId}/prefs") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// UpdatePrefs update user preferences by its unique ID. You can pass only the -// specific settings you wish to update. -func (srv *Users) UpdatePrefs(UserId string, Prefs object) (map[string]interface{}, error) { - r := strings.NewReplacer("{userId}", UserId) - path := r.Replace("/users/{userId}/prefs") - - params := map[string]interface{}{ - "prefs": Prefs, - } - - return srv.client.Call("PATCH", path, nil, params) -} - -// GetSessions get user sessions list by its unique ID. -func (srv *Users) GetSessions(UserId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{userId}", UserId) - path := r.Replace("/users/{userId}/sessions") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// DeleteSessions delete all user sessions by its unique ID. -func (srv *Users) DeleteSessions(UserId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{userId}", UserId) - path := r.Replace("/users/{userId}/sessions") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// DeleteSession delete user sessions by its unique ID. -func (srv *Users) DeleteSession(UserId string, SessionId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{userId}", UserId, "{sessionId}", SessionId) - path := r.Replace("/users/{userId}/sessions/{sessionId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// UpdateStatus update user status by its unique ID. -func (srv *Users) UpdateStatus(UserId string, Status string) (map[string]interface{}, error) { - r := strings.NewReplacer("{userId}", UserId) - path := r.Replace("/users/{userId}/status") - - params := map[string]interface{}{ - "status": Status, - } - - return srv.client.Call("PATCH", path, nil, params) -} diff --git a/app/sdks/server-go/utils.go b/app/sdks/server-go/utils.go deleted file mode 100644 index ca36149cf1..0000000000 --- a/app/sdks/server-go/utils.go +++ /dev/null @@ -1,36 +0,0 @@ -package appwrite - -import ( - "fmt" - "reflect" - "strconv" -) - -// ToString changes arg to string -func ToString(arg interface{}) string { - var tmp = reflect.Indirect(reflect.ValueOf(arg)).Interface() - switch v := tmp.(type) { - case int: - return strconv.Itoa(v) - case int8: - return strconv.FormatInt(int64(v), 10) - case int16: - return strconv.FormatInt(int64(v), 10) - case int32: - return strconv.FormatInt(int64(v), 10) - case int64: - return strconv.FormatInt(v, 10) - case string: - return v - case float32: - return strconv.FormatFloat(float64(v), 'f', -1, 32) - case float64: - return strconv.FormatFloat(v, 'f', -1, 64) - case fmt.Stringer: - return v.String() - case reflect.Value: - return ToString(v.Interface()) - default: - return "" - } -} diff --git a/app/sdks/server-java/CHANGELOG.md b/app/sdks/server-java/CHANGELOG.md deleted file mode 100644 index fa4d35e687..0000000000 --- a/app/sdks/server-java/CHANGELOG.md +++ /dev/null @@ -1 +0,0 @@ -# Change Log \ No newline at end of file diff --git a/app/sdks/server-java/LICENSE b/app/sdks/server-java/LICENSE deleted file mode 100644 index fc7c051a91..0000000000 --- a/app/sdks/server-java/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/app/sdks/server-java/README.md b/app/sdks/server-java/README.md deleted file mode 100644 index 05e7d85945..0000000000 --- a/app/sdks/server-java/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Appwrite SDK for Java - -![License](https://img.shields.io/github/license/appwrite/sdk-for-java.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.6.0-blue.svg?v=1) - -**This SDK is compatible with Appwrite server version 0.6.0. For older versions, please check previous releases.** - -Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. - Use the Java SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. - For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) - - - -![Appwrite](https://appwrite.io/images/github.png) - -## Installation - -### Maven -Add this to your project's `pom.xml` file: - -```xml - - - com.squareup.okhttp3 - appwrite - 0.0.1 - - -``` - -You can install packages from the command line: - -```bash -mvn install appwrite -``` - -## Contribution - -This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request. - -## License - -Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. \ No newline at end of file diff --git a/app/sdks/server-java/pom.xml b/app/sdks/server-java/pom.xml deleted file mode 100644 index 6d3098a6ea..0000000000 --- a/app/sdks/server-java/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - 4.0.0 - - - appwrite - 0.0.1 - - Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API - https://appwrite.io - - - 1.9 - 1.9 - - - - - com.squareup.okhttp3 - okhttp - 4.5.0 - - - com.google.code.gson - gson - 2.8.2 - - - - org.junit.jupiter - junit-jupiter-api - 5.6.2 - test - - - org.junit.jupiter - junit-jupiter-engine - 5.6.2 - test - - - - - - - maven-surefire-plugin - 2.22.2 - - - maven-failsafe-plugin - 2.22.2 - - - - \ No newline at end of file diff --git a/app/sdks/server-java/src/main/java/Client.java b/app/sdks/server-java/src/main/java/Client.java deleted file mode 100644 index 51c52aebb5..0000000000 --- a/app/sdks/server-java/src/main/java/Client.java +++ /dev/null @@ -1,143 +0,0 @@ -package ; - -import com.google.gson.Gson; -import okhttp3.Call; -import okhttp3.CookieJar; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.FormBody; -import okhttp3.MediaType; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; - -import java.util.List; -import java.util.HashMap; -import java.util.Map; - -import static java.util.Map.entry; - -public class Client { - private final OkHttpClient http; - private final Map headers; - private final Map config; - private String endPoint; - private boolean selfSigned; - private CookieJar cookieJar = CookieJar.NO_COOKIES; - - public Client() { - this("https://appwrite.io/v1", false, new OkHttpClient()); - } - - public Client(String endPoint, boolean selfSigned, OkHttpClient http) { - this.endPoint = endPoint; - this.selfSigned = selfSigned; - this.headers = new HashMap<>(Map.ofEntries( - entry("content-type", "application/json"), - entry("x-sdk-version", "appwrite:java:0.0.1") - )); - this.config = new HashMap<>(); - this.http = http.newBuilder() - .cookieJar(cookieJar) - .build(); - } - - public String getEndPoint(){ - return endPoint; - } - - public Map getConfig(){ - return config; - } - -// private Future getCookiePath() { -// final directory = getApplicationDocumentsDirectory(); -// final path = directory.path; -// final Directory dir = new Directory("$path/cookies"); -// dir.create(); -// return dir; -// } - - /// Your project ID - public Client setProject(String value) { - config.put("project", value); - addHeader("X-Appwrite-Project", value); - return this; - } - - /// Your secret API key - public Client setKey(String value) { - config.put("key", value); - addHeader("X-Appwrite-Key", value); - return this; - } - - public Client setLocale(String value) { - config.put("locale", value); - addHeader("X-Appwrite-Locale", value); - return this; - } - - public Client setSelfSigned(boolean status) { - selfSigned = status; - return this; - } - - public Client setEndpoint(String endPoint) { - this.endPoint = endPoint; - return this; - } - - public Client addHeader(String key, String value) { - headers.put(key, value); - return this; - } - - public Call call(String method, String path, Map headers, Map params) { - if(selfSigned) { - // Allow self signed requests - - } - - Headers requestHeaders = Headers.of(this.headers).newBuilder() - .addAll(Headers.of(headers)) - .build(); - - HttpUrl.Builder httpBuilder = HttpUrl.get(endPoint + path).newBuilder(); - if("GET".equals(method)) { - params.forEach((k, v) -> { - if(v instanceof List){ - httpBuilder.addQueryParameter(k+"[]", v.toString()); - }else{ - httpBuilder.addQueryParameter(k, v.toString()); - } - }); - Request request = new Request.Builder() - .url(httpBuilder.build()) - .headers(requestHeaders) - .get() - .build(); - - return http.newCall(request); - } - - RequestBody body; - if("multipart/form-data".equals(headers.get("content-type"))) { - FormBody.Builder builder = new FormBody.Builder(); - params.forEach((k, v) -> builder.add(k, v.toString())); - body = builder.build(); - } else { - Gson gson = new Gson(); - String json = gson.toJson(params); - body = RequestBody.create(json, MediaType.get("application/json")); - } - - Request request = new Request.Builder() - .url(httpBuilder.build()) - .headers(requestHeaders) - .method(method, body) - .build(); - - return http.newCall(request); - } -} \ No newline at end of file diff --git a/app/sdks/server-java/src/main/java/enums/OrderType.java b/app/sdks/server-java/src/main/java/enums/OrderType.java deleted file mode 100644 index d4a73a3886..0000000000 --- a/app/sdks/server-java/src/main/java/enums/OrderType.java +++ /dev/null @@ -1,6 +0,0 @@ -package .enums; - -public enum OrderType { - ASC, DESC -} - diff --git a/app/sdks/server-java/src/main/java/services/Avatars.java b/app/sdks/server-java/src/main/java/services/Avatars.java deleted file mode 100644 index 3c0bb4e6c8..0000000000 --- a/app/sdks/server-java/src/main/java/services/Avatars.java +++ /dev/null @@ -1,164 +0,0 @@ -package .services; - - - -import okhttp3.Call; -import .Client; -import .enums.OrderType; - -import java.io.File; -import java.util.List; -import java.util.HashMap; -import java.util.Map; - -import static java.util.Map.entry; - -public class Avatars extends Service { - public Avatars(Client client){ - super(client); - } - - /// Get Browser Icon - /* - * 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 - * /account/sessions endpoint. Use width, height and quality arguments to - * change the output settings. - */ - public Call getBrowser(String code, int width, int height, int quality) { - final String path = "/avatars/browsers/{code}".replace("{code}", code); - - final Map params = Map.ofEntries( - entry("width", width), - entry("height", height), - entry("quality", quality) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Get Credit Card Icon - /* - * Need to display your users with your billing method or their payment - * methods? 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. - */ - public Call getCreditCard(String code, int width, int height, int quality) { - final String path = "/avatars/credit-cards/{code}".replace("{code}", code); - - final Map params = Map.ofEntries( - entry("width", width), - entry("height", height), - entry("quality", quality) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Get Favicon - /* - * Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote - * website URL. - */ - public Call getFavicon(String url) { - final String path = "/avatars/favicon"; - - final Map params = Map.ofEntries( - entry("url", url) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Get Country Flag - /* - * 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. - */ - public Call getFlag(String code, int width, int height, int quality) { - final String path = "/avatars/flags/{code}".replace("{code}", code); - - final Map params = Map.ofEntries( - entry("width", width), - entry("height", height), - entry("quality", quality) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Get Image from URL - /* - * 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. - */ - public Call getImage(String url, int width, int height) { - final String path = "/avatars/image"; - - final Map params = Map.ofEntries( - entry("url", url), - entry("width", width), - entry("height", height) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Get QR Code - /* - * 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. - */ - public Call getQR(String text, int size, int margin, int download) { - final String path = "/avatars/qr"; - - final Map params = Map.ofEntries( - entry("text", text), - entry("size", size), - entry("margin", margin), - entry("download", download) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } -} \ No newline at end of file diff --git a/app/sdks/server-java/src/main/java/services/Database.java b/app/sdks/server-java/src/main/java/services/Database.java deleted file mode 100644 index 84161de9fc..0000000000 --- a/app/sdks/server-java/src/main/java/services/Database.java +++ /dev/null @@ -1,264 +0,0 @@ -package .services; - - - -import okhttp3.Call; -import .Client; -import .enums.OrderType; - -import java.io.File; -import java.util.List; -import java.util.HashMap; -import java.util.Map; - -import static java.util.Map.entry; - -public class Database extends Service { - public Database(Client client){ - super(client); - } - - /// List Collections - /* - * Get a list of all the user collections. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project collections. [Learn more about different API - * modes](/docs/admin). - */ - public Call listCollections(String search, int limit, int offset, OrderType orderType) { - final String path = "/database/collections"; - - final Map params = Map.ofEntries( - entry("search", search), - entry("limit", limit), - entry("offset", offset), - entry("orderType", orderType.name()) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Create Collection - /* - * Create a new Collection. - */ - public Call createCollection(String name, List read, List write, List rules) { - final String path = "/database/collections"; - - final Map params = Map.ofEntries( - entry("name", name), - entry("read", read), - entry("write", write), - entry("rules", rules) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("POST", path, headers, params); - } - - /// Get Collection - /* - * Get collection by its unique ID. This endpoint response returns a JSON - * object with the collection metadata. - */ - public Call getCollection(String collectionId) { - final String path = "/database/collections/{collectionId}".replace("{collectionId}", collectionId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Update Collection - /* - * Update collection by its unique ID. - */ - public Call updateCollection(String collectionId, String name, List read, List write, List rules) { - final String path = "/database/collections/{collectionId}".replace("{collectionId}", collectionId); - - final Map params = Map.ofEntries( - entry("name", name), - entry("read", read), - entry("write", write), - entry("rules", rules) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("PUT", path, headers, params); - } - - /// Delete Collection - /* - * Delete a collection by its unique ID. Only users with write permissions - * have access to delete this resource. - */ - public Call deleteCollection(String collectionId) { - final String path = "/database/collections/{collectionId}".replace("{collectionId}", collectionId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("DELETE", path, headers, params); - } - - /// List Documents - /* - * Get a list of all the user documents. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project documents. [Learn more about different API - * modes](/docs/admin). - */ - public Call listDocuments(String collectionId, List filters, int offset, int limit, String orderField, OrderType orderType, String orderCast, String search, int first, int last) { - final String path = "/database/collections/{collectionId}/documents".replace("{collectionId}", collectionId); - - final Map params = Map.ofEntries( - entry("filters", filters), - entry("offset", offset), - entry("limit", limit), - entry("orderField", orderField), - entry("orderType", orderType.name()), - entry("orderCast", orderCast), - entry("search", search), - entry("first", first), - entry("last", last) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Create Document - /* - * Create a new Document. - */ - public Call createDocument(String collectionId, Object data, List read, List write, String parentDocument, String parentProperty, String parentPropertyType) { - final String path = "/database/collections/{collectionId}/documents".replace("{collectionId}", collectionId); - - final Map params = Map.ofEntries( - entry("data", data), - entry("read", read), - entry("write", write), - entry("parentDocument", parentDocument), - entry("parentProperty", parentProperty), - entry("parentPropertyType", parentPropertyType) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("POST", path, headers, params); - } - - /// Get Document - /* - * Get document by its unique ID. This endpoint response returns a JSON object - * with the document data. - */ - public Call getDocument(String collectionId, String documentId) { - final String path = "/database/collections/{collectionId}/documents/{documentId}".replace("{collectionId}", collectionId).replace("{documentId}", documentId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Update Document - public Call updateDocument(String collectionId, String documentId, Object data, List read, List write) { - final String path = "/database/collections/{collectionId}/documents/{documentId}".replace("{collectionId}", collectionId).replace("{documentId}", documentId); - - final Map params = Map.ofEntries( - entry("data", data), - entry("read", read), - entry("write", write) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("PATCH", path, headers, params); - } - - /// Delete Document - /* - * Delete document by its unique ID. This endpoint deletes only the parent - * documents, his attributes and relations to other documents. Child documents - * **will not** be deleted. - */ - public Call deleteDocument(String collectionId, String documentId) { - final String path = "/database/collections/{collectionId}/documents/{documentId}".replace("{collectionId}", collectionId).replace("{documentId}", documentId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("DELETE", path, headers, params); - } - - /// Get Collection Logs - public Call getCollectionLogs(String collectionId) { - final String path = "/database/collections/{collectionId}/logs".replace("{collectionId}", collectionId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } -} \ No newline at end of file diff --git a/app/sdks/server-java/src/main/java/services/Functions.java b/app/sdks/server-java/src/main/java/services/Functions.java deleted file mode 100644 index a04ad1b5a9..0000000000 --- a/app/sdks/server-java/src/main/java/services/Functions.java +++ /dev/null @@ -1,255 +0,0 @@ -package .services; - - - -import okhttp3.Call; -import .Client; -import .enums.OrderType; - -import java.io.File; -import java.util.List; -import java.util.HashMap; -import java.util.Map; - -import static java.util.Map.entry; - -public class Functions extends Service { - public Functions(Client client){ - super(client); - } - - /// List Functions - public Call list(String search, int limit, int offset, OrderType orderType) { - final String path = "/functions"; - - final Map params = Map.ofEntries( - entry("search", search), - entry("limit", limit), - entry("offset", offset), - entry("orderType", orderType.name()) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Create Function - public Call create(String name, Object vars, List events, String schedule, int timeout) { - final String path = "/functions"; - - final Map params = Map.ofEntries( - entry("name", name), - entry("vars", vars), - entry("events", events), - entry("schedule", schedule), - entry("timeout", timeout) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("POST", path, headers, params); - } - - /// Get Function - public Call get(String functionId) { - final String path = "/functions/{functionId}".replace("{functionId}", functionId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Update Function - public Call update(String functionId, String name, Object vars, List events, String schedule, int timeout) { - final String path = "/functions/{functionId}".replace("{functionId}", functionId); - - final Map params = Map.ofEntries( - entry("name", name), - entry("vars", vars), - entry("events", events), - entry("schedule", schedule), - entry("timeout", timeout) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("PUT", path, headers, params); - } - - /// Delete Function - public Call delete(String functionId) { - final String path = "/functions/{functionId}".replace("{functionId}", functionId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("DELETE", path, headers, params); - } - - /// List Executions - public Call listExecutions(String functionId, String search, int limit, int offset, OrderType orderType) { - final String path = "/functions/{functionId}/executions".replace("{functionId}", functionId); - - final Map params = Map.ofEntries( - entry("search", search), - entry("limit", limit), - entry("offset", offset), - entry("orderType", orderType.name()) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Create Execution - public Call createExecution(String functionId, int async) { - final String path = "/functions/{functionId}/executions".replace("{functionId}", functionId); - - final Map params = Map.ofEntries( - entry("async", async) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("POST", path, headers, params); - } - - /// Get Execution - public Call getExecution(String functionId, String executionId) { - final String path = "/functions/{functionId}/executions/{executionId}".replace("{functionId}", functionId).replace("{executionId}", executionId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Update Function Tag - public Call updateTag(String functionId, String tag) { - final String path = "/functions/{functionId}/tag".replace("{functionId}", functionId); - - final Map params = Map.ofEntries( - entry("tag", tag) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("PATCH", path, headers, params); - } - - /// List Tags - public Call listTags(String functionId, String search, int limit, int offset, OrderType orderType) { - final String path = "/functions/{functionId}/tags".replace("{functionId}", functionId); - - final Map params = Map.ofEntries( - entry("search", search), - entry("limit", limit), - entry("offset", offset), - entry("orderType", orderType.name()) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Create Tag - public Call createTag(String functionId, String env, String command, String code) { - final String path = "/functions/{functionId}/tags".replace("{functionId}", functionId); - - final Map params = Map.ofEntries( - entry("env", env), - entry("command", command), - entry("code", code) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("POST", path, headers, params); - } - - /// Get Tag - public Call getTag(String functionId, String tagId) { - final String path = "/functions/{functionId}/tags/{tagId}".replace("{functionId}", functionId).replace("{tagId}", tagId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Delete Tag - public Call deleteTag(String functionId, String tagId) { - final String path = "/functions/{functionId}/tags/{tagId}".replace("{functionId}", functionId).replace("{tagId}", tagId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("DELETE", path, headers, params); - } -} \ No newline at end of file diff --git a/app/sdks/server-java/src/main/java/services/Health.java b/app/sdks/server-java/src/main/java/services/Health.java deleted file mode 100644 index 08e23433d1..0000000000 --- a/app/sdks/server-java/src/main/java/services/Health.java +++ /dev/null @@ -1,258 +0,0 @@ -package .services; - - - -import okhttp3.Call; -import .Client; -import .enums.OrderType; - -import java.io.File; -import java.util.List; -import java.util.HashMap; -import java.util.Map; - -import static java.util.Map.entry; - -public class Health extends Service { - public Health(Client client){ - super(client); - } - - /// Get HTTP - /* - * Check the Appwrite HTTP server is up and responsive. - */ - public Call get() { - final String path = "/health"; - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Get Anti virus - /* - * Check the Appwrite Anti Virus server is up and connection is successful. - */ - public Call getAntiVirus() { - final String path = "/health/anti-virus"; - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Get Cache - /* - * Check the Appwrite in-memory cache server is up and connection is - * successful. - */ - public Call getCache() { - final String path = "/health/cache"; - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Get DB - /* - * Check the Appwrite database server is up and connection is successful. - */ - public Call getDB() { - final String path = "/health/db"; - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Get Certificate Queue - /* - * Get the number of certificates that are waiting to be issued against - * [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue - * server. - */ - public Call getQueueCertificates() { - final String path = "/health/queue/certificates"; - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Get Functions Queue - public Call getQueueFunctions() { - final String path = "/health/queue/functions"; - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Get Logs Queue - /* - * Get the number of logs that are waiting to be processed in the Appwrite - * internal queue server. - */ - public Call getQueueLogs() { - final String path = "/health/queue/logs"; - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Get Tasks Queue - /* - * Get the number of tasks that are waiting to be processed in the Appwrite - * internal queue server. - */ - public Call getQueueTasks() { - final String path = "/health/queue/tasks"; - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Get Usage Queue - /* - * Get the number of usage stats that are waiting to be processed in the - * Appwrite internal queue server. - */ - public Call getQueueUsage() { - final String path = "/health/queue/usage"; - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Get Webhooks Queue - /* - * Get the number of webhooks that are waiting to be processed in the Appwrite - * internal queue server. - */ - public Call getQueueWebhooks() { - final String path = "/health/queue/webhooks"; - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Get Local Storage - /* - * Check the Appwrite local storage device is up and connection is successful. - */ - public Call getStorageLocal() { - final String path = "/health/storage/local"; - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Get Time - /* - * 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. - */ - public Call getTime() { - final String path = "/health/time"; - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } -} \ No newline at end of file diff --git a/app/sdks/server-java/src/main/java/services/Locale.java b/app/sdks/server-java/src/main/java/services/Locale.java deleted file mode 100644 index 695b04a679..0000000000 --- a/app/sdks/server-java/src/main/java/services/Locale.java +++ /dev/null @@ -1,145 +0,0 @@ -package .services; - - - -import okhttp3.Call; -import .Client; -import .enums.OrderType; - -import java.io.File; -import java.util.List; -import java.util.HashMap; -import java.util.Map; - -import static java.util.Map.entry; - -public class Locale extends Service { - public Locale(Client client){ - super(client); - } - - /// Get User Locale - /* - * 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. - * - * ([IP Geolocation by DB-IP](https://db-ip.com)) - */ - public Call get() { - final String path = "/locale"; - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// List Continents - /* - * List of all continents. You can use the locale header to get the data in a - * supported language. - */ - public Call getContinents() { - final String path = "/locale/continents"; - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// List Countries - /* - * List of all countries. You can use the locale header to get the data in a - * supported language. - */ - public Call getCountries() { - final String path = "/locale/countries"; - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// List EU Countries - /* - * 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. - */ - public Call getCountriesEU() { - final String path = "/locale/countries/eu"; - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// List Countries Phone Codes - /* - * List of all countries phone codes. You can use the locale header to get the - * data in a supported language. - */ - public Call getCountriesPhones() { - final String path = "/locale/countries/phones"; - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// List Currencies - /* - * List of all currencies, including currency symol, 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. - */ - public Call getCurrencies() { - final String path = "/locale/currencies"; - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } -} \ No newline at end of file diff --git a/app/sdks/server-java/src/main/java/services/Service.java b/app/sdks/server-java/src/main/java/services/Service.java deleted file mode 100644 index 477b0ba724..0000000000 --- a/app/sdks/server-java/src/main/java/services/Service.java +++ /dev/null @@ -1,11 +0,0 @@ -package .services; - -import .Client; - -abstract class Service { - final Client client; - - Service(Client client) { - this.client = client; - } -} diff --git a/app/sdks/server-java/src/main/java/services/Storage.java b/app/sdks/server-java/src/main/java/services/Storage.java deleted file mode 100644 index 0233868d0d..0000000000 --- a/app/sdks/server-java/src/main/java/services/Storage.java +++ /dev/null @@ -1,204 +0,0 @@ -package .services; - - - -import okhttp3.Call; -import okhttp3.HttpUrl; -import .Client; -import .enums.OrderType; - -import java.io.File; -import java.util.List; -import java.util.HashMap; -import java.util.Map; - -import static java.util.Map.entry; - -public class Storage extends Service { - public Storage(Client client){ - super(client); - } - - /// List Files - /* - * Get a list of all the user files. You can use the query params to filter - * your results. On admin mode, this endpoint will return a list of all of the - * project files. [Learn more about different API modes](/docs/admin). - */ - public Call listFiles(String search, int limit, int offset, OrderType orderType) { - final String path = "/storage/files"; - - final Map params = Map.ofEntries( - entry("search", search), - entry("limit", limit), - entry("offset", offset), - entry("orderType", orderType.name()) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Create File - /* - * Create a new file. The user who creates the file will automatically be - * assigned to read and write access unless he has passed custom values for - * read and write arguments. - */ - public Call createFile(File file, List read, List write) { - final String path = "/storage/files"; - - final Map params = Map.ofEntries( - entry("file", file), - entry("read", read), - entry("write", write) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "multipart/form-data") - ); - - return client.call("POST", path, headers, params); - } - - /// Get File - /* - * Get file by its unique ID. This endpoint response returns a JSON object - * with the file metadata. - */ - public Call getFile(String fileId) { - final String path = "/storage/files/{fileId}".replace("{fileId}", fileId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Update File - /* - * Update file by its unique ID. Only users with write permissions have access - * to update this resource. - */ - public Call updateFile(String fileId, List read, List write) { - final String path = "/storage/files/{fileId}".replace("{fileId}", fileId); - - final Map params = Map.ofEntries( - entry("read", read), - entry("write", write) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("PUT", path, headers, params); - } - - /// Delete File - /* - * Delete a file by its unique ID. Only users with write permissions have - * access to delete this resource. - */ - public Call deleteFile(String fileId) { - final String path = "/storage/files/{fileId}".replace("{fileId}", fileId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("DELETE", path, headers, params); - } - - /// Get File for Download - /* - * Get 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. - */ - public String getFileDownload(String fileId) { - final String path = "/storage/files/{fileId}/download".replace("{fileId}", fileId); - - final Map params = Map.ofEntries( - entry("project", client.getConfig().get("project")), - entry("key", client.getConfig().get("key")) - ); - - - - HttpUrl.Builder httpBuilder = new HttpUrl.Builder().build().newBuilder(client.getEndPoint() + path); - params.forEach((k, v) -> httpBuilder.addQueryParameter(k, v.toString())); - - return httpBuilder.build().toString(); - } - - /// Get File Preview - /* - * 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. - */ - public String getFilePreview(String fileId, int width, int height, int quality, String background, String output) { - final String path = "/storage/files/{fileId}/preview".replace("{fileId}", fileId); - - final Map params = Map.ofEntries( - entry("width", width), - entry("height", height), - entry("quality", quality), - entry("background", background), - entry("output", output), - entry("project", client.getConfig().get("project")), - entry("key", client.getConfig().get("key")) - ); - - - - HttpUrl.Builder httpBuilder = new HttpUrl.Builder().build().newBuilder(client.getEndPoint() + path); - params.forEach((k, v) -> httpBuilder.addQueryParameter(k, v.toString())); - - return httpBuilder.build().toString(); - } - - /// Get File for View - /* - * Get file content by its unique ID. This endpoint is similar to the download - * method but returns with no 'Content-Disposition: attachment' header. - */ - public String getFileView(String fileId, String as) { - final String path = "/storage/files/{fileId}/view".replace("{fileId}", fileId); - - final Map params = Map.ofEntries( - entry("as", as), - entry("project", client.getConfig().get("project")), - entry("key", client.getConfig().get("key")) - ); - - - - HttpUrl.Builder httpBuilder = new HttpUrl.Builder().build().newBuilder(client.getEndPoint() + path); - params.forEach((k, v) -> httpBuilder.addQueryParameter(k, v.toString())); - - return httpBuilder.build().toString(); - } -} \ No newline at end of file diff --git a/app/sdks/server-java/src/main/java/services/Teams.java b/app/sdks/server-java/src/main/java/services/Teams.java deleted file mode 100644 index 46cff57f8c..0000000000 --- a/app/sdks/server-java/src/main/java/services/Teams.java +++ /dev/null @@ -1,206 +0,0 @@ -package .services; - - - -import okhttp3.Call; -import .Client; -import .enums.OrderType; - -import java.io.File; -import java.util.List; -import java.util.HashMap; -import java.util.Map; - -import static java.util.Map.entry; - -public class Teams extends Service { - public Teams(Client client){ - super(client); - } - - /// List Teams - /* - * Get a list of all the current user teams. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project teams. [Learn more about different API modes](/docs/admin). - */ - public Call list(String search, int limit, int offset, OrderType orderType) { - final String path = "/teams"; - - final Map params = Map.ofEntries( - entry("search", search), - entry("limit", limit), - entry("offset", offset), - entry("orderType", orderType.name()) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Create Team - /* - * Create a new team. The user who creates the team will automatically be - * assigned as the owner of the team. The team owner can invite new members, - * who will be able add new owners and update or delete the team from your - * project. - */ - public Call create(String name, List roles) { - final String path = "/teams"; - - final Map params = Map.ofEntries( - entry("name", name), - entry("roles", roles) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("POST", path, headers, params); - } - - /// Get Team - /* - * Get team by its unique ID. All team members have read access for this - * resource. - */ - public Call get(String teamId) { - final String path = "/teams/{teamId}".replace("{teamId}", teamId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Update Team - /* - * Update team by its unique ID. Only team owners have write access for this - * resource. - */ - public Call update(String teamId, String name) { - final String path = "/teams/{teamId}".replace("{teamId}", teamId); - - final Map params = Map.ofEntries( - entry("name", name) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("PUT", path, headers, params); - } - - /// Delete Team - /* - * Delete team by its unique ID. Only team owners have write access for this - * resource. - */ - public Call delete(String teamId) { - final String path = "/teams/{teamId}".replace("{teamId}", teamId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("DELETE", path, headers, params); - } - - /// Get Team Memberships - /* - * Get team members by the team unique ID. All team members have read access - * for this list of resources. - */ - public Call getMemberships(String teamId) { - final String path = "/teams/{teamId}/memberships".replace("{teamId}", teamId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Create Team Membership - /* - * Use this endpoint to invite a new member to join your team. An email with a - * link to join the team will be sent to the new member email address if the - * member doesn't exist in the project it will be created automatically. - * - * Use the 'URL' parameter to redirect the user from the invitation email back - * to your app. When the user is redirected, use the [Update Team Membership - * Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to - * accept the invitation to the team. - * - * Please note that in order to avoid a [Redirect - * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) - * the only valid redirect URL's are the once from domains you have set when - * added your platforms in the console interface. - */ - public Call createMembership(String teamId, String email, List roles, String url, String name) { - final String path = "/teams/{teamId}/memberships".replace("{teamId}", teamId); - - final Map params = Map.ofEntries( - entry("email", email), - entry("name", name), - entry("roles", roles), - entry("url", url) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("POST", path, headers, params); - } - - /// Delete Team Membership - /* - * 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 he didn't accept it. - */ - public Call deleteMembership(String teamId, String inviteId) { - final String path = "/teams/{teamId}/memberships/{inviteId}".replace("{teamId}", teamId).replace("{inviteId}", inviteId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("DELETE", path, headers, params); - } -} \ No newline at end of file diff --git a/app/sdks/server-java/src/main/java/services/Users.java b/app/sdks/server-java/src/main/java/services/Users.java deleted file mode 100644 index 921a7c1296..0000000000 --- a/app/sdks/server-java/src/main/java/services/Users.java +++ /dev/null @@ -1,221 +0,0 @@ -package .services; - - - -import okhttp3.Call; -import .Client; -import .enums.OrderType; - -import java.io.File; -import java.util.List; -import java.util.HashMap; -import java.util.Map; - -import static java.util.Map.entry; - -public class Users extends Service { - public Users(Client client){ - super(client); - } - - /// List Users - /* - * Get a list of all the project users. You can use the query params to filter - * your results. - */ - public Call list(String search, int limit, int offset, OrderType orderType) { - final String path = "/users"; - - final Map params = Map.ofEntries( - entry("search", search), - entry("limit", limit), - entry("offset", offset), - entry("orderType", orderType.name()) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Create User - /* - * Create a new user. - */ - public Call create(String email, String password, String name) { - final String path = "/users"; - - final Map params = Map.ofEntries( - entry("email", email), - entry("password", password), - entry("name", name) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("POST", path, headers, params); - } - - /// Get User - /* - * Get user by its unique ID. - */ - public Call get(String userId) { - final String path = "/users/{userId}".replace("{userId}", userId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Get User Logs - /* - * Get user activity logs list by its unique ID. - */ - public Call getLogs(String userId) { - final String path = "/users/{userId}/logs".replace("{userId}", userId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Get User Preferences - /* - * Get user preferences by its unique ID. - */ - public Call getPrefs(String userId) { - final String path = "/users/{userId}/prefs".replace("{userId}", userId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Update User Preferences - /* - * Update user preferences by its unique ID. You can pass only the specific - * settings you wish to update. - */ - public Call updatePrefs(String userId, Object prefs) { - final String path = "/users/{userId}/prefs".replace("{userId}", userId); - - final Map params = Map.ofEntries( - entry("prefs", prefs) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("PATCH", path, headers, params); - } - - /// Get User Sessions - /* - * Get user sessions list by its unique ID. - */ - public Call getSessions(String userId) { - final String path = "/users/{userId}/sessions".replace("{userId}", userId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Delete User Sessions - /* - * Delete all user sessions by its unique ID. - */ - public Call deleteSessions(String userId) { - final String path = "/users/{userId}/sessions".replace("{userId}", userId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("DELETE", path, headers, params); - } - - /// Delete User Session - /* - * Delete user sessions by its unique ID. - */ - public Call deleteSession(String userId, String sessionId) { - final String path = "/users/{userId}/sessions/{sessionId}".replace("{userId}", userId).replace("{sessionId}", sessionId); - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("DELETE", path, headers, params); - } - - /// Update User Status - /* - * Update user status by its unique ID. - */ - public Call updateStatus(String userId, String status) { - final String path = "/users/{userId}/status".replace("{userId}", userId); - - final Map params = Map.ofEntries( - entry("status", status) - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("PATCH", path, headers, params); - } -} \ No newline at end of file diff --git a/app/sdks/server-nodejs/CHANGELOG.md b/app/sdks/server-nodejs/CHANGELOG.md deleted file mode 100644 index fa4d35e687..0000000000 --- a/app/sdks/server-nodejs/CHANGELOG.md +++ /dev/null @@ -1 +0,0 @@ -# Change Log \ No newline at end of file diff --git a/app/sdks/server-nodejs/LICENSE b/app/sdks/server-nodejs/LICENSE deleted file mode 100644 index fc7c051a91..0000000000 --- a/app/sdks/server-nodejs/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/app/sdks/server-nodejs/README.md b/app/sdks/server-nodejs/README.md deleted file mode 100644 index abf67fea4e..0000000000 --- a/app/sdks/server-nodejs/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Appwrite Node.js SDK - -![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.6.1-blue.svg?v=1) - -Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. - Use the Node.js SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. - For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) - - - -![Appwrite](https://appwrite.io/images/github.png) - -## Installation - -To install via [NPM](https://www.npmjs.com/): - -```bash -npm install node-appwrite --save -``` - -## Contribution - -This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request. - -## License - -Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/functions/update-active.md b/app/sdks/server-nodejs/docs/examples/functions/update-active.md deleted file mode 100644 index 1c2f0da2e2..0000000000 --- a/app/sdks/server-nodejs/docs/examples/functions/update-active.md +++ /dev/null @@ -1,19 +0,0 @@ -const sdk = require('node-appwrite'); - -// Init SDK -let client = new sdk.Client(); - -let functions = new sdk.Functions(client); - -client - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = functions.updateActive('[FUNCTION_ID]', '[ACTIVE]'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/index.js b/app/sdks/server-nodejs/index.js deleted file mode 100644 index deb571190d..0000000000 --- a/app/sdks/server-nodejs/index.js +++ /dev/null @@ -1,21 +0,0 @@ -const Client = require('./lib/client.js'); -const Avatars = require('./lib/services/avatars.js'); -const Database = require('./lib/services/database.js'); -const Functions = require('./lib/services/functions.js'); -const Health = require('./lib/services/health.js'); -const Locale = require('./lib/services/locale.js'); -const Storage = require('./lib/services/storage.js'); -const Teams = require('./lib/services/teams.js'); -const Users = require('./lib/services/users.js'); - -module.exports = { - Client, - Avatars, - Database, - Functions, - Health, - Locale, - Storage, - Teams, - Users, -}; \ No newline at end of file diff --git a/app/sdks/server-nodejs/lib/client.js b/app/sdks/server-nodejs/lib/client.js deleted file mode 100644 index add1956056..0000000000 --- a/app/sdks/server-nodejs/lib/client.js +++ /dev/null @@ -1,135 +0,0 @@ -const URL = require('url').URL; -const request = require('request-promise-native'); - -class Client { - - constructor() { - this.endpoint = 'https://appwrite.io/v1'; - this.headers = { - 'content-type': '', - 'x-sdk-version': 'appwrite:nodejs:1.1.0', - }; - this.selfSigned = false; - } - - /** - * Set Project - * - * Your project ID - * - * @param string value - * - * @return self - */ - setProject(value) { - this.addHeader('X-Appwrite-Project', value); - - return this; - } - - /** - * Set Key - * - * Your secret API key - * - * @param string value - * - * @return self - */ - setKey(value) { - this.addHeader('X-Appwrite-Key', value); - - return this; - } - - /** - * Set Locale - * - * @param string value - * - * @return self - */ - setLocale(value) { - this.addHeader('X-Appwrite-Locale', value); - - return this; - } - - /*** - * @param bool status - * @return this - */ - setSelfSigned(status = true) { - this.selfSigned = status; - - return this; - } - - /*** - * @param endpoint - * @return this - */ - setEndpoint(endpoint) - { - this.endpoint = endpoint; - - return this; - } - - /** - * @param key string - * @param value string - */ - addHeader(key, value) { - this.headers[key.toLowerCase()] = value.toLowerCase(); - - return this; - } - - async call(method, path = '', headers = {}, params = {}) { - if(this.selfSigned) { // Allow self signed requests - process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0; - } - - headers = Object.assign(this.headers, headers); - - let contentType = headers['content-type'].toLowerCase(); - let options = { - method: method.toUpperCase(), - uri: this.endpoint + path, - qs: (method.toUpperCase() === 'GET') ? params : {}, - headers: headers, - body: (method.toUpperCase() === 'GET' || contentType.startsWith('multipart/form-data')) ? null : params, - json: (contentType.startsWith('application/json')), - formData: (contentType.startsWith('multipart/form-data')) ? this.flatten(params) : null, - }; - - let response = await request(options); - - if(contentType.startsWith('multipart/form-data')) { - response = JSON.parse(response); - } - - return response; - } - - flatten(data, prefix = '') { - let output = {}; - - for (const key in data) { - let value = data[key]; - let finalKey = prefix ? prefix + '[' + key +']' : key; - - if (Array.isArray(value)) { - output = Object.assign(output, this.flatten(value, finalKey)); // @todo: handle name collision here if needed - } - else { - output[finalKey] = value; - } - } - - return output; - } -} - -module.exports = Client; \ No newline at end of file diff --git a/app/sdks/server-nodejs/lib/service.js b/app/sdks/server-nodejs/lib/service.js deleted file mode 100644 index e799c064be..0000000000 --- a/app/sdks/server-nodejs/lib/service.js +++ /dev/null @@ -1,10 +0,0 @@ -class Service { - /** - * @param client - */ - constructor(client) { - this.client = client; - } -} - -module.exports = Service; \ No newline at end of file diff --git a/app/sdks/server-nodejs/lib/services/avatars.js b/app/sdks/server-nodejs/lib/services/avatars.js deleted file mode 100644 index c34bdde966..0000000000 --- a/app/sdks/server-nodejs/lib/services/avatars.js +++ /dev/null @@ -1,164 +0,0 @@ -const Service = require('../service.js'); - -class Avatars extends Service { - - /** - * Get Browser Icon - * - * 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 - * /account/sessions endpoint. Use width, height and quality arguments to - * change the output settings. - * - * @param string code - * @param number width - * @param number height - * @param number quality - * @throws Exception - * @return {} - */ - async getBrowser(code, width = 100, height = 100, quality = 100) { - let path = '/avatars/browsers/{code}'.replace(new RegExp('{code}', 'g'), code); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'width': width, - 'height': height, - 'quality': quality - }); - } - - /** - * Get Credit Card Icon - * - * Need to display your users with your billing method or their payment - * methods? 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. - * - * @param string code - * @param number width - * @param number height - * @param number quality - * @throws Exception - * @return {} - */ - async getCreditCard(code, width = 100, height = 100, quality = 100) { - let path = '/avatars/credit-cards/{code}'.replace(new RegExp('{code}', 'g'), code); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'width': width, - 'height': height, - 'quality': quality - }); - } - - /** - * Get Favicon - * - * Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote - * website URL. - * - * @param string url - * @throws Exception - * @return {} - */ - async getFavicon(url) { - let path = '/avatars/favicon'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'url': url - }); - } - - /** - * Get Country Flag - * - * 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. - * - * @param string code - * @param number width - * @param number height - * @param number quality - * @throws Exception - * @return {} - */ - async getFlag(code, width = 100, height = 100, quality = 100) { - let path = '/avatars/flags/{code}'.replace(new RegExp('{code}', 'g'), code); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'width': width, - 'height': height, - 'quality': quality - }); - } - - /** - * Get Image from URL - * - * 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. - * - * @param string url - * @param number width - * @param number height - * @throws Exception - * @return {} - */ - async getImage(url, width = 400, height = 400) { - let path = '/avatars/image'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'url': url, - 'width': width, - 'height': height - }); - } - - /** - * Get QR Code - * - * 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. - * - * @param string text - * @param number size - * @param number margin - * @param number download - * @throws Exception - * @return {} - */ - async getQR(text, size = 400, margin = 1, download = 0) { - let path = '/avatars/qr'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'text': text, - 'size': size, - 'margin': margin, - 'download': download - }); - } -} - -module.exports = Avatars; \ No newline at end of file diff --git a/app/sdks/server-nodejs/lib/services/database.js b/app/sdks/server-nodejs/lib/services/database.js deleted file mode 100644 index ce1c09e391..0000000000 --- a/app/sdks/server-nodejs/lib/services/database.js +++ /dev/null @@ -1,283 +0,0 @@ -const Service = require('../service.js'); - -class Database extends Service { - - /** - * List Collections - * - * Get a list of all the user collections. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project collections. [Learn more about different API - * modes](/docs/admin). - * - * @param string search - * @param number limit - * @param number offset - * @param string orderType - * @throws Exception - * @return {} - */ - async listCollections(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/database/collections'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType - }); - } - - /** - * Create Collection - * - * Create a new Collection. - * - * @param string name - * @param string[] read - * @param string[] write - * @param string[] rules - * @throws Exception - * @return {} - */ - async createCollection(name, read, write, rules) { - let path = '/database/collections'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'read': read, - 'write': write, - 'rules': rules - }); - } - - /** - * Get Collection - * - * Get collection by its unique ID. This endpoint response returns a JSON - * object with the collection metadata. - * - * @param string collectionId - * @throws Exception - * @return {} - */ - async getCollection(collectionId) { - let path = '/database/collections/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Collection - * - * Update collection by its unique ID. - * - * @param string collectionId - * @param string name - * @param string[] read - * @param string[] write - * @param string[] rules - * @throws Exception - * @return {} - */ - async updateCollection(collectionId, name, read, write, rules = []) { - let path = '/database/collections/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'read': read, - 'write': write, - 'rules': rules - }); - } - - /** - * Delete Collection - * - * Delete a collection by its unique ID. Only users with write permissions - * have access to delete this resource. - * - * @param string collectionId - * @throws Exception - * @return {} - */ - async deleteCollection(collectionId) { - let path = '/database/collections/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Documents - * - * Get a list of all the user documents. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project documents. [Learn more about different API - * modes](/docs/admin). - * - * @param string collectionId - * @param string[] filters - * @param number offset - * @param number limit - * @param string orderField - * @param string orderType - * @param string orderCast - * @param string search - * @param number first - * @param number last - * @throws Exception - * @return {} - */ - async listDocuments(collectionId, filters = [], offset = 0, limit = 50, orderField = '$id', orderType = 'ASC', orderCast = 'string', search = '', first = 0, last = 0) { - let path = '/database/collections/{collectionId}/documents'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'filters': filters, - 'offset': offset, - 'limit': limit, - 'orderField': orderField, - 'orderType': orderType, - 'orderCast': orderCast, - 'search': search, - 'first': first, - 'last': last - }); - } - - /** - * Create Document - * - * Create a new Document. - * - * @param string collectionId - * @param object data - * @param string[] read - * @param string[] write - * @param string parentDocument - * @param string parentProperty - * @param string parentPropertyType - * @throws Exception - * @return {} - */ - async createDocument(collectionId, data, read, write, parentDocument = '', parentProperty = '', parentPropertyType = 'assign') { - let path = '/database/collections/{collectionId}/documents'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'data': data, - 'read': read, - 'write': write, - 'parentDocument': parentDocument, - 'parentProperty': parentProperty, - 'parentPropertyType': parentPropertyType - }); - } - - /** - * Get Document - * - * Get document by its unique ID. This endpoint response returns a JSON object - * with the document data. - * - * @param string collectionId - * @param string documentId - * @throws Exception - * @return {} - */ - async getDocument(collectionId, documentId) { - let path = '/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Document - * - * @param string collectionId - * @param string documentId - * @param object data - * @param string[] read - * @param string[] write - * @throws Exception - * @return {} - */ - async updateDocument(collectionId, documentId, data, read, write) { - let path = '/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'data': data, - 'read': read, - 'write': write - }); - } - - /** - * Delete Document - * - * Delete document by its unique ID. This endpoint deletes only the parent - * documents, his attributes and relations to other documents. Child documents - * **will not** be deleted. - * - * @param string collectionId - * @param string documentId - * @throws Exception - * @return {} - */ - async deleteDocument(collectionId, documentId) { - let path = '/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Collection Logs - * - * @param string collectionId - * @throws Exception - * @return {} - */ - async getCollectionLogs(collectionId) { - let path = '/database/collections/{collectionId}/logs'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } -} - -module.exports = Database; \ No newline at end of file diff --git a/app/sdks/server-nodejs/lib/services/functions.js b/app/sdks/server-nodejs/lib/services/functions.js deleted file mode 100644 index 0dfd8d945d..0000000000 --- a/app/sdks/server-nodejs/lib/services/functions.js +++ /dev/null @@ -1,282 +0,0 @@ -const Service = require('../service.js'); - -class Functions extends Service { - - /** - * List Functions - * - * @param string search - * @param number limit - * @param number offset - * @param string orderType - * @throws Exception - * @return {} - */ - async list(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/functions'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType - }); - } - - /** - * Create Function - * - * @param string name - * @param object vars - * @param string[] events - * @param string schedule - * @param number timeout - * @throws Exception - * @return {} - */ - async create(name, vars = [], events = [], schedule = '', timeout = 15) { - let path = '/functions'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'vars': vars, - 'events': events, - 'schedule': schedule, - 'timeout': timeout - }); - } - - /** - * Get Function - * - * @param string functionId - * @throws Exception - * @return {} - */ - async get(functionId) { - let path = '/functions/{functionId}'.replace(new RegExp('{functionId}', 'g'), functionId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Function - * - * @param string functionId - * @param string name - * @param object vars - * @param string[] events - * @param string schedule - * @param number timeout - * @throws Exception - * @return {} - */ - async update(functionId, name, vars = [], events = [], schedule = '', timeout = 15) { - let path = '/functions/{functionId}'.replace(new RegExp('{functionId}', 'g'), functionId); - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'vars': vars, - 'events': events, - 'schedule': schedule, - 'timeout': timeout - }); - } - - /** - * Delete Function - * - * @param string functionId - * @throws Exception - * @return {} - */ - async delete(functionId) { - let path = '/functions/{functionId}'.replace(new RegExp('{functionId}', 'g'), functionId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Executions - * - * @param string functionId - * @param string search - * @param number limit - * @param number offset - * @param string orderType - * @throws Exception - * @return {} - */ - async listExecutions(functionId, search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/functions/{functionId}/executions'.replace(new RegExp('{functionId}', 'g'), functionId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType - }); - } - - /** - * Create Execution - * - * @param string functionId - * @param number async - * @throws Exception - * @return {} - */ - async createExecution(functionId, async = 1) { - let path = '/functions/{functionId}/executions'.replace(new RegExp('{functionId}', 'g'), functionId); - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'async': async - }); - } - - /** - * Get Execution - * - * @param string functionId - * @param string executionId - * @throws Exception - * @return {} - */ - async getExecution(functionId, executionId) { - let path = '/functions/{functionId}/executions/{executionId}'.replace(new RegExp('{functionId}', 'g'), functionId).replace(new RegExp('{executionId}', 'g'), executionId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Function Tag - * - * @param string functionId - * @param string tag - * @throws Exception - * @return {} - */ - async updateTag(functionId, tag) { - let path = '/functions/{functionId}/tag'.replace(new RegExp('{functionId}', 'g'), functionId); - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'tag': tag - }); - } - - /** - * List Tags - * - * @param string functionId - * @param string search - * @param number limit - * @param number offset - * @param string orderType - * @throws Exception - * @return {} - */ - async listTags(functionId, search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/functions/{functionId}/tags'.replace(new RegExp('{functionId}', 'g'), functionId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType - }); - } - - /** - * Create Tag - * - * @param string functionId - * @param string env - * @param string command - * @param string code - * @throws Exception - * @return {} - */ - async createTag(functionId, env, command, code) { - let path = '/functions/{functionId}/tags'.replace(new RegExp('{functionId}', 'g'), functionId); - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'env': env, - 'command': command, - 'code': code - }); - } - - /** - * Get Tag - * - * @param string functionId - * @param string tagId - * @throws Exception - * @return {} - */ - async getTag(functionId, tagId) { - let path = '/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}', 'g'), functionId).replace(new RegExp('{tagId}', 'g'), tagId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Delete Tag - * - * @param string functionId - * @param string tagId - * @throws Exception - * @return {} - */ - async deleteTag(functionId, tagId) { - let path = '/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}', 'g'), functionId).replace(new RegExp('{tagId}', 'g'), tagId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } -} - -module.exports = Functions; \ No newline at end of file diff --git a/app/sdks/server-nodejs/lib/services/health.js b/app/sdks/server-nodejs/lib/services/health.js deleted file mode 100644 index a0aed052ce..0000000000 --- a/app/sdks/server-nodejs/lib/services/health.js +++ /dev/null @@ -1,233 +0,0 @@ -const Service = require('../service.js'); - -class Health extends Service { - - /** - * Get HTTP - * - * Check the Appwrite HTTP server is up and responsive. - * - * @throws Exception - * @return {} - */ - async get() { - let path = '/health'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Anti virus - * - * Check the Appwrite Anti Virus server is up and connection is successful. - * - * @throws Exception - * @return {} - */ - async getAntiVirus() { - let path = '/health/anti-virus'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Cache - * - * Check the Appwrite in-memory cache server is up and connection is - * successful. - * - * @throws Exception - * @return {} - */ - async getCache() { - let path = '/health/cache'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get DB - * - * Check the Appwrite database server is up and connection is successful. - * - * @throws Exception - * @return {} - */ - async getDB() { - let path = '/health/db'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Certificate Queue - * - * Get the number of certificates that are waiting to be issued against - * [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue - * server. - * - * @throws Exception - * @return {} - */ - async getQueueCertificates() { - let path = '/health/queue/certificates'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Functions Queue - * - * @throws Exception - * @return {} - */ - async getQueueFunctions() { - let path = '/health/queue/functions'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Logs Queue - * - * Get the number of logs that are waiting to be processed in the Appwrite - * internal queue server. - * - * @throws Exception - * @return {} - */ - async getQueueLogs() { - let path = '/health/queue/logs'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Tasks Queue - * - * Get the number of tasks that are waiting to be processed in the Appwrite - * internal queue server. - * - * @throws Exception - * @return {} - */ - async getQueueTasks() { - let path = '/health/queue/tasks'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Usage Queue - * - * Get the number of usage stats that are waiting to be processed in the - * Appwrite internal queue server. - * - * @throws Exception - * @return {} - */ - async getQueueUsage() { - let path = '/health/queue/usage'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Webhooks Queue - * - * Get the number of webhooks that are waiting to be processed in the Appwrite - * internal queue server. - * - * @throws Exception - * @return {} - */ - async getQueueWebhooks() { - let path = '/health/queue/webhooks'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Local Storage - * - * Check the Appwrite local storage device is up and connection is successful. - * - * @throws Exception - * @return {} - */ - async getStorageLocal() { - let path = '/health/storage/local'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Time - * - * 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. - * - * @throws Exception - * @return {} - */ - async getTime() { - let path = '/health/time'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } -} - -module.exports = Health; \ No newline at end of file diff --git a/app/sdks/server-nodejs/lib/services/locale.js b/app/sdks/server-nodejs/lib/services/locale.js deleted file mode 100644 index bc1efa4688..0000000000 --- a/app/sdks/server-nodejs/lib/services/locale.js +++ /dev/null @@ -1,125 +0,0 @@ -const Service = require('../service.js'); - -class Locale extends Service { - - /** - * Get User Locale - * - * 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. - * - * ([IP Geolocation by DB-IP](https://db-ip.com)) - * - * @throws Exception - * @return {} - */ - async get() { - let path = '/locale'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Continents - * - * List of all continents. You can use the locale header to get the data in a - * supported language. - * - * @throws Exception - * @return {} - */ - async getContinents() { - let path = '/locale/continents'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Countries - * - * List of all countries. You can use the locale header to get the data in a - * supported language. - * - * @throws Exception - * @return {} - */ - async getCountries() { - let path = '/locale/countries'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List EU Countries - * - * 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. - * - * @throws Exception - * @return {} - */ - async getCountriesEU() { - let path = '/locale/countries/eu'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Countries Phone Codes - * - * List of all countries phone codes. You can use the locale header to get the - * data in a supported language. - * - * @throws Exception - * @return {} - */ - async getCountriesPhones() { - let path = '/locale/countries/phones'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * List Currencies - * - * List of all currencies, including currency symol, 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. - * - * @throws Exception - * @return {} - */ - async getCurrencies() { - let path = '/locale/currencies'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } -} - -module.exports = Locale; \ No newline at end of file diff --git a/app/sdks/server-nodejs/lib/services/storage.js b/app/sdks/server-nodejs/lib/services/storage.js deleted file mode 100644 index 2b670db31a..0000000000 --- a/app/sdks/server-nodejs/lib/services/storage.js +++ /dev/null @@ -1,199 +0,0 @@ -const Service = require('../service.js'); - -class Storage extends Service { - - /** - * List Files - * - * Get a list of all the user files. You can use the query params to filter - * your results. On admin mode, this endpoint will return a list of all of the - * project files. [Learn more about different API modes](/docs/admin). - * - * @param string search - * @param number limit - * @param number offset - * @param string orderType - * @throws Exception - * @return {} - */ - async listFiles(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/storage/files'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType - }); - } - - /** - * Create File - * - * Create a new file. The user who creates the file will automatically be - * assigned to read and write access unless he has passed custom values for - * read and write arguments. - * - * @param File file - * @param string[] read - * @param string[] write - * @throws Exception - * @return {} - */ - async createFile(file, read, write) { - let path = '/storage/files'; - - return await this.client.call('post', path, { - 'content-type': 'multipart/form-data', - }, - { - 'file': file, - 'read': read, - 'write': write - }); - } - - /** - * Get File - * - * Get file by its unique ID. This endpoint response returns a JSON object - * with the file metadata. - * - * @param string fileId - * @throws Exception - * @return {} - */ - async getFile(fileId) { - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update File - * - * Update file by its unique ID. Only users with write permissions have access - * to update this resource. - * - * @param string fileId - * @param string[] read - * @param string[] write - * @throws Exception - * @return {} - */ - async updateFile(fileId, read, write) { - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'read': read, - 'write': write - }); - } - - /** - * Delete File - * - * Delete a file by its unique ID. Only users with write permissions have - * access to delete this resource. - * - * @param string fileId - * @throws Exception - * @return {} - */ - async deleteFile(fileId) { - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get File for Download - * - * Get 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. - * - * @param string fileId - * @throws Exception - * @return {} - */ - async getFileDownload(fileId) { - let path = '/storage/files/{fileId}/download'.replace(new RegExp('{fileId}', 'g'), fileId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get File Preview - * - * 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. - * - * @param string fileId - * @param number width - * @param number height - * @param number quality - * @param string background - * @param string output - * @throws Exception - * @return {} - */ - async getFilePreview(fileId, width = 0, height = 0, quality = 100, background = '', output = '') { - let path = '/storage/files/{fileId}/preview'.replace(new RegExp('{fileId}', 'g'), fileId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'width': width, - 'height': height, - 'quality': quality, - 'background': background, - 'output': output - }); - } - - /** - * Get File for View - * - * Get file content by its unique ID. This endpoint is similar to the download - * method but returns with no 'Content-Disposition: attachment' header. - * - * @param string fileId - * @param string as - * @throws Exception - * @return {} - */ - async getFileView(fileId, as = '') { - let path = '/storage/files/{fileId}/view'.replace(new RegExp('{fileId}', 'g'), fileId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'as': as - }); - } -} - -module.exports = Storage; \ No newline at end of file diff --git a/app/sdks/server-nodejs/lib/services/teams.js b/app/sdks/server-nodejs/lib/services/teams.js deleted file mode 100644 index a17dd50aa3..0000000000 --- a/app/sdks/server-nodejs/lib/services/teams.js +++ /dev/null @@ -1,202 +0,0 @@ -const Service = require('../service.js'); - -class Teams extends Service { - - /** - * List Teams - * - * Get a list of all the current user teams. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project teams. [Learn more about different API modes](/docs/admin). - * - * @param string search - * @param number limit - * @param number offset - * @param string orderType - * @throws Exception - * @return {} - */ - async list(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/teams'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType - }); - } - - /** - * Create Team - * - * Create a new team. The user who creates the team will automatically be - * assigned as the owner of the team. The team owner can invite new members, - * who will be able add new owners and update or delete the team from your - * project. - * - * @param string name - * @param string[] roles - * @throws Exception - * @return {} - */ - async create(name, roles = ["owner"]) { - let path = '/teams'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'name': name, - 'roles': roles - }); - } - - /** - * Get Team - * - * Get team by its unique ID. All team members have read access for this - * resource. - * - * @param string teamId - * @throws Exception - * @return {} - */ - async get(teamId) { - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update Team - * - * Update team by its unique ID. Only team owners have write access for this - * resource. - * - * @param string teamId - * @param string name - * @throws Exception - * @return {} - */ - async update(teamId, name) { - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - return await this.client.call('put', path, { - 'content-type': 'application/json', - }, - { - 'name': name - }); - } - - /** - * Delete Team - * - * Delete team by its unique ID. Only team owners have write access for this - * resource. - * - * @param string teamId - * @throws Exception - * @return {} - */ - async delete(teamId) { - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get Team Memberships - * - * Get team members by the team unique ID. All team members have read access - * for this list of resources. - * - * @param string teamId - * @throws Exception - * @return {} - */ - async getMemberships(teamId) { - let path = '/teams/{teamId}/memberships'.replace(new RegExp('{teamId}', 'g'), teamId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Create Team Membership - * - * Use this endpoint to invite a new member to join your team. An email with a - * link to join the team will be sent to the new member email address if the - * member doesn't exist in the project it will be created automatically. - * - * Use the 'URL' parameter to redirect the user from the invitation email back - * to your app. When the user is redirected, use the [Update Team Membership - * Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to - * accept the invitation to the team. - * - * Please note that in order to avoid a [Redirect - * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) - * the only valid redirect URL's are the once from domains you have set when - * added your platforms in the console interface. - * - * @param string teamId - * @param string email - * @param string[] roles - * @param string url - * @param string name - * @throws Exception - * @return {} - */ - async createMembership(teamId, email, roles, url, name = '') { - let path = '/teams/{teamId}/memberships'.replace(new RegExp('{teamId}', 'g'), teamId); - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'email': email, - 'name': name, - 'roles': roles, - 'url': url - }); - } - - /** - * Delete Team Membership - * - * 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 he didn't accept it. - * - * @param string teamId - * @param string inviteId - * @throws Exception - * @return {} - */ - async deleteMembership(teamId, inviteId) { - let path = '/teams/{teamId}/memberships/{inviteId}'.replace(new RegExp('{teamId}', 'g'), teamId).replace(new RegExp('{inviteId}', 'g'), inviteId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } -} - -module.exports = Teams; \ No newline at end of file diff --git a/app/sdks/server-nodejs/lib/services/users.js b/app/sdks/server-nodejs/lib/services/users.js deleted file mode 100644 index 2292fb2664..0000000000 --- a/app/sdks/server-nodejs/lib/services/users.js +++ /dev/null @@ -1,215 +0,0 @@ -const Service = require('../service.js'); - -class Users extends Service { - - /** - * List Users - * - * Get a list of all the project users. You can use the query params to filter - * your results. - * - * @param string search - * @param number limit - * @param number offset - * @param string orderType - * @throws Exception - * @return {} - */ - async list(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/users'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': orderType - }); - } - - /** - * Create User - * - * Create a new user. - * - * @param string email - * @param string password - * @param string name - * @throws Exception - * @return {} - */ - async create(email, password, name = '') { - let path = '/users'; - - return await this.client.call('post', path, { - 'content-type': 'application/json', - }, - { - 'email': email, - 'password': password, - 'name': name - }); - } - - /** - * Get User - * - * Get user by its unique ID. - * - * @param string userId - * @throws Exception - * @return {} - */ - async get(userId) { - let path = '/users/{userId}'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get User Logs - * - * Get user activity logs list by its unique ID. - * - * @param string userId - * @throws Exception - * @return {} - */ - async getLogs(userId) { - let path = '/users/{userId}/logs'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Get User Preferences - * - * Get user preferences by its unique ID. - * - * @param string userId - * @throws Exception - * @return {} - */ - async getPrefs(userId) { - let path = '/users/{userId}/prefs'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update User Preferences - * - * Update user preferences by its unique ID. You can pass only the specific - * settings you wish to update. - * - * @param string userId - * @param object prefs - * @throws Exception - * @return {} - */ - async updatePrefs(userId, prefs) { - let path = '/users/{userId}/prefs'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'prefs': prefs - }); - } - - /** - * Get User Sessions - * - * Get user sessions list by its unique ID. - * - * @param string userId - * @throws Exception - * @return {} - */ - async getSessions(userId) { - let path = '/users/{userId}/sessions'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Delete User Sessions - * - * Delete all user sessions by its unique ID. - * - * @param string userId - * @throws Exception - * @return {} - */ - async deleteSessions(userId) { - let path = '/users/{userId}/sessions'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Delete User Session - * - * Delete user sessions by its unique ID. - * - * @param string userId - * @param string sessionId - * @throws Exception - * @return {} - */ - async deleteSession(userId, sessionId) { - let path = '/users/{userId}/sessions/{sessionId}'.replace(new RegExp('{userId}', 'g'), userId).replace(new RegExp('{sessionId}', 'g'), sessionId); - - return await this.client.call('delete', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Update User Status - * - * Update user status by its unique ID. - * - * @param string userId - * @param string status - * @throws Exception - * @return {} - */ - async updateStatus(userId, status) { - let path = '/users/{userId}/status'.replace(new RegExp('{userId}', 'g'), userId); - - return await this.client.call('patch', path, { - 'content-type': 'application/json', - }, - { - 'status': status - }); - } -} - -module.exports = Users; \ No newline at end of file diff --git a/app/sdks/server-nodejs/package.json b/app/sdks/server-nodejs/package.json deleted file mode 100644 index 377ea48db2..0000000000 --- a/app/sdks/server-nodejs/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "node-appwrite", - "homepage": "https://appwrite.io/support", - "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", - "version": "1.1.0", - "license": "BSD-3-Clause", - "main": "index.js", - "repository": { - "type": "git", - "url": "https://github.com/appwrite/sdk-for-node" - }, - "devDependencies": {}, - "dependencies": { - "request": "^2.88.0", - "request-promise-native": "^1.0.7" - } -} \ No newline at end of file diff --git a/app/sdks/server-php/CHANGELOG.md b/app/sdks/server-php/CHANGELOG.md deleted file mode 100644 index fa4d35e687..0000000000 --- a/app/sdks/server-php/CHANGELOG.md +++ /dev/null @@ -1 +0,0 @@ -# Change Log \ No newline at end of file diff --git a/app/sdks/server-php/LICENSE b/app/sdks/server-php/LICENSE deleted file mode 100644 index fc7c051a91..0000000000 --- a/app/sdks/server-php/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/app/sdks/server-php/README.md b/app/sdks/server-php/README.md deleted file mode 100644 index 0d64f84fca..0000000000 --- a/app/sdks/server-php/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Appwrite PHP SDK - -![License](https://img.shields.io/github/license/appwrite/sdk-for-php.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.6.1-blue.svg?v=1) - -Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. - Use the PHP SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. - For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) - - - -![Appwrite](https://appwrite.io/images/github.png) - -## Installation - -To install via [Composer](http://getcomposer.org/): - -```bash -composer require appwrite/appwrite -``` - -## Contribution - -This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request. - -## License - -Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. \ No newline at end of file diff --git a/app/sdks/server-php/composer.json b/app/sdks/server-php/composer.json deleted file mode 100644 index 64d2e1746f..0000000000 --- a/app/sdks/server-php/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "appwrite/appwrite", - "description": "Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. - Use the PHP SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. - For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)", - "type": "library", - "license": "BSD-3-Clause", - "support": { - "url": "https://appwrite.io/support", - "email": "team@localhost.test" - }, - "autoload": { - "psr-4": { - "Appwrite\\": "src/Appwrite" - } - }, - "require": { - "php": ">=7.1.0", - "ext-curl": "*", - "ext-json": "*" - }, - "require-dev": { - "phpunit/phpunit": "3.7.35" - }, - "minimum-stability": "dev" -} \ No newline at end of file diff --git a/app/sdks/server-php/docs/avatars.md b/app/sdks/server-php/docs/avatars.md deleted file mode 100644 index 9fa1ee61f1..0000000000 --- a/app/sdks/server-php/docs/avatars.md +++ /dev/null @@ -1,100 +0,0 @@ -# Avatars Service - -## Get Browser Icon - -```http request -GET https://appwrite.io/v1/avatars/browsers/{code} -``` - -** 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 /account/sessions endpoint. Use width, height and quality arguments to change the output settings. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| code | string | **Required** Browser Code. | | -| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 | -| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 | -| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 | - -## Get Credit Card Icon - -```http request -GET https://appwrite.io/v1/avatars/credit-cards/{code} -``` - -** Need to display your users with your billing method or their payment methods? 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| code | string | **Required** Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa. | | -| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 | -| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 | -| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 | - -## Get Favicon - -```http request -GET https://appwrite.io/v1/avatars/favicon -``` - -** Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| url | string | **Required** Website URL which you want to fetch the favicon from. | | - -## Get Country Flag - -```http request -GET https://appwrite.io/v1/avatars/flags/{code} -``` - -** 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| code | string | **Required** Country Code. ISO Alpha-2 country code format. | | -| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 | -| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 | -| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 | - -## Get Image from URL - -```http request -GET https://appwrite.io/v1/avatars/image -``` - -** 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| url | string | **Required** Image URL which you want to crop. | | -| width | integer | Resize preview image width, Pass an integer between 0 to 2000. | 400 | -| height | integer | Resize preview image height, Pass an integer between 0 to 2000. | 400 | - -## Get QR Code - -```http request -GET https://appwrite.io/v1/avatars/qr -``` - -** 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| text | string | **Required** Plain text to be converted to QR code image. | | -| size | integer | QR code size. Pass an integer between 0 to 1000. Defaults to 400. | 400 | -| margin | integer | Margin from edge. Pass an integer between 0 to 10. Defaults to 1. | 1 | -| download | integer | 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. | 0 | - diff --git a/app/sdks/server-php/docs/database.md b/app/sdks/server-php/docs/database.md deleted file mode 100644 index f192a92fc8..0000000000 --- a/app/sdks/server-php/docs/database.md +++ /dev/null @@ -1,183 +0,0 @@ -# Database Service - -## List Collections - -```http request -GET https://appwrite.io/v1/database/collections -``` - -** Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](/docs/admin). ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| search | string | Search term to filter your list results. | | -| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 | -| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 | -| orderType | string | Order result by ASC or DESC order. | ASC | - -## Create Collection - -```http request -POST https://appwrite.io/v1/database/collections -``` - -** Create a new Collection. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| name | string | Collection name. | | -| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | -| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | -| rules | array | Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation. | | - -## Get Collection - -```http request -GET https://appwrite.io/v1/database/collections/{collectionId} -``` - -** Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| collectionId | string | **Required** Collection unique ID. | | - -## Update Collection - -```http request -PUT https://appwrite.io/v1/database/collections/{collectionId} -``` - -** Update collection by its unique ID. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| collectionId | string | **Required** Collection unique ID. | | -| name | string | Collection name. | | -| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(/docs/permissions) and get a full list of available permissions. | | -| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | -| rules | array | Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation. | [] | - -## Delete Collection - -```http request -DELETE https://appwrite.io/v1/database/collections/{collectionId} -``` - -** Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| collectionId | string | **Required** Collection unique ID. | | - -## List Documents - -```http request -GET https://appwrite.io/v1/database/collections/{collectionId}/documents -``` - -** Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](/docs/admin). ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/database?platform=server#createCollection). | | -| filters | array | Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'. | [] | -| offset | integer | Offset value. Use this value to manage pagination. | 0 | -| limit | integer | Maximum number of documents to return in response. Use this value to manage pagination. | 50 | -| orderField | string | Document field that results will be sorted by. | $id | -| orderType | string | Order direction. Possible values are DESC for descending order, or ASC for ascending order. | ASC | -| orderCast | string | Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string. | string | -| search | string | Search query. Enter any free text search. The database will try to find a match against all document attributes and children. | | -| first | integer | Return only the first document. Pass 1 for true or 0 for false. The default value is 0. | 0 | -| last | integer | Return only the last document. Pass 1 for true or 0 for false. The default value is 0. | 0 | - -## Create Document - -```http request -POST https://appwrite.io/v1/database/collections/{collectionId}/documents -``` - -** Create a new Document. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/database?platform=server#createCollection). | | -| data | object | Document data as JSON object. | | -| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | -| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | -| parentDocument | string | Parent document unique ID. Use when you want your new document to be a child of a parent document. | | -| parentProperty | string | Parent document property name. Use when you want your new document to be a child of a parent document. | | -| parentPropertyType | string | Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document. | assign | - -## Get Document - -```http request -GET https://appwrite.io/v1/database/collections/{collectionId}/documents/{documentId} -``` - -** Get document by its unique ID. This endpoint response returns a JSON object with the document data. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/database?platform=server#createCollection). | | -| documentId | string | **Required** Document unique ID. | | - -## Update Document - -```http request -PATCH https://appwrite.io/v1/database/collections/{collectionId}/documents/{documentId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/database?platform=server#createCollection). | | -| documentId | string | **Required** Document unique ID. | | -| data | object | Document data as JSON object. | | -| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | -| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | - -## Delete Document - -```http request -DELETE https://appwrite.io/v1/database/collections/{collectionId}/documents/{documentId} -``` - -** Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/database?platform=server#createCollection). | | -| documentId | string | **Required** Document unique ID. | | - -## Get Collection Logs - -```http request -GET https://appwrite.io/v1/database/collections/{collectionId}/logs -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| collectionId | string | **Required** Collection unique ID. | | - diff --git a/app/sdks/server-php/docs/examples/functions/update-active.md b/app/sdks/server-php/docs/examples/functions/update-active.md deleted file mode 100644 index 18b7316f3b..0000000000 --- a/app/sdks/server-php/docs/examples/functions/update-active.md +++ /dev/null @@ -1,15 +0,0 @@ -setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$functions = new Functions($client); - -$result = $functions->updateActive('[FUNCTION_ID]', '[ACTIVE]'); \ No newline at end of file diff --git a/app/sdks/server-php/docs/functions.md b/app/sdks/server-php/docs/functions.md deleted file mode 100644 index 39e28d55b8..0000000000 --- a/app/sdks/server-php/docs/functions.md +++ /dev/null @@ -1,186 +0,0 @@ -# Functions Service - -## List Functions - -```http request -GET https://appwrite.io/v1/functions -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| search | string | Search term to filter your list results. | | -| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 | -| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 | -| orderType | string | Order result by ASC or DESC order. | ASC | - -## Create Function - -```http request -POST https://appwrite.io/v1/functions -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| name | string | Function name. | | -| vars | object | Key-value JSON object. | [] | -| events | array | Events list. | [] | -| schedule | string | Schedule CRON syntax. | | -| timeout | integer | Function maximum execution time in seconds. | 15 | - -## Get Function - -```http request -GET https://appwrite.io/v1/functions/{functionId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| functionId | string | **Required** Function unique ID. | | - -## Update Function - -```http request -PUT https://appwrite.io/v1/functions/{functionId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| functionId | string | **Required** Function unique ID. | | -| name | string | Function name. | | -| vars | object | Key-value JSON object. | [] | -| events | array | Events list. | [] | -| schedule | string | Schedule CRON syntax. | | -| timeout | integer | Function maximum execution time in seconds. | 15 | - -## Delete Function - -```http request -DELETE https://appwrite.io/v1/functions/{functionId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| functionId | string | **Required** Function unique ID. | | - -## List Executions - -```http request -GET https://appwrite.io/v1/functions/{functionId}/executions -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| functionId | string | **Required** Function unique ID. | | -| search | string | Search term to filter your list results. | | -| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 | -| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 | -| orderType | string | Order result by ASC or DESC order. | ASC | - -## Create Execution - -```http request -POST https://appwrite.io/v1/functions/{functionId}/executions -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| functionId | string | **Required** Function unique ID. | | -| async | integer | Execute code asynchronously. Pass 1 for true, 0 for false. Default value is 1. | 1 | - -## Get Execution - -```http request -GET https://appwrite.io/v1/functions/{functionId}/executions/{executionId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| functionId | string | **Required** Function unique ID. | | -| executionId | string | **Required** Execution unique ID. | | - -## Update Function Tag - -```http request -PATCH https://appwrite.io/v1/functions/{functionId}/tag -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| functionId | string | **Required** Function unique ID. | | -| tag | string | Tag unique ID. | | - -## List Tags - -```http request -GET https://appwrite.io/v1/functions/{functionId}/tags -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| functionId | string | **Required** Function unique ID. | | -| search | string | Search term to filter your list results. | | -| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 | -| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 | -| orderType | string | Order result by ASC or DESC order. | ASC | - -## Create Tag - -```http request -POST https://appwrite.io/v1/functions/{functionId}/tags -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| functionId | string | **Required** Function unique ID. | | -| env | string | Execution enviornment. | | -| command | string | Code execution command. | | -| code | string | Code package. Use the Appwrite code packager to create a deployable package file. | | - -## Get Tag - -```http request -GET https://appwrite.io/v1/functions/{functionId}/tags/{tagId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| functionId | string | **Required** Function unique ID. | | -| tagId | string | **Required** Tag unique ID. | | - -## Delete Tag - -```http request -DELETE https://appwrite.io/v1/functions/{functionId}/tags/{tagId} -``` - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| functionId | string | **Required** Function unique ID. | | -| tagId | string | **Required** Tag unique ID. | | - diff --git a/app/sdks/server-php/docs/health.md b/app/sdks/server-php/docs/health.md deleted file mode 100644 index 38b814b633..0000000000 --- a/app/sdks/server-php/docs/health.md +++ /dev/null @@ -1,96 +0,0 @@ -# Health Service - -## Get HTTP - -```http request -GET https://appwrite.io/v1/health -``` - -** Check the Appwrite HTTP server is up and responsive. ** - -## Get Anti virus - -```http request -GET https://appwrite.io/v1/health/anti-virus -``` - -** Check the Appwrite Anti Virus server is up and connection is successful. ** - -## Get Cache - -```http request -GET https://appwrite.io/v1/health/cache -``` - -** Check the Appwrite in-memory cache server is up and connection is successful. ** - -## Get DB - -```http request -GET https://appwrite.io/v1/health/db -``` - -** Check the Appwrite database server is up and connection is successful. ** - -## Get Certificate Queue - -```http request -GET https://appwrite.io/v1/health/queue/certificates -``` - -** Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server. ** - -## Get Functions Queue - -```http request -GET https://appwrite.io/v1/health/queue/functions -``` - -## Get Logs Queue - -```http request -GET https://appwrite.io/v1/health/queue/logs -``` - -** Get the number of logs that are waiting to be processed in the Appwrite internal queue server. ** - -## Get Tasks Queue - -```http request -GET https://appwrite.io/v1/health/queue/tasks -``` - -** Get the number of tasks that are waiting to be processed in the Appwrite internal queue server. ** - -## Get Usage Queue - -```http request -GET https://appwrite.io/v1/health/queue/usage -``` - -** Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server. ** - -## Get Webhooks Queue - -```http request -GET https://appwrite.io/v1/health/queue/webhooks -``` - -** Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server. ** - -## Get Local Storage - -```http request -GET https://appwrite.io/v1/health/storage/local -``` - -** Check the Appwrite local storage device is up and connection is successful. ** - -## Get Time - -```http request -GET https://appwrite.io/v1/health/time -``` - -** 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. ** - diff --git a/app/sdks/server-php/docs/locale.md b/app/sdks/server-php/docs/locale.md deleted file mode 100644 index 7e99b08829..0000000000 --- a/app/sdks/server-php/docs/locale.md +++ /dev/null @@ -1,52 +0,0 @@ -# Locale Service - -## Get User Locale - -```http request -GET https://appwrite.io/v1/locale -``` - -** 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. - -([IP Geolocation by DB-IP](https://db-ip.com)) ** - -## List Continents - -```http request -GET https://appwrite.io/v1/locale/continents -``` - -** List of all continents. You can use the locale header to get the data in a supported language. ** - -## List Countries - -```http request -GET https://appwrite.io/v1/locale/countries -``` - -** List of all countries. You can use the locale header to get the data in a supported language. ** - -## List EU Countries - -```http request -GET https://appwrite.io/v1/locale/countries/eu -``` - -** 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. ** - -## List Countries Phone Codes - -```http request -GET https://appwrite.io/v1/locale/countries/phones -``` - -** List of all countries phone codes. You can use the locale header to get the data in a supported language. ** - -## List Currencies - -```http request -GET https://appwrite.io/v1/locale/currencies -``` - -** List of all currencies, including currency symol, 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. ** - diff --git a/app/sdks/server-php/docs/storage.md b/app/sdks/server-php/docs/storage.md deleted file mode 100644 index 2138f901a8..0000000000 --- a/app/sdks/server-php/docs/storage.md +++ /dev/null @@ -1,127 +0,0 @@ -# Storage Service - -## List Files - -```http request -GET https://appwrite.io/v1/storage/files -``` - -** Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](/docs/admin). ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| search | string | Search term to filter your list results. | | -| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 | -| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 | -| orderType | string | Order result by ASC or DESC order. | ASC | - -## Create File - -```http request -POST https://appwrite.io/v1/storage/files -``` - -** Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| file | file | Binary File. | | -| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | -| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | - -## Get File - -```http request -GET https://appwrite.io/v1/storage/files/{fileId} -``` - -** Get file by its unique ID. This endpoint response returns a JSON object with the file metadata. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| fileId | string | **Required** File unique ID. | | - -## Update File - -```http request -PUT https://appwrite.io/v1/storage/files/{fileId} -``` - -** Update file by its unique ID. Only users with write permissions have access to update this resource. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| fileId | string | **Required** File unique ID. | | -| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | -| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | - -## Delete File - -```http request -DELETE https://appwrite.io/v1/storage/files/{fileId} -``` - -** Delete a file by its unique ID. Only users with write permissions have access to delete this resource. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| fileId | string | **Required** File unique ID. | | - -## Get File for Download - -```http request -GET https://appwrite.io/v1/storage/files/{fileId}/download -``` - -** Get 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| fileId | string | **Required** File unique ID. | | - -## Get File Preview - -```http request -GET https://appwrite.io/v1/storage/files/{fileId}/preview -``` - -** 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. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| fileId | string | **Required** File unique ID | | -| width | integer | Resize preview image width, Pass an integer between 0 to 4000. | 0 | -| height | integer | Resize preview image height, Pass an integer between 0 to 4000. | 0 | -| quality | integer | Preview image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 | -| background | string | Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix. | | -| output | string | Output format type (jpeg, jpg, png, gif and webp). | | - -## Get File for View - -```http request -GET https://appwrite.io/v1/storage/files/{fileId}/view -``` - -** Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| fileId | string | **Required** File unique ID. | | -| as | string | Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk. | | - diff --git a/app/sdks/server-php/docs/teams.md b/app/sdks/server-php/docs/teams.md deleted file mode 100644 index 7b2646c0ce..0000000000 --- a/app/sdks/server-php/docs/teams.md +++ /dev/null @@ -1,128 +0,0 @@ -# Teams Service - -## List Teams - -```http request -GET https://appwrite.io/v1/teams -``` - -** Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](/docs/admin). ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| search | string | Search term to filter your list results. | | -| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 | -| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 | -| orderType | string | Order result by ASC or DESC order. | ASC | - -## Create Team - -```http request -POST https://appwrite.io/v1/teams -``` - -** Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| name | string | Team name. | | -| roles | array | 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](/docs/permissions). | ["owner"] | - -## Get Team - -```http request -GET https://appwrite.io/v1/teams/{teamId} -``` - -** Get team by its unique ID. All team members have read access for this resource. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| teamId | string | **Required** Team unique ID. | | - -## Update Team - -```http request -PUT https://appwrite.io/v1/teams/{teamId} -``` - -** Update team by its unique ID. Only team owners have write access for this resource. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| teamId | string | **Required** Team unique ID. | | -| name | string | Team name. | | - -## Delete Team - -```http request -DELETE https://appwrite.io/v1/teams/{teamId} -``` - -** Delete team by its unique ID. Only team owners have write access for this resource. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| teamId | string | **Required** Team unique ID. | | - -## Get Team Memberships - -```http request -GET https://appwrite.io/v1/teams/{teamId}/memberships -``` - -** Get team members by the team unique ID. All team members have read access for this list of resources. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| teamId | string | **Required** Team unique ID. | | - -## Create Team Membership - -```http request -POST https://appwrite.io/v1/teams/{teamId}/memberships -``` - -** Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically. - -Use the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. - -Please note that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| teamId | string | **Required** Team unique ID. | | -| email | string | New team member email. | | -| name | string | New team member name. | | -| roles | array | 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](/docs/permissions). | | -| url | string | URL to redirect the user back to your app from the invitation email. | | - -## Delete Team Membership - -```http request -DELETE https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId} -``` - -** 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 he didn't accept it. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| teamId | string | **Required** Team unique ID. | | -| inviteId | string | **Required** Invite unique ID. | | - diff --git a/app/sdks/server-php/docs/users.md b/app/sdks/server-php/docs/users.md deleted file mode 100644 index fd884b254f..0000000000 --- a/app/sdks/server-php/docs/users.md +++ /dev/null @@ -1,150 +0,0 @@ -# Users Service - -## List Users - -```http request -GET https://appwrite.io/v1/users -``` - -** Get a list of all the project users. You can use the query params to filter your results. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| search | string | Search term to filter your list results. | | -| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 | -| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 | -| orderType | string | Order result by ASC or DESC order. | ASC | - -## Create User - -```http request -POST https://appwrite.io/v1/users -``` - -** Create a new user. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| email | string | User email. | | -| password | string | User password. | | -| name | string | User name. | | - -## Get User - -```http request -GET https://appwrite.io/v1/users/{userId} -``` - -** Get user by its unique ID. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| userId | string | **Required** User unique ID. | | - -## Get User Logs - -```http request -GET https://appwrite.io/v1/users/{userId}/logs -``` - -** Get user activity logs list by its unique ID. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| userId | string | **Required** User unique ID. | | - -## Get User Preferences - -```http request -GET https://appwrite.io/v1/users/{userId}/prefs -``` - -** Get user preferences by its unique ID. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| userId | string | **Required** User unique ID. | | - -## Update User Preferences - -```http request -PATCH https://appwrite.io/v1/users/{userId}/prefs -``` - -** Update user preferences by its unique ID. You can pass only the specific settings you wish to update. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| userId | string | **Required** User unique ID. | | -| prefs | object | Prefs key-value JSON object. | | - -## Get User Sessions - -```http request -GET https://appwrite.io/v1/users/{userId}/sessions -``` - -** Get user sessions list by its unique ID. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| userId | string | **Required** User unique ID. | | - -## Delete User Sessions - -```http request -DELETE https://appwrite.io/v1/users/{userId}/sessions -``` - -** Delete all user sessions by its unique ID. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| userId | string | **Required** User unique ID. | | - -## Delete User Session - -```http request -DELETE https://appwrite.io/v1/users/{userId}/sessions/{sessionId} -``` - -** Delete user sessions by its unique ID. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| userId | string | **Required** User unique ID. | | -| sessionId | string | **Required** User unique session ID. | | - -## Update User Status - -```http request -PATCH https://appwrite.io/v1/users/{userId}/status -``` - -** Update user status by its unique ID. ** - -### Parameters - -| Field Name | Type | Description | Default | -| --- | --- | --- | --- | -| userId | string | **Required** User unique ID. | | -| status | string | User Status code. To activate the user pass 1, to block the user pass 2 and for disabling the user pass 0 | | - diff --git a/app/sdks/server-php/src/Appwrite/Client.php b/app/sdks/server-php/src/Appwrite/Client.php deleted file mode 100644 index f44d0c9233..0000000000 --- a/app/sdks/server-php/src/Appwrite/Client.php +++ /dev/null @@ -1,240 +0,0 @@ - '', - 'x-sdk-version' => 'appwrite:php:1.1.0', - ]; - - /** - * SDK constructor. - */ - public function __construct() - { - } - - /** - * Set Project - * - * Your project ID - * - * @param string $value - * - * @return Client - */ - public function setProject($value) - { - $this->addHeader('X-Appwrite-Project', $value); - - return $this; - } - - /** - * Set Key - * - * Your secret API key - * - * @param string $value - * - * @return Client - */ - public function setKey($value) - { - $this->addHeader('X-Appwrite-Key', $value); - - return $this; - } - - /** - * Set Locale - * - * @param string $value - * - * @return Client - */ - public function setLocale($value) - { - $this->addHeader('X-Appwrite-Locale', $value); - - return $this; - } - - - /*** - * @param bool $status - * @return $this - */ - public function setSelfSigned($status = true) - { - $this->selfSigned = $status; - - return $this; - } - - /*** - * @param $endpoint - * @return $this - */ - public function setEndpoint($endpoint) - { - $this->endpoint = $endpoint; - - return $this; - } - - /** - * @param $key - * @param $value - */ - public function addHeader($key, $value) - { - $this->headers[strtolower($key)] = strtolower($value); - - return $this; - } - - /** - * Call - * - * Make an API call - * - * @param string $method - * @param string $path - * @param array $params - * @param array $headers - * @return array|string - * @throws Exception - */ - public function call($method, $path = '', $headers = array(), array $params = array()) - { - $headers = array_merge($this->headers, $headers); - $ch = curl_init($this->endpoint . $path . (($method == self::METHOD_GET && !empty($params)) ? '?' . http_build_query($params) : '')); - $responseHeaders = []; - $responseStatus = -1; - $responseType = ''; - $responseBody = ''; - - switch ($headers['content-type']) { - case 'application/json': - $query = json_encode($params); - break; - - case 'multipart/form-data': - $query = $this->flatten($params); - break; - - default: - $query = http_build_query($params); - break; - } - - foreach ($headers as $i => $header) { - $headers[] = $i . ':' . $header; - unset($headers[$i]); - } - - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_USERAGENT, php_uname('s') . '-' . php_uname('r') . ':php-' . phpversion()); - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); - curl_setopt($ch, CURLOPT_HEADERFUNCTION, function($curl, $header) use (&$responseHeaders) { - $len = strlen($header); - $header = explode(':', strtolower($header), 2); - - if (count($header) < 2) { // ignore invalid headers - return $len; - } - - $responseHeaders[strtolower(trim($header[0]))] = trim($header[1]); - - return $len; - }); - - if($method != self::METHOD_GET) { - curl_setopt($ch, CURLOPT_POSTFIELDS, $query); - } - - // Allow self signed certificates - if($this->selfSigned) { - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - } - - $responseBody = curl_exec($ch); - $responseType = (isset($responseHeaders['content-type'])) ? $responseHeaders['content-type'] : ''; - $responseStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE); - - switch(substr($responseType, 0, strpos($responseType, ';'))) { - case 'application/json': - $responseBody = json_decode($responseBody, true); - break; - } - - if ((curl_errno($ch)/* || 200 != $responseStatus*/)) { - throw new Exception(curl_error($ch) . ' with status code ' . $responseStatus, $responseStatus); - } - - curl_close($ch); - - return $responseBody; - } - - /** - * Flatten params array to PHP multiple format - * - * @param array $data - * @param string $prefix - * @return array - */ - protected function flatten(array $data, $prefix = '') { - $output = []; - - foreach($data as $key => $value) { - $finalKey = $prefix ? "{$prefix}[{$key}]" : $key; - - if (is_array($value)) { - $output += $this->flatten($value, $finalKey); // @todo: handle name collision here if needed - } - else { - $output[$finalKey] = $value; - } - } - - return $output; - } -} diff --git a/app/sdks/server-php/src/Appwrite/Service.php b/app/sdks/server-php/src/Appwrite/Service.php deleted file mode 100644 index ea3ad92e2d..0000000000 --- a/app/sdks/server-php/src/Appwrite/Service.php +++ /dev/null @@ -1,19 +0,0 @@ -client = $client; - } -} \ No newline at end of file diff --git a/app/sdks/server-php/src/Appwrite/Services/Avatars.php b/app/sdks/server-php/src/Appwrite/Services/Avatars.php deleted file mode 100644 index 90f39f8535..0000000000 --- a/app/sdks/server-php/src/Appwrite/Services/Avatars.php +++ /dev/null @@ -1,175 +0,0 @@ -client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Credit Card Icon - * - * Need to display your users with your billing method or their payment - * methods? 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. - * - * @param string $code - * @param int $width - * @param int $height - * @param int $quality - * @throws Exception - * @return array - */ - public function getCreditCard(string $code, int $width = 100, int $height = 100, int $quality = 100):array - { - $path = str_replace(['{code}'], [$code], '/avatars/credit-cards/{code}'); - $params = []; - - $params['width'] = $width; - $params['height'] = $height; - $params['quality'] = $quality; - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Favicon - * - * Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote - * website URL. - * - * @param string $url - * @throws Exception - * @return array - */ - public function getFavicon(string $url):array - { - $path = str_replace([], [], '/avatars/favicon'); - $params = []; - - $params['url'] = $url; - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Country Flag - * - * 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. - * - * @param string $code - * @param int $width - * @param int $height - * @param int $quality - * @throws Exception - * @return array - */ - public function getFlag(string $code, int $width = 100, int $height = 100, int $quality = 100):array - { - $path = str_replace(['{code}'], [$code], '/avatars/flags/{code}'); - $params = []; - - $params['width'] = $width; - $params['height'] = $height; - $params['quality'] = $quality; - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Image from URL - * - * 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. - * - * @param string $url - * @param int $width - * @param int $height - * @throws Exception - * @return array - */ - public function getImage(string $url, int $width = 400, int $height = 400):array - { - $path = str_replace([], [], '/avatars/image'); - $params = []; - - $params['url'] = $url; - $params['width'] = $width; - $params['height'] = $height; - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get QR Code - * - * 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. - * - * @param string $text - * @param int $size - * @param int $margin - * @param int $download - * @throws Exception - * @return array - */ - public function getQR(string $text, int $size = 400, int $margin = 1, int $download = 0):array - { - $path = str_replace([], [], '/avatars/qr'); - $params = []; - - $params['text'] = $text; - $params['size'] = $size; - $params['margin'] = $margin; - $params['download'] = $download; - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - -} \ No newline at end of file diff --git a/app/sdks/server-php/src/Appwrite/Services/Database.php b/app/sdks/server-php/src/Appwrite/Services/Database.php deleted file mode 100644 index 7ce8ac359f..0000000000 --- a/app/sdks/server-php/src/Appwrite/Services/Database.php +++ /dev/null @@ -1,299 +0,0 @@ -client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Create Collection - * - * Create a new Collection. - * - * @param string $name - * @param array $read - * @param array $write - * @param array $rules - * @throws Exception - * @return array - */ - public function createCollection(string $name, array $read, array $write, array $rules):array - { - $path = str_replace([], [], '/database/collections'); - $params = []; - - $params['name'] = $name; - $params['read'] = $read; - $params['write'] = $write; - $params['rules'] = $rules; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Collection - * - * Get collection by its unique ID. This endpoint response returns a JSON - * object with the collection metadata. - * - * @param string $collectionId - * @throws Exception - * @return array - */ - public function getCollection(string $collectionId):array - { - $path = str_replace(['{collectionId}'], [$collectionId], '/database/collections/{collectionId}'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Update Collection - * - * Update collection by its unique ID. - * - * @param string $collectionId - * @param string $name - * @param array $read - * @param array $write - * @param array $rules - * @throws Exception - * @return array - */ - public function updateCollection(string $collectionId, string $name, array $read, array $write, array $rules = []):array - { - $path = str_replace(['{collectionId}'], [$collectionId], '/database/collections/{collectionId}'); - $params = []; - - $params['name'] = $name; - $params['read'] = $read; - $params['write'] = $write; - $params['rules'] = $rules; - - return $this->client->call(Client::METHOD_PUT, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Delete Collection - * - * Delete a collection by its unique ID. Only users with write permissions - * have access to delete this resource. - * - * @param string $collectionId - * @throws Exception - * @return array - */ - public function deleteCollection(string $collectionId):array - { - $path = str_replace(['{collectionId}'], [$collectionId], '/database/collections/{collectionId}'); - $params = []; - - - return $this->client->call(Client::METHOD_DELETE, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * List Documents - * - * Get a list of all the user documents. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project documents. [Learn more about different API - * modes](/docs/admin). - * - * @param string $collectionId - * @param array $filters - * @param int $offset - * @param int $limit - * @param string $orderField - * @param string $orderType - * @param string $orderCast - * @param string $search - * @param int $first - * @param int $last - * @throws Exception - * @return array - */ - public function listDocuments(string $collectionId, array $filters = [], int $offset = 0, int $limit = 50, string $orderField = '$id', string $orderType = 'ASC', string $orderCast = 'string', string $search = '', int $first = 0, int $last = 0):array - { - $path = str_replace(['{collectionId}'], [$collectionId], '/database/collections/{collectionId}/documents'); - $params = []; - - $params['filters'] = $filters; - $params['offset'] = $offset; - $params['limit'] = $limit; - $params['orderField'] = $orderField; - $params['orderType'] = $orderType; - $params['orderCast'] = $orderCast; - $params['search'] = $search; - $params['first'] = $first; - $params['last'] = $last; - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Create Document - * - * Create a new Document. - * - * @param string $collectionId - * @param array $data - * @param array $read - * @param array $write - * @param string $parentDocument - * @param string $parentProperty - * @param string $parentPropertyType - * @throws Exception - * @return array - */ - public function createDocument(string $collectionId, array $data, array $read, array $write, string $parentDocument = '', string $parentProperty = '', string $parentPropertyType = 'assign'):array - { - $path = str_replace(['{collectionId}'], [$collectionId], '/database/collections/{collectionId}/documents'); - $params = []; - - $params['data'] = $data; - $params['read'] = $read; - $params['write'] = $write; - $params['parentDocument'] = $parentDocument; - $params['parentProperty'] = $parentProperty; - $params['parentPropertyType'] = $parentPropertyType; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Document - * - * Get document by its unique ID. This endpoint response returns a JSON object - * with the document data. - * - * @param string $collectionId - * @param string $documentId - * @throws Exception - * @return array - */ - public function getDocument(string $collectionId, string $documentId):array - { - $path = str_replace(['{collectionId}', '{documentId}'], [$collectionId, $documentId], '/database/collections/{collectionId}/documents/{documentId}'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Update Document - * - * @param string $collectionId - * @param string $documentId - * @param array $data - * @param array $read - * @param array $write - * @throws Exception - * @return array - */ - public function updateDocument(string $collectionId, string $documentId, array $data, array $read, array $write):array - { - $path = str_replace(['{collectionId}', '{documentId}'], [$collectionId, $documentId], '/database/collections/{collectionId}/documents/{documentId}'); - $params = []; - - $params['data'] = $data; - $params['read'] = $read; - $params['write'] = $write; - - return $this->client->call(Client::METHOD_PATCH, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Delete Document - * - * Delete document by its unique ID. This endpoint deletes only the parent - * documents, his attributes and relations to other documents. Child documents - * **will not** be deleted. - * - * @param string $collectionId - * @param string $documentId - * @throws Exception - * @return array - */ - public function deleteDocument(string $collectionId, string $documentId):array - { - $path = str_replace(['{collectionId}', '{documentId}'], [$collectionId, $documentId], '/database/collections/{collectionId}/documents/{documentId}'); - $params = []; - - - return $this->client->call(Client::METHOD_DELETE, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Collection Logs - * - * @param string $collectionId - * @throws Exception - * @return array - */ - public function getCollectionLogs(string $collectionId):array - { - $path = str_replace(['{collectionId}'], [$collectionId], '/database/collections/{collectionId}/logs'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - -} \ No newline at end of file diff --git a/app/sdks/server-php/src/Appwrite/Services/Functions.php b/app/sdks/server-php/src/Appwrite/Services/Functions.php deleted file mode 100644 index 1771652072..0000000000 --- a/app/sdks/server-php/src/Appwrite/Services/Functions.php +++ /dev/null @@ -1,300 +0,0 @@ -client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Create Function - * - * @param string $name - * @param array $vars - * @param array $events - * @param string $schedule - * @param int $timeout - * @throws Exception - * @return array - */ - public function create(string $name, array $vars = , array $events = [], string $schedule = '', int $timeout = 15):array - { - $path = str_replace([], [], '/functions'); - $params = []; - - $params['name'] = $name; - $params['vars'] = $vars; - $params['events'] = $events; - $params['schedule'] = $schedule; - $params['timeout'] = $timeout; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Function - * - * @param string $functionId - * @throws Exception - * @return array - */ - public function get(string $functionId):array - { - $path = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Update Function - * - * @param string $functionId - * @param string $name - * @param array $vars - * @param array $events - * @param string $schedule - * @param int $timeout - * @throws Exception - * @return array - */ - public function update(string $functionId, string $name, array $vars = , array $events = [], string $schedule = '', int $timeout = 15):array - { - $path = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}'); - $params = []; - - $params['name'] = $name; - $params['vars'] = $vars; - $params['events'] = $events; - $params['schedule'] = $schedule; - $params['timeout'] = $timeout; - - return $this->client->call(Client::METHOD_PUT, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Delete Function - * - * @param string $functionId - * @throws Exception - * @return array - */ - public function delete(string $functionId):array - { - $path = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}'); - $params = []; - - - return $this->client->call(Client::METHOD_DELETE, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * List Executions - * - * @param string $functionId - * @param string $search - * @param int $limit - * @param int $offset - * @param string $orderType - * @throws Exception - * @return array - */ - public function listExecutions(string $functionId, string $search = '', int $limit = 25, int $offset = 0, string $orderType = 'ASC'):array - { - $path = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}/executions'); - $params = []; - - $params['search'] = $search; - $params['limit'] = $limit; - $params['offset'] = $offset; - $params['orderType'] = $orderType; - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Create Execution - * - * @param string $functionId - * @param int $async - * @throws Exception - * @return array - */ - public function createExecution(string $functionId, int $async = 1):array - { - $path = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}/executions'); - $params = []; - - $params['async'] = $async; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Execution - * - * @param string $functionId - * @param string $executionId - * @throws Exception - * @return array - */ - public function getExecution(string $functionId, string $executionId):array - { - $path = str_replace(['{functionId}', '{executionId}'], [$functionId, $executionId], '/functions/{functionId}/executions/{executionId}'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Update Function Tag - * - * @param string $functionId - * @param string $tag - * @throws Exception - * @return array - */ - public function updateTag(string $functionId, string $tag):array - { - $path = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}/tag'); - $params = []; - - $params['tag'] = $tag; - - return $this->client->call(Client::METHOD_PATCH, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * List Tags - * - * @param string $functionId - * @param string $search - * @param int $limit - * @param int $offset - * @param string $orderType - * @throws Exception - * @return array - */ - public function listTags(string $functionId, string $search = '', int $limit = 25, int $offset = 0, string $orderType = 'ASC'):array - { - $path = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}/tags'); - $params = []; - - $params['search'] = $search; - $params['limit'] = $limit; - $params['offset'] = $offset; - $params['orderType'] = $orderType; - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Create Tag - * - * @param string $functionId - * @param string $env - * @param string $command - * @param string $code - * @throws Exception - * @return array - */ - public function createTag(string $functionId, string $env, string $command, string $code):array - { - $path = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}/tags'); - $params = []; - - $params['env'] = $env; - $params['command'] = $command; - $params['code'] = $code; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Tag - * - * @param string $functionId - * @param string $tagId - * @throws Exception - * @return array - */ - public function getTag(string $functionId, string $tagId):array - { - $path = str_replace(['{functionId}', '{tagId}'], [$functionId, $tagId], '/functions/{functionId}/tags/{tagId}'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Delete Tag - * - * @param string $functionId - * @param string $tagId - * @throws Exception - * @return array - */ - public function deleteTag(string $functionId, string $tagId):array - { - $path = str_replace(['{functionId}', '{tagId}'], [$functionId, $tagId], '/functions/{functionId}/tags/{tagId}'); - $params = []; - - - return $this->client->call(Client::METHOD_DELETE, $path, [ - 'content-type' => 'application/json', - ], $params); - } - -} \ No newline at end of file diff --git a/app/sdks/server-php/src/Appwrite/Services/Health.php b/app/sdks/server-php/src/Appwrite/Services/Health.php deleted file mode 100644 index d39f1f406d..0000000000 --- a/app/sdks/server-php/src/Appwrite/Services/Health.php +++ /dev/null @@ -1,250 +0,0 @@ -client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Anti virus - * - * Check the Appwrite Anti Virus server is up and connection is successful. - * - * @throws Exception - * @return array - */ - public function getAntiVirus():array - { - $path = str_replace([], [], '/health/anti-virus'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Cache - * - * Check the Appwrite in-memory cache server is up and connection is - * successful. - * - * @throws Exception - * @return array - */ - public function getCache():array - { - $path = str_replace([], [], '/health/cache'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get DB - * - * Check the Appwrite database server is up and connection is successful. - * - * @throws Exception - * @return array - */ - public function getDB():array - { - $path = str_replace([], [], '/health/db'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Certificate Queue - * - * Get the number of certificates that are waiting to be issued against - * [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue - * server. - * - * @throws Exception - * @return array - */ - public function getQueueCertificates():array - { - $path = str_replace([], [], '/health/queue/certificates'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Functions Queue - * - * @throws Exception - * @return array - */ - public function getQueueFunctions():array - { - $path = str_replace([], [], '/health/queue/functions'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Logs Queue - * - * Get the number of logs that are waiting to be processed in the Appwrite - * internal queue server. - * - * @throws Exception - * @return array - */ - public function getQueueLogs():array - { - $path = str_replace([], [], '/health/queue/logs'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Tasks Queue - * - * Get the number of tasks that are waiting to be processed in the Appwrite - * internal queue server. - * - * @throws Exception - * @return array - */ - public function getQueueTasks():array - { - $path = str_replace([], [], '/health/queue/tasks'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Usage Queue - * - * Get the number of usage stats that are waiting to be processed in the - * Appwrite internal queue server. - * - * @throws Exception - * @return array - */ - public function getQueueUsage():array - { - $path = str_replace([], [], '/health/queue/usage'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Webhooks Queue - * - * Get the number of webhooks that are waiting to be processed in the Appwrite - * internal queue server. - * - * @throws Exception - * @return array - */ - public function getQueueWebhooks():array - { - $path = str_replace([], [], '/health/queue/webhooks'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Local Storage - * - * Check the Appwrite local storage device is up and connection is successful. - * - * @throws Exception - * @return array - */ - public function getStorageLocal():array - { - $path = str_replace([], [], '/health/storage/local'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Time - * - * 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. - * - * @throws Exception - * @return array - */ - public function getTime():array - { - $path = str_replace([], [], '/health/time'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - -} \ No newline at end of file diff --git a/app/sdks/server-php/src/Appwrite/Services/Locale.php b/app/sdks/server-php/src/Appwrite/Services/Locale.php deleted file mode 100644 index 25255c81a0..0000000000 --- a/app/sdks/server-php/src/Appwrite/Services/Locale.php +++ /dev/null @@ -1,136 +0,0 @@ -client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * List Continents - * - * List of all continents. You can use the locale header to get the data in a - * supported language. - * - * @throws Exception - * @return array - */ - public function getContinents():array - { - $path = str_replace([], [], '/locale/continents'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * List Countries - * - * List of all countries. You can use the locale header to get the data in a - * supported language. - * - * @throws Exception - * @return array - */ - public function getCountries():array - { - $path = str_replace([], [], '/locale/countries'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * List EU Countries - * - * 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. - * - * @throws Exception - * @return array - */ - public function getCountriesEU():array - { - $path = str_replace([], [], '/locale/countries/eu'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * List Countries Phone Codes - * - * List of all countries phone codes. You can use the locale header to get the - * data in a supported language. - * - * @throws Exception - * @return array - */ - public function getCountriesPhones():array - { - $path = str_replace([], [], '/locale/countries/phones'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * List Currencies - * - * List of all currencies, including currency symol, 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. - * - * @throws Exception - * @return array - */ - public function getCurrencies():array - { - $path = str_replace([], [], '/locale/currencies'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - -} \ No newline at end of file diff --git a/app/sdks/server-php/src/Appwrite/Services/Storage.php b/app/sdks/server-php/src/Appwrite/Services/Storage.php deleted file mode 100644 index 09b74fbf8f..0000000000 --- a/app/sdks/server-php/src/Appwrite/Services/Storage.php +++ /dev/null @@ -1,212 +0,0 @@ -client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Create File - * - * Create a new file. The user who creates the file will automatically be - * assigned to read and write access unless he has passed custom values for - * read and write arguments. - * - * @param \CurlFile $file - * @param array $read - * @param array $write - * @throws Exception - * @return array - */ - public function createFile(\CurlFile $file, array $read, array $write):array - { - $path = str_replace([], [], '/storage/files'); - $params = []; - - $params['file'] = $file; - $params['read'] = $read; - $params['write'] = $write; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'multipart/form-data', - ], $params); - } - - /** - * Get File - * - * Get file by its unique ID. This endpoint response returns a JSON object - * with the file metadata. - * - * @param string $fileId - * @throws Exception - * @return array - */ - public function getFile(string $fileId):array - { - $path = str_replace(['{fileId}'], [$fileId], '/storage/files/{fileId}'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Update File - * - * Update file by its unique ID. Only users with write permissions have access - * to update this resource. - * - * @param string $fileId - * @param array $read - * @param array $write - * @throws Exception - * @return array - */ - public function updateFile(string $fileId, array $read, array $write):array - { - $path = str_replace(['{fileId}'], [$fileId], '/storage/files/{fileId}'); - $params = []; - - $params['read'] = $read; - $params['write'] = $write; - - return $this->client->call(Client::METHOD_PUT, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Delete File - * - * Delete a file by its unique ID. Only users with write permissions have - * access to delete this resource. - * - * @param string $fileId - * @throws Exception - * @return array - */ - public function deleteFile(string $fileId):array - { - $path = str_replace(['{fileId}'], [$fileId], '/storage/files/{fileId}'); - $params = []; - - - return $this->client->call(Client::METHOD_DELETE, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get File for Download - * - * Get 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. - * - * @param string $fileId - * @throws Exception - * @return array - */ - public function getFileDownload(string $fileId):array - { - $path = str_replace(['{fileId}'], [$fileId], '/storage/files/{fileId}/download'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get File Preview - * - * 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. - * - * @param string $fileId - * @param int $width - * @param int $height - * @param int $quality - * @param string $background - * @param string $output - * @throws Exception - * @return array - */ - public function getFilePreview(string $fileId, int $width = 0, int $height = 0, int $quality = 100, string $background = '', string $output = ''):array - { - $path = str_replace(['{fileId}'], [$fileId], '/storage/files/{fileId}/preview'); - $params = []; - - $params['width'] = $width; - $params['height'] = $height; - $params['quality'] = $quality; - $params['background'] = $background; - $params['output'] = $output; - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get File for View - * - * Get file content by its unique ID. This endpoint is similar to the download - * method but returns with no 'Content-Disposition: attachment' header. - * - * @param string $fileId - * @param string $as - * @throws Exception - * @return array - */ - public function getFileView(string $fileId, string $as = ''):array - { - $path = str_replace(['{fileId}'], [$fileId], '/storage/files/{fileId}/view'); - $params = []; - - $params['as'] = $as; - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - -} \ No newline at end of file diff --git a/app/sdks/server-php/src/Appwrite/Services/Teams.php b/app/sdks/server-php/src/Appwrite/Services/Teams.php deleted file mode 100644 index 7ef2240ab7..0000000000 --- a/app/sdks/server-php/src/Appwrite/Services/Teams.php +++ /dev/null @@ -1,215 +0,0 @@ -client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Create Team - * - * Create a new team. The user who creates the team will automatically be - * assigned as the owner of the team. The team owner can invite new members, - * who will be able add new owners and update or delete the team from your - * project. - * - * @param string $name - * @param array $roles - * @throws Exception - * @return array - */ - public function create(string $name, array $roles = ["owner"]):array - { - $path = str_replace([], [], '/teams'); - $params = []; - - $params['name'] = $name; - $params['roles'] = $roles; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Team - * - * Get team by its unique ID. All team members have read access for this - * resource. - * - * @param string $teamId - * @throws Exception - * @return array - */ - public function get(string $teamId):array - { - $path = str_replace(['{teamId}'], [$teamId], '/teams/{teamId}'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Update Team - * - * Update team by its unique ID. Only team owners have write access for this - * resource. - * - * @param string $teamId - * @param string $name - * @throws Exception - * @return array - */ - public function update(string $teamId, string $name):array - { - $path = str_replace(['{teamId}'], [$teamId], '/teams/{teamId}'); - $params = []; - - $params['name'] = $name; - - return $this->client->call(Client::METHOD_PUT, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Delete Team - * - * Delete team by its unique ID. Only team owners have write access for this - * resource. - * - * @param string $teamId - * @throws Exception - * @return array - */ - public function delete(string $teamId):array - { - $path = str_replace(['{teamId}'], [$teamId], '/teams/{teamId}'); - $params = []; - - - return $this->client->call(Client::METHOD_DELETE, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get Team Memberships - * - * Get team members by the team unique ID. All team members have read access - * for this list of resources. - * - * @param string $teamId - * @throws Exception - * @return array - */ - public function getMemberships(string $teamId):array - { - $path = str_replace(['{teamId}'], [$teamId], '/teams/{teamId}/memberships'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Create Team Membership - * - * Use this endpoint to invite a new member to join your team. An email with a - * link to join the team will be sent to the new member email address if the - * member doesn't exist in the project it will be created automatically. - * - * Use the 'URL' parameter to redirect the user from the invitation email back - * to your app. When the user is redirected, use the [Update Team Membership - * Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to - * accept the invitation to the team. - * - * Please note that in order to avoid a [Redirect - * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) - * the only valid redirect URL's are the once from domains you have set when - * added your platforms in the console interface. - * - * @param string $teamId - * @param string $email - * @param array $roles - * @param string $url - * @param string $name - * @throws Exception - * @return array - */ - public function createMembership(string $teamId, string $email, array $roles, string $url, string $name = ''):array - { - $path = str_replace(['{teamId}'], [$teamId], '/teams/{teamId}/memberships'); - $params = []; - - $params['email'] = $email; - $params['name'] = $name; - $params['roles'] = $roles; - $params['url'] = $url; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Delete Team Membership - * - * 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 he didn't accept it. - * - * @param string $teamId - * @param string $inviteId - * @throws Exception - * @return array - */ - public function deleteMembership(string $teamId, string $inviteId):array - { - $path = str_replace(['{teamId}', '{inviteId}'], [$teamId, $inviteId], '/teams/{teamId}/memberships/{inviteId}'); - $params = []; - - - return $this->client->call(Client::METHOD_DELETE, $path, [ - 'content-type' => 'application/json', - ], $params); - } - -} \ No newline at end of file diff --git a/app/sdks/server-php/src/Appwrite/Services/Users.php b/app/sdks/server-php/src/Appwrite/Services/Users.php deleted file mode 100644 index b2b4f576cc..0000000000 --- a/app/sdks/server-php/src/Appwrite/Services/Users.php +++ /dev/null @@ -1,230 +0,0 @@ -client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Create User - * - * Create a new user. - * - * @param string $email - * @param string $password - * @param string $name - * @throws Exception - * @return array - */ - public function create(string $email, string $password, string $name = ''):array - { - $path = str_replace([], [], '/users'); - $params = []; - - $params['email'] = $email; - $params['password'] = $password; - $params['name'] = $name; - - return $this->client->call(Client::METHOD_POST, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get User - * - * Get user by its unique ID. - * - * @param string $userId - * @throws Exception - * @return array - */ - public function get(string $userId):array - { - $path = str_replace(['{userId}'], [$userId], '/users/{userId}'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get User Logs - * - * Get user activity logs list by its unique ID. - * - * @param string $userId - * @throws Exception - * @return array - */ - public function getLogs(string $userId):array - { - $path = str_replace(['{userId}'], [$userId], '/users/{userId}/logs'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get User Preferences - * - * Get user preferences by its unique ID. - * - * @param string $userId - * @throws Exception - * @return array - */ - public function getPrefs(string $userId):array - { - $path = str_replace(['{userId}'], [$userId], '/users/{userId}/prefs'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Update User Preferences - * - * Update user preferences by its unique ID. You can pass only the specific - * settings you wish to update. - * - * @param string $userId - * @param array $prefs - * @throws Exception - * @return array - */ - public function updatePrefs(string $userId, array $prefs):array - { - $path = str_replace(['{userId}'], [$userId], '/users/{userId}/prefs'); - $params = []; - - $params['prefs'] = $prefs; - - return $this->client->call(Client::METHOD_PATCH, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Get User Sessions - * - * Get user sessions list by its unique ID. - * - * @param string $userId - * @throws Exception - * @return array - */ - public function getSessions(string $userId):array - { - $path = str_replace(['{userId}'], [$userId], '/users/{userId}/sessions'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Delete User Sessions - * - * Delete all user sessions by its unique ID. - * - * @param string $userId - * @throws Exception - * @return array - */ - public function deleteSessions(string $userId):array - { - $path = str_replace(['{userId}'], [$userId], '/users/{userId}/sessions'); - $params = []; - - - return $this->client->call(Client::METHOD_DELETE, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Delete User Session - * - * Delete user sessions by its unique ID. - * - * @param string $userId - * @param string $sessionId - * @throws Exception - * @return array - */ - public function deleteSession(string $userId, string $sessionId):array - { - $path = str_replace(['{userId}', '{sessionId}'], [$userId, $sessionId], '/users/{userId}/sessions/{sessionId}'); - $params = []; - - - return $this->client->call(Client::METHOD_DELETE, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Update User Status - * - * Update user status by its unique ID. - * - * @param string $userId - * @param string $status - * @throws Exception - * @return array - */ - public function updateStatus(string $userId, string $status):array - { - $path = str_replace(['{userId}'], [$userId], '/users/{userId}/status'); - $params = []; - - $params['status'] = $status; - - return $this->client->call(Client::METHOD_PATCH, $path, [ - 'content-type' => 'application/json', - ], $params); - } - -} \ No newline at end of file diff --git a/app/sdks/server-python/CHANGELOG.md b/app/sdks/server-python/CHANGELOG.md deleted file mode 100644 index fa4d35e687..0000000000 --- a/app/sdks/server-python/CHANGELOG.md +++ /dev/null @@ -1 +0,0 @@ -# Change Log \ No newline at end of file diff --git a/app/sdks/server-python/LICENSE b/app/sdks/server-python/LICENSE deleted file mode 100644 index fc7c051a91..0000000000 --- a/app/sdks/server-python/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/app/sdks/server-python/README.md b/app/sdks/server-python/README.md deleted file mode 100644 index 04421ff241..0000000000 --- a/app/sdks/server-python/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# Appwrite Python SDK - -![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.6.2-blue.svg?v=1) - -**This SDK is compatible with Appwrite server version 0.6.2. For older versions, please check previous releases.** - -Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. - Use the Python SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. - For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) - - - -![Appwrite](https://appwrite.io/images/github.png) - -## Installation - -To install via [PyPI](https://pypi.org/): - -```bash -pip install appwrite -``` - -## Contribution - -This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request. - -## License - -Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. diff --git a/app/sdks/server-python/appwrite/__init__.py b/app/sdks/server-python/appwrite/__init__.py deleted file mode 100644 index 0519ecba6e..0000000000 --- a/app/sdks/server-python/appwrite/__init__.py +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/sdks/server-python/appwrite/client.py b/app/sdks/server-python/appwrite/client.py deleted file mode 100644 index 8989fccb9c..0000000000 --- a/app/sdks/server-python/appwrite/client.py +++ /dev/null @@ -1,106 +0,0 @@ -import io -import requests - -class Client: - def __init__(self): - self._self_signed = False - self._endpoint = 'https://appwrite.io/v1' - self._global_headers = { - 'content-type': '', - 'x-sdk-version': 'appwrite:python:0.0.6', - } - - def set_self_signed(self, status=True): - self._self_signed = status - return self - - def set_endpoint(self, endpoint): - self._endpoint = endpoint - return self - - def add_header(self, key, value): - self._global_headers[key.lower()] = value.lower() - return self - - def set_project(self, value): - """Your project ID""" - - self._global_headers['x-appwrite-project'] = value.lower() - return self - - def set_key(self, value): - """Your secret API key""" - - self._global_headers['x-appwrite-key'] = value.lower() - return self - - def set_locale(self, value): - self._global_headers['x-appwrite-locale'] = value.lower() - return self - - def call(self, method, path='', headers=None, params=None): - if headers is None: - headers = {} - - if params is None: - params = {} - - data = {} - json = {} - files = {} - - headers = {**self._global_headers, **headers} - - if method != 'get': - data = params - params = {} - - if headers['content-type'].startswith('application/json'): - json = data - data = {} - - if headers['content-type'].startswith('multipart/form-data'): - del headers['content-type'] - - for key in data.copy(): - if isinstance(data[key], io.BufferedIOBase): - files[key] = data[key] - del data[key] - - response = requests.request( # call method dynamically https://stackoverflow.com/a/4246075/2299554 - method=method, - url=self._endpoint + path, - params=self.flatten(params), - data=self.flatten(data), - json=json, - files=files, - headers=headers, - verify=self._self_signed, - ) - - response.raise_for_status() - - content_type = response.headers['Content-Type'] - - if content_type.startswith('application/json'): - return response.json() - - return response._content - - def flatten(self, data, prefix=''): - output = {} - i = 0 - - for key in data: - value = data[key] if isinstance(data, dict) else key - finalKey = prefix + '[' + key +']' if prefix else key - finalKey = prefix + '[' + str(i) +']' if isinstance(data, list) else finalKey - i += 1 - - if isinstance(value, list) or isinstance(value, dict): - output = {**output, **self.flatten(value, finalKey)} - else: - output[finalKey] = value - - return output - diff --git a/app/sdks/server-python/appwrite/service.py b/app/sdks/server-python/appwrite/service.py deleted file mode 100644 index b5b60e6c22..0000000000 --- a/app/sdks/server-python/appwrite/service.py +++ /dev/null @@ -1,6 +0,0 @@ -from .client import Client - - -class Service: - def __init__(self, client: Client): - self.client = client diff --git a/app/sdks/server-python/appwrite/services/__init__.py b/app/sdks/server-python/appwrite/services/__init__.py deleted file mode 100644 index 0519ecba6e..0000000000 --- a/app/sdks/server-python/appwrite/services/__init__.py +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/sdks/server-python/appwrite/services/avatars.py b/app/sdks/server-python/appwrite/services/avatars.py deleted file mode 100644 index 4a2a4024a6..0000000000 --- a/app/sdks/server-python/appwrite/services/avatars.py +++ /dev/null @@ -1,87 +0,0 @@ -from ..service import Service - - -class Avatars(Service): - - def __init__(self, client): - super(Avatars, self).__init__(client) - - def get_browser(self, code, width=100, height=100, quality=100): - """Get Browser Icon""" - - params = {} - path = '/avatars/browsers/{code}' - path = path.replace('{code}', code) - params['width'] = width - params['height'] = height - params['quality'] = quality - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_credit_card(self, code, width=100, height=100, quality=100): - """Get Credit Card Icon""" - - params = {} - path = '/avatars/credit-cards/{code}' - path = path.replace('{code}', code) - params['width'] = width - params['height'] = height - params['quality'] = quality - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_favicon(self, url): - """Get Favicon""" - - params = {} - path = '/avatars/favicon' - params['url'] = url - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_flag(self, code, width=100, height=100, quality=100): - """Get Country Flag""" - - params = {} - path = '/avatars/flags/{code}' - path = path.replace('{code}', code) - params['width'] = width - params['height'] = height - params['quality'] = quality - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_image(self, url, width=400, height=400): - """Get Image from URL""" - - params = {} - path = '/avatars/image' - params['url'] = url - params['width'] = width - params['height'] = height - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_q_r(self, text, size=400, margin=1, download=0): - """Get QR Code""" - - params = {} - path = '/avatars/qr' - params['text'] = text - params['size'] = size - params['margin'] = margin - params['download'] = download - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) diff --git a/app/sdks/server-python/appwrite/services/database.py b/app/sdks/server-python/appwrite/services/database.py deleted file mode 100644 index 2549e689d5..0000000000 --- a/app/sdks/server-python/appwrite/services/database.py +++ /dev/null @@ -1,159 +0,0 @@ -from ..service import Service - - -class Database(Service): - - def __init__(self, client): - super(Database, self).__init__(client) - - def list_collections(self, search='', limit=25, offset=0, order_type='ASC'): - """List Collections""" - - params = {} - path = '/database/collections' - params['search'] = search - params['limit'] = limit - params['offset'] = offset - params['orderType'] = order_type - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def create_collection(self, name, read, write, rules): - """Create Collection""" - - params = {} - path = '/database/collections' - params['name'] = name - params['read'] = read - params['write'] = write - params['rules'] = rules - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def get_collection(self, collection_id): - """Get Collection""" - - params = {} - path = '/database/collections/{collectionId}' - path = path.replace('{collectionId}', collection_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def update_collection(self, collection_id, name, read, write, rules=[]): - """Update Collection""" - - params = {} - path = '/database/collections/{collectionId}' - path = path.replace('{collectionId}', collection_id) - params['name'] = name - params['read'] = read - params['write'] = write - params['rules'] = rules - - return self.client.call('put', path, { - 'content-type': 'application/json', - }, params) - - def delete_collection(self, collection_id): - """Delete Collection""" - - params = {} - path = '/database/collections/{collectionId}' - path = path.replace('{collectionId}', collection_id) - - return self.client.call('delete', path, { - 'content-type': 'application/json', - }, params) - - def list_documents(self, collection_id, filters=[], offset=0, limit=50, order_field='$id', order_type='ASC', order_cast='string', search='', first=0, last=0): - """List Documents""" - - params = {} - path = '/database/collections/{collectionId}/documents' - path = path.replace('{collectionId}', collection_id) - params['filters'] = filters - params['offset'] = offset - params['limit'] = limit - params['orderField'] = order_field - params['orderType'] = order_type - params['orderCast'] = order_cast - params['search'] = search - params['first'] = first - params['last'] = last - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def create_document(self, collection_id, data, read, write, parent_document='', parent_property='', parent_property_type='assign'): - """Create Document""" - - params = {} - path = '/database/collections/{collectionId}/documents' - path = path.replace('{collectionId}', collection_id) - params['data'] = data - params['read'] = read - params['write'] = write - params['parentDocument'] = parent_document - params['parentProperty'] = parent_property - params['parentPropertyType'] = parent_property_type - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def get_document(self, collection_id, document_id): - """Get Document""" - - params = {} - path = '/database/collections/{collectionId}/documents/{documentId}' - path = path.replace('{collectionId}', collection_id) - path = path.replace('{documentId}', document_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def update_document(self, collection_id, document_id, data, read, write): - """Update Document""" - - params = {} - path = '/database/collections/{collectionId}/documents/{documentId}' - path = path.replace('{collectionId}', collection_id) - path = path.replace('{documentId}', document_id) - params['data'] = data - params['read'] = read - params['write'] = write - - return self.client.call('patch', path, { - 'content-type': 'application/json', - }, params) - - def delete_document(self, collection_id, document_id): - """Delete Document""" - - params = {} - path = '/database/collections/{collectionId}/documents/{documentId}' - path = path.replace('{collectionId}', collection_id) - path = path.replace('{documentId}', document_id) - - return self.client.call('delete', path, { - 'content-type': 'application/json', - }, params) - - def get_collection_logs(self, collection_id): - """Get Collection Logs""" - - params = {} - path = '/database/collections/{collectionId}/logs' - path = path.replace('{collectionId}', collection_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) diff --git a/app/sdks/server-python/appwrite/services/functions.py b/app/sdks/server-python/appwrite/services/functions.py deleted file mode 100644 index 1688f21f47..0000000000 --- a/app/sdks/server-python/appwrite/services/functions.py +++ /dev/null @@ -1,178 +0,0 @@ -from ..service import Service - - -class Functions(Service): - - def __init__(self, client): - super(Functions, self).__init__(client) - - def list(self, search='', limit=25, offset=0, order_type='ASC'): - """List Functions""" - - params = {} - path = '/functions' - params['search'] = search - params['limit'] = limit - params['offset'] = offset - params['orderType'] = order_type - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def create(self, name, vars=[], events=[], schedule='', timeout=15): - """Create Function""" - - params = {} - path = '/functions' - params['name'] = name - params['vars'] = vars - params['events'] = events - params['schedule'] = schedule - params['timeout'] = timeout - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def get(self, function_id): - """Get Function""" - - params = {} - path = '/functions/{functionId}' - path = path.replace('{functionId}', function_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def update(self, function_id, name, vars=[], events=[], schedule='', timeout=15): - """Update Function""" - - params = {} - path = '/functions/{functionId}' - path = path.replace('{functionId}', function_id) - params['name'] = name - params['vars'] = vars - params['events'] = events - params['schedule'] = schedule - params['timeout'] = timeout - - return self.client.call('put', path, { - 'content-type': 'application/json', - }, params) - - def delete(self, function_id): - """Delete Function""" - - params = {} - path = '/functions/{functionId}' - path = path.replace('{functionId}', function_id) - - return self.client.call('delete', path, { - 'content-type': 'application/json', - }, params) - - def list_executions(self, function_id, search='', limit=25, offset=0, order_type='ASC'): - """List Executions""" - - params = {} - path = '/functions/{functionId}/executions' - path = path.replace('{functionId}', function_id) - params['search'] = search - params['limit'] = limit - params['offset'] = offset - params['orderType'] = order_type - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def create_execution(self, function_id, async=1): - """Create Execution""" - - params = {} - path = '/functions/{functionId}/executions' - path = path.replace('{functionId}', function_id) - params['async'] = async - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def get_execution(self, function_id, execution_id): - """Get Execution""" - - params = {} - path = '/functions/{functionId}/executions/{executionId}' - path = path.replace('{functionId}', function_id) - path = path.replace('{executionId}', execution_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def update_tag(self, function_id, tag): - """Update Function Tag""" - - params = {} - path = '/functions/{functionId}/tag' - path = path.replace('{functionId}', function_id) - params['tag'] = tag - - return self.client.call('patch', path, { - 'content-type': 'application/json', - }, params) - - def list_tags(self, function_id, search='', limit=25, offset=0, order_type='ASC'): - """List Tags""" - - params = {} - path = '/functions/{functionId}/tags' - path = path.replace('{functionId}', function_id) - params['search'] = search - params['limit'] = limit - params['offset'] = offset - params['orderType'] = order_type - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def create_tag(self, function_id, env, command, code): - """Create Tag""" - - params = {} - path = '/functions/{functionId}/tags' - path = path.replace('{functionId}', function_id) - params['env'] = env - params['command'] = command - params['code'] = code - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def get_tag(self, function_id, tag_id): - """Get Tag""" - - params = {} - path = '/functions/{functionId}/tags/{tagId}' - path = path.replace('{functionId}', function_id) - path = path.replace('{tagId}', tag_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def delete_tag(self, function_id, tag_id): - """Delete Tag""" - - params = {} - path = '/functions/{functionId}/tags/{tagId}' - path = path.replace('{functionId}', function_id) - path = path.replace('{tagId}', tag_id) - - return self.client.call('delete', path, { - 'content-type': 'application/json', - }, params) diff --git a/app/sdks/server-python/appwrite/services/health.py b/app/sdks/server-python/appwrite/services/health.py deleted file mode 100644 index 5e08ebe6e8..0000000000 --- a/app/sdks/server-python/appwrite/services/health.py +++ /dev/null @@ -1,127 +0,0 @@ -from ..service import Service - - -class Health(Service): - - def __init__(self, client): - super(Health, self).__init__(client) - - def get(self): - """Get HTTP""" - - params = {} - path = '/health' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_anti_virus(self): - """Get Anti virus""" - - params = {} - path = '/health/anti-virus' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_cache(self): - """Get Cache""" - - params = {} - path = '/health/cache' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_d_b(self): - """Get DB""" - - params = {} - path = '/health/db' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_queue_certificates(self): - """Get Certificate Queue""" - - params = {} - path = '/health/queue/certificates' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_queue_functions(self): - """Get Functions Queue""" - - params = {} - path = '/health/queue/functions' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_queue_logs(self): - """Get Logs Queue""" - - params = {} - path = '/health/queue/logs' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_queue_tasks(self): - """Get Tasks Queue""" - - params = {} - path = '/health/queue/tasks' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_queue_usage(self): - """Get Usage Queue""" - - params = {} - path = '/health/queue/usage' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_queue_webhooks(self): - """Get Webhooks Queue""" - - params = {} - path = '/health/queue/webhooks' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_storage_local(self): - """Get Local Storage""" - - params = {} - path = '/health/storage/local' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_time(self): - """Get Time""" - - params = {} - path = '/health/time' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) diff --git a/app/sdks/server-python/appwrite/services/locale.py b/app/sdks/server-python/appwrite/services/locale.py deleted file mode 100644 index 70c955eb85..0000000000 --- a/app/sdks/server-python/appwrite/services/locale.py +++ /dev/null @@ -1,67 +0,0 @@ -from ..service import Service - - -class Locale(Service): - - def __init__(self, client): - super(Locale, self).__init__(client) - - def get(self): - """Get User Locale""" - - params = {} - path = '/locale' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_continents(self): - """List Continents""" - - params = {} - path = '/locale/continents' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_countries(self): - """List Countries""" - - params = {} - path = '/locale/countries' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_countries_e_u(self): - """List EU Countries""" - - params = {} - path = '/locale/countries/eu' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_countries_phones(self): - """List Countries Phone Codes""" - - params = {} - path = '/locale/countries/phones' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_currencies(self): - """List Currencies""" - - params = {} - path = '/locale/currencies' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) diff --git a/app/sdks/server-python/appwrite/services/storage.py b/app/sdks/server-python/appwrite/services/storage.py deleted file mode 100644 index 7e2a986f6e..0000000000 --- a/app/sdks/server-python/appwrite/services/storage.py +++ /dev/null @@ -1,108 +0,0 @@ -from ..service import Service - - -class Storage(Service): - - def __init__(self, client): - super(Storage, self).__init__(client) - - def list_files(self, search='', limit=25, offset=0, order_type='ASC'): - """List Files""" - - params = {} - path = '/storage/files' - params['search'] = search - params['limit'] = limit - params['offset'] = offset - params['orderType'] = order_type - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def create_file(self, file, read, write): - """Create File""" - - params = {} - path = '/storage/files' - params['file'] = file - params['read'] = read - params['write'] = write - - return self.client.call('post', path, { - 'content-type': 'multipart/form-data', - }, params) - - def get_file(self, file_id): - """Get File""" - - params = {} - path = '/storage/files/{fileId}' - path = path.replace('{fileId}', file_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def update_file(self, file_id, read, write): - """Update File""" - - params = {} - path = '/storage/files/{fileId}' - path = path.replace('{fileId}', file_id) - params['read'] = read - params['write'] = write - - return self.client.call('put', path, { - 'content-type': 'application/json', - }, params) - - def delete_file(self, file_id): - """Delete File""" - - params = {} - path = '/storage/files/{fileId}' - path = path.replace('{fileId}', file_id) - - return self.client.call('delete', path, { - 'content-type': 'application/json', - }, params) - - def get_file_download(self, file_id): - """Get File for Download""" - - params = {} - path = '/storage/files/{fileId}/download' - path = path.replace('{fileId}', file_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_file_preview(self, file_id, width=0, height=0, quality=100, background='', output=''): - """Get File Preview""" - - params = {} - path = '/storage/files/{fileId}/preview' - path = path.replace('{fileId}', file_id) - params['width'] = width - params['height'] = height - params['quality'] = quality - params['background'] = background - params['output'] = output - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_file_view(self, file_id, xas=''): - """Get File for View""" - - params = {} - path = '/storage/files/{fileId}/view' - path = path.replace('{fileId}', file_id) - params['as'] = xas - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) diff --git a/app/sdks/server-python/appwrite/services/teams.py b/app/sdks/server-python/appwrite/services/teams.py deleted file mode 100644 index cdc3780ad9..0000000000 --- a/app/sdks/server-python/appwrite/services/teams.py +++ /dev/null @@ -1,105 +0,0 @@ -from ..service import Service - - -class Teams(Service): - - def __init__(self, client): - super(Teams, self).__init__(client) - - def list(self, search='', limit=25, offset=0, order_type='ASC'): - """List Teams""" - - params = {} - path = '/teams' - params['search'] = search - params['limit'] = limit - params['offset'] = offset - params['orderType'] = order_type - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def create(self, name, roles=[]): - """Create Team""" - - params = {} - path = '/teams' - params['name'] = name - params['roles'] = roles - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def get(self, team_id): - """Get Team""" - - params = {} - path = '/teams/{teamId}' - path = path.replace('{teamId}', team_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def update(self, team_id, name): - """Update Team""" - - params = {} - path = '/teams/{teamId}' - path = path.replace('{teamId}', team_id) - params['name'] = name - - return self.client.call('put', path, { - 'content-type': 'application/json', - }, params) - - def delete(self, team_id): - """Delete Team""" - - params = {} - path = '/teams/{teamId}' - path = path.replace('{teamId}', team_id) - - return self.client.call('delete', path, { - 'content-type': 'application/json', - }, params) - - def get_memberships(self, team_id): - """Get Team Memberships""" - - params = {} - path = '/teams/{teamId}/memberships' - path = path.replace('{teamId}', team_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def create_membership(self, team_id, email, roles, url, name=''): - """Create Team Membership""" - - params = {} - path = '/teams/{teamId}/memberships' - path = path.replace('{teamId}', team_id) - params['email'] = email - params['name'] = name - params['roles'] = roles - params['url'] = url - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def delete_membership(self, team_id, invite_id): - """Delete Team Membership""" - - params = {} - path = '/teams/{teamId}/memberships/{inviteId}' - path = path.replace('{teamId}', team_id) - path = path.replace('{inviteId}', invite_id) - - return self.client.call('delete', path, { - 'content-type': 'application/json', - }, params) diff --git a/app/sdks/server-python/appwrite/services/users.py b/app/sdks/server-python/appwrite/services/users.py deleted file mode 100644 index 2608f07a50..0000000000 --- a/app/sdks/server-python/appwrite/services/users.py +++ /dev/null @@ -1,125 +0,0 @@ -from ..service import Service - - -class Users(Service): - - def __init__(self, client): - super(Users, self).__init__(client) - - def list(self, search='', limit=25, offset=0, order_type='ASC'): - """List Users""" - - params = {} - path = '/users' - params['search'] = search - params['limit'] = limit - params['offset'] = offset - params['orderType'] = order_type - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def create(self, email, password, name=''): - """Create User""" - - params = {} - path = '/users' - params['email'] = email - params['password'] = password - params['name'] = name - - return self.client.call('post', path, { - 'content-type': 'application/json', - }, params) - - def get(self, user_id): - """Get User""" - - params = {} - path = '/users/{userId}' - path = path.replace('{userId}', user_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_logs(self, user_id): - """Get User Logs""" - - params = {} - path = '/users/{userId}/logs' - path = path.replace('{userId}', user_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def get_prefs(self, user_id): - """Get User Preferences""" - - params = {} - path = '/users/{userId}/prefs' - path = path.replace('{userId}', user_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def update_prefs(self, user_id, prefs): - """Update User Preferences""" - - params = {} - path = '/users/{userId}/prefs' - path = path.replace('{userId}', user_id) - params['prefs'] = prefs - - return self.client.call('patch', path, { - 'content-type': 'application/json', - }, params) - - def get_sessions(self, user_id): - """Get User Sessions""" - - params = {} - path = '/users/{userId}/sessions' - path = path.replace('{userId}', user_id) - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - - def delete_sessions(self, user_id): - """Delete User Sessions""" - - params = {} - path = '/users/{userId}/sessions' - path = path.replace('{userId}', user_id) - - return self.client.call('delete', path, { - 'content-type': 'application/json', - }, params) - - def delete_session(self, user_id, session_id): - """Delete User Session""" - - params = {} - path = '/users/{userId}/sessions/{sessionId}' - path = path.replace('{userId}', user_id) - path = path.replace('{sessionId}', session_id) - - return self.client.call('delete', path, { - 'content-type': 'application/json', - }, params) - - def update_status(self, user_id, status): - """Update User Status""" - - params = {} - path = '/users/{userId}/status' - path = path.replace('{userId}', user_id) - params['status'] = status - - return self.client.call('patch', path, { - 'content-type': 'application/json', - }, params) diff --git a/app/sdks/server-python/docs/examples/functions/update-active.md b/app/sdks/server-python/docs/examples/functions/update-active.md deleted file mode 100644 index 72f8314055..0000000000 --- a/app/sdks/server-python/docs/examples/functions/update-active.md +++ /dev/null @@ -1,13 +0,0 @@ -from appwrite.client import Client -from appwrite.services.functions import Functions - -client = Client() - -(client - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -functions = Functions(client) - -result = functions.update_active('[FUNCTION_ID]', '[ACTIVE]') diff --git a/app/sdks/server-python/requirements.txt b/app/sdks/server-python/requirements.txt deleted file mode 100644 index e20605c43d..0000000000 --- a/app/sdks/server-python/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -requests==2.22.0 \ No newline at end of file diff --git a/app/sdks/server-python/setup.cfg b/app/sdks/server-python/setup.cfg deleted file mode 100644 index 224a77957f..0000000000 --- a/app/sdks/server-python/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[metadata] -description-file = README.md \ No newline at end of file diff --git a/app/sdks/server-python/setup.py b/app/sdks/server-python/setup.py deleted file mode 100644 index 8e2fd0c3cb..0000000000 --- a/app/sdks/server-python/setup.py +++ /dev/null @@ -1,30 +0,0 @@ -import setuptools - -setuptools.setup( - name = 'appwrite', - packages = ['appwrite', 'appwrite/services'], - version = '0.0.6', - license='BSD-3-Clause', - description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API', - author = 'Appwrite Team', - author_email = 'team@localhost.test', - maintainer = 'Appwrite Team', - maintainer_email = 'team@localhost.test', - url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/0.0.6.tar.gz', - # keywords = ['SOME', 'MEANINGFULL', 'KEYWORDS'], - install_requires=[ - 'requests', - ], - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers', - 'Environment :: Web Environment', - 'Topic :: Software Development', - 'License :: OSI Approved :: BSD License', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - ], -) diff --git a/app/sdks/server-ruby/CHANGELOG.md b/app/sdks/server-ruby/CHANGELOG.md deleted file mode 100644 index fa4d35e687..0000000000 --- a/app/sdks/server-ruby/CHANGELOG.md +++ /dev/null @@ -1 +0,0 @@ -# Change Log \ No newline at end of file diff --git a/app/sdks/server-ruby/Gemfile b/app/sdks/server-ruby/Gemfile deleted file mode 100644 index cd8aa9e04c..0000000000 --- a/app/sdks/server-ruby/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source 'https://rubygems.org' - -gemspec \ No newline at end of file diff --git a/app/sdks/server-ruby/LICENSE b/app/sdks/server-ruby/LICENSE deleted file mode 100644 index fc7c051a91..0000000000 --- a/app/sdks/server-ruby/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/app/sdks/server-ruby/README.md b/app/sdks/server-ruby/README.md deleted file mode 100644 index cbc2cf781c..0000000000 --- a/app/sdks/server-ruby/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# Appwrite Ruby SDK - -![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.6.1-blue.svg?v=1) - -**This SDK is compatible with Appwrite server version 0.6.1. For older versions, please check previous releases.** - -Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. - Use the Ruby SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. - For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) - - - -![Appwrite](https://appwrite.io/images/github.png) - -## Installation - -To install via [Gem](https://rubygems.org/): - -```bash -gem install appwrite --save -``` - -## Contribution - -This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request. - -## License - -Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. \ No newline at end of file diff --git a/app/sdks/server-ruby/appwrite.gemspec b/app/sdks/server-ruby/appwrite.gemspec deleted file mode 100644 index f550cecf9f..0000000000 --- a/app/sdks/server-ruby/appwrite.gemspec +++ /dev/null @@ -1,13 +0,0 @@ -Gem::Specification.new do |s| - - s.name = 'appwrite' - s.version = '1.0.11' - s.summary = "Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. - Use the Ruby SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. - For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)" - s.author = 'Appwrite Team' - s.homepage = 'https://appwrite.io/support' - s.email = 'team@localhost.test' - s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) - -end \ No newline at end of file diff --git a/app/sdks/server-ruby/lib/appwrite.rb b/app/sdks/server-ruby/lib/appwrite.rb deleted file mode 100644 index 1b4f38bea2..0000000000 --- a/app/sdks/server-ruby/lib/appwrite.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'net/http' -require 'uri' -require 'json' -require_relative 'appwrite/client' -require_relative 'appwrite/service' -require_relative 'appwrite/services/avatars' -require_relative 'appwrite/services/database' -require_relative 'appwrite/services/functions' -require_relative 'appwrite/services/health' -require_relative 'appwrite/services/locale' -require_relative 'appwrite/services/storage' -require_relative 'appwrite/services/teams' -require_relative 'appwrite/services/users' diff --git a/app/sdks/server-ruby/lib/appwrite/client.rb b/app/sdks/server-ruby/lib/appwrite/client.rb deleted file mode 100644 index 2cd09d52fe..0000000000 --- a/app/sdks/server-ruby/lib/appwrite/client.rb +++ /dev/null @@ -1,116 +0,0 @@ -require 'net/http' -require 'uri' -require 'json' -require 'cgi' - -module Appwrite - class Client - - METHOD_GET = 'get' - METHOD_POST = 'post' - METHOD_PUT = 'put' - METHOD_PATCH = 'patch' - METHOD_DELETE = 'delete' - METHOD_HEAD = 'head' - METHOD_OPTIONS = 'options' - METHOD_CONNECT = 'connect' - METHOD_TRACE = 'trace' - - def initialize() - @headers = { - 'content-type' => '', - 'user-agent' => RUBY_PLATFORM + ':ruby-' + RUBY_VERSION, - 'x-sdk-version' => 'appwrite:ruby:1.0.11' - } - @endpoint = 'https://appwrite.io/v1'; - end - - def set_project(value) - add_header('x-appwrite-project', value) - - return self - end - - def set_key(value) - add_header('x-appwrite-key', value) - - return self - end - - def set_locale(value) - add_header('x-appwrite-locale', value) - - return self - end - - def set_endpoint(endpoint) - @endpoint = endpoint - - return self - end - - def add_header(key, value) - @headers[key.downcase] = value.downcase - - return self - end - - def call(method, path = '', headers = {}, params = {}) - uri = URI.parse(@endpoint + path + ((method == METHOD_GET && params.length) ? '?' + encode(params) : '')) - return fetch(method, uri, headers, params) - end - - protected - - private - - def fetch(method, uri, headers, params, limit = 5) - raise ArgumentError, 'Too Many HTTP Redirects' if limit == 0 - - http = Net::HTTP.new(uri.host, uri.port) - http.use_ssl = (uri.scheme == 'https') - payload = '' - - headers = @headers.merge(headers) - - if (method != METHOD_GET) - case headers['content-type'][0, headers['content-type'].index(';') || headers['content-type'].length] - when 'application/json' - payload = params.to_json - else - payload = encode(params) - end - end - - begin - response = http.send_request(method.upcase, uri.request_uri, payload, headers) - rescue => error - raise 'Request Failed: ' + error.message - end - - # Handle Redirects - if (response.class == Net::HTTPRedirection || response.class == Net::HTTPMovedPermanently) - location = response['location'] - uri = URI.parse(uri.scheme + "://" + uri.host + "" + location) - - return fetch(method, uri, headers, {}, limit - 1) - end - - return JSON.parse(response.body); - end - - def encode(value, key = nil) - case value - when Hash then value.map { |k,v| encode(v, append_key(key,k)) }.join('&') - when Array then value.map { |v| encode(v, "#{key}[]") }.join('&') - when nil then '' - else - "#{key}=#{CGI.escape(value.to_s)}" - end - end - - def append_key(root_key, key) - root_key.nil? ? key : "#{root_key}[#{key.to_s}]" - end - end -end \ No newline at end of file diff --git a/app/sdks/server-ruby/lib/appwrite/service.rb b/app/sdks/server-ruby/lib/appwrite/service.rb deleted file mode 100644 index 0d954c6d17..0000000000 --- a/app/sdks/server-ruby/lib/appwrite/service.rb +++ /dev/null @@ -1,12 +0,0 @@ -module Appwrite - class Service - - def initialize(client) - @client = client - end - - protected - - private - end -end \ No newline at end of file diff --git a/app/sdks/server-ruby/lib/appwrite/services/avatars.rb b/app/sdks/server-ruby/lib/appwrite/services/avatars.rb deleted file mode 100644 index 2c8e8ee723..0000000000 --- a/app/sdks/server-ruby/lib/appwrite/services/avatars.rb +++ /dev/null @@ -1,95 +0,0 @@ -module Appwrite - class Avatars < Service - - def get_browser(code:, width: 100, height: 100, quality: 100) - path = '/avatars/browsers/{code}' - .gsub('{code}', code) - - params = { - 'width': width, - 'height': height, - 'quality': quality - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_credit_card(code:, width: 100, height: 100, quality: 100) - path = '/avatars/credit-cards/{code}' - .gsub('{code}', code) - - params = { - 'width': width, - 'height': height, - 'quality': quality - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_favicon(url:) - path = '/avatars/favicon' - - params = { - 'url': url - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_flag(code:, width: 100, height: 100, quality: 100) - path = '/avatars/flags/{code}' - .gsub('{code}', code) - - params = { - 'width': width, - 'height': height, - 'quality': quality - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_image(url:, width: 400, height: 400) - path = '/avatars/image' - - params = { - 'url': url, - 'width': width, - 'height': height - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_q_r(text:, size: 400, margin: 1, download: 0) - path = '/avatars/qr' - - params = { - 'text': text, - 'size': size, - 'margin': margin, - 'download': download - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - - protected - - private - end -end \ No newline at end of file diff --git a/app/sdks/server-ruby/lib/appwrite/services/database.rb b/app/sdks/server-ruby/lib/appwrite/services/database.rb deleted file mode 100644 index d8efcc34e1..0000000000 --- a/app/sdks/server-ruby/lib/appwrite/services/database.rb +++ /dev/null @@ -1,172 +0,0 @@ -module Appwrite - class Database < Service - - def list_collections(search: '', limit: 25, offset: 0, order_type: 'ASC') - path = '/database/collections' - - params = { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': order_type - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def create_collection(name:, read:, write:, rules:) - path = '/database/collections' - - params = { - 'name': name, - 'read': read, - 'write': write, - 'rules': rules - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_collection(collection_id:) - path = '/database/collections/{collectionId}' - .gsub('{collectionId}', collection_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def update_collection(collection_id:, name:, read:, write:, rules: []) - path = '/database/collections/{collectionId}' - .gsub('{collectionId}', collection_id) - - params = { - 'name': name, - 'read': read, - 'write': write, - 'rules': rules - } - - return @client.call('put', path, { - 'content-type' => 'application/json', - }, params); - end - - def delete_collection(collection_id:) - path = '/database/collections/{collectionId}' - .gsub('{collectionId}', collection_id) - - params = { - } - - return @client.call('delete', path, { - 'content-type' => 'application/json', - }, params); - end - - def list_documents(collection_id:, filters: [], offset: 0, limit: 50, order_field: '$id', order_type: 'ASC', order_cast: 'string', search: '', first: 0, last: 0) - path = '/database/collections/{collectionId}/documents' - .gsub('{collectionId}', collection_id) - - params = { - 'filters': filters, - 'offset': offset, - 'limit': limit, - 'orderField': order_field, - 'orderType': order_type, - 'orderCast': order_cast, - 'search': search, - 'first': first, - 'last': last - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def create_document(collection_id:, data:, read:, write:, parent_document: '', parent_property: '', parent_property_type: 'assign') - path = '/database/collections/{collectionId}/documents' - .gsub('{collectionId}', collection_id) - - params = { - 'data': data, - 'read': read, - 'write': write, - 'parentDocument': parent_document, - 'parentProperty': parent_property, - 'parentPropertyType': parent_property_type - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_document(collection_id:, document_id:) - path = '/database/collections/{collectionId}/documents/{documentId}' - .gsub('{collectionId}', collection_id) - .gsub('{documentId}', document_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def update_document(collection_id:, document_id:, data:, read:, write:) - path = '/database/collections/{collectionId}/documents/{documentId}' - .gsub('{collectionId}', collection_id) - .gsub('{documentId}', document_id) - - params = { - 'data': data, - 'read': read, - 'write': write - } - - return @client.call('patch', path, { - 'content-type' => 'application/json', - }, params); - end - - def delete_document(collection_id:, document_id:) - path = '/database/collections/{collectionId}/documents/{documentId}' - .gsub('{collectionId}', collection_id) - .gsub('{documentId}', document_id) - - params = { - } - - return @client.call('delete', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_collection_logs(collection_id:) - path = '/database/collections/{collectionId}/logs' - .gsub('{collectionId}', collection_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - - protected - - private - end -end \ No newline at end of file diff --git a/app/sdks/server-ruby/lib/appwrite/services/functions.rb b/app/sdks/server-ruby/lib/appwrite/services/functions.rb deleted file mode 100644 index e6fb0c5f12..0000000000 --- a/app/sdks/server-ruby/lib/appwrite/services/functions.rb +++ /dev/null @@ -1,193 +0,0 @@ -module Appwrite - class Functions < Service - - def list(search: '', limit: 25, offset: 0, order_type: 'ASC') - path = '/functions' - - params = { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': order_type - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def create(name:, vars: [], events: [], schedule: '', timeout: 15) - path = '/functions' - - params = { - 'name': name, - 'vars': vars, - 'events': events, - 'schedule': schedule, - 'timeout': timeout - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def get(function_id:) - path = '/functions/{functionId}' - .gsub('{function_id}', function_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def update(function_id:, name:, vars: [], events: [], schedule: '', timeout: 15) - path = '/functions/{functionId}' - .gsub('{function_id}', function_id) - - params = { - 'name': name, - 'vars': vars, - 'events': events, - 'schedule': schedule, - 'timeout': timeout - } - - return @client.call('put', path, { - 'content-type' => 'application/json', - }, params); - end - - def delete(function_id:) - path = '/functions/{functionId}' - .gsub('{function_id}', function_id) - - params = { - } - - return @client.call('delete', path, { - 'content-type' => 'application/json', - }, params); - end - - def list_executions(function_id:, search: '', limit: 25, offset: 0, order_type: 'ASC') - path = '/functions/{functionId}/executions' - .gsub('{function_id}', function_id) - - params = { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': order_type - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def create_execution(function_id:, async: 1) - path = '/functions/{functionId}/executions' - .gsub('{function_id}', function_id) - - params = { - 'async': async - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_execution(function_id:, execution_id:) - path = '/functions/{functionId}/executions/{executionId}' - .gsub('{function_id}', function_id) - .gsub('{execution_id}', execution_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def update_tag(function_id:, tag:) - path = '/functions/{functionId}/tag' - .gsub('{function_id}', function_id) - - params = { - 'tag': tag - } - - return @client.call('patch', path, { - 'content-type' => 'application/json', - }, params); - end - - def list_tags(function_id:, search: '', limit: 25, offset: 0, order_type: 'ASC') - path = '/functions/{functionId}/tags' - .gsub('{function_id}', function_id) - - params = { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': order_type - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def create_tag(function_id:, env:, command:, code:) - path = '/functions/{functionId}/tags' - .gsub('{function_id}', function_id) - - params = { - 'env': env, - 'command': command, - 'code': code - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_tag(function_id:, tag_id:) - path = '/functions/{functionId}/tags/{tagId}' - .gsub('{function_id}', function_id) - .gsub('{tag_id}', tag_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def delete_tag(function_id:, tag_id:) - path = '/functions/{functionId}/tags/{tagId}' - .gsub('{function_id}', function_id) - .gsub('{tag_id}', tag_id) - - params = { - } - - return @client.call('delete', path, { - 'content-type' => 'application/json', - }, params); - end - - - protected - - private - end -end \ No newline at end of file diff --git a/app/sdks/server-ruby/lib/appwrite/services/health.rb b/app/sdks/server-ruby/lib/appwrite/services/health.rb deleted file mode 100644 index d2c6bc7b60..0000000000 --- a/app/sdks/server-ruby/lib/appwrite/services/health.rb +++ /dev/null @@ -1,141 +0,0 @@ -module Appwrite - class Health < Service - - def get() - path = '/health' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_anti_virus() - path = '/health/anti-virus' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_cache() - path = '/health/cache' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_d_b() - path = '/health/db' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_queue_certificates() - path = '/health/queue/certificates' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_queue_functions() - path = '/health/queue/functions' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_queue_logs() - path = '/health/queue/logs' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_queue_tasks() - path = '/health/queue/tasks' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_queue_usage() - path = '/health/queue/usage' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_queue_webhooks() - path = '/health/queue/webhooks' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_storage_local() - path = '/health/storage/local' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_time() - path = '/health/time' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - - protected - - private - end -end \ No newline at end of file diff --git a/app/sdks/server-ruby/lib/appwrite/services/locale.rb b/app/sdks/server-ruby/lib/appwrite/services/locale.rb deleted file mode 100644 index 707c8b2f4a..0000000000 --- a/app/sdks/server-ruby/lib/appwrite/services/locale.rb +++ /dev/null @@ -1,75 +0,0 @@ -module Appwrite - class Locale < Service - - def get() - path = '/locale' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_continents() - path = '/locale/continents' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_countries() - path = '/locale/countries' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_countries_e_u() - path = '/locale/countries/eu' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_countries_phones() - path = '/locale/countries/phones' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_currencies() - path = '/locale/currencies' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - - protected - - private - end -end \ No newline at end of file diff --git a/app/sdks/server-ruby/lib/appwrite/services/storage.rb b/app/sdks/server-ruby/lib/appwrite/services/storage.rb deleted file mode 100644 index 0e99a2b0d5..0000000000 --- a/app/sdks/server-ruby/lib/appwrite/services/storage.rb +++ /dev/null @@ -1,118 +0,0 @@ -module Appwrite - class Storage < Service - - def list_files(search: '', limit: 25, offset: 0, order_type: 'ASC') - path = '/storage/files' - - params = { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': order_type - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def create_file(file:, read:, write:) - path = '/storage/files' - - params = { - 'file': file, - 'read': read, - 'write': write - } - - return @client.call('post', path, { - 'content-type' => 'multipart/form-data', - }, params); - end - - def get_file(file_id:) - path = '/storage/files/{fileId}' - .gsub('{fileId}', file_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def update_file(file_id:, read:, write:) - path = '/storage/files/{fileId}' - .gsub('{fileId}', file_id) - - params = { - 'read': read, - 'write': write - } - - return @client.call('put', path, { - 'content-type' => 'application/json', - }, params); - end - - def delete_file(file_id:) - path = '/storage/files/{fileId}' - .gsub('{fileId}', file_id) - - params = { - } - - return @client.call('delete', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_file_download(file_id:) - path = '/storage/files/{fileId}/download' - .gsub('{fileId}', file_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_file_preview(file_id:, width: 0, height: 0, quality: 100, background: '', output: '') - path = '/storage/files/{fileId}/preview' - .gsub('{fileId}', file_id) - - params = { - 'width': width, - 'height': height, - 'quality': quality, - 'background': background, - 'output': output - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_file_view(file_id:, as: '') - path = '/storage/files/{fileId}/view' - .gsub('{fileId}', file_id) - - params = { - 'as': as - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - - protected - - private - end -end \ No newline at end of file diff --git a/app/sdks/server-ruby/lib/appwrite/services/teams.rb b/app/sdks/server-ruby/lib/appwrite/services/teams.rb deleted file mode 100644 index 0e677476d2..0000000000 --- a/app/sdks/server-ruby/lib/appwrite/services/teams.rb +++ /dev/null @@ -1,115 +0,0 @@ -module Appwrite - class Teams < Service - - def list(search: '', limit: 25, offset: 0, order_type: 'ASC') - path = '/teams' - - params = { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': order_type - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def create(name:, roles: ["owner"]) - path = '/teams' - - params = { - 'name': name, - 'roles': roles - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def get(team_id:) - path = '/teams/{teamId}' - .gsub('{teamId}', team_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def update(team_id:, name:) - path = '/teams/{teamId}' - .gsub('{teamId}', team_id) - - params = { - 'name': name - } - - return @client.call('put', path, { - 'content-type' => 'application/json', - }, params); - end - - def delete(team_id:) - path = '/teams/{teamId}' - .gsub('{teamId}', team_id) - - params = { - } - - return @client.call('delete', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_memberships(team_id:) - path = '/teams/{teamId}/memberships' - .gsub('{teamId}', team_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def create_membership(team_id:, email:, roles:, url:, name: '') - path = '/teams/{teamId}/memberships' - .gsub('{teamId}', team_id) - - params = { - 'email': email, - 'name': name, - 'roles': roles, - 'url': url - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def delete_membership(team_id:, invite_id:) - path = '/teams/{teamId}/memberships/{inviteId}' - .gsub('{teamId}', team_id) - .gsub('{inviteId}', invite_id) - - params = { - } - - return @client.call('delete', path, { - 'content-type' => 'application/json', - }, params); - end - - - protected - - private - end -end \ No newline at end of file diff --git a/app/sdks/server-ruby/lib/appwrite/services/users.rb b/app/sdks/server-ruby/lib/appwrite/services/users.rb deleted file mode 100644 index f75434bd1a..0000000000 --- a/app/sdks/server-ruby/lib/appwrite/services/users.rb +++ /dev/null @@ -1,137 +0,0 @@ -module Appwrite - class Users < Service - - def list(search: '', limit: 25, offset: 0, order_type: 'ASC') - path = '/users' - - params = { - 'search': search, - 'limit': limit, - 'offset': offset, - 'orderType': order_type - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def create(email:, password:, name: '') - path = '/users' - - params = { - 'email': email, - 'password': password, - 'name': name - } - - return @client.call('post', path, { - 'content-type' => 'application/json', - }, params); - end - - def get(user_id:) - path = '/users/{userId}' - .gsub('{userId}', user_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_logs(user_id:) - path = '/users/{userId}/logs' - .gsub('{userId}', user_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_prefs(user_id:) - path = '/users/{userId}/prefs' - .gsub('{userId}', user_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def update_prefs(user_id:, prefs:) - path = '/users/{userId}/prefs' - .gsub('{userId}', user_id) - - params = { - 'prefs': prefs - } - - return @client.call('patch', path, { - 'content-type' => 'application/json', - }, params); - end - - def get_sessions(user_id:) - path = '/users/{userId}/sessions' - .gsub('{userId}', user_id) - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - - def delete_sessions(user_id:) - path = '/users/{userId}/sessions' - .gsub('{userId}', user_id) - - params = { - } - - return @client.call('delete', path, { - 'content-type' => 'application/json', - }, params); - end - - def delete_session(user_id:, session_id:) - path = '/users/{userId}/sessions/{sessionId}' - .gsub('{userId}', user_id) - .gsub('{sessionId}', session_id) - - params = { - } - - return @client.call('delete', path, { - 'content-type' => 'application/json', - }, params); - end - - def update_status(user_id:, status:) - path = '/users/{userId}/status' - .gsub('{userId}', user_id) - - params = { - 'status': status - } - - return @client.call('patch', path, { - 'content-type' => 'application/json', - }, params); - end - - - protected - - private - end -end \ No newline at end of file diff --git a/app/tasks/maintenance.php b/app/tasks/maintenance.php new file mode 100644 index 0000000000..f8786bcac8 --- /dev/null +++ b/app/tasks/maintenance.php @@ -0,0 +1,67 @@ +setAdapter(new RedisAdapter(new MySQLAdapter($register), $register)); + $consoleDB->setNamespace('app_console'); // Main DB + $consoleDB->setMocks(Config::getParam('collections', [])); + return $consoleDB; +} + +function notifyDeleteExecutionLogs() +{ + Resque::enqueue(Event::DELETE_QUEUE_NAME, Event::DELETE_CLASS_NAME, [ + 'type' => DELETE_TYPE_EXECUTIONS + ]); +} + +function notifyDeleteAbuseLogs(int $interval) +{ + Resque::enqueue(Event::DELETE_QUEUE_NAME, Event::DELETE_CLASS_NAME, [ + 'type' => DELETE_TYPE_ABUSE, + 'timestamp' => time() - $interval + ]); +} + +function notifyDeleteAuditLogs(int $interval) +{ + Resque::enqueue(Event::DELETE_QUEUE_NAME, Event::DELETE_CLASS_NAME, [ + 'type' => DELETE_TYPE_AUDIT, + 'timestamp' => time() - $interval + ]); +} + +$cli + ->task('maintenance') + ->desc('Schedules maintenance tasks and publishes them to resque') + ->action(function () { + // # of days in seconds (1 day = 86400s) + $interval = (int) App::getEnv('_APP_MAINTENANCE_INTERVAL', '86400'); + //Convert Seconds to microseconds + $intervalMicroseconds = $interval * 1000000; + + $consoleDB = getConsoleDB(); + + Console::loop(function() use ($consoleDB, $interval){ + Console::info("[ MAINTENANCE TASK ] Notifying deletes workers every {$interval} seconds"); + notifyDeleteExecutionLogs(); + notifyDeleteAbuseLogs($interval); + notifyDeleteAuditLogs($interval); + + }, $intervalMicroseconds); + + }); \ No newline at end of file diff --git a/app/tasks/sdks.php b/app/tasks/sdks.php index 364b326062..857b4de7b5 100644 --- a/app/tasks/sdks.php +++ b/app/tasks/sdks.php @@ -5,7 +5,7 @@ use Utopia\CLI\Console; use Appwrite\Spec\Swagger2; use Appwrite\SDK\SDK; use Appwrite\SDK\Language\PHP; -use Appwrite\SDK\Language\JS; +use Appwrite\SDK\Language\Web; use Appwrite\SDK\Language\Node; use Appwrite\SDK\Language\Python; use Appwrite\SDK\Language\Ruby; @@ -36,8 +36,9 @@ $cli $platforms = Config::getParam('platforms'); $selected = \strtolower(Console::confirm('Choose SDK ("*" for all):')); $version = Console::confirm('Choose an Appwrite version'); - $message = Console::confirm('Please enter your commit message:'); - $production = (Console::confirm('Type "Appwrite" to deploy for production') == 'Appwrite'); + $git = (Console::confirm('Should we use git push? (yes/no)') == 'yes'); + $production = ($git) ? (Console::confirm('Type "Appwrite" to push code to production git repos') == 'Appwrite') : false; + $message = ($git) ? Console::confirm('Please enter your commit message:') : ''; $warning = '**This SDK is compatible with Appwrite server version ' . $version . '. For older versions, please check previous releases.**'; if(!in_array($version, ['0.6.2', '0.7.0'])) { @@ -60,6 +61,7 @@ $cli $spec = file_get_contents(__DIR__.'/../config/specs/'.$version.'.'.$language['family'].'.json'); $result = \realpath(__DIR__.'/..').'/sdks/'.$key.'-'.$language['key']; + $resultExamples = \realpath(__DIR__.'/../..').'/docs/examples/'.$version.'/'.$key.'-'.$language['key']; $target = \realpath(__DIR__.'/..').'/sdks/git/'.$language['key'].'/'; $readme = \realpath(__DIR__ . '/../../docs/sdks/'.$language['key'].'/README.md'); $readme = ($readme) ? \file_get_contents($readme) : ''; @@ -84,7 +86,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND switch ($language['key']) { case 'web': - $config = new JS(); + $config = new Web(); $config->setNPMPackage('appwrite'); $config->setBowerPackage('appwrite'); break; @@ -173,35 +175,39 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND } $gitUrl = $language['gitUrl']; - - if(empty($gitUrl)) { - continue; - } - + if(!$production) { $gitUrl = 'git@github.com:aw-tests/'.$language['gitRepoName'].'.git'; } + + if($git && !empty($gitUrl)) { + \exec('rm -rf '.$target.' && \ + mkdir -p '.$target.' && \ + cd '.$target.' && \ + git init && \ + git remote add origin '.$gitUrl.' && \ + git fetch && \ + git pull '.$gitUrl.' && \ + rm -rf '.$target.'/* && \ + cp -r '.$result.'/ '.$target.'/ && \ + git add . && \ + git commit -m "'.$message.'" && \ + git push -u origin master + '); - \exec('rm -rf '.$target.' && \ - mkdir -p '.$target.' && \ - cd '.$target.' && \ - git init && \ - git remote add origin '.$gitUrl.' && \ - git fetch && \ - git pull '.$gitUrl.' && \ - rm -rf '.$target.'/* && \ - cp -r '.$result.'/ '.$target.'/ && \ - git add . && \ - git commit -m "'.$message.'" && \ - git push -u origin master'); + Console::success("Pushed {$language['name']} SDK to {$gitUrl}"); - Console::success("Pushed {$language['name']} SDK to {$gitUrl}"); - - \exec('rm -rf '.$target); + \exec('rm -rf '.$target); + Console::success("Remove temp directory '{$target}' for {$language['name']} SDK"); + } - Console::success("Remove temp directory '{$target}' for {$language['name']} SDK"); + \exec('mkdir -p '.$resultExamples.' && cp -r '.$result.'/docs/examples '.$resultExamples); + Console::success("Copied code examples for {$language['name']} SDK to: {$resultExamples}"); + + \exec('rm -rf '.$result); + Console::success("Removed source code directory '{$result}' for {$language['name']} SDK"); } } exit(); - }); \ No newline at end of file + }); diff --git a/app/views/console/home/index.phtml b/app/views/console/home/index.phtml index f11dfe35c2..173336728e 100644 --- a/app/views/console/home/index.phtml +++ b/app/views/console/home/index.phtml @@ -85,11 +85,11 @@ $graph = $this->getParam('graph', false);
0
Bandwidth
- + @@ -245,7 +245,7 @@ $graph = $this->getParam('graph', false);
Next Steps
-

After adding your new website, install our JS SDK to integrate with your code and read our getting started tutorial.

+

After adding your new website, install our Web SDK to integrate with your code and read our getting started tutorial.

npm install appwrite
diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index b07aa5238e..5d74fd8ef9 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -81,6 +81,9 @@ services: - _APP_STORAGE_LIMIT - _APP_FUNCTIONS_TIMEOUT - _APP_FUNCTIONS_CONTAINERS + - _APP_FUNCTIONS_CPUS + - _APP_FUNCTIONS_MEMORY + - _APP_FUNCTIONS_MEMORY_SWAP appwrite-worker-usage: image: appwrite/appwrite: @@ -220,8 +223,8 @@ services: - mariadb volumes: - /var/run/docker.sock:/var/run/docker.sock - - /tmp:/tmp:rw - appwrite-functions:/storage/functions:rw + - /tmp:/tmp:rw environment: - _APP_ENV - _APP_REDIS_HOST @@ -233,6 +236,9 @@ services: - _APP_DB_PASS - _APP_FUNCTIONS_TIMEOUT - _APP_FUNCTIONS_CONTAINERS + - _APP_FUNCTIONS_CPUS + - _APP_FUNCTIONS_MEMORY + - _APP_FUNCTIONS_MEMORY_SWAP appwrite-worker-mails: image: appwrite/appwrite: @@ -255,6 +261,27 @@ services: - _APP_SMTP_SECURE - _APP_SMTP_USERNAME - _APP_SMTP_PASSWORD + + appwrite-maintenance: + entrypoint: maintenance + container_name: appwrite-maintenance + build: + context: . + restart: unless-stopped + networks: + - appwrite + depends_on: + - redis + environment: + - _APP_ENV + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_MAINTENANCE_INTERVAL + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS appwrite-schedule: image: appwrite/appwrite: diff --git a/app/workers/deletes.php b/app/workers/deletes.php index 3f8acfe777..36d68f0f9f 100644 --- a/app/workers/deletes.php +++ b/app/workers/deletes.php @@ -1,22 +1,27 @@ args['projectId']; - $document = $this->args['document']; - - $document = new Document($document); + $projectId = $this->args['projectId']; + $type = $this->args['type']; - switch (strval($document->getCollection())) { - case Database::SYSTEM_COLLECTION_PROJECTS: - $this->deleteProject($document); + switch (strval($type)) { + case DELETE_TYPE_DOCUMENT: + $document = $this->args['document']; + $document = new Document($document); + switch (strval($document->getCollection())) { + case Database::SYSTEM_COLLECTION_PROJECTS: + $this->deleteProject($document); + break; + case Database::SYSTEM_COLLECTION_FUNCTIONS: + $this->deleteFunction($document, $projectId); + break; + case Database::SYSTEM_COLLECTION_USERS: + $this->deleteUser($document, $projectId); + break; + case Database::SYSTEM_COLLECTION_COLLECTIONS: + $this->deleteDocuments($document, $projectId); + break; + default: + Console::error('No lazy delete operation available for document of type: '.$document->getCollection()); + break; + } break; - case Database::SYSTEM_COLLECTION_FUNCTIONS: - $this->deleteFunction($document, $projectId); + + case DELETE_TYPE_EXECUTIONS: + $this->deleteExecutionLogs(); break; - case Database::SYSTEM_COLLECTION_USERS: - $this->deleteUser($document, $projectId); + + case DELETE_TYPE_AUDIT: + $this->deleteAuditLogs($this->args['timestamp']); break; - case Database::SYSTEM_COLLECTION_COLLECTIONS: - $this->deleteDocuments($document, $projectId); + + case DELETE_TYPE_ABUSE: + $this->deleteAbuseLogs($this->args['timestamp']); break; + default: - Console::error('No lazy delete operation available for document of type: '.$document->getCollection()); + Console::error('No delete operation for type: '.$type); break; - } + + } } public function tearDown(): void @@ -84,7 +110,7 @@ class DeletesV1 foreach ($tokens as $token) { if (!$this->getProjectDB($projectId)->deleteDocument($token->getId())) { - throw new Exception('Failed to remove token from DB', 500); + throw new Exception('Failed to remove token from DB'); } } @@ -95,6 +121,59 @@ class DeletesV1 ], $this->getProjectDB($projectId)); } + protected function deleteExecutionLogs() + { + $this->deleteForProjectIds(function($projectId) { + if (!($projectDB = $this->getProjectDB($projectId))) { + throw new Exception('Failed to get projectDB for project '.$projectId); + } + + // Delete Executions + $this->deleteByGroup([ + '$collection='.Database::SYSTEM_COLLECTION_EXECUTIONS + ], $projectDB); + }); + } + + protected function deleteAbuseLogs($timestamp) + { + global $register; + if($timestamp == 0) { + throw new Exception('Failed to delete audit logs. No timestamp provided'); + } + + $timeLimit = new TimeLimit("", 0, 1, function () use ($register) { + return $register->get('db'); + }); + + $this->deleteForProjectIds(function($projectId) use ($timeLimit, $timestamp){ + $timeLimit->setNamespace('app_'.$projectId); + $abuse = new Abuse($timeLimit); + + $status = $abuse->cleanup($timestamp); + if (!$status) { + throw new Exception('Failed to delete Abuse logs for project '.$projectId); + } + }); + } + + protected function deleteAuditLogs($timestamp) + { + global $register; + if($timestamp == 0) { + throw new Exception('Failed to delete audit logs. No timestamp provided'); + } + $this->deleteForProjectIds(function($projectId) use ($register, $timestamp){ + $adapter = new AuditAdapter($register->get('db')); + $adapter->setNamespace('app_'.$projectId); + $audit = new Audit($adapter); + $status = $audit->cleanup($timestamp); + if (!$status) { + throw new Exception('Failed to delete Audit logs for project'.$projectId); + } + }); + } + protected function deleteFunction(Document $document, $projectId) { $projectDB = $this->getProjectDB($projectId); @@ -142,6 +221,48 @@ class DeletesV1 Authorization::reset(); } + protected function deleteForProjectIds(callable $callback) + { + $count = 0; + $chunk = 0; + $limit = 50; + $projects = []; + $sum = $limit; + + $executionStart = \microtime(true); + + while($sum === $limit) { + $chunk++; + + Authorization::disable(); + $projects = $this->getConsoleDB()->getCollection([ + 'limit' => $limit, + 'offset' => $count, + 'orderType' => 'ASC', + 'orderCast' => 'string', + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_PROJECTS, + ], + ]); + Authorization::reset(); + + $projectIds = array_map (function ($project) { + return $project->getId(); + }, $projects); + + $sum = count($projects); + + Console::info('Executing delete function for chunk #'.$chunk.'. Found '.$sum.' projects'); + foreach ($projectIds as $projectId) { + $callback($projectId); + $count++; + } + } + + $executionEnd = \microtime(true); + Console::info("Found {$count} projects " . ($executionEnd - $executionStart) . " seconds"); + } + protected function deleteByGroup(array $filters, Database $database, callable $callback = null) { $count = 0; @@ -159,7 +280,10 @@ class DeletesV1 $results = $database->getCollection([ 'limit' => $limit, - 'offset' => 0, + 'offset' => $count, + 'orderField' => '$id', + 'orderType' => 'ASC', + 'orderCast' => 'string', 'filters' => $filters, ]); diff --git a/app/workers/functions.php b/app/workers/functions.php index 2967430267..4bacc120b4 100644 --- a/app/workers/functions.php +++ b/app/workers/functions.php @@ -4,9 +4,12 @@ ini_set('display_startup_errors', 1); error_reporting(E_ALL); use Appwrite\Database\Database; +use Appwrite\Database\Document; use Appwrite\Database\Adapter\MySQL as MySQLAdapter; use Appwrite\Database\Adapter\Redis as RedisAdapter; use Appwrite\Database\Validator\Authorization; +use Appwrite\Event\Event; +use Swoole\Runtime; use Utopia\App; use Utopia\CLI\Console; use Utopia\Config\Config; @@ -15,19 +18,26 @@ require_once __DIR__.'/../init.php'; \cli_set_process_title('Functions V1 Worker'); +Runtime::setHookFlags(SWOOLE_HOOK_ALL); + Console::success(APP_NAME.' functions worker v1 has started'); $environments = Config::getParam('environments'); +/** + * Warmup Docker Images + */ $warmupStart = \microtime(true); -Co\run(function() use ($environments) { - foreach($environments as $environment) { // Warmup: make sure images are ready to run fast 🚀 +Co\run(function() use ($environments) { // Warmup: make sure images are ready to run fast 🚀 + Swoole\Runtime::enableCoroutine(SWOOLE_HOOK_ALL); + + foreach($environments as $environment) { go(function() use ($environment) { $stdout = ''; $stderr = ''; - Console::info('Warming up '.$environment['name'].' environment'); + Console::info('Warming up '.$environment['name'].' environment...'); Console::execute('docker pull '.$environment['image'], '', $stdout, $stderr); @@ -47,6 +57,62 @@ $warmupTime = $warmupEnd - $warmupStart; Console::success('Finished warmup in '.$warmupTime.' seconds'); +/** + * List function servers + */ +$stdout = ''; +$stderr = ''; + +$exitCode = Console::execute('docker ps --all --format "name={{.Names}}&status={{.Status}}&labels={{.Labels}}" --filter label=appwrite-type=function' + , '', $stdout, $stderr, 30); + +$executionStart = \microtime(true); + +$exitCode = Console::execute('docker ps --all --format "name={{.Names}}&status={{.Status}}&labels={{.Labels}}" --filter label=appwrite-type=function' + , '', $stdout, $stderr, 30); + +$executionEnd = \microtime(true); + +$list = []; +$stdout = \explode("\n", $stdout); + +\array_map(function($value) use (&$list) { + $container = []; + + \parse_str($value, $container); + + if(isset($container['name'])) { + // $labels = []; + // $temp = explode(',', $container['labels'] ?? []); + + // foreach($temp as &$label) { + // $label = explode('=', $label); + // $labels[$label[0] || 0] = $label[1] || ''; + // } + + $container = [ + 'name' => $container['name'], + 'online' => (\substr($container['status'], 0, 2) === 'Up'), + 'status' => $container['status'], + 'labels' => $container['labels'], + ]; + + \array_map(function($value) use (&$container) { + $value = \explode('=', $value); + + if(isset($value[0]) && isset($value[1])) { + $container[$value[0]] = $value[1]; + } + }, \explode(',', $container['labels'])); + + $list[$container['name']] = $container; + } +}, $stdout); + +var_dump(json_encode($list)); + +Console::info(count($list)." functions listed in " . ($executionEnd - $executionStart) . " seconds with exit code {$exitCode}"); + /* * 1. Get Original Task * 2. Check for updates @@ -69,8 +135,8 @@ Console::success('Finished warmup in '.$warmupTime.' seconds'); * + pass one-time api key * 4. Update execution status - DONE * 5. Update execution stdout & stderr - DONE - * 6. Trigger audit log - * 7. Trigger usage log + * 6. Trigger audit log - DONE + * 7. Trigger usage log - DONE */ //TODO aviod scheduled execution if delay is bigger than X offest @@ -88,46 +154,141 @@ Console::success('Finished warmup in '.$warmupTime.' seconds'); /** * Get Usage Stats * -> Network (docker stats --no-stream --format="{{.NetIO}}" appwrite) - * -> CPU Time - * -> Invoctions (+1) - * Report to usage worker + * -> CPU Time - DONE + * -> Invoctions (+1) - DONE */ -// Double-check Cleanup - class FunctionsV1 { public $args = []; + public $allowed = []; + public function setUp(): void { } public function perform() { - global $environments, $register; + global $register; - $projectId = $this->args['projectId']; - $functionId = $this->args['functionId']; - $functionTag = $this->args['functionTag']; - $executionId = $this->args['executionId']; - $functionTrigger = $this->args['functionTrigger']; + $projectId = $this->args['projectId'] ?? ''; + $functionId = $this->args['functionId'] ?? ''; + $executionId = $this->args['executionId'] ?? ''; + $trigger = $this->args['trigger'] ?? ''; + $event = $this->args['event'] ?? ''; + $payload = (!empty($this->args['payload'])) ? json_encode($this->args['payload']) : ''; - $projectDB = new Database(); - $projectDB->setAdapter(new RedisAdapter(new MySQLAdapter($register), $register)); - $projectDB->setNamespace('app_'.$projectId); - $projectDB->setMocks(Config::getParam('collections', [])); + $database = new Database(); + $database->setAdapter(new RedisAdapter(new MySQLAdapter($register), $register)); + $database->setNamespace('app_'.$projectId); + $database->setMocks(Config::getParam('collections', [])); - Authorization::disable(); - $function = $projectDB->getDocument($functionId); - Authorization::reset(); + switch ($trigger) { + case 'event': + $limit = 30; + $sum = 30; + $offset = 0; + $functions = []; /** @var Document[] $functions */ - if (empty($function->getId()) || Database::SYSTEM_COLLECTION_FUNCTIONS != $function->getCollection()) { - throw new Exception('Function not found', 404); + while ($sum >= $limit) { + + Authorization::disable(); + + $functions = $database->getCollection([ + 'limit' => $limit, + 'offset' => $offset, + 'orderField' => 'name', + 'orderType' => 'ASC', + 'orderCast' => 'string', + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_FUNCTIONS, + ], + ]); + + Authorization::reset(); + + $sum = \count($functions); + $offset = $offset + $limit; + + Console::log('Fetched '.$sum.' functions...'); + + foreach($functions as $function) { + $events = $function->getAttribute('events', []); + $tag = $function->getAttribute('tag', []); + + Console::success('Itterating function: '.$function->getAttribute('name')); + + if(!\in_array($event, $events) || empty($tag)) { + continue; + } + + Console::success('Triggered function: '.$event); + + Swoole\Coroutine\run(function () use ($projectId, $database, $function, $event, $payload) { + $this->execute('event', $projectId, '', $database, $function, $event, $payload); + }); + } + } + break; + + case 'schedule': + /* + * 1. Get Original Task + * 2. Check for updates + * If has updates skip task and don't reschedule + * If status not equal to play skip task + * 3. Check next run date, update task and add new job at the given date + * 4. Execute task (set optional timeout) + * 5. Update task response to log + * On success reset error count + * On failure add error count + * If error count bigger than allowed change status to pause + */ + + break; + + case 'http': + Authorization::disable(); + $function = $database->getDocument($functionId); + Authorization::reset(); + + if (empty($function->getId()) || Database::SYSTEM_COLLECTION_FUNCTIONS != $function->getCollection()) { + throw new Exception('Function not found ('.$functionId.')'); + } + + Swoole\Coroutine\run(function () use ($trigger, $projectId, $executionId, $database, $function) { + $this->execute($trigger, $projectId, $executionId, $database, $function); + }); + break; + + default: + # code... + break; } + } + + /** + * Execute function tag + * + * @param string $trigger + * @param string $projectId + * @param string $executionId + * @param Database $database + * @param Database $function + * @param string $event + * @param string $payload + * + * @return void + */ + public function execute(string $trigger, string $projectId, string $executionId, Database $database, Document $function, string $event = '', string $payload = ''): void + { + global $list; + + $environments = Config::getParam('environments'); Authorization::disable(); - $tag = $projectDB->getDocument($functionTag); + $tag = $database->getDocument($function->getAttribute('tag', '')); Authorization::reset(); if($tag->getAttribute('functionId') !== $function->getId()) { @@ -136,27 +297,24 @@ class FunctionsV1 Authorization::disable(); - $execution = $projectDB->getDocument($executionId); + $execution = (!empty($executionId)) ? $database->getDocument($executionId) : $database->createDocument([ + '$collection' => Database::SYSTEM_COLLECTION_EXECUTIONS, + '$permissions' => [ + 'read' => [], + 'write' => [], + ], + 'dateCreated' => time(), + 'functionId' => $function->getId(), + 'trigger' => $trigger, // http / schedule / event + 'status' => 'processing', // waiting / processing / completed / failed + 'exitCode' => 0, + 'stdout' => '', + 'stderr' => '', + 'time' => 0, + ]); - if (empty($execution->getId()) || Database::SYSTEM_COLLECTION_EXECUTIONS != $execution->getCollection()) { - $execution = $projectDB->createDocument([ - '$collection' => Database::SYSTEM_COLLECTION_EXECUTIONS, - '$permissions' => [ - 'read' => [], - 'write' => [], - ], - 'dateCreated' => \time(), - 'functionId' => $function->getId(), - 'status' => 'processing', // waiting / processing / completed / failed - 'exitCode' => 0, - 'stdout' => '', - 'stderr' => '', - 'time' => 0, - ]); - - if (false === $execution) { - throw new Exception('Failed saving execution to DB', 500); - } + if(false === $execution) { + throw new Exception('Failed to create execution'); } Authorization::reset(); @@ -170,27 +328,30 @@ class FunctionsV1 } $vars = \array_merge($function->getAttribute('vars', []), [ - 'APPWRITE_FUNCTION_ID' => $functionId, + 'APPWRITE_FUNCTION_ID' => $function->getId(), 'APPWRITE_FUNCTION_NAME' => $function->getAttribute('name', ''), - 'APPWRITE_FUNCTION_TAG' => $functionTag, - 'APPWRITE_FUNCTION_TRIGGER' => $functionTrigger, + 'APPWRITE_FUNCTION_TAG' => $tag->getId(), + 'APPWRITE_FUNCTION_TRIGGER' => $trigger, 'APPWRITE_FUNCTION_ENV_NAME' => $environment['name'], 'APPWRITE_FUNCTION_ENV_VERSION' => $environment['version'], + 'APPWRITE_FUNCTION_EVENT' => $event, + 'APPWRITE_FUNCTION_EVENT_PAYLOAD' => $payload, ]); \array_walk($vars, function (&$value, $key) { - $value = (empty($value)) ? 'null' : $value; + $key = $this->filterEnvKey($key); + $value = \escapeshellarg((empty($value)) ? 'null' : $value); $value = "\t\t\t--env {$key}={$value} \\"; }); - $tagPath = $tag->getAttribute('codePath', ''); + $tagPath = $tag->getAttribute('path', ''); $tagPathTarget = '/tmp/project-'.$projectId.'/'.$tag->getId().'/code.tar.gz'; $tagPathTargetDir = \pathinfo($tagPathTarget, PATHINFO_DIRNAME); $container = 'appwrite-function-'.$tag->getId(); $command = \escapeshellcmd($tag->getAttribute('command', '')); if(!\is_readable($tagPath)) { - throw new Exception('Code is not readable: '.$tag->getAttribute('codePath', '')); + throw new Exception('Code is not readable: '.$tag->getAttribute('path', '')); } if (!\file_exists($tagPathTargetDir)) { @@ -205,47 +366,7 @@ class FunctionsV1 } } - $stdout = ''; - $stderr = ''; - - $executionStart = \microtime(true); - - $exitCode = Console::execute('docker ps --all --format "name={{.Names}}&status={{.Status}}&labels={{.Labels}}" --filter label=appwrite-type=function' - , '', $stdout, $stderr, 30); - - $executionEnd = \microtime(true); - - $list = []; - $stdout = \explode("\n", $stdout); - - \array_map(function($value) use (&$list) { - $container = []; - - \parse_str($value, $container); - - if(isset($container['name'])) { - $container = [ - 'name' => $container['name'], - 'online' => (\substr($container['status'], 0, 2) === 'Up'), - 'status' => $container['status'], - 'labels' => $container['labels'], - ]; - - \array_map(function($value) use (&$container) { - $value = \explode('=', $value); - - if(isset($value[0]) && isset($value[1])) { - $container[$value[0]] = $value[1]; - } - }, \explode(',', $container['labels'])); - - $list[$container['name']] = $container; - } - }, $stdout); - - Console::info("Functions listed in " . ($executionEnd - $executionStart) . " seconds with exit code {$exitCode}"); - - if(isset($list[$container]) && !$list[$container]['online']) { + if(isset($list[$container]) && !$list[$container]['online']) { // Remove conatiner if not online $stdout = ''; $stderr = ''; @@ -261,17 +382,17 @@ class FunctionsV1 $stderr = ''; $executionStart = \microtime(true); - + $executionTime = \time(); + $exitCode = Console::execute("docker run \ -d \ --entrypoint=\"\" \ - --cpus=4 \ - --memory=128m \ - --memory-swap=128m \ - --rm \ + --cpus=".App::getEnv('_APP_FUNCTIONS_CPUS', '1')." \ + --memory=".App::getEnv('_APP_FUNCTIONS_MEMORY', '128')."m \ + --memory-swap=".App::getEnv('_APP_FUNCTIONS_MEMORY_SWAP', '128')."m \ --name={$container} \ --label appwrite-type=function \ - --label appwrite-created=".\time()." \ + --label appwrite-created=".$executionTime." \ --volume {$tagPathTargetDir}:/tmp:rw \ --workdir /usr/local/src \ ".\implode("\n", $vars)." @@ -284,7 +405,17 @@ class FunctionsV1 if($exitCode !== 0) { throw new Exception('Failed to create function environment: '.$stderr); } - + + $list[$container] = [ + 'name' => $container, + 'online' => true, + 'status' => 'Up', + 'labels' => [ + 'appwrite-type' => 'function', + 'appwrite-created' => $executionTime, + ], + ]; + Console::info("Function created in " . ($executionEnd - $executionStart) . " seconds with exit code {$exitCode}"); } else { @@ -296,22 +427,27 @@ class FunctionsV1 $executionStart = \microtime(true); - $exitCode = Console::execute("docker exec {$container} {$command}" + $exitCode = Console::execute("docker exec \ + ".\implode("\n", $vars)." + {$container} \ + {$command}" , '', $stdout, $stderr, $function->getAttribute('timeout', (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900))); $executionEnd = \microtime(true); + $executionTime = ($executionEnd - $executionStart); + $functionStatus = ($exitCode === 0) ? 'completed' : 'failed'; Console::info("Function executed in " . ($executionEnd - $executionStart) . " seconds with exit code {$exitCode}"); Authorization::disable(); - $execution = $projectDB->updateDocument(array_merge($execution->getArrayCopy(), [ + $execution = $database->updateDocument(array_merge($execution->getArrayCopy(), [ 'tagId' => $tag->getId(), - 'status' => ($exitCode === 0) ? 'completed' : 'failed', + 'status' => $functionStatus, 'exitCode' => $exitCode, - 'stdout' => mb_substr($stdout, -4000), // log last 4000 chars output - 'stderr' => mb_substr($stderr, -4000), // log last 4000 chars output - 'time' => ($executionEnd - $executionStart), + 'stdout' => \mb_substr($stdout, -4000), // log last 4000 chars output + 'stderr' => \mb_substr($stderr, -4000), // log last 4000 chars output + 'time' => $executionTime, ])); Authorization::reset(); @@ -320,6 +456,32 @@ class FunctionsV1 throw new Exception('Failed saving execution to DB', 500); } + $usage = new Event('v1-usage', 'UsageV1'); + + $usage + ->setParam('projectId', $projectId) + ->setParam('functionId', $function->getId()) + ->setParam('functionExecution', 1) + ->setParam('functionStatus', $functionStatus) + ->setParam('functionExecutionTime', $executionTime * 1000) // ms + ->setParam('networkRequestSize', 0) + ->setParam('networkResponseSize', 0) + ; + + $usage->trigger(); + + $this->cleanup(); + } + + /** + * Cleanup any hanging containers above the allowed max containers. + * + * @return void + */ + public function cleanup(): void + { + global $list; + Console::success(count($list).' running containers counted'); $max = (int) App::getEnv('_APP_FUNCTIONS_CONTAINERS'); @@ -327,33 +489,50 @@ class FunctionsV1 if(\count($list) > $max) { Console::info('Starting containers cleanup'); - $sorted = []; - - foreach($list as $env) { - $sorted[] = [ - 'name' => $env['name'], - 'created' => (int)$env['appwrite-created'] - ]; - } - - \usort($sorted, function ($item1, $item2) { - return $item1['created'] <=> $item2['created']; + \usort($list, function ($item1, $item2) { + return (int)($item1['appwrite-created'] ?? 0) <=> (int)($item2['appwrite-created'] ?? 0); }); - while(\count($sorted) > $max) { - $first = \array_shift($sorted); + while(\count($list) > $max) { + $first = \array_shift($list); $stdout = ''; $stderr = ''; - if(Console::execute("docker stop {$first['name']}", '', $stdout, $stderr, 30) !== 0) { + if(Console::execute("docker rm -f {$first['name']}", '', $stdout, $stderr, 30) !== 0) { Console::error('Failed to remove container: '.$stderr); } - - Console::info('Removed container: '.$first['name']); + else { + Console::info('Removed container: '.$first['name']); + } } } } + /** + * Filter ENV vars + * + * @param string $string + * + * @return string + */ + public function filterEnvKey(string $string): string + { + if(empty($this->allowed)) { + $this->allowed = array_fill_keys(\str_split('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_'), true); + } + + $string = \str_split($string); + $output = ''; + + foreach ($string as $char) { + if(\array_key_exists($char, $this->allowed)) { + $output .= $char; + } + } + + return $output; + } + public function tearDown(): void { } diff --git a/app/workers/mails.php b/app/workers/mails.php index a7f6f6c235..5431ee9225 100644 --- a/app/workers/mails.php +++ b/app/workers/mails.php @@ -7,7 +7,7 @@ require_once __DIR__.'/../init.php'; \cli_set_process_title('Mails V1 Worker'); -echo APP_NAME.' mails worker v1 has started'."\n"; +Console::success(APP_NAME.' mails worker v1 has started'."\n"); class MailsV1 { diff --git a/app/workers/usage.php b/app/workers/usage.php index 54f8e7bde8..c0486c4bbc 100644 --- a/app/workers/usage.php +++ b/app/workers/usage.php @@ -27,17 +27,19 @@ class UsageV1 $statsd = $register->get('statsd', true); $projectId = $this->args['projectId']; - $httpMethod = $this->args['httpMethod']; - $httpRequest = $this->args['httpRequest']; - + + $storage = $this->args['storage']; + $networkRequestSize = $this->args['networkRequestSize']; $networkResponseSize = $this->args['networkResponseSize']; - $storage = $this->args['storage']; + $httpMethod = $this->args['httpMethod']; + $httpRequest = $this->args['httpRequest']; + $functionId = $this->args['functionId']; $functionExecution = $this->args['functionExecution']; $functionExecutionTime = $this->args['functionExecutionTime']; - $functionId = $this->args['functionId']; + $functionStatus = $this->args['functionStatus']; $tags = ",project={$projectId},version=".App::getEnv('_APP_VERSION', 'UNKNOWN').''; @@ -49,14 +51,18 @@ class UsageV1 } if($functionExecution >= 1) { - $statsd->increment('executions.all'.$tags.',functionId='.$functionId); + $statsd->increment('executions.all'.$tags.',functionId='.$functionId.',functionStatus='.$functionStatus); + var_dump($tags.',functionId='.$functionId.',functionStatus='.$functionStatus); $statsd->count('executions.time'.$tags.',functionId='.$functionId, $functionExecutionTime); } - $statsd->count('network.all'.$tags, $networkRequestSize + $networkResponseSize); $statsd->count('network.inbound'.$tags, $networkRequestSize); $statsd->count('network.outbound'.$tags, $networkResponseSize); - $statsd->count('storage.all'.$tags, $storage); + $statsd->count('network.all'.$tags, $networkRequestSize + $networkResponseSize); + + if($storage >= 1) { + $statsd->count('storage.all'.$tags, $storage); + } } public function tearDown(): void diff --git a/bin/maintenance b/bin/maintenance new file mode 100644 index 0000000000..099551cb32 --- /dev/null +++ b/bin/maintenance @@ -0,0 +1,3 @@ +#!/bin/sh + +php /usr/src/code/app/cli.php maintenance $@ \ No newline at end of file diff --git a/composer.json b/composer.json index d70246a474..bf9f354acc 100644 --- a/composer.json +++ b/composer.json @@ -34,11 +34,11 @@ "appwrite/php-clamav": "1.0.*", - "utopia-php/framework": "0.9.8", - "utopia-php/abuse": "0.2.*", - "utopia-php/audit": "0.3.*", + "utopia-php/framework": "0.10.0", + "utopia-php/abuse": "0.3.*", + "utopia-php/audit": "0.5.*", "utopia-php/cache": "0.2.*", - "utopia-php/cli": "0.7.2", + "utopia-php/cli": "0.8.0", "utopia-php/config": "0.2.*", "utopia-php/locale": "0.3.*", "utopia-php/registry": "0.2.*", @@ -56,7 +56,7 @@ }, "require-dev": { "swoole/ide-helper": "4.5.5", - "appwrite/sdk-generator": "master", + "appwrite/sdk-generator": "0.2.3", "phpunit/phpunit": "9.4.2", "vimeo/psalm": "4.1.1" }, diff --git a/composer.lock b/composer.lock index bdb00f0705..500c67d954 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "18cec0afcb76ef57fa38386fe04fd87b", + "content-hash": "aa1bf812ee6a45af12cdfbbfb7229471", "packages": [ { "name": "appwrite/php-clamav", @@ -49,6 +49,10 @@ "clamav", "php" ], + "support": { + "issues": "https://github.com/appwrite/php-clamav/issues", + "source": "https://github.com/appwrite/php-clamav/tree/master" + }, "time": "2020-02-29T11:35:01+00:00" }, { @@ -113,6 +117,10 @@ "qrcode", "qrcode-generator" ], + "support": { + "issues": "https://github.com/chillerlan/php-qrcode/issues", + "source": "https://github.com/chillerlan/php-qrcode/tree/4.2.0" + }, "funding": [ { "url": "https://ko-fi.com/codemasher", @@ -168,6 +176,10 @@ "container", "helper" ], + "support": { + "issues": "https://github.com/chillerlan/php-settings-container/issues", + "source": "https://github.com/chillerlan/php-settings-container" + }, "funding": [ { "url": "https://ko-fi.com/codemasher", @@ -214,6 +226,10 @@ ], "description": "Credis is a lightweight interface to the Redis key-value store which wraps the phpredis library when available for better performance.", "homepage": "https://github.com/colinmollenhour/credis", + "support": { + "issues": "https://github.com/colinmollenhour/credis/issues", + "source": "https://github.com/colinmollenhour/credis/tree/v1.12.1" + }, "time": "2020-11-06T16:09:14+00:00" }, { @@ -264,6 +280,10 @@ "statsd", "udp" ], + "support": { + "issues": "https://github.com/domnikl/statsd-php/issues", + "source": "https://github.com/domnikl/statsd-php/tree/master" + }, "time": "2020-01-03T14:24:58+00:00" }, { @@ -312,6 +332,10 @@ "cron", "schedule" ], + "support": { + "issues": "https://github.com/dragonmantank/cron-expression/issues", + "source": "https://github.com/dragonmantank/cron-expression/tree/3.0.1" + }, "funding": [ { "url": "https://github.com/dragonmantank", @@ -398,6 +422,10 @@ "rest", "web service" ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.2.0" + }, "funding": [ { "url": "https://github.com/GrahamCampbell", @@ -438,6 +466,7 @@ "require-dev": { "symfony/phpunit-bridge": "^4.4 || ^5.1" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -467,6 +496,10 @@ "keywords": [ "promise" ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/master" + }, "time": "2020-10-19T16:50:15+00:00" }, { @@ -475,12 +508,12 @@ "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "25f7f893f0b52b7b14e244a16679d72b1f0088de" + "reference": "f47ece9e6e8ce74e3be04bef47f46061dc18c095" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/25f7f893f0b52b7b14e244a16679d72b1f0088de", - "reference": "25f7f893f0b52b7b14e244a16679d72b1f0088de", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f47ece9e6e8ce74e3be04bef47f46061dc18c095", + "reference": "f47ece9e6e8ce74e3be04bef47f46061dc18c095", "shasum": "" }, "require": { @@ -538,7 +571,11 @@ "uri", "url" ], - "time": "2020-10-22T07:42:05+00:00" + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/1.x" + }, + "time": "2020-12-08T11:45:39+00:00" }, { "name": "influxdb/influxdb-php", @@ -599,6 +636,10 @@ "influxdb library", "time series" ], + "support": { + "issues": "https://github.com/influxdata/influxdb-php/issues", + "source": "https://github.com/influxdata/influxdb-php/tree/1.15.1" + }, "time": "2020-09-18T13:24:03+00:00" }, { @@ -654,20 +695,26 @@ "parser", "useragent" ], + "support": { + "forum": "http://forum.matomo.org/", + "issues": "https://github.com/matomo-org/device-detector/issues", + "source": "https://github.com/matomo-org/piwik", + "wiki": "https://dev.matomo.org/" + }, "time": "2020-08-17T07:37:33+00:00" }, { "name": "mustangostang/spyc", - "version": "dev-master", + "version": "0.6.3", "source": { "type": "git", - "url": "https://github.com/mustangostang/spyc.git", - "reference": "daf9fa4ef675519386b4f556c9d5ab5f9c14055a" + "url": "git@github.com:mustangostang/spyc.git", + "reference": "4627c838b16550b666d15aeae1e5289dd5b77da0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mustangostang/spyc/zipball/daf9fa4ef675519386b4f556c9d5ab5f9c14055a", - "reference": "daf9fa4ef675519386b4f556c9d5ab5f9c14055a", + "url": "https://api.github.com/repos/mustangostang/spyc/zipball/4627c838b16550b666d15aeae1e5289dd5b77da0", + "reference": "4627c838b16550b666d15aeae1e5289dd5b77da0", "shasum": "" }, "require": { @@ -704,7 +751,7 @@ "yaml", "yml" ], - "time": "2019-12-03T17:11:33+00:00" + "time": "2019-09-10T13:16:29+00:00" }, { "name": "phpmailer/phpmailer", @@ -766,6 +813,10 @@ } ], "description": "PHPMailer is a full-featured email creation and transfer class for PHP", + "support": { + "issues": "https://github.com/PHPMailer/PHPMailer/issues", + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.1.7" + }, "funding": [ { "url": "https://github.com/synchro", @@ -792,6 +843,7 @@ "php": "^7.0 || ^8.0", "psr/http-message": "^1.0" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -821,6 +873,9 @@ "psr", "psr-18" ], + "support": { + "source": "https://github.com/php-fig/http-client/tree/master" + }, "time": "2020-09-19T09:12:31+00:00" }, { @@ -840,6 +895,7 @@ "require": { "php": ">=5.3.0" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -871,6 +927,9 @@ "request", "response" ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, "time": "2019-08-29T13:16:46+00:00" }, { @@ -890,6 +949,7 @@ "require": { "php": ">=5.3.0" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -918,6 +978,9 @@ "psr", "psr-3" ], + "support": { + "source": "https://github.com/php-fig/log/tree/master" + }, "time": "2020-09-18T06:44:51+00:00" }, { @@ -958,6 +1021,10 @@ } ], "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, "time": "2019-03-08T08:55:37+00:00" }, { @@ -1037,20 +1104,24 @@ "redis", "resque" ], + "support": { + "issues": "https://github.com/resque/php-resque/issues", + "source": "https://github.com/resque/php-resque/tree/v1.3.6" + }, "time": "2020-04-16T16:39:50+00:00" }, { "name": "utopia-php/abuse", - "version": "0.2.2", + "version": "0.3.1", "source": { "type": "git", "url": "https://github.com/utopia-php/abuse.git", - "reference": "8e65890a6d7afa9f57992f1eca9fe64508f9822e" + "reference": "23c2eb533bca8f3ef5548ae265398fa7d4d39a1c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/abuse/zipball/8e65890a6d7afa9f57992f1eca9fe64508f9822e", - "reference": "8e65890a6d7afa9f57992f1eca9fe64508f9822e", + "url": "https://api.github.com/repos/utopia-php/abuse/zipball/23c2eb533bca8f3ef5548ae265398fa7d4d39a1c", + "reference": "23c2eb533bca8f3ef5548ae265398fa7d4d39a1c", "shasum": "" }, "require": { @@ -1085,20 +1156,24 @@ "upf", "utopia" ], + "support": { + "issues": "https://github.com/utopia-php/abuse/issues", + "source": "https://github.com/utopia-php/abuse/tree/0.2.2" + }, "time": "2020-10-23T06:51:42+00:00" }, { "name": "utopia-php/audit", - "version": "0.3.2", + "version": "0.5.1", "source": { "type": "git", "url": "https://github.com/utopia-php/audit.git", - "reference": "544ecff78788d11f60992a721f102cafc22ab084" + "reference": "154a850170a58667a15e4b65fbabb6cd0b709dd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/audit/zipball/544ecff78788d11f60992a721f102cafc22ab084", - "reference": "544ecff78788d11f60992a721f102cafc22ab084", + "url": "https://api.github.com/repos/utopia-php/audit/zipball/154a850170a58667a15e4b65fbabb6cd0b709dd9", + "reference": "154a850170a58667a15e4b65fbabb6cd0b709dd9", "shasum": "" }, "require": { @@ -1133,6 +1208,10 @@ "upf", "utopia" ], + "support": { + "issues": "https://github.com/utopia-php/audit/issues", + "source": "https://github.com/utopia-php/audit/tree/0.3.2" + }, "time": "2020-10-23T08:09:44+00:00" }, { @@ -1181,20 +1260,24 @@ "upf", "utopia" ], + "support": { + "issues": "https://github.com/utopia-php/cache/issues", + "source": "https://github.com/utopia-php/cache/tree/0.2.3" + }, "time": "2020-10-24T10:11:01+00:00" }, { "name": "utopia-php/cli", - "version": "0.7.2", + "version": "0.8", "source": { "type": "git", "url": "https://github.com/utopia-php/cli.git", - "reference": "0b19cd33b86deb6aeb26bfdabc18bd2bdf5eba04" + "reference": "090c7ae22b53a175d962e8f9601d36350496153c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/cli/zipball/0b19cd33b86deb6aeb26bfdabc18bd2bdf5eba04", - "reference": "0b19cd33b86deb6aeb26bfdabc18bd2bdf5eba04", + "url": "https://api.github.com/repos/utopia-php/cli/zipball/090c7ae22b53a175d962e8f9601d36350496153c", + "reference": "090c7ae22b53a175d962e8f9601d36350496153c", "shasum": "" }, "require": { @@ -1230,7 +1313,11 @@ "upf", "utopia" ], - "time": "2020-10-23T13:34:41+00:00" + "support": { + "issues": "https://github.com/utopia-php/cli/issues", + "source": "https://github.com/utopia-php/cli/tree/0.7.3" + }, + "time": "2020-11-02T07:50:18+00:00" }, { "name": "utopia-php/config", @@ -1277,6 +1364,10 @@ "upf", "utopia" ], + "support": { + "issues": "https://github.com/utopia-php/config/issues", + "source": "https://github.com/utopia-php/config/tree/0.2.2" + }, "time": "2020-10-24T09:49:09+00:00" }, { @@ -1328,20 +1419,24 @@ "upf", "utopia" ], + "support": { + "issues": "https://github.com/utopia-php/domains/issues", + "source": "https://github.com/utopia-php/domains/tree/0.2.3" + }, "time": "2020-10-23T09:59:51+00:00" }, { "name": "utopia-php/framework", - "version": "0.9.8", + "version": "0.10.0", "source": { "type": "git", "url": "https://github.com/utopia-php/framework.git", - "reference": "4caec144554f028b3ec710a0cdd4f75193f01285" + "reference": "65909bdb24ef6b6c6751abfdea90caf96bbc6c50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/framework/zipball/4caec144554f028b3ec710a0cdd4f75193f01285", - "reference": "4caec144554f028b3ec710a0cdd4f75193f01285", + "url": "https://api.github.com/repos/utopia-php/framework/zipball/65909bdb24ef6b6c6751abfdea90caf96bbc6c50", + "reference": "65909bdb24ef6b6c6751abfdea90caf96bbc6c50", "shasum": "" }, "require": { @@ -1373,7 +1468,11 @@ "php", "upf" ], - "time": "2020-11-11T20:34:58+00:00" + "support": { + "issues": "https://github.com/utopia-php/framework/issues", + "source": "https://github.com/utopia-php/framework/tree/0.10.0" + }, + "time": "2020-12-26T12:02:39+00:00" }, { "name": "utopia-php/locale", @@ -1420,6 +1519,10 @@ "upf", "utopia" ], + "support": { + "issues": "https://github.com/utopia-php/locale/issues", + "source": "https://github.com/utopia-php/locale/tree/0.3.3" + }, "time": "2020-10-24T08:12:55+00:00" }, { @@ -1469,6 +1572,10 @@ "upf", "utopia" ], + "support": { + "issues": "https://github.com/utopia-php/preloader/issues", + "source": "https://github.com/utopia-php/preloader/tree/0.2.4" + }, "time": "2020-10-24T07:04:59+00:00" }, { @@ -1517,6 +1624,10 @@ "upf", "utopia" ], + "support": { + "issues": "https://github.com/utopia-php/registry/issues", + "source": "https://github.com/utopia-php/registry/tree/0.2.4" + }, "time": "2020-10-24T08:51:37+00:00" }, { @@ -1569,6 +1680,10 @@ "upf", "utopia" ], + "support": { + "issues": "https://github.com/utopia-php/swoole/issues", + "source": "https://github.com/utopia-php/swoole/tree/0.2.0" + }, "time": "2020-10-29T12:42:38+00:00" } ], @@ -1579,12 +1694,12 @@ "source": { "type": "git", "url": "https://github.com/amphp/amp.git", - "reference": "ecdc3c476b3ccff02f8e5d5bcc04f7ccfd18751c" + "reference": "dbb3c28ece24b36efa91be205f6f0b015bddc27c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/ecdc3c476b3ccff02f8e5d5bcc04f7ccfd18751c", - "reference": "ecdc3c476b3ccff02f8e5d5bcc04f7ccfd18751c", + "url": "https://api.github.com/repos/amphp/amp/zipball/dbb3c28ece24b36efa91be205f6f0b015bddc27c", + "reference": "dbb3c28ece24b36efa91be205f6f0b015bddc27c", "shasum": "" }, "require": { @@ -1599,6 +1714,7 @@ "psalm/phar": "^3.11@dev", "react/promise": "^2" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -1649,13 +1765,18 @@ "non-blocking", "promise" ], + "support": { + "irc": "irc://irc.freenode.org/amphp", + "issues": "https://github.com/amphp/amp/issues", + "source": "https://github.com/amphp/amp/tree/master" + }, "funding": [ { "url": "https://github.com/amphp", "type": "github" } ], - "time": "2020-11-03T16:23:45+00:00" + "time": "2020-11-14T16:44:06+00:00" }, { "name": "amphp/byte-stream", @@ -1683,6 +1804,7 @@ "phpunit/phpunit": "^6 || ^7 || ^8", "psalm/phar": "^3.11.4" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -1721,6 +1843,11 @@ "non-blocking", "stream" ], + "support": { + "irc": "irc://irc.freenode.org/amphp", + "issues": "https://github.com/amphp/byte-stream/issues", + "source": "https://github.com/amphp/byte-stream/tree/master" + }, "funding": [ { "url": "https://github.com/amphp", @@ -1731,11 +1858,11 @@ }, { "name": "appwrite/sdk-generator", - "version": "dev-master", + "version": "0.2.3", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator", - "reference": "e78d94eb1bc538e988d7e45afca7304a98ffc3f1" + "reference": "6b564fef01fd681023c1d465783931bade04468d" }, "require": { "ext-curl": "*", @@ -1748,6 +1875,7 @@ "require-dev": { "phpunit/phpunit": "^7.0" }, + "default-branch": true, "type": "library", "autoload": { "psr-4": { @@ -1765,7 +1893,7 @@ } ], "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", - "time": "2020-11-11T09:53:31+00:00" + "time": "2020-12-23T21:58:58+00:00" }, { "name": "composer/package-versions-deprecated", @@ -1773,12 +1901,12 @@ "source": { "type": "git", "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6" + "reference": "64291c788b9a18272346decf566931e33a317399" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/7413f0b55a051e89485c5cb9f765fe24bb02a7b6", - "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/64291c788b9a18272346decf566931e33a317399", + "reference": "64291c788b9a18272346decf566931e33a317399", "shasum": "" }, "require": { @@ -1793,6 +1921,7 @@ "ext-zip": "^1.13", "phpunit/phpunit": "^6.5 || ^7" }, + "default-branch": true, "type": "composer-plugin", "extra": { "class": "PackageVersions\\Installer", @@ -1820,6 +1949,10 @@ } ], "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "support": { + "issues": "https://github.com/composer/package-versions-deprecated/issues", + "source": "https://github.com/composer/package-versions-deprecated/tree/master" + }, "funding": [ { "url": "https://packagist.com", @@ -1834,7 +1967,7 @@ "type": "tidelift" } ], - "time": "2020-11-11T10:22:58+00:00" + "time": "2020-11-12T09:39:33+00:00" }, { "name": "composer/semver", @@ -1842,21 +1975,22 @@ "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "4089fddb67bcf6bf860d91b979e95be303835002" + "reference": "dd61cb4efbd0cff1700b217faf24ce596af4fc4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/4089fddb67bcf6bf860d91b979e95be303835002", - "reference": "4089fddb67bcf6bf860d91b979e95be303835002", + "url": "https://api.github.com/repos/composer/semver/zipball/dd61cb4efbd0cff1700b217faf24ce596af4fc4e", + "reference": "dd61cb4efbd0cff1700b217faf24ce596af4fc4e", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.19", + "phpstan/phpstan": "^0.12.54", "symfony/phpunit-bridge": "^4.2 || ^5" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -1896,6 +2030,11 @@ "validation", "versioning" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/main" + }, "funding": [ { "url": "https://packagist.com", @@ -1910,20 +2049,20 @@ "type": "tidelift" } ], - "time": "2020-10-14T08:51:15+00:00" + "time": "2020-12-10T07:55:43+00:00" }, { "name": "composer/xdebug-handler", - "version": "1.4.4", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba" + "reference": "f28d44c286812c714741478d968104c5e604a1d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6e076a124f7ee146f2487554a94b6a19a74887ba", - "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f28d44c286812c714741478d968104c5e604a1d4", + "reference": "f28d44c286812c714741478d968104c5e604a1d4", "shasum": "" }, "require": { @@ -1954,6 +2093,11 @@ "Xdebug", "performance" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/1.4.5" + }, "funding": [ { "url": "https://packagist.com", @@ -1968,7 +2112,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:39:10+00:00" + "time": "2020-11-13T08:04:11+00:00" }, { "name": "dnoegel/php-xdg-base-dir", @@ -2001,6 +2145,10 @@ "MIT" ], "description": "implementation of xdg base directory specification for php", + "support": { + "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues", + "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1" + }, "time": "2019-12-04T15:06:13+00:00" }, { @@ -2052,6 +2200,10 @@ "constructor", "instantiate" ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.4.x" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -2107,6 +2259,10 @@ } ], "description": "A more advanced JSONRPC implementation", + "support": { + "issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues", + "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/master" + }, "time": "2020-03-11T15:21:41+00:00" }, { @@ -2131,6 +2287,7 @@ "squizlabs/php_codesniffer": "^3.1", "vimeo/psalm": "^4.0" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -2159,20 +2316,24 @@ "php", "server" ], + "support": { + "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", + "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.0" + }, "time": "2020-10-23T13:55:30+00:00" }, { "name": "matthiasmullie/minify", - "version": "1.3.63", + "version": "1.3.64", "source": { "type": "git", "url": "https://github.com/matthiasmullie/minify.git", - "reference": "9ba1b459828adc13430f4dd6c49dae4950dc4117" + "reference": "38f9d58c739687e269f46c6dff4647de9e2eb855" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/9ba1b459828adc13430f4dd6c49dae4950dc4117", - "reference": "9ba1b459828adc13430f4dd6c49dae4950dc4117", + "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/38f9d58c739687e269f46c6dff4647de9e2eb855", + "reference": "38f9d58c739687e269f46c6dff4647de9e2eb855", "shasum": "" }, "require": { @@ -2219,7 +2380,11 @@ "minifier", "minify" ], - "time": "2020-01-21T20:21:08+00:00" + "support": { + "issues": "https://github.com/matthiasmullie/minify/issues", + "source": "https://github.com/matthiasmullie/minify/tree/1.3.64" + }, + "time": "2020-12-23T13:37:53+00:00" }, { "name": "matthiasmullie/path-converter", @@ -2268,6 +2433,10 @@ "paths", "relative" ], + "support": { + "issues": "https://github.com/matthiasmullie/path-converter/issues", + "source": "https://github.com/matthiasmullie/path-converter/tree/1.1.3" + }, "time": "2019-02-05T23:41:09+00:00" }, { @@ -2276,12 +2445,12 @@ "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "00aba97fc36feabc8d94667eebd5d43959e60008" + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/00aba97fc36feabc8d94667eebd5d43959e60008", - "reference": "00aba97fc36feabc8d94667eebd5d43959e60008", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", "shasum": "" }, "require": { @@ -2295,6 +2464,7 @@ "doctrine/common": "^2.6", "phpunit/phpunit": "^7.1" }, + "default-branch": true, "type": "library", "autoload": { "psr-4": { @@ -2316,13 +2486,17 @@ "object", "object graph" ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + }, "funding": [ { "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", "type": "tidelift" } ], - "time": "2020-10-01T09:35:15+00:00" + "time": "2020-11-13T09:40:50+00:00" }, { "name": "netresearch/jsonmapper", @@ -2368,20 +2542,25 @@ } ], "description": "Map nested JSON structures onto PHP classes", + "support": { + "email": "cweiske@cweiske.de", + "issues": "https://github.com/cweiske/jsonmapper/issues", + "source": "https://github.com/cweiske/jsonmapper/tree/master" + }, "time": "2020-04-16T18:48:43+00:00" }, { "name": "nikic/php-parser", - "version": "v4.10.2", + "version": "v4.10.4", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "658f1be311a230e0907f5dfe0213742aff0596de" + "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/658f1be311a230e0907f5dfe0213742aff0596de", - "reference": "658f1be311a230e0907f5dfe0213742aff0596de", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c6d052fc58cb876152f89f532b95a8d7907e7f0e", + "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e", "shasum": "" }, "require": { @@ -2420,7 +2599,11 @@ "parser", "php" ], - "time": "2020-09-26T10:30:38+00:00" + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.4" + }, + "time": "2020-12-20T10:01:03+00:00" }, { "name": "openlss/lib-array2xml", @@ -2469,6 +2652,10 @@ "xml", "xml conversion" ], + "support": { + "issues": "https://github.com/nullivex/lib-array2xml/issues", + "source": "https://github.com/nullivex/lib-array2xml/tree/master" + }, "time": "2019-03-29T20:06:56+00:00" }, { @@ -2492,6 +2679,7 @@ "phar-io/version": "^3.0.1", "php": "^7.2 || ^8.0" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -2525,20 +2713,24 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.1" + }, "time": "2020-06-27T14:33:11+00:00" }, { "name": "phar-io/version", - "version": "3.0.2", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "c6bb6825def89e0a32220f88337f8ceaf1975fa0" + "reference": "e4782611070e50613683d2b9a57730e9a3ba5451" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/c6bb6825def89e0a32220f88337f8ceaf1975fa0", - "reference": "c6bb6825def89e0a32220f88337f8ceaf1975fa0", + "url": "https://api.github.com/repos/phar-io/version/zipball/e4782611070e50613683d2b9a57730e9a3ba5451", + "reference": "e4782611070e50613683d2b9a57730e9a3ba5451", "shasum": "" }, "require": { @@ -2572,7 +2764,11 @@ } ], "description": "Library for handling version information and constraints", - "time": "2020-06-27T14:39:04+00:00" + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.0.4" + }, + "time": "2020-12-13T23:18:30+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -2591,6 +2787,7 @@ "require": { "php": ">=7.1" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -2621,6 +2818,10 @@ "reflection", "static analysis" ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/master" + }, "time": "2020-06-19T17:42:03+00:00" }, { @@ -2629,12 +2830,12 @@ "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" + "reference": "e3324ecbde7319b0bbcf0fd7ca4af19469c38da9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", - "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e3324ecbde7319b0bbcf0fd7ca4af19469c38da9", + "reference": "e3324ecbde7319b0bbcf0fd7ca4af19469c38da9", "shasum": "" }, "require": { @@ -2647,6 +2848,7 @@ "require-dev": { "mockery/mockery": "~1.3.2" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -2673,7 +2875,11 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2020-09-03T19:13:55+00:00" + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" + }, + "time": "2020-11-18T14:27:38+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -2696,6 +2902,7 @@ "require-dev": { "ext-tokenizer": "*" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -2718,20 +2925,24 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" + }, "time": "2020-09-17T18:55:26+00:00" }, { "name": "phpspec/prophecy", - "version": "1.12.1", + "version": "1.12.2", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d" + "reference": "245710e971a030f42e08f4912863805570f23d39" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/8ce87516be71aae9b956f81906aaf0338e0d8a2d", - "reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/245710e971a030f42e08f4912863805570f23d39", + "reference": "245710e971a030f42e08f4912863805570f23d39", "shasum": "" }, "require": { @@ -2743,7 +2954,7 @@ }, "require-dev": { "phpspec/phpspec": "^6.0", - "phpunit/phpunit": "^8.0 || ^9.0 <9.3" + "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", "extra": { @@ -2781,20 +2992,24 @@ "spy", "stub" ], - "time": "2020-09-29T09:10:42+00:00" + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/1.12.2" + }, + "time": "2020-12-19T10:15:11+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "dev-master", + "version": "9.2.x-dev", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "5d66bde3afba51e21c6eb7d1a3776bd3b88dfafc" + "reference": "ad44fae76b874e7d49afb6923a66591e0a94bef6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5d66bde3afba51e21c6eb7d1a3776bd3b88dfafc", - "reference": "5d66bde3afba51e21c6eb7d1a3776bd3b88dfafc", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ad44fae76b874e7d49afb6923a66591e0a94bef6", + "reference": "ad44fae76b874e7d49afb6923a66591e0a94bef6", "shasum": "" }, "require": { @@ -2808,7 +3023,7 @@ "sebastian/code-unit-reverse-lookup": "^2.0.2", "sebastian/complexity": "^2.0", "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0", + "sebastian/lines-of-code": "^1.0.3", "sebastian/version": "^3.0.1", "theseer/tokenizer": "^1.2.0" }, @@ -2848,13 +3063,17 @@ "testing", "xunit" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/master" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-09T10:25:30+00:00" + "time": "2020-12-24T12:26:22+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2862,12 +3081,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "854c530d02bcc6b5b96942e6e4cfeead11b35aad" + "reference": "544be757d192233486ad9119dcb297ebbf5f2dd4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/854c530d02bcc6b5b96942e6e4cfeead11b35aad", - "reference": "854c530d02bcc6b5b96942e6e4cfeead11b35aad", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/544be757d192233486ad9119dcb297ebbf5f2dd4", + "reference": "544be757d192233486ad9119dcb297ebbf5f2dd4", "shasum": "" }, "require": { @@ -2876,6 +3095,7 @@ "require-dev": { "phpunit/phpunit": "^9.3" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -2904,13 +3124,17 @@ "filesystem", "iterator" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/master" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-09T10:26:59+00:00" + "time": "2020-12-24T12:27:43+00:00" }, { "name": "phpunit/php-invoker", @@ -2918,12 +3142,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "0cd572c9935a3a8373416e733ad1566d7c602ff1" + "reference": "05210af8d0ab68c811ae61a4bc42b066d62b88a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/0cd572c9935a3a8373416e733ad1566d7c602ff1", - "reference": "0cd572c9935a3a8373416e733ad1566d7c602ff1", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/05210af8d0ab68c811ae61a4bc42b066d62b88a0", + "reference": "05210af8d0ab68c811ae61a4bc42b066d62b88a0", "shasum": "" }, "require": { @@ -2936,6 +3160,7 @@ "suggest": { "ext-pcntl": "*" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -2963,13 +3188,17 @@ "keywords": [ "process" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/master" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-09T10:27:08+00:00" + "time": "2020-12-24T12:27:51+00:00" }, { "name": "phpunit/php-text-template", @@ -2977,12 +3206,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "0d0bdf563575ba6715c5a6754541c80a9aa6dde2" + "reference": "c1abda6e0590f8e7138eb48ade2f0b21a5c4257b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0d0bdf563575ba6715c5a6754541c80a9aa6dde2", - "reference": "0d0bdf563575ba6715c5a6754541c80a9aa6dde2", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/c1abda6e0590f8e7138eb48ade2f0b21a5c4257b", + "reference": "c1abda6e0590f8e7138eb48ade2f0b21a5c4257b", "shasum": "" }, "require": { @@ -2991,6 +3220,7 @@ "require-dev": { "phpunit/phpunit": "^9.3" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -3018,13 +3248,17 @@ "keywords": [ "template" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/master" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-09T10:27:42+00:00" + "time": "2020-12-24T12:28:23+00:00" }, { "name": "phpunit/php-timer", @@ -3032,12 +3266,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "16bcf8ca6821c270f22794c02e50b8107cb375d8" + "reference": "59e401088c91efeb76150f0a301aa79e3ac95fd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/16bcf8ca6821c270f22794c02e50b8107cb375d8", - "reference": "16bcf8ca6821c270f22794c02e50b8107cb375d8", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/59e401088c91efeb76150f0a301aa79e3ac95fd1", + "reference": "59e401088c91efeb76150f0a301aa79e3ac95fd1", "shasum": "" }, "require": { @@ -3046,6 +3280,7 @@ "require-dev": { "phpunit/phpunit": "^9.3" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -3073,13 +3308,17 @@ "keywords": [ "timer" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/master" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-09T10:27:16+00:00" + "time": "2020-12-24T12:27:59+00:00" }, { "name": "phpunit/phpunit", @@ -3168,6 +3407,10 @@ "testing", "xunit" ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.4.2" + }, "funding": [ { "url": "https://phpunit.de/donate.html", @@ -3197,6 +3440,7 @@ "require": { "php": ">=7.2.0" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -3227,6 +3471,10 @@ "container-interop", "psr" ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/master" + }, "time": "2020-10-13T07:07:53+00:00" }, { @@ -3235,12 +3483,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "0810c53718aa9ea7e42f2de2865a049ce3f5122f" + "reference": "7605547e80bf845bc2c1b2cc3f8ac0f5574caa63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/0810c53718aa9ea7e42f2de2865a049ce3f5122f", - "reference": "0810c53718aa9ea7e42f2de2865a049ce3f5122f", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/7605547e80bf845bc2c1b2cc3f8ac0f5574caa63", + "reference": "7605547e80bf845bc2c1b2cc3f8ac0f5574caa63", "shasum": "" }, "require": { @@ -3249,6 +3497,7 @@ "require-dev": { "phpunit/phpunit": "^9.3" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -3273,26 +3522,30 @@ ], "description": "Library for parsing CLI options", "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/master" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-09T10:28:10+00:00" + "time": "2020-12-24T12:28:52+00:00" }, { "name": "sebastian/code-unit", - "version": "dev-master", + "version": "1.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "2af9894d3d514c2ee6d6ad03cc23bb4625050649" + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/2af9894d3d514c2ee6d6ad03cc23bb4625050649", - "reference": "2af9894d3d514c2ee6d6ad03cc23bb4625050649", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", "shasum": "" }, "require": { @@ -3325,13 +3578,17 @@ ], "description": "Collection of value objects that represent the PHP code units", "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-09T10:25:39+00:00" + "time": "2020-10-26T13:08:54+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -3339,12 +3596,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "2f9aa793a37d4f39b5cf5ee3c9a1bd506885d60c" + "reference": "f861b90785c30dc0743554f0e615d8f950dc8e9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/2f9aa793a37d4f39b5cf5ee3c9a1bd506885d60c", - "reference": "2f9aa793a37d4f39b5cf5ee3c9a1bd506885d60c", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/f861b90785c30dc0743554f0e615d8f950dc8e9d", + "reference": "f861b90785c30dc0743554f0e615d8f950dc8e9d", "shasum": "" }, "require": { @@ -3353,6 +3610,7 @@ "require-dev": { "phpunit/phpunit": "^9.3" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -3376,13 +3634,17 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/master" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-09T10:25:48+00:00" + "time": "2020-12-24T12:26:38+00:00" }, { "name": "sebastian/comparator", @@ -3390,12 +3652,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "6d3dc38d8631941ca18c76cac3d7a15838071693" + "reference": "1cfe9edf7ec9e4c18e54bb259110a053d09a899f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6d3dc38d8631941ca18c76cac3d7a15838071693", - "reference": "6d3dc38d8631941ca18c76cac3d7a15838071693", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1cfe9edf7ec9e4c18e54bb259110a053d09a899f", + "reference": "1cfe9edf7ec9e4c18e54bb259110a053d09a899f", "shasum": "" }, "require": { @@ -3406,6 +3668,7 @@ "require-dev": { "phpunit/phpunit": "^9.3" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -3446,13 +3709,17 @@ "compare", "equality" ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/master" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-09T10:25:57+00:00" + "time": "2020-12-24T12:38:43+00:00" }, { "name": "sebastian/complexity", @@ -3460,12 +3727,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "cf04d6dfa8f99e37a677bf67195c43fc30024282" + "reference": "23030bf3d3722767fdc5f8f2d2d99b03f4e58122" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/cf04d6dfa8f99e37a677bf67195c43fc30024282", - "reference": "cf04d6dfa8f99e37a677bf67195c43fc30024282", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/23030bf3d3722767fdc5f8f2d2d99b03f4e58122", + "reference": "23030bf3d3722767fdc5f8f2d2d99b03f4e58122", "shasum": "" }, "require": { @@ -3475,6 +3742,7 @@ "require-dev": { "phpunit/phpunit": "^9.3" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -3499,13 +3767,17 @@ ], "description": "Library for calculating the complexity of PHP code units", "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/master" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-09T10:27:51+00:00" + "time": "2020-12-24T12:28:32+00:00" }, { "name": "sebastian/diff", @@ -3513,12 +3785,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "2c921642f8495dbf50fdcb920c425f9ccbb6a843" + "reference": "02178c586d5fbd59d348798d7122237a2907f8a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/2c921642f8495dbf50fdcb920c425f9ccbb6a843", - "reference": "2c921642f8495dbf50fdcb920c425f9ccbb6a843", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/02178c586d5fbd59d348798d7122237a2907f8a4", + "reference": "02178c586d5fbd59d348798d7122237a2907f8a4", "shasum": "" }, "require": { @@ -3528,6 +3800,7 @@ "phpunit/phpunit": "^9.3", "symfony/process": "^4.2 || ^5" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -3561,13 +3834,17 @@ "unidiff", "unified diff" ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/master" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-09T10:26:06+00:00" + "time": "2020-12-24T12:26:54+00:00" }, { "name": "sebastian/environment", @@ -3575,12 +3852,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "6fe240eca4c1230f6442747269ff94234674f30e" + "reference": "7bb5a20ec06e366cb75b0e126169649c62b397b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6fe240eca4c1230f6442747269ff94234674f30e", - "reference": "6fe240eca4c1230f6442747269ff94234674f30e", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/7bb5a20ec06e366cb75b0e126169649c62b397b1", + "reference": "7bb5a20ec06e366cb75b0e126169649c62b397b1", "shasum": "" }, "require": { @@ -3592,6 +3869,7 @@ "suggest": { "ext-posix": "*" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -3620,13 +3898,17 @@ "environment", "hhvm" ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/master" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-09T10:26:15+00:00" + "time": "2020-12-24T12:27:03+00:00" }, { "name": "sebastian/exporter", @@ -3634,12 +3916,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "04229817d2bb369fa6b25229316e7bbc53baece2" + "reference": "91975a2dbcf4a89184d9e4143c06b88d89644b58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/04229817d2bb369fa6b25229316e7bbc53baece2", - "reference": "04229817d2bb369fa6b25229316e7bbc53baece2", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/91975a2dbcf4a89184d9e4143c06b88d89644b58", + "reference": "91975a2dbcf4a89184d9e4143c06b88d89644b58", "shasum": "" }, "require": { @@ -3650,6 +3932,7 @@ "ext-mbstring": "*", "phpunit/phpunit": "^9.3" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -3693,13 +3976,17 @@ "export", "exporter" ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/master" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-09T10:26:24+00:00" + "time": "2020-12-24T12:27:11+00:00" }, { "name": "sebastian/global-state", @@ -3707,12 +3994,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bae2a2a7c5dac8eb4ab11e178fcd88242c1f8b17" + "reference": "0471b24bddeb05ffd0a5edc6837796f339068c25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bae2a2a7c5dac8eb4ab11e178fcd88242c1f8b17", - "reference": "bae2a2a7c5dac8eb4ab11e178fcd88242c1f8b17", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0471b24bddeb05ffd0a5edc6837796f339068c25", + "reference": "0471b24bddeb05ffd0a5edc6837796f339068c25", "shasum": "" }, "require": { @@ -3727,6 +4014,7 @@ "suggest": { "ext-uopz": "*" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -3753,13 +4041,17 @@ "keywords": [ "global state" ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/master" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-09T10:26:33+00:00" + "time": "2020-12-24T12:27:19+00:00" }, { "name": "sebastian/lines-of-code", @@ -3767,12 +4059,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "62f65495957a0d4b39045a059bbf8d6d74db06f5" + "reference": "219c932af1aeee0b4eccbc53af2181ff50e14b24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/62f65495957a0d4b39045a059bbf8d6d74db06f5", - "reference": "62f65495957a0d4b39045a059bbf8d6d74db06f5", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/219c932af1aeee0b4eccbc53af2181ff50e14b24", + "reference": "219c932af1aeee0b4eccbc53af2181ff50e14b24", "shasum": "" }, "require": { @@ -3782,6 +4074,7 @@ "require-dev": { "phpunit/phpunit": "^9.3" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -3806,13 +4099,17 @@ ], "description": "Library for counting the lines of code in PHP source code", "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/master" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-09T10:28:00+00:00" + "time": "2020-12-24T12:28:42+00:00" }, { "name": "sebastian/object-enumerator", @@ -3820,12 +4117,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "bd926d4c9372e89f8eeff4d3e1d46886b3647959" + "reference": "da36684b10f17db8718e314fa8d84b2e0ed7132e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/bd926d4c9372e89f8eeff4d3e1d46886b3647959", - "reference": "bd926d4c9372e89f8eeff4d3e1d46886b3647959", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/da36684b10f17db8718e314fa8d84b2e0ed7132e", + "reference": "da36684b10f17db8718e314fa8d84b2e0ed7132e", "shasum": "" }, "require": { @@ -3836,6 +4133,7 @@ "require-dev": { "phpunit/phpunit": "^9.3" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -3859,13 +4157,17 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/master" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-09T10:26:42+00:00" + "time": "2020-12-24T12:27:27+00:00" }, { "name": "sebastian/object-reflector", @@ -3873,12 +4175,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "2ae863c8667f2c149b20d13782d11ce23ab995f8" + "reference": "6717d193da503616e69462cf98e2af3f4443335d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/2ae863c8667f2c149b20d13782d11ce23ab995f8", - "reference": "2ae863c8667f2c149b20d13782d11ce23ab995f8", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/6717d193da503616e69462cf98e2af3f4443335d", + "reference": "6717d193da503616e69462cf98e2af3f4443335d", "shasum": "" }, "require": { @@ -3887,6 +4189,7 @@ "require-dev": { "phpunit/phpunit": "^9.3" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -3910,13 +4213,17 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/master" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-09T10:26:50+00:00" + "time": "2020-12-24T12:27:35+00:00" }, { "name": "sebastian/recursion-context", @@ -3924,12 +4231,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "4c073073e68e3d2d5dd7a50ebfc53a912116b498" + "reference": "cee249a3e471aa870067fa6155991230c7507924" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/4c073073e68e3d2d5dd7a50ebfc53a912116b498", - "reference": "4c073073e68e3d2d5dd7a50ebfc53a912116b498", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cee249a3e471aa870067fa6155991230c7507924", + "reference": "cee249a3e471aa870067fa6155991230c7507924", "shasum": "" }, "require": { @@ -3938,6 +4245,7 @@ "require-dev": { "phpunit/phpunit": "^9.3" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -3969,13 +4277,17 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/master" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-09T10:27:25+00:00" + "time": "2020-12-24T12:28:07+00:00" }, { "name": "sebastian/resource-operations", @@ -3997,6 +4309,7 @@ "require-dev": { "phpunit/phpunit": "^9.0" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -4020,6 +4333,10 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -4034,12 +4351,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "dcac0d6b8489ed9975d01303f0903958ebad0ce4" + "reference": "67bfce3beb94968d175fdf117b80fc9a6b60bdd0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/dcac0d6b8489ed9975d01303f0903958ebad0ce4", - "reference": "dcac0d6b8489ed9975d01303f0903958ebad0ce4", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/67bfce3beb94968d175fdf117b80fc9a6b60bdd0", + "reference": "67bfce3beb94968d175fdf117b80fc9a6b60bdd0", "shasum": "" }, "require": { @@ -4048,6 +4365,7 @@ "require-dev": { "phpunit/phpunit": "^9.3" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -4072,13 +4390,17 @@ ], "description": "Collection of value objects that represent the types of the PHP type system", "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/master" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-09T10:27:33+00:00" + "time": "2020-12-24T12:28:15+00:00" }, { "name": "sebastian/version", @@ -4097,6 +4419,7 @@ "require": { "php": ">=7.3" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -4121,6 +4444,10 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -4161,6 +4488,10 @@ } ], "description": "IDE help files for Swoole.", + "support": { + "issues": "https://github.com/swoole/ide-helper/issues", + "source": "https://github.com/swoole/ide-helper/tree/4.5.5" + }, "time": "2020-10-14T18:05:12+00:00" }, { @@ -4169,12 +4500,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "d1d8b8fd9b605630aa73b1b384e246fee54e8ffa" + "reference": "15c96194f32e1b1aa30d1b302c71c5f83fd4dea9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/d1d8b8fd9b605630aa73b1b384e246fee54e8ffa", - "reference": "d1d8b8fd9b605630aa73b1b384e246fee54e8ffa", + "url": "https://api.github.com/repos/symfony/console/zipball/15c96194f32e1b1aa30d1b302c71c5f83fd4dea9", + "reference": "15c96194f32e1b1aa30d1b302c71c5f83fd4dea9", "shasum": "" }, "require": { @@ -4210,6 +4541,7 @@ "symfony/lock": "", "symfony/process": "" }, + "default-branch": true, "type": "library", "autoload": { "psr-4": { @@ -4241,6 +4573,9 @@ "console", "terminal" ], + "support": { + "source": "https://github.com/symfony/console/tree/5.x" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4255,7 +4590,7 @@ "type": "tidelift" } ], - "time": "2020-11-05T20:05:54+00:00" + "time": "2020-12-18T08:03:24+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4277,6 +4612,7 @@ "suggest": { "ext-ctype": "For best performance" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -4317,6 +4653,9 @@ "polyfill", "portable" ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/main" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4339,12 +4678,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "ee2f954ea0f9ab61dad0170eddc919ee83bef327" + "reference": "be092746c3ab9f9c62608c82e0f04687f8a879f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/ee2f954ea0f9ab61dad0170eddc919ee83bef327", - "reference": "ee2f954ea0f9ab61dad0170eddc919ee83bef327", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/be092746c3ab9f9c62608c82e0f04687f8a879f9", + "reference": "be092746c3ab9f9c62608c82e0f04687f8a879f9", "shasum": "" }, "require": { @@ -4353,6 +4692,7 @@ "suggest": { "ext-intl": "For best performance" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -4395,6 +4735,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/main" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4409,7 +4752,7 @@ "type": "tidelift" } ], - "time": "2020-10-26T13:35:45+00:00" + "time": "2020-11-13T15:40:22+00:00" }, { "name": "symfony/polyfill-intl-normalizer", @@ -4431,6 +4774,7 @@ "suggest": { "ext-intl": "For best performance" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -4476,6 +4820,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/main" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4512,6 +4859,7 @@ "suggest": { "ext-mbstring": "For best performance" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -4553,6 +4901,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/main" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4586,6 +4937,7 @@ "require": { "php": ">=7.1" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -4629,6 +4981,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/main" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4662,6 +5017,7 @@ "require": { "php": ">=7.1" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -4709,6 +5065,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/main" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4731,12 +5090,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "0aeee2f70f4550e6c48c9a796d98f5ceda58dfda" + "reference": "5c448a39281b671be2cc8d208e6df75ac2d4b366" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/0aeee2f70f4550e6c48c9a796d98f5ceda58dfda", - "reference": "0aeee2f70f4550e6c48c9a796d98f5ceda58dfda", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/5c448a39281b671be2cc8d208e6df75ac2d4b366", + "reference": "5c448a39281b671be2cc8d208e6df75ac2d4b366", "shasum": "" }, "require": { @@ -4746,6 +5105,7 @@ "suggest": { "symfony/service-implementation": "" }, + "default-branch": true, "type": "library", "extra": { "branch-version": "2.3", @@ -4786,6 +5146,9 @@ "interoperability", "standards" ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/main" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4800,7 +5163,7 @@ "type": "tidelift" } ], - "time": "2020-10-14T17:08:19+00:00" + "time": "2020-12-23T15:38:30+00:00" }, { "name": "symfony/string", @@ -4808,12 +5171,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "40e975edadd4e32cd16f3753b3bad65d9ac48242" + "reference": "5bd67751d2e3f7d6f770c9154b8fbcb2aa05f7ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/40e975edadd4e32cd16f3753b3bad65d9ac48242", - "reference": "40e975edadd4e32cd16f3753b3bad65d9ac48242", + "url": "https://api.github.com/repos/symfony/string/zipball/5bd67751d2e3f7d6f770c9154b8fbcb2aa05f7ed", + "reference": "5bd67751d2e3f7d6f770c9154b8fbcb2aa05f7ed", "shasum": "" }, "require": { @@ -4830,6 +5193,7 @@ "symfony/translation-contracts": "^1.1|^2", "symfony/var-exporter": "^4.4|^5.0" }, + "default-branch": true, "type": "library", "autoload": { "psr-4": { @@ -4866,6 +5230,9 @@ "utf-8", "utf8" ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.2.1" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4880,7 +5247,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:08:07+00:00" + "time": "2020-12-05T07:33:16+00:00" }, { "name": "theseer/tokenizer", @@ -4920,6 +5287,10 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/master" + }, "funding": [ { "url": "https://github.com/theseer", @@ -4934,12 +5305,12 @@ "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "e133d1fd8c9f22dd9bc43d1b7fc46e0f35692226" + "reference": "c5379903e5640e5f29024e71aa0817f7bd56102b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/e133d1fd8c9f22dd9bc43d1b7fc46e0f35692226", - "reference": "e133d1fd8c9f22dd9bc43d1b7fc46e0f35692226", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/c5379903e5640e5f29024e71aa0817f7bd56102b", + "reference": "c5379903e5640e5f29024e71aa0817f7bd56102b", "shasum": "" }, "require": { @@ -4991,6 +5362,10 @@ "keywords": [ "templating" ], + "support": { + "issues": "https://github.com/twigphp/Twig/issues", + "source": "https://github.com/twigphp/Twig/tree/2.x" + }, "funding": [ { "url": "https://github.com/fabpot", @@ -5001,7 +5376,7 @@ "type": "tidelift" } ], - "time": "2020-11-09T13:33:24+00:00" + "time": "2020-11-27T13:05:37+00:00" }, { "name": "vimeo/psalm", @@ -5102,6 +5477,10 @@ "inspection", "php" ], + "support": { + "issues": "https://github.com/vimeo/psalm/issues", + "source": "https://github.com/vimeo/psalm/tree/4.1.1" + }, "time": "2020-11-02T05:54:12+00:00" }, { @@ -5151,6 +5530,10 @@ "check", "validate" ], + "support": { + "issues": "https://github.com/webmozart/assert/issues", + "source": "https://github.com/webmozart/assert/tree/master" + }, "time": "2020-07-08T17:02:28+00:00" }, { @@ -5175,6 +5558,7 @@ "phpunit/phpunit": "^4.6", "sebastian/version": "^1.0.1" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -5197,6 +5581,10 @@ } ], "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", + "support": { + "issues": "https://github.com/webmozart/path-util/issues", + "source": "https://github.com/webmozart/path-util/tree/master" + }, "time": "2016-08-15T15:31:42+00:00" } ], @@ -5224,5 +5612,5 @@ "platform-overrides": { "php": "7.4" }, - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } diff --git a/docker-compose.yml b/docker-compose.yml index f0f54f9939..e082937c3e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -55,7 +55,6 @@ services: - traefik.http.routers.appwrite-secure.rule=PathPrefix(`/`) - traefik.http.routers.appwrite-secure.tls=true volumes: - - /var/run/docker.sock:/var/run/docker.sock - appwrite-uploads:/storage/uploads:rw - appwrite-cache:/storage/cache:rw - appwrite-config:/storage/config:rw @@ -103,6 +102,9 @@ services: - _APP_FUNCTIONS_TIMEOUT - _APP_FUNCTIONS_CONTAINERS - _APP_SYSTEM_RESPONSE_FORMAT + - _APP_FUNCTIONS_CPUS + - _APP_FUNCTIONS_MEMORY + - _APP_FUNCTIONS_MEMORY_SWAP appwrite-worker-usage: entrypoint: worker-usage @@ -112,6 +114,9 @@ services: restart: unless-stopped networks: - appwrite + volumes: + - ./app:/usr/src/code/app + - ./src:/usr/src/code/src depends_on: - redis - telegraf @@ -130,6 +135,9 @@ services: restart: unless-stopped networks: - appwrite + volumes: + - ./app:/usr/src/code/app + - ./src:/usr/src/code/src depends_on: - redis - mariadb @@ -151,6 +159,9 @@ services: restart: unless-stopped networks: - appwrite + volumes: + - ./app:/usr/src/code/app + - ./src:/usr/src/code/src depends_on: - redis - mariadb @@ -174,6 +185,9 @@ services: restart: unless-stopped networks: - appwrite + volumes: + - ./app:/usr/src/code/app + - ./src:/usr/src/code/src depends_on: - redis - mariadb @@ -196,12 +210,15 @@ services: restart: unless-stopped networks: - appwrite - depends_on: - - redis - - mariadb volumes: - appwrite-uploads:/storage/uploads:rw - appwrite-cache:/storage/cache:rw + - appwrite-functions:/storage/functions:rw + - ./app:/usr/src/code/app + - ./src:/usr/src/code/src + depends_on: + - redis + - mariadb environment: - _APP_ENV - _APP_REDIS_HOST @@ -220,12 +237,14 @@ services: restart: unless-stopped networks: - appwrite - depends_on: - - redis - - mariadb volumes: - appwrite-config:/storage/config:rw - appwrite-certificates:/storage/certificates:rw + - ./app:/usr/src/code/app + - ./src:/usr/src/code/src + depends_on: + - redis + - mariadb environment: - _APP_ENV - _APP_SYSTEM_SECURITY_EMAIL_ADDRESS @@ -245,13 +264,15 @@ services: restart: unless-stopped networks: - appwrite + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - appwrite-functions:/storage/functions:rw + - /tmp:/tmp:rw + - ./app:/usr/src/code/app + - ./src:/usr/src/code/src depends_on: - redis - mariadb - volumes: - - /var/run/docker.sock:/var/run/docker.sock - - /tmp:/tmp:rw - - appwrite-functions:/storage/functions:rw environment: - _APP_ENV - _APP_REDIS_HOST @@ -263,6 +284,9 @@ services: - _APP_DB_PASS - _APP_FUNCTIONS_TIMEOUT - _APP_FUNCTIONS_CONTAINERS + - _APP_FUNCTIONS_CPUS + - _APP_FUNCTIONS_MEMORY + - _APP_FUNCTIONS_MEMORY_SWAP appwrite-worker-mails: entrypoint: worker-mails @@ -272,6 +296,9 @@ services: restart: unless-stopped networks: - appwrite + volumes: + - ./app:/usr/src/code/app + - ./src:/usr/src/code/src depends_on: - redis - maildev @@ -288,6 +315,27 @@ services: - _APP_SMTP_USERNAME - _APP_SMTP_PASSWORD + appwrite-maintenance: + entrypoint: maintenance + container_name: appwrite-maintenance + build: + context: . + restart: unless-stopped + networks: + - appwrite + depends_on: + - redis + environment: + - _APP_ENV + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_MAINTENANCE_INTERVAL + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + appwrite-schedule: entrypoint: schedule container_name: appwrite-schedule @@ -296,6 +344,9 @@ services: restart: unless-stopped networks: - appwrite + volumes: + - ./app:/usr/src/code/app + - ./src:/usr/src/code/src depends_on: - redis environment: @@ -312,7 +363,7 @@ services: volumes: - appwrite-mariadb:/var/lib/mysql:rw ports: - - "3306:3306" + - "9502:3306" environment: - MYSQL_ROOT_PASSWORD=password - MYSQL_DATABASE=${_APP_DB_SCHEMA} @@ -372,7 +423,7 @@ services: container_name: appwrite-maildev restart: unless-stopped ports: - - '1080:80' + - '9503:80' networks: - appwrite @@ -381,7 +432,7 @@ services: container_name: appwrite-request-catcher restart: unless-stopped ports: - - '5000:5000' + - '9504:5000' networks: - appwrite diff --git a/docker/environments/README.md b/docker/environments/README.md index 6ffaf1d4fb..7713755301 100644 --- a/docker/environments/README.md +++ b/docker/environments/README.md @@ -2,4 +2,12 @@ Docker based enviornments for Appwrite Functions. You can use this Docker images to locally tests your functions by executing them on your local desktop or server. -All the supported enviornments are based on Docker Alpine images. \ No newline at end of file +All the supported enviornments are based on Docker Alpine images. + +## Build + +Build envs for all supported cloud functions (multicore builds) + +```bash +bash ./docker/environments/build.sh +``` \ No newline at end of file diff --git a/docker/environments/build.sh b/docker/environments/build.sh new file mode 100644 index 0000000000..0dc07947a8 --- /dev/null +++ b/docker/environments/build.sh @@ -0,0 +1,22 @@ +echo 'Starting build...' + +echo 'Deno 1.2...' +docker buildx build --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le -t appwrite/env-deno-1.2:1.0.0 ./docker/environments/deno-1.2/ --push + +echo 'Deno 1.5...' +docker buildx build --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le -t appwrite/env-deno-1.5:1.0.0 ./docker/environments/deno-1.5/ --push + +echo 'Node 14.5...' +docker buildx build --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le -t appwrite/env-node-14.5:1.0.0 ./docker/environments/node-14.5/ --push + +echo 'PHP 7.4...' +docker buildx build --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le -t appwrite/env-php-7.4:1.0.0 ./docker/environments/php-7.4/ --push + +echo 'PHP 8.0...' +docker buildx build --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le -t appwrite/env-php-8.0:1.0.0 ./docker/environments/php-8.0/ --push + +echo 'Python 3.8...' +docker buildx build --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le -t appwrite/env-python-3.8:1.0.0 ./docker/environments/python-3.8/ --push + +echo 'Ruby 2.7...' +docker buildx build --platform linux/amd64,linux/arm64,linux/386,linux/ppc64le -t appwrite/env-ruby-2.7:1.0.2 ./docker/environments/ruby-2.7/ --push diff --git a/docker/environments/deno-1.2/build.sh b/docker/environments/deno-1.2/build.sh deleted file mode 100644 index 5eaaffb491..0000000000 --- a/docker/environments/deno-1.2/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -echo 'Starting Deno 1.2 build...' - -docker build --tag appwrite/env-deno:1.2 . - -echo 'Pushing Deno 1.2 build to registry...' - -docker push appwrite/env-deno:1.2 \ No newline at end of file diff --git a/docker/environments/deno-1.5/Dockerfile b/docker/environments/deno-1.5/Dockerfile new file mode 100644 index 0000000000..4d48179bab --- /dev/null +++ b/docker/environments/deno-1.5/Dockerfile @@ -0,0 +1,11 @@ +FROM hayd/deno:alpine-1.5.0 + +LABEL maintainer="team@appwrite.io" + +RUN apk add tar + +RUN mkdir /usr/local/src + +WORKDIR /usr/local/src/ + +ENV DENO_DIR=/usr/local/src/.appwrite \ No newline at end of file diff --git a/docker/environments/node-14.5/build.sh b/docker/environments/node-14.5/build.sh deleted file mode 100644 index d81449f267..0000000000 --- a/docker/environments/node-14.5/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -echo 'Starting Node 14.5 build...' - -docker build --tag appwrite/env-node:14.5 . - -echo 'Pushing Node 14.5 build to registry...' - -docker push appwrite/env-node:14.5 \ No newline at end of file diff --git a/docker/environments/php-7.4/build.sh b/docker/environments/php-7.4/build.sh deleted file mode 100644 index 84b20e4d42..0000000000 --- a/docker/environments/php-7.4/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -echo 'Starting PHP 7.4 build...' - -docker build --tag appwrite/env-php:7.4 . - -echo 'Pushing PHP 7.4 build to registry...' - -docker push appwrite/env-php:7.4 \ No newline at end of file diff --git a/docker/environments/php-8.0/Dockerfile b/docker/environments/php-8.0/Dockerfile new file mode 100644 index 0000000000..221b0c4a15 --- /dev/null +++ b/docker/environments/php-8.0/Dockerfile @@ -0,0 +1,9 @@ +FROM php:8.0-cli-alpine + +LABEL maintainer="team@appwrite.io" + +RUN apk add tar + +RUN mkdir /usr/local/src + +WORKDIR /usr/local/src/ \ No newline at end of file diff --git a/docker/environments/python-3.8/Dockerfile b/docker/environments/python-3.8/Dockerfile index 91e2fbc27f..659644bd24 100644 --- a/docker/environments/python-3.8/Dockerfile +++ b/docker/environments/python-3.8/Dockerfile @@ -8,4 +8,4 @@ RUN mkdir /usr/local/src WORKDIR /usr/local/src/ -ENV PIP_TARGET=/usr/local/src/.appwrite \ No newline at end of file +ENV PYTHONPATH "${PYTHONPATH}:/usr/local/src/.appwrite" \ No newline at end of file diff --git a/docker/environments/python-3.8/build.sh b/docker/environments/python-3.8/build.sh deleted file mode 100644 index 2dc97b783b..0000000000 --- a/docker/environments/python-3.8/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -echo 'Starting Python 3.8 build...' - -docker build --tag appwrite/env-python:3.8 . - -echo 'Pushing Python 3.8 build to registry...' - -docker push appwrite/env-python:3.8 \ No newline at end of file diff --git a/docker/environments/ruby-2.7/Dockerfile b/docker/environments/ruby-2.7/Dockerfile index 5b93233762..36cbb56746 100644 --- a/docker/environments/ruby-2.7/Dockerfile +++ b/docker/environments/ruby-2.7/Dockerfile @@ -8,5 +8,5 @@ RUN mkdir /usr/local/src WORKDIR /usr/local/src/ -ENV GEM_PATH=/usr/local/src/.appwrite/2.1.0 +ENV GEM_PATH=/usr/local/src/.appwrite ENV GEM_SPEC_CACHE=/usr/local/src/.appwrite/specs \ No newline at end of file diff --git a/docker/environments/ruby-2.7/build.sh b/docker/environments/ruby-2.7/build.sh deleted file mode 100644 index 377d62a231..0000000000 --- a/docker/environments/ruby-2.7/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -echo 'Starting Ruby 2.7 build...' - -docker build --tag appwrite/env-ruby:2.7 . - -echo 'Pushing Ruby 2.7 build to registry...' - -docker push appwrite/env-ruby:2.7 \ No newline at end of file diff --git a/app/sdks/client-flutter/docs/examples/account/create-o-auth2session.md b/docs/examples/0.6.2/client-flutter/examples/account/create-o-auth2session.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/account/create-o-auth2session.md rename to docs/examples/0.6.2/client-flutter/examples/account/create-o-auth2session.md diff --git a/app/sdks/client-flutter/docs/examples/account/create-recovery.md b/docs/examples/0.6.2/client-flutter/examples/account/create-recovery.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/account/create-recovery.md rename to docs/examples/0.6.2/client-flutter/examples/account/create-recovery.md diff --git a/app/sdks/client-flutter/docs/examples/account/create-session.md b/docs/examples/0.6.2/client-flutter/examples/account/create-session.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/account/create-session.md rename to docs/examples/0.6.2/client-flutter/examples/account/create-session.md diff --git a/app/sdks/client-flutter/docs/examples/account/create-verification.md b/docs/examples/0.6.2/client-flutter/examples/account/create-verification.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/account/create-verification.md rename to docs/examples/0.6.2/client-flutter/examples/account/create-verification.md diff --git a/app/sdks/client-flutter/docs/examples/account/create.md b/docs/examples/0.6.2/client-flutter/examples/account/create.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/account/create.md rename to docs/examples/0.6.2/client-flutter/examples/account/create.md diff --git a/app/sdks/client-flutter/docs/examples/account/delete-session.md b/docs/examples/0.6.2/client-flutter/examples/account/delete-session.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/account/delete-session.md rename to docs/examples/0.6.2/client-flutter/examples/account/delete-session.md diff --git a/app/sdks/client-flutter/docs/examples/account/get-sessions.md b/docs/examples/0.6.2/client-flutter/examples/account/delete-sessions.md similarity index 89% rename from app/sdks/client-flutter/docs/examples/account/get-sessions.md rename to docs/examples/0.6.2/client-flutter/examples/account/delete-sessions.md index e921bda59b..74e494db25 100644 --- a/app/sdks/client-flutter/docs/examples/account/get-sessions.md +++ b/docs/examples/0.6.2/client-flutter/examples/account/delete-sessions.md @@ -9,7 +9,7 @@ void main() { // Init SDK .setProject('5df5acd0d48c2') // Your project ID ; - Future result = account.getSessions( ); + Future result = account.deleteSessions(); result .then((response) { diff --git a/app/sdks/client-flutter/docs/examples/account/delete.md b/docs/examples/0.6.2/client-flutter/examples/account/delete.md similarity index 91% rename from app/sdks/client-flutter/docs/examples/account/delete.md rename to docs/examples/0.6.2/client-flutter/examples/account/delete.md index 2853a1f437..2d9d302af0 100644 --- a/app/sdks/client-flutter/docs/examples/account/delete.md +++ b/docs/examples/0.6.2/client-flutter/examples/account/delete.md @@ -9,7 +9,7 @@ void main() { // Init SDK .setProject('5df5acd0d48c2') // Your project ID ; - Future result = account.delete( ); + Future result = account.delete(); result .then((response) { diff --git a/app/sdks/client-flutter/docs/examples/account/get-logs.md b/docs/examples/0.6.2/client-flutter/examples/account/get-logs.md similarity index 90% rename from app/sdks/client-flutter/docs/examples/account/get-logs.md rename to docs/examples/0.6.2/client-flutter/examples/account/get-logs.md index 8f52f8220b..4240e55eec 100644 --- a/app/sdks/client-flutter/docs/examples/account/get-logs.md +++ b/docs/examples/0.6.2/client-flutter/examples/account/get-logs.md @@ -9,7 +9,7 @@ void main() { // Init SDK .setProject('5df5acd0d48c2') // Your project ID ; - Future result = account.getLogs( ); + Future result = account.getLogs(); result .then((response) { diff --git a/app/sdks/client-flutter/docs/examples/account/get-prefs.md b/docs/examples/0.6.2/client-flutter/examples/account/get-prefs.md similarity index 90% rename from app/sdks/client-flutter/docs/examples/account/get-prefs.md rename to docs/examples/0.6.2/client-flutter/examples/account/get-prefs.md index 01d57a5499..d98dcd7290 100644 --- a/app/sdks/client-flutter/docs/examples/account/get-prefs.md +++ b/docs/examples/0.6.2/client-flutter/examples/account/get-prefs.md @@ -9,7 +9,7 @@ void main() { // Init SDK .setProject('5df5acd0d48c2') // Your project ID ; - Future result = account.getPrefs( ); + Future result = account.getPrefs(); result .then((response) { diff --git a/docs/examples/0.6.2/client-flutter/examples/account/get-sessions.md b/docs/examples/0.6.2/client-flutter/examples/account/get-sessions.md new file mode 100644 index 0000000000..b5ecd34e45 --- /dev/null +++ b/docs/examples/0.6.2/client-flutter/examples/account/get-sessions.md @@ -0,0 +1,20 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = account.getSessions(); + + result + .then((response) { + print(response); + }).catchError((error) { + print(error.response); + }); +} \ No newline at end of file diff --git a/app/sdks/client-flutter/docs/examples/account/get.md b/docs/examples/0.6.2/client-flutter/examples/account/get.md similarity index 91% rename from app/sdks/client-flutter/docs/examples/account/get.md rename to docs/examples/0.6.2/client-flutter/examples/account/get.md index 35241b5607..a77fbf3ad5 100644 --- a/app/sdks/client-flutter/docs/examples/account/get.md +++ b/docs/examples/0.6.2/client-flutter/examples/account/get.md @@ -9,7 +9,7 @@ void main() { // Init SDK .setProject('5df5acd0d48c2') // Your project ID ; - Future result = account.get( ); + Future result = account.get(); result .then((response) { diff --git a/app/sdks/client-flutter/docs/examples/account/update-email.md b/docs/examples/0.6.2/client-flutter/examples/account/update-email.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/account/update-email.md rename to docs/examples/0.6.2/client-flutter/examples/account/update-email.md diff --git a/app/sdks/client-flutter/docs/examples/account/update-name.md b/docs/examples/0.6.2/client-flutter/examples/account/update-name.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/account/update-name.md rename to docs/examples/0.6.2/client-flutter/examples/account/update-name.md diff --git a/app/sdks/client-flutter/docs/examples/account/update-password.md b/docs/examples/0.6.2/client-flutter/examples/account/update-password.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/account/update-password.md rename to docs/examples/0.6.2/client-flutter/examples/account/update-password.md diff --git a/app/sdks/client-flutter/docs/examples/account/update-prefs.md b/docs/examples/0.6.2/client-flutter/examples/account/update-prefs.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/account/update-prefs.md rename to docs/examples/0.6.2/client-flutter/examples/account/update-prefs.md diff --git a/app/sdks/client-flutter/docs/examples/account/update-recovery.md b/docs/examples/0.6.2/client-flutter/examples/account/update-recovery.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/account/update-recovery.md rename to docs/examples/0.6.2/client-flutter/examples/account/update-recovery.md diff --git a/app/sdks/client-flutter/docs/examples/account/update-verification.md b/docs/examples/0.6.2/client-flutter/examples/account/update-verification.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/account/update-verification.md rename to docs/examples/0.6.2/client-flutter/examples/account/update-verification.md diff --git a/app/sdks/client-flutter/docs/examples/avatars/get-browser.md b/docs/examples/0.6.2/client-flutter/examples/avatars/get-browser.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/avatars/get-browser.md rename to docs/examples/0.6.2/client-flutter/examples/avatars/get-browser.md diff --git a/app/sdks/client-flutter/docs/examples/avatars/get-credit-card.md b/docs/examples/0.6.2/client-flutter/examples/avatars/get-credit-card.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/avatars/get-credit-card.md rename to docs/examples/0.6.2/client-flutter/examples/avatars/get-credit-card.md diff --git a/app/sdks/client-flutter/docs/examples/avatars/get-favicon.md b/docs/examples/0.6.2/client-flutter/examples/avatars/get-favicon.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/avatars/get-favicon.md rename to docs/examples/0.6.2/client-flutter/examples/avatars/get-favicon.md diff --git a/app/sdks/client-flutter/docs/examples/avatars/get-flag.md b/docs/examples/0.6.2/client-flutter/examples/avatars/get-flag.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/avatars/get-flag.md rename to docs/examples/0.6.2/client-flutter/examples/avatars/get-flag.md diff --git a/app/sdks/client-flutter/docs/examples/avatars/get-image.md b/docs/examples/0.6.2/client-flutter/examples/avatars/get-image.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/avatars/get-image.md rename to docs/examples/0.6.2/client-flutter/examples/avatars/get-image.md diff --git a/app/sdks/client-flutter/docs/examples/avatars/get-initials.md b/docs/examples/0.6.2/client-flutter/examples/avatars/get-initials.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/avatars/get-initials.md rename to docs/examples/0.6.2/client-flutter/examples/avatars/get-initials.md diff --git a/app/sdks/client-flutter/docs/examples/avatars/get-q-r.md b/docs/examples/0.6.2/client-flutter/examples/avatars/get-q-r.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/avatars/get-q-r.md rename to docs/examples/0.6.2/client-flutter/examples/avatars/get-q-r.md diff --git a/app/sdks/client-flutter/docs/examples/database/create-document.md b/docs/examples/0.6.2/client-flutter/examples/database/create-document.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/database/create-document.md rename to docs/examples/0.6.2/client-flutter/examples/database/create-document.md diff --git a/app/sdks/client-flutter/docs/examples/database/delete-document.md b/docs/examples/0.6.2/client-flutter/examples/database/delete-document.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/database/delete-document.md rename to docs/examples/0.6.2/client-flutter/examples/database/delete-document.md diff --git a/app/sdks/client-flutter/docs/examples/database/get-document.md b/docs/examples/0.6.2/client-flutter/examples/database/get-document.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/database/get-document.md rename to docs/examples/0.6.2/client-flutter/examples/database/get-document.md diff --git a/app/sdks/client-flutter/docs/examples/database/list-documents.md b/docs/examples/0.6.2/client-flutter/examples/database/list-documents.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/database/list-documents.md rename to docs/examples/0.6.2/client-flutter/examples/database/list-documents.md diff --git a/app/sdks/client-flutter/docs/examples/database/update-document.md b/docs/examples/0.6.2/client-flutter/examples/database/update-document.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/database/update-document.md rename to docs/examples/0.6.2/client-flutter/examples/database/update-document.md diff --git a/app/sdks/client-flutter/docs/examples/locale/get-continents.md b/docs/examples/0.6.2/client-flutter/examples/locale/get-continents.md similarity index 89% rename from app/sdks/client-flutter/docs/examples/locale/get-continents.md rename to docs/examples/0.6.2/client-flutter/examples/locale/get-continents.md index 2a6a6413ba..60d4f32c4f 100644 --- a/app/sdks/client-flutter/docs/examples/locale/get-continents.md +++ b/docs/examples/0.6.2/client-flutter/examples/locale/get-continents.md @@ -9,7 +9,7 @@ void main() { // Init SDK .setProject('5df5acd0d48c2') // Your project ID ; - Future result = locale.getContinents( ); + Future result = locale.getContinents(); result .then((response) { diff --git a/docs/examples/0.6.2/client-flutter/examples/locale/get-countries-e-u.md b/docs/examples/0.6.2/client-flutter/examples/locale/get-countries-e-u.md new file mode 100644 index 0000000000..766006fecc --- /dev/null +++ b/docs/examples/0.6.2/client-flutter/examples/locale/get-countries-e-u.md @@ -0,0 +1,20 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Locale locale = Locale(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = locale.getCountriesEU(); + + result + .then((response) { + print(response); + }).catchError((error) { + print(error.response); + }); +} \ No newline at end of file diff --git a/app/sdks/client-flutter/docs/examples/locale/get-countries-e-u.md b/docs/examples/0.6.2/client-flutter/examples/locale/get-countries-phones.md similarity index 89% rename from app/sdks/client-flutter/docs/examples/locale/get-countries-e-u.md rename to docs/examples/0.6.2/client-flutter/examples/locale/get-countries-phones.md index 1934fc6709..786eeb0b70 100644 --- a/app/sdks/client-flutter/docs/examples/locale/get-countries-e-u.md +++ b/docs/examples/0.6.2/client-flutter/examples/locale/get-countries-phones.md @@ -9,7 +9,7 @@ void main() { // Init SDK .setProject('5df5acd0d48c2') // Your project ID ; - Future result = locale.getCountriesEU( ); + Future result = locale.getCountriesPhones(); result .then((response) { diff --git a/app/sdks/client-flutter/docs/examples/locale/get-countries.md b/docs/examples/0.6.2/client-flutter/examples/locale/get-countries.md similarity index 89% rename from app/sdks/client-flutter/docs/examples/locale/get-countries.md rename to docs/examples/0.6.2/client-flutter/examples/locale/get-countries.md index 104584968f..0570421ef9 100644 --- a/app/sdks/client-flutter/docs/examples/locale/get-countries.md +++ b/docs/examples/0.6.2/client-flutter/examples/locale/get-countries.md @@ -9,7 +9,7 @@ void main() { // Init SDK .setProject('5df5acd0d48c2') // Your project ID ; - Future result = locale.getCountries( ); + Future result = locale.getCountries(); result .then((response) { diff --git a/app/sdks/client-flutter/docs/examples/locale/get-currencies.md b/docs/examples/0.6.2/client-flutter/examples/locale/get-currencies.md similarity index 89% rename from app/sdks/client-flutter/docs/examples/locale/get-currencies.md rename to docs/examples/0.6.2/client-flutter/examples/locale/get-currencies.md index 8dc01fc68e..7846c3c710 100644 --- a/app/sdks/client-flutter/docs/examples/locale/get-currencies.md +++ b/docs/examples/0.6.2/client-flutter/examples/locale/get-currencies.md @@ -9,7 +9,7 @@ void main() { // Init SDK .setProject('5df5acd0d48c2') // Your project ID ; - Future result = locale.getCurrencies( ); + Future result = locale.getCurrencies(); result .then((response) { diff --git a/app/sdks/client-flutter/docs/examples/locale/get-languages.md b/docs/examples/0.6.2/client-flutter/examples/locale/get-languages.md similarity index 89% rename from app/sdks/client-flutter/docs/examples/locale/get-languages.md rename to docs/examples/0.6.2/client-flutter/examples/locale/get-languages.md index a4124d3cbd..4f526383fa 100644 --- a/app/sdks/client-flutter/docs/examples/locale/get-languages.md +++ b/docs/examples/0.6.2/client-flutter/examples/locale/get-languages.md @@ -9,7 +9,7 @@ void main() { // Init SDK .setProject('5df5acd0d48c2') // Your project ID ; - Future result = locale.getLanguages( ); + Future result = locale.getLanguages(); result .then((response) { diff --git a/app/sdks/client-flutter/docs/examples/locale/get.md b/docs/examples/0.6.2/client-flutter/examples/locale/get.md similarity index 91% rename from app/sdks/client-flutter/docs/examples/locale/get.md rename to docs/examples/0.6.2/client-flutter/examples/locale/get.md index 189fceb7d1..2dbdd47f63 100644 --- a/app/sdks/client-flutter/docs/examples/locale/get.md +++ b/docs/examples/0.6.2/client-flutter/examples/locale/get.md @@ -9,7 +9,7 @@ void main() { // Init SDK .setProject('5df5acd0d48c2') // Your project ID ; - Future result = locale.get( ); + Future result = locale.get(); result .then((response) { diff --git a/app/sdks/client-flutter/docs/examples/storage/create-file.md b/docs/examples/0.6.2/client-flutter/examples/storage/create-file.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/storage/create-file.md rename to docs/examples/0.6.2/client-flutter/examples/storage/create-file.md diff --git a/app/sdks/client-flutter/docs/examples/storage/delete-file.md b/docs/examples/0.6.2/client-flutter/examples/storage/delete-file.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/storage/delete-file.md rename to docs/examples/0.6.2/client-flutter/examples/storage/delete-file.md diff --git a/app/sdks/client-flutter/docs/examples/storage/get-file-download.md b/docs/examples/0.6.2/client-flutter/examples/storage/get-file-download.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/storage/get-file-download.md rename to docs/examples/0.6.2/client-flutter/examples/storage/get-file-download.md diff --git a/app/sdks/client-flutter/docs/examples/storage/get-file-preview.md b/docs/examples/0.6.2/client-flutter/examples/storage/get-file-preview.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/storage/get-file-preview.md rename to docs/examples/0.6.2/client-flutter/examples/storage/get-file-preview.md diff --git a/app/sdks/client-flutter/docs/examples/storage/get-file-view.md b/docs/examples/0.6.2/client-flutter/examples/storage/get-file-view.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/storage/get-file-view.md rename to docs/examples/0.6.2/client-flutter/examples/storage/get-file-view.md diff --git a/app/sdks/client-flutter/docs/examples/storage/get-file.md b/docs/examples/0.6.2/client-flutter/examples/storage/get-file.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/storage/get-file.md rename to docs/examples/0.6.2/client-flutter/examples/storage/get-file.md diff --git a/app/sdks/client-flutter/docs/examples/storage/list-files.md b/docs/examples/0.6.2/client-flutter/examples/storage/list-files.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/storage/list-files.md rename to docs/examples/0.6.2/client-flutter/examples/storage/list-files.md diff --git a/app/sdks/client-flutter/docs/examples/storage/update-file.md b/docs/examples/0.6.2/client-flutter/examples/storage/update-file.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/storage/update-file.md rename to docs/examples/0.6.2/client-flutter/examples/storage/update-file.md diff --git a/app/sdks/client-flutter/docs/examples/teams/create-membership.md b/docs/examples/0.6.2/client-flutter/examples/teams/create-membership.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/teams/create-membership.md rename to docs/examples/0.6.2/client-flutter/examples/teams/create-membership.md diff --git a/app/sdks/client-flutter/docs/examples/teams/create.md b/docs/examples/0.6.2/client-flutter/examples/teams/create.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/teams/create.md rename to docs/examples/0.6.2/client-flutter/examples/teams/create.md diff --git a/app/sdks/client-flutter/docs/examples/teams/delete-membership.md b/docs/examples/0.6.2/client-flutter/examples/teams/delete-membership.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/teams/delete-membership.md rename to docs/examples/0.6.2/client-flutter/examples/teams/delete-membership.md diff --git a/app/sdks/client-flutter/docs/examples/teams/delete.md b/docs/examples/0.6.2/client-flutter/examples/teams/delete.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/teams/delete.md rename to docs/examples/0.6.2/client-flutter/examples/teams/delete.md diff --git a/app/sdks/client-flutter/docs/examples/teams/get-memberships.md b/docs/examples/0.6.2/client-flutter/examples/teams/get-memberships.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/teams/get-memberships.md rename to docs/examples/0.6.2/client-flutter/examples/teams/get-memberships.md diff --git a/app/sdks/client-flutter/docs/examples/teams/get.md b/docs/examples/0.6.2/client-flutter/examples/teams/get.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/teams/get.md rename to docs/examples/0.6.2/client-flutter/examples/teams/get.md diff --git a/app/sdks/client-flutter/docs/examples/teams/list.md b/docs/examples/0.6.2/client-flutter/examples/teams/list.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/teams/list.md rename to docs/examples/0.6.2/client-flutter/examples/teams/list.md diff --git a/app/sdks/client-flutter/docs/examples/teams/update-membership-status.md b/docs/examples/0.6.2/client-flutter/examples/teams/update-membership-status.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/teams/update-membership-status.md rename to docs/examples/0.6.2/client-flutter/examples/teams/update-membership-status.md diff --git a/app/sdks/client-flutter/docs/examples/teams/update.md b/docs/examples/0.6.2/client-flutter/examples/teams/update.md similarity index 100% rename from app/sdks/client-flutter/docs/examples/teams/update.md rename to docs/examples/0.6.2/client-flutter/examples/teams/update.md diff --git a/app/sdks/client-web/docs/examples/account/create-o-auth2session.md b/docs/examples/0.6.2/client-web/examples/account/create-o-auth2session.md similarity index 100% rename from app/sdks/client-web/docs/examples/account/create-o-auth2session.md rename to docs/examples/0.6.2/client-web/examples/account/create-o-auth2session.md diff --git a/app/sdks/client-web/docs/examples/account/create-recovery.md b/docs/examples/0.6.2/client-web/examples/account/create-recovery.md similarity index 100% rename from app/sdks/client-web/docs/examples/account/create-recovery.md rename to docs/examples/0.6.2/client-web/examples/account/create-recovery.md diff --git a/app/sdks/client-web/docs/examples/account/create-session.md b/docs/examples/0.6.2/client-web/examples/account/create-session.md similarity index 100% rename from app/sdks/client-web/docs/examples/account/create-session.md rename to docs/examples/0.6.2/client-web/examples/account/create-session.md diff --git a/app/sdks/client-web/docs/examples/account/create-verification.md b/docs/examples/0.6.2/client-web/examples/account/create-verification.md similarity index 100% rename from app/sdks/client-web/docs/examples/account/create-verification.md rename to docs/examples/0.6.2/client-web/examples/account/create-verification.md diff --git a/app/sdks/client-web/docs/examples/account/create.md b/docs/examples/0.6.2/client-web/examples/account/create.md similarity index 100% rename from app/sdks/client-web/docs/examples/account/create.md rename to docs/examples/0.6.2/client-web/examples/account/create.md diff --git a/app/sdks/client-web/docs/examples/account/delete-session.md b/docs/examples/0.6.2/client-web/examples/account/delete-session.md similarity index 100% rename from app/sdks/client-web/docs/examples/account/delete-session.md rename to docs/examples/0.6.2/client-web/examples/account/delete-session.md diff --git a/app/sdks/client-web/docs/examples/account/delete-sessions.md b/docs/examples/0.6.2/client-web/examples/account/delete-sessions.md similarity index 100% rename from app/sdks/client-web/docs/examples/account/delete-sessions.md rename to docs/examples/0.6.2/client-web/examples/account/delete-sessions.md diff --git a/app/sdks/client-web/docs/examples/account/delete.md b/docs/examples/0.6.2/client-web/examples/account/delete.md similarity index 100% rename from app/sdks/client-web/docs/examples/account/delete.md rename to docs/examples/0.6.2/client-web/examples/account/delete.md diff --git a/app/sdks/client-web/docs/examples/account/get-logs.md b/docs/examples/0.6.2/client-web/examples/account/get-logs.md similarity index 100% rename from app/sdks/client-web/docs/examples/account/get-logs.md rename to docs/examples/0.6.2/client-web/examples/account/get-logs.md diff --git a/app/sdks/client-web/docs/examples/account/get-prefs.md b/docs/examples/0.6.2/client-web/examples/account/get-prefs.md similarity index 100% rename from app/sdks/client-web/docs/examples/account/get-prefs.md rename to docs/examples/0.6.2/client-web/examples/account/get-prefs.md diff --git a/app/sdks/client-web/docs/examples/account/get-sessions.md b/docs/examples/0.6.2/client-web/examples/account/get-sessions.md similarity index 100% rename from app/sdks/client-web/docs/examples/account/get-sessions.md rename to docs/examples/0.6.2/client-web/examples/account/get-sessions.md diff --git a/app/sdks/client-web/docs/examples/account/get.md b/docs/examples/0.6.2/client-web/examples/account/get.md similarity index 100% rename from app/sdks/client-web/docs/examples/account/get.md rename to docs/examples/0.6.2/client-web/examples/account/get.md diff --git a/app/sdks/client-web/docs/examples/account/update-email.md b/docs/examples/0.6.2/client-web/examples/account/update-email.md similarity index 100% rename from app/sdks/client-web/docs/examples/account/update-email.md rename to docs/examples/0.6.2/client-web/examples/account/update-email.md diff --git a/app/sdks/client-web/docs/examples/account/update-name.md b/docs/examples/0.6.2/client-web/examples/account/update-name.md similarity index 100% rename from app/sdks/client-web/docs/examples/account/update-name.md rename to docs/examples/0.6.2/client-web/examples/account/update-name.md diff --git a/app/sdks/client-web/docs/examples/account/update-password.md b/docs/examples/0.6.2/client-web/examples/account/update-password.md similarity index 100% rename from app/sdks/client-web/docs/examples/account/update-password.md rename to docs/examples/0.6.2/client-web/examples/account/update-password.md diff --git a/app/sdks/client-web/docs/examples/account/update-prefs.md b/docs/examples/0.6.2/client-web/examples/account/update-prefs.md similarity index 100% rename from app/sdks/client-web/docs/examples/account/update-prefs.md rename to docs/examples/0.6.2/client-web/examples/account/update-prefs.md diff --git a/app/sdks/client-web/docs/examples/account/update-recovery.md b/docs/examples/0.6.2/client-web/examples/account/update-recovery.md similarity index 100% rename from app/sdks/client-web/docs/examples/account/update-recovery.md rename to docs/examples/0.6.2/client-web/examples/account/update-recovery.md diff --git a/app/sdks/client-web/docs/examples/account/update-verification.md b/docs/examples/0.6.2/client-web/examples/account/update-verification.md similarity index 100% rename from app/sdks/client-web/docs/examples/account/update-verification.md rename to docs/examples/0.6.2/client-web/examples/account/update-verification.md diff --git a/app/sdks/client-web/docs/examples/avatars/get-browser.md b/docs/examples/0.6.2/client-web/examples/avatars/get-browser.md similarity index 100% rename from app/sdks/client-web/docs/examples/avatars/get-browser.md rename to docs/examples/0.6.2/client-web/examples/avatars/get-browser.md diff --git a/app/sdks/client-web/docs/examples/avatars/get-credit-card.md b/docs/examples/0.6.2/client-web/examples/avatars/get-credit-card.md similarity index 100% rename from app/sdks/client-web/docs/examples/avatars/get-credit-card.md rename to docs/examples/0.6.2/client-web/examples/avatars/get-credit-card.md diff --git a/app/sdks/client-web/docs/examples/avatars/get-favicon.md b/docs/examples/0.6.2/client-web/examples/avatars/get-favicon.md similarity index 100% rename from app/sdks/client-web/docs/examples/avatars/get-favicon.md rename to docs/examples/0.6.2/client-web/examples/avatars/get-favicon.md diff --git a/app/sdks/client-web/docs/examples/avatars/get-flag.md b/docs/examples/0.6.2/client-web/examples/avatars/get-flag.md similarity index 100% rename from app/sdks/client-web/docs/examples/avatars/get-flag.md rename to docs/examples/0.6.2/client-web/examples/avatars/get-flag.md diff --git a/app/sdks/client-web/docs/examples/avatars/get-image.md b/docs/examples/0.6.2/client-web/examples/avatars/get-image.md similarity index 100% rename from app/sdks/client-web/docs/examples/avatars/get-image.md rename to docs/examples/0.6.2/client-web/examples/avatars/get-image.md diff --git a/app/sdks/client-web/docs/examples/avatars/get-initials.md b/docs/examples/0.6.2/client-web/examples/avatars/get-initials.md similarity index 100% rename from app/sdks/client-web/docs/examples/avatars/get-initials.md rename to docs/examples/0.6.2/client-web/examples/avatars/get-initials.md diff --git a/app/sdks/client-web/docs/examples/avatars/get-q-r.md b/docs/examples/0.6.2/client-web/examples/avatars/get-q-r.md similarity index 100% rename from app/sdks/client-web/docs/examples/avatars/get-q-r.md rename to docs/examples/0.6.2/client-web/examples/avatars/get-q-r.md diff --git a/app/sdks/client-web/docs/examples/database/create-document.md b/docs/examples/0.6.2/client-web/examples/database/create-document.md similarity index 100% rename from app/sdks/client-web/docs/examples/database/create-document.md rename to docs/examples/0.6.2/client-web/examples/database/create-document.md diff --git a/app/sdks/client-web/docs/examples/database/delete-document.md b/docs/examples/0.6.2/client-web/examples/database/delete-document.md similarity index 100% rename from app/sdks/client-web/docs/examples/database/delete-document.md rename to docs/examples/0.6.2/client-web/examples/database/delete-document.md diff --git a/app/sdks/client-web/docs/examples/database/get-document.md b/docs/examples/0.6.2/client-web/examples/database/get-document.md similarity index 100% rename from app/sdks/client-web/docs/examples/database/get-document.md rename to docs/examples/0.6.2/client-web/examples/database/get-document.md diff --git a/app/sdks/client-web/docs/examples/database/list-documents.md b/docs/examples/0.6.2/client-web/examples/database/list-documents.md similarity index 100% rename from app/sdks/client-web/docs/examples/database/list-documents.md rename to docs/examples/0.6.2/client-web/examples/database/list-documents.md diff --git a/app/sdks/client-web/docs/examples/database/update-document.md b/docs/examples/0.6.2/client-web/examples/database/update-document.md similarity index 100% rename from app/sdks/client-web/docs/examples/database/update-document.md rename to docs/examples/0.6.2/client-web/examples/database/update-document.md diff --git a/app/sdks/client-web/docs/examples/locale/get-continents.md b/docs/examples/0.6.2/client-web/examples/locale/get-continents.md similarity index 100% rename from app/sdks/client-web/docs/examples/locale/get-continents.md rename to docs/examples/0.6.2/client-web/examples/locale/get-continents.md diff --git a/app/sdks/client-web/docs/examples/locale/get-countries-e-u.md b/docs/examples/0.6.2/client-web/examples/locale/get-countries-e-u.md similarity index 100% rename from app/sdks/client-web/docs/examples/locale/get-countries-e-u.md rename to docs/examples/0.6.2/client-web/examples/locale/get-countries-e-u.md diff --git a/app/sdks/client-web/docs/examples/locale/get-countries-phones.md b/docs/examples/0.6.2/client-web/examples/locale/get-countries-phones.md similarity index 100% rename from app/sdks/client-web/docs/examples/locale/get-countries-phones.md rename to docs/examples/0.6.2/client-web/examples/locale/get-countries-phones.md diff --git a/app/sdks/client-web/docs/examples/locale/get-countries.md b/docs/examples/0.6.2/client-web/examples/locale/get-countries.md similarity index 100% rename from app/sdks/client-web/docs/examples/locale/get-countries.md rename to docs/examples/0.6.2/client-web/examples/locale/get-countries.md diff --git a/app/sdks/client-web/docs/examples/locale/get-currencies.md b/docs/examples/0.6.2/client-web/examples/locale/get-currencies.md similarity index 100% rename from app/sdks/client-web/docs/examples/locale/get-currencies.md rename to docs/examples/0.6.2/client-web/examples/locale/get-currencies.md diff --git a/app/sdks/client-web/docs/examples/locale/get-languages.md b/docs/examples/0.6.2/client-web/examples/locale/get-languages.md similarity index 100% rename from app/sdks/client-web/docs/examples/locale/get-languages.md rename to docs/examples/0.6.2/client-web/examples/locale/get-languages.md diff --git a/app/sdks/client-web/docs/examples/locale/get.md b/docs/examples/0.6.2/client-web/examples/locale/get.md similarity index 100% rename from app/sdks/client-web/docs/examples/locale/get.md rename to docs/examples/0.6.2/client-web/examples/locale/get.md diff --git a/app/sdks/client-web/docs/examples/storage/create-file.md b/docs/examples/0.6.2/client-web/examples/storage/create-file.md similarity index 100% rename from app/sdks/client-web/docs/examples/storage/create-file.md rename to docs/examples/0.6.2/client-web/examples/storage/create-file.md diff --git a/app/sdks/client-web/docs/examples/storage/delete-file.md b/docs/examples/0.6.2/client-web/examples/storage/delete-file.md similarity index 100% rename from app/sdks/client-web/docs/examples/storage/delete-file.md rename to docs/examples/0.6.2/client-web/examples/storage/delete-file.md diff --git a/app/sdks/client-web/docs/examples/storage/get-file-download.md b/docs/examples/0.6.2/client-web/examples/storage/get-file-download.md similarity index 100% rename from app/sdks/client-web/docs/examples/storage/get-file-download.md rename to docs/examples/0.6.2/client-web/examples/storage/get-file-download.md diff --git a/app/sdks/client-web/docs/examples/storage/get-file-preview.md b/docs/examples/0.6.2/client-web/examples/storage/get-file-preview.md similarity index 100% rename from app/sdks/client-web/docs/examples/storage/get-file-preview.md rename to docs/examples/0.6.2/client-web/examples/storage/get-file-preview.md diff --git a/app/sdks/client-web/docs/examples/storage/get-file-view.md b/docs/examples/0.6.2/client-web/examples/storage/get-file-view.md similarity index 100% rename from app/sdks/client-web/docs/examples/storage/get-file-view.md rename to docs/examples/0.6.2/client-web/examples/storage/get-file-view.md diff --git a/app/sdks/client-web/docs/examples/storage/get-file.md b/docs/examples/0.6.2/client-web/examples/storage/get-file.md similarity index 100% rename from app/sdks/client-web/docs/examples/storage/get-file.md rename to docs/examples/0.6.2/client-web/examples/storage/get-file.md diff --git a/app/sdks/client-web/docs/examples/storage/list-files.md b/docs/examples/0.6.2/client-web/examples/storage/list-files.md similarity index 100% rename from app/sdks/client-web/docs/examples/storage/list-files.md rename to docs/examples/0.6.2/client-web/examples/storage/list-files.md diff --git a/app/sdks/client-web/docs/examples/storage/update-file.md b/docs/examples/0.6.2/client-web/examples/storage/update-file.md similarity index 100% rename from app/sdks/client-web/docs/examples/storage/update-file.md rename to docs/examples/0.6.2/client-web/examples/storage/update-file.md diff --git a/app/sdks/client-web/docs/examples/teams/create-membership.md b/docs/examples/0.6.2/client-web/examples/teams/create-membership.md similarity index 100% rename from app/sdks/client-web/docs/examples/teams/create-membership.md rename to docs/examples/0.6.2/client-web/examples/teams/create-membership.md diff --git a/app/sdks/client-web/docs/examples/teams/create.md b/docs/examples/0.6.2/client-web/examples/teams/create.md similarity index 100% rename from app/sdks/client-web/docs/examples/teams/create.md rename to docs/examples/0.6.2/client-web/examples/teams/create.md diff --git a/app/sdks/client-web/docs/examples/teams/delete-membership.md b/docs/examples/0.6.2/client-web/examples/teams/delete-membership.md similarity index 100% rename from app/sdks/client-web/docs/examples/teams/delete-membership.md rename to docs/examples/0.6.2/client-web/examples/teams/delete-membership.md diff --git a/app/sdks/client-web/docs/examples/teams/delete.md b/docs/examples/0.6.2/client-web/examples/teams/delete.md similarity index 100% rename from app/sdks/client-web/docs/examples/teams/delete.md rename to docs/examples/0.6.2/client-web/examples/teams/delete.md diff --git a/app/sdks/client-web/docs/examples/teams/get-memberships.md b/docs/examples/0.6.2/client-web/examples/teams/get-memberships.md similarity index 100% rename from app/sdks/client-web/docs/examples/teams/get-memberships.md rename to docs/examples/0.6.2/client-web/examples/teams/get-memberships.md diff --git a/app/sdks/client-web/docs/examples/teams/get.md b/docs/examples/0.6.2/client-web/examples/teams/get.md similarity index 100% rename from app/sdks/client-web/docs/examples/teams/get.md rename to docs/examples/0.6.2/client-web/examples/teams/get.md diff --git a/app/sdks/client-web/docs/examples/teams/list.md b/docs/examples/0.6.2/client-web/examples/teams/list.md similarity index 100% rename from app/sdks/client-web/docs/examples/teams/list.md rename to docs/examples/0.6.2/client-web/examples/teams/list.md diff --git a/app/sdks/client-web/docs/examples/teams/update-membership-status.md b/docs/examples/0.6.2/client-web/examples/teams/update-membership-status.md similarity index 100% rename from app/sdks/client-web/docs/examples/teams/update-membership-status.md rename to docs/examples/0.6.2/client-web/examples/teams/update-membership-status.md diff --git a/app/sdks/client-web/docs/examples/teams/update.md b/docs/examples/0.6.2/client-web/examples/teams/update.md similarity index 100% rename from app/sdks/client-web/docs/examples/teams/update.md rename to docs/examples/0.6.2/client-web/examples/teams/update.md diff --git a/app/sdks/console-web/docs/examples/account/create-o-auth2session.md b/docs/examples/0.6.2/console-web/examples/account/create-o-auth2session.md similarity index 100% rename from app/sdks/console-web/docs/examples/account/create-o-auth2session.md rename to docs/examples/0.6.2/console-web/examples/account/create-o-auth2session.md diff --git a/app/sdks/console-web/docs/examples/account/create-recovery.md b/docs/examples/0.6.2/console-web/examples/account/create-recovery.md similarity index 100% rename from app/sdks/console-web/docs/examples/account/create-recovery.md rename to docs/examples/0.6.2/console-web/examples/account/create-recovery.md diff --git a/app/sdks/console-web/docs/examples/account/create-session.md b/docs/examples/0.6.2/console-web/examples/account/create-session.md similarity index 100% rename from app/sdks/console-web/docs/examples/account/create-session.md rename to docs/examples/0.6.2/console-web/examples/account/create-session.md diff --git a/app/sdks/console-web/docs/examples/account/create-verification.md b/docs/examples/0.6.2/console-web/examples/account/create-verification.md similarity index 100% rename from app/sdks/console-web/docs/examples/account/create-verification.md rename to docs/examples/0.6.2/console-web/examples/account/create-verification.md diff --git a/app/sdks/console-web/docs/examples/account/create.md b/docs/examples/0.6.2/console-web/examples/account/create.md similarity index 100% rename from app/sdks/console-web/docs/examples/account/create.md rename to docs/examples/0.6.2/console-web/examples/account/create.md diff --git a/app/sdks/console-web/docs/examples/account/delete-session.md b/docs/examples/0.6.2/console-web/examples/account/delete-session.md similarity index 100% rename from app/sdks/console-web/docs/examples/account/delete-session.md rename to docs/examples/0.6.2/console-web/examples/account/delete-session.md diff --git a/app/sdks/console-web/docs/examples/account/delete-sessions.md b/docs/examples/0.6.2/console-web/examples/account/delete-sessions.md similarity index 100% rename from app/sdks/console-web/docs/examples/account/delete-sessions.md rename to docs/examples/0.6.2/console-web/examples/account/delete-sessions.md diff --git a/app/sdks/console-web/docs/examples/account/delete.md b/docs/examples/0.6.2/console-web/examples/account/delete.md similarity index 100% rename from app/sdks/console-web/docs/examples/account/delete.md rename to docs/examples/0.6.2/console-web/examples/account/delete.md diff --git a/app/sdks/console-web/docs/examples/account/get-logs.md b/docs/examples/0.6.2/console-web/examples/account/get-logs.md similarity index 100% rename from app/sdks/console-web/docs/examples/account/get-logs.md rename to docs/examples/0.6.2/console-web/examples/account/get-logs.md diff --git a/app/sdks/console-web/docs/examples/account/get-prefs.md b/docs/examples/0.6.2/console-web/examples/account/get-prefs.md similarity index 100% rename from app/sdks/console-web/docs/examples/account/get-prefs.md rename to docs/examples/0.6.2/console-web/examples/account/get-prefs.md diff --git a/app/sdks/console-web/docs/examples/account/get-sessions.md b/docs/examples/0.6.2/console-web/examples/account/get-sessions.md similarity index 100% rename from app/sdks/console-web/docs/examples/account/get-sessions.md rename to docs/examples/0.6.2/console-web/examples/account/get-sessions.md diff --git a/app/sdks/console-web/docs/examples/account/get.md b/docs/examples/0.6.2/console-web/examples/account/get.md similarity index 100% rename from app/sdks/console-web/docs/examples/account/get.md rename to docs/examples/0.6.2/console-web/examples/account/get.md diff --git a/app/sdks/console-web/docs/examples/account/update-email.md b/docs/examples/0.6.2/console-web/examples/account/update-email.md similarity index 100% rename from app/sdks/console-web/docs/examples/account/update-email.md rename to docs/examples/0.6.2/console-web/examples/account/update-email.md diff --git a/app/sdks/console-web/docs/examples/account/update-name.md b/docs/examples/0.6.2/console-web/examples/account/update-name.md similarity index 100% rename from app/sdks/console-web/docs/examples/account/update-name.md rename to docs/examples/0.6.2/console-web/examples/account/update-name.md diff --git a/app/sdks/console-web/docs/examples/account/update-password.md b/docs/examples/0.6.2/console-web/examples/account/update-password.md similarity index 100% rename from app/sdks/console-web/docs/examples/account/update-password.md rename to docs/examples/0.6.2/console-web/examples/account/update-password.md diff --git a/app/sdks/console-web/docs/examples/account/update-prefs.md b/docs/examples/0.6.2/console-web/examples/account/update-prefs.md similarity index 100% rename from app/sdks/console-web/docs/examples/account/update-prefs.md rename to docs/examples/0.6.2/console-web/examples/account/update-prefs.md diff --git a/app/sdks/console-web/docs/examples/account/update-recovery.md b/docs/examples/0.6.2/console-web/examples/account/update-recovery.md similarity index 100% rename from app/sdks/console-web/docs/examples/account/update-recovery.md rename to docs/examples/0.6.2/console-web/examples/account/update-recovery.md diff --git a/app/sdks/console-web/docs/examples/account/update-verification.md b/docs/examples/0.6.2/console-web/examples/account/update-verification.md similarity index 100% rename from app/sdks/console-web/docs/examples/account/update-verification.md rename to docs/examples/0.6.2/console-web/examples/account/update-verification.md diff --git a/app/sdks/console-web/docs/examples/avatars/get-browser.md b/docs/examples/0.6.2/console-web/examples/avatars/get-browser.md similarity index 100% rename from app/sdks/console-web/docs/examples/avatars/get-browser.md rename to docs/examples/0.6.2/console-web/examples/avatars/get-browser.md diff --git a/app/sdks/console-web/docs/examples/avatars/get-credit-card.md b/docs/examples/0.6.2/console-web/examples/avatars/get-credit-card.md similarity index 100% rename from app/sdks/console-web/docs/examples/avatars/get-credit-card.md rename to docs/examples/0.6.2/console-web/examples/avatars/get-credit-card.md diff --git a/app/sdks/console-web/docs/examples/avatars/get-favicon.md b/docs/examples/0.6.2/console-web/examples/avatars/get-favicon.md similarity index 100% rename from app/sdks/console-web/docs/examples/avatars/get-favicon.md rename to docs/examples/0.6.2/console-web/examples/avatars/get-favicon.md diff --git a/app/sdks/console-web/docs/examples/avatars/get-flag.md b/docs/examples/0.6.2/console-web/examples/avatars/get-flag.md similarity index 100% rename from app/sdks/console-web/docs/examples/avatars/get-flag.md rename to docs/examples/0.6.2/console-web/examples/avatars/get-flag.md diff --git a/app/sdks/console-web/docs/examples/avatars/get-image.md b/docs/examples/0.6.2/console-web/examples/avatars/get-image.md similarity index 100% rename from app/sdks/console-web/docs/examples/avatars/get-image.md rename to docs/examples/0.6.2/console-web/examples/avatars/get-image.md diff --git a/app/sdks/console-web/docs/examples/avatars/get-initials.md b/docs/examples/0.6.2/console-web/examples/avatars/get-initials.md similarity index 100% rename from app/sdks/console-web/docs/examples/avatars/get-initials.md rename to docs/examples/0.6.2/console-web/examples/avatars/get-initials.md diff --git a/app/sdks/console-web/docs/examples/avatars/get-q-r.md b/docs/examples/0.6.2/console-web/examples/avatars/get-q-r.md similarity index 100% rename from app/sdks/console-web/docs/examples/avatars/get-q-r.md rename to docs/examples/0.6.2/console-web/examples/avatars/get-q-r.md diff --git a/app/sdks/console-web/docs/examples/bar/delete.md b/docs/examples/0.6.2/console-web/examples/bar/delete.md similarity index 100% rename from app/sdks/console-web/docs/examples/bar/delete.md rename to docs/examples/0.6.2/console-web/examples/bar/delete.md diff --git a/app/sdks/console-web/docs/examples/bar/get.md b/docs/examples/0.6.2/console-web/examples/bar/get.md similarity index 100% rename from app/sdks/console-web/docs/examples/bar/get.md rename to docs/examples/0.6.2/console-web/examples/bar/get.md diff --git a/app/sdks/console-web/docs/examples/bar/patch.md b/docs/examples/0.6.2/console-web/examples/bar/patch.md similarity index 100% rename from app/sdks/console-web/docs/examples/bar/patch.md rename to docs/examples/0.6.2/console-web/examples/bar/patch.md diff --git a/app/sdks/console-web/docs/examples/bar/post.md b/docs/examples/0.6.2/console-web/examples/bar/post.md similarity index 100% rename from app/sdks/console-web/docs/examples/bar/post.md rename to docs/examples/0.6.2/console-web/examples/bar/post.md diff --git a/app/sdks/console-web/docs/examples/bar/put.md b/docs/examples/0.6.2/console-web/examples/bar/put.md similarity index 100% rename from app/sdks/console-web/docs/examples/bar/put.md rename to docs/examples/0.6.2/console-web/examples/bar/put.md diff --git a/app/sdks/console-web/docs/examples/database/create-collection.md b/docs/examples/0.6.2/console-web/examples/database/create-collection.md similarity index 100% rename from app/sdks/console-web/docs/examples/database/create-collection.md rename to docs/examples/0.6.2/console-web/examples/database/create-collection.md diff --git a/app/sdks/console-web/docs/examples/database/create-document.md b/docs/examples/0.6.2/console-web/examples/database/create-document.md similarity index 100% rename from app/sdks/console-web/docs/examples/database/create-document.md rename to docs/examples/0.6.2/console-web/examples/database/create-document.md diff --git a/app/sdks/console-web/docs/examples/database/delete-collection.md b/docs/examples/0.6.2/console-web/examples/database/delete-collection.md similarity index 100% rename from app/sdks/console-web/docs/examples/database/delete-collection.md rename to docs/examples/0.6.2/console-web/examples/database/delete-collection.md diff --git a/app/sdks/console-web/docs/examples/database/delete-document.md b/docs/examples/0.6.2/console-web/examples/database/delete-document.md similarity index 100% rename from app/sdks/console-web/docs/examples/database/delete-document.md rename to docs/examples/0.6.2/console-web/examples/database/delete-document.md diff --git a/app/sdks/console-web/docs/examples/database/get-collection.md b/docs/examples/0.6.2/console-web/examples/database/get-collection.md similarity index 100% rename from app/sdks/console-web/docs/examples/database/get-collection.md rename to docs/examples/0.6.2/console-web/examples/database/get-collection.md diff --git a/app/sdks/console-web/docs/examples/database/get-document.md b/docs/examples/0.6.2/console-web/examples/database/get-document.md similarity index 100% rename from app/sdks/console-web/docs/examples/database/get-document.md rename to docs/examples/0.6.2/console-web/examples/database/get-document.md diff --git a/app/sdks/console-web/docs/examples/database/list-collections.md b/docs/examples/0.6.2/console-web/examples/database/list-collections.md similarity index 100% rename from app/sdks/console-web/docs/examples/database/list-collections.md rename to docs/examples/0.6.2/console-web/examples/database/list-collections.md diff --git a/app/sdks/console-web/docs/examples/database/list-documents.md b/docs/examples/0.6.2/console-web/examples/database/list-documents.md similarity index 100% rename from app/sdks/console-web/docs/examples/database/list-documents.md rename to docs/examples/0.6.2/console-web/examples/database/list-documents.md diff --git a/app/sdks/console-web/docs/examples/database/update-collection.md b/docs/examples/0.6.2/console-web/examples/database/update-collection.md similarity index 100% rename from app/sdks/console-web/docs/examples/database/update-collection.md rename to docs/examples/0.6.2/console-web/examples/database/update-collection.md diff --git a/app/sdks/console-web/docs/examples/database/update-document.md b/docs/examples/0.6.2/console-web/examples/database/update-document.md similarity index 100% rename from app/sdks/console-web/docs/examples/database/update-document.md rename to docs/examples/0.6.2/console-web/examples/database/update-document.md diff --git a/app/sdks/console-web/docs/examples/foo/delete.md b/docs/examples/0.6.2/console-web/examples/foo/delete.md similarity index 100% rename from app/sdks/console-web/docs/examples/foo/delete.md rename to docs/examples/0.6.2/console-web/examples/foo/delete.md diff --git a/app/sdks/console-web/docs/examples/foo/get.md b/docs/examples/0.6.2/console-web/examples/foo/get.md similarity index 100% rename from app/sdks/console-web/docs/examples/foo/get.md rename to docs/examples/0.6.2/console-web/examples/foo/get.md diff --git a/app/sdks/console-web/docs/examples/foo/patch.md b/docs/examples/0.6.2/console-web/examples/foo/patch.md similarity index 100% rename from app/sdks/console-web/docs/examples/foo/patch.md rename to docs/examples/0.6.2/console-web/examples/foo/patch.md diff --git a/app/sdks/console-web/docs/examples/foo/post.md b/docs/examples/0.6.2/console-web/examples/foo/post.md similarity index 100% rename from app/sdks/console-web/docs/examples/foo/post.md rename to docs/examples/0.6.2/console-web/examples/foo/post.md diff --git a/app/sdks/console-web/docs/examples/foo/put.md b/docs/examples/0.6.2/console-web/examples/foo/put.md similarity index 100% rename from app/sdks/console-web/docs/examples/foo/put.md rename to docs/examples/0.6.2/console-web/examples/foo/put.md diff --git a/docs/examples/0.6.2/console-web/examples/functions/get-usage.md b/docs/examples/0.6.2/console-web/examples/functions/get-usage.md new file mode 100644 index 0000000000..7515c0fe5c --- /dev/null +++ b/docs/examples/0.6.2/console-web/examples/functions/get-usage.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.functions.getUsage('[FUNCTION_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/general/empty.md b/docs/examples/0.6.2/console-web/examples/general/empty.md similarity index 100% rename from app/sdks/console-web/docs/examples/general/empty.md rename to docs/examples/0.6.2/console-web/examples/general/empty.md diff --git a/app/sdks/console-web/docs/examples/general/get-cookie.md b/docs/examples/0.6.2/console-web/examples/general/get-cookie.md similarity index 100% rename from app/sdks/console-web/docs/examples/general/get-cookie.md rename to docs/examples/0.6.2/console-web/examples/general/get-cookie.md diff --git a/app/sdks/console-web/docs/examples/general/redirect.md b/docs/examples/0.6.2/console-web/examples/general/redirect.md similarity index 100% rename from app/sdks/console-web/docs/examples/general/redirect.md rename to docs/examples/0.6.2/console-web/examples/general/redirect.md diff --git a/app/sdks/console-web/docs/examples/general/redirected.md b/docs/examples/0.6.2/console-web/examples/general/redirected.md similarity index 100% rename from app/sdks/console-web/docs/examples/general/redirected.md rename to docs/examples/0.6.2/console-web/examples/general/redirected.md diff --git a/app/sdks/console-web/docs/examples/general/set-cookie.md b/docs/examples/0.6.2/console-web/examples/general/set-cookie.md similarity index 100% rename from app/sdks/console-web/docs/examples/general/set-cookie.md rename to docs/examples/0.6.2/console-web/examples/general/set-cookie.md diff --git a/app/sdks/console-web/docs/examples/general/upload.md b/docs/examples/0.6.2/console-web/examples/general/upload.md similarity index 100% rename from app/sdks/console-web/docs/examples/general/upload.md rename to docs/examples/0.6.2/console-web/examples/general/upload.md diff --git a/app/sdks/console-web/docs/examples/health/get-anti-virus.md b/docs/examples/0.6.2/console-web/examples/health/get-anti-virus.md similarity index 100% rename from app/sdks/console-web/docs/examples/health/get-anti-virus.md rename to docs/examples/0.6.2/console-web/examples/health/get-anti-virus.md diff --git a/app/sdks/console-web/docs/examples/health/get-cache.md b/docs/examples/0.6.2/console-web/examples/health/get-cache.md similarity index 100% rename from app/sdks/console-web/docs/examples/health/get-cache.md rename to docs/examples/0.6.2/console-web/examples/health/get-cache.md diff --git a/app/sdks/console-web/docs/examples/health/get-d-b.md b/docs/examples/0.6.2/console-web/examples/health/get-d-b.md similarity index 100% rename from app/sdks/console-web/docs/examples/health/get-d-b.md rename to docs/examples/0.6.2/console-web/examples/health/get-d-b.md diff --git a/app/sdks/console-web/docs/examples/health/get-queue-certificates.md b/docs/examples/0.6.2/console-web/examples/health/get-queue-certificates.md similarity index 100% rename from app/sdks/console-web/docs/examples/health/get-queue-certificates.md rename to docs/examples/0.6.2/console-web/examples/health/get-queue-certificates.md diff --git a/app/sdks/console-web/docs/examples/health/get-queue-functions.md b/docs/examples/0.6.2/console-web/examples/health/get-queue-functions.md similarity index 100% rename from app/sdks/console-web/docs/examples/health/get-queue-functions.md rename to docs/examples/0.6.2/console-web/examples/health/get-queue-functions.md diff --git a/app/sdks/console-web/docs/examples/health/get-queue-logs.md b/docs/examples/0.6.2/console-web/examples/health/get-queue-logs.md similarity index 100% rename from app/sdks/console-web/docs/examples/health/get-queue-logs.md rename to docs/examples/0.6.2/console-web/examples/health/get-queue-logs.md diff --git a/app/sdks/console-web/docs/examples/health/get-queue-tasks.md b/docs/examples/0.6.2/console-web/examples/health/get-queue-tasks.md similarity index 100% rename from app/sdks/console-web/docs/examples/health/get-queue-tasks.md rename to docs/examples/0.6.2/console-web/examples/health/get-queue-tasks.md diff --git a/app/sdks/console-web/docs/examples/health/get-queue-usage.md b/docs/examples/0.6.2/console-web/examples/health/get-queue-usage.md similarity index 100% rename from app/sdks/console-web/docs/examples/health/get-queue-usage.md rename to docs/examples/0.6.2/console-web/examples/health/get-queue-usage.md diff --git a/app/sdks/console-web/docs/examples/health/get-queue-webhooks.md b/docs/examples/0.6.2/console-web/examples/health/get-queue-webhooks.md similarity index 100% rename from app/sdks/console-web/docs/examples/health/get-queue-webhooks.md rename to docs/examples/0.6.2/console-web/examples/health/get-queue-webhooks.md diff --git a/app/sdks/console-web/docs/examples/health/get-storage-local.md b/docs/examples/0.6.2/console-web/examples/health/get-storage-local.md similarity index 100% rename from app/sdks/console-web/docs/examples/health/get-storage-local.md rename to docs/examples/0.6.2/console-web/examples/health/get-storage-local.md diff --git a/app/sdks/console-web/docs/examples/health/get-time.md b/docs/examples/0.6.2/console-web/examples/health/get-time.md similarity index 100% rename from app/sdks/console-web/docs/examples/health/get-time.md rename to docs/examples/0.6.2/console-web/examples/health/get-time.md diff --git a/app/sdks/console-web/docs/examples/health/get.md b/docs/examples/0.6.2/console-web/examples/health/get.md similarity index 100% rename from app/sdks/console-web/docs/examples/health/get.md rename to docs/examples/0.6.2/console-web/examples/health/get.md diff --git a/app/sdks/console-web/docs/examples/locale/get-continents.md b/docs/examples/0.6.2/console-web/examples/locale/get-continents.md similarity index 100% rename from app/sdks/console-web/docs/examples/locale/get-continents.md rename to docs/examples/0.6.2/console-web/examples/locale/get-continents.md diff --git a/app/sdks/console-web/docs/examples/locale/get-countries-e-u.md b/docs/examples/0.6.2/console-web/examples/locale/get-countries-e-u.md similarity index 100% rename from app/sdks/console-web/docs/examples/locale/get-countries-e-u.md rename to docs/examples/0.6.2/console-web/examples/locale/get-countries-e-u.md diff --git a/app/sdks/console-web/docs/examples/locale/get-countries-phones.md b/docs/examples/0.6.2/console-web/examples/locale/get-countries-phones.md similarity index 100% rename from app/sdks/console-web/docs/examples/locale/get-countries-phones.md rename to docs/examples/0.6.2/console-web/examples/locale/get-countries-phones.md diff --git a/app/sdks/console-web/docs/examples/locale/get-countries.md b/docs/examples/0.6.2/console-web/examples/locale/get-countries.md similarity index 100% rename from app/sdks/console-web/docs/examples/locale/get-countries.md rename to docs/examples/0.6.2/console-web/examples/locale/get-countries.md diff --git a/app/sdks/console-web/docs/examples/locale/get-currencies.md b/docs/examples/0.6.2/console-web/examples/locale/get-currencies.md similarity index 100% rename from app/sdks/console-web/docs/examples/locale/get-currencies.md rename to docs/examples/0.6.2/console-web/examples/locale/get-currencies.md diff --git a/app/sdks/console-web/docs/examples/locale/get-languages.md b/docs/examples/0.6.2/console-web/examples/locale/get-languages.md similarity index 100% rename from app/sdks/console-web/docs/examples/locale/get-languages.md rename to docs/examples/0.6.2/console-web/examples/locale/get-languages.md diff --git a/app/sdks/console-web/docs/examples/locale/get.md b/docs/examples/0.6.2/console-web/examples/locale/get.md similarity index 100% rename from app/sdks/console-web/docs/examples/locale/get.md rename to docs/examples/0.6.2/console-web/examples/locale/get.md diff --git a/app/sdks/console-web/docs/examples/projects/create-domain.md b/docs/examples/0.6.2/console-web/examples/projects/create-domain.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/create-domain.md rename to docs/examples/0.6.2/console-web/examples/projects/create-domain.md diff --git a/app/sdks/console-web/docs/examples/projects/create-key.md b/docs/examples/0.6.2/console-web/examples/projects/create-key.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/create-key.md rename to docs/examples/0.6.2/console-web/examples/projects/create-key.md diff --git a/app/sdks/console-web/docs/examples/projects/create-platform.md b/docs/examples/0.6.2/console-web/examples/projects/create-platform.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/create-platform.md rename to docs/examples/0.6.2/console-web/examples/projects/create-platform.md diff --git a/app/sdks/console-web/docs/examples/projects/create-task.md b/docs/examples/0.6.2/console-web/examples/projects/create-task.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/create-task.md rename to docs/examples/0.6.2/console-web/examples/projects/create-task.md diff --git a/docs/examples/0.6.2/console-web/examples/projects/create-webhook.md b/docs/examples/0.6.2/console-web/examples/projects/create-webhook.md new file mode 100644 index 0000000000..971319f212 --- /dev/null +++ b/docs/examples/0.6.2/console-web/examples/projects/create-webhook.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.createWebhook('[PROJECT_ID]', '[NAME]', [], '[URL]', false); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/projects/create.md b/docs/examples/0.6.2/console-web/examples/projects/create.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/create.md rename to docs/examples/0.6.2/console-web/examples/projects/create.md diff --git a/app/sdks/console-web/docs/examples/projects/delete-domain.md b/docs/examples/0.6.2/console-web/examples/projects/delete-domain.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/delete-domain.md rename to docs/examples/0.6.2/console-web/examples/projects/delete-domain.md diff --git a/app/sdks/console-web/docs/examples/projects/delete-key.md b/docs/examples/0.6.2/console-web/examples/projects/delete-key.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/delete-key.md rename to docs/examples/0.6.2/console-web/examples/projects/delete-key.md diff --git a/app/sdks/console-web/docs/examples/projects/delete-platform.md b/docs/examples/0.6.2/console-web/examples/projects/delete-platform.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/delete-platform.md rename to docs/examples/0.6.2/console-web/examples/projects/delete-platform.md diff --git a/app/sdks/console-web/docs/examples/projects/delete-task.md b/docs/examples/0.6.2/console-web/examples/projects/delete-task.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/delete-task.md rename to docs/examples/0.6.2/console-web/examples/projects/delete-task.md diff --git a/app/sdks/console-web/docs/examples/projects/delete-webhook.md b/docs/examples/0.6.2/console-web/examples/projects/delete-webhook.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/delete-webhook.md rename to docs/examples/0.6.2/console-web/examples/projects/delete-webhook.md diff --git a/app/sdks/console-web/docs/examples/projects/delete.md b/docs/examples/0.6.2/console-web/examples/projects/delete.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/delete.md rename to docs/examples/0.6.2/console-web/examples/projects/delete.md diff --git a/app/sdks/console-web/docs/examples/projects/get-domain.md b/docs/examples/0.6.2/console-web/examples/projects/get-domain.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/get-domain.md rename to docs/examples/0.6.2/console-web/examples/projects/get-domain.md diff --git a/app/sdks/console-web/docs/examples/projects/get-key.md b/docs/examples/0.6.2/console-web/examples/projects/get-key.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/get-key.md rename to docs/examples/0.6.2/console-web/examples/projects/get-key.md diff --git a/app/sdks/console-web/docs/examples/projects/get-platform.md b/docs/examples/0.6.2/console-web/examples/projects/get-platform.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/get-platform.md rename to docs/examples/0.6.2/console-web/examples/projects/get-platform.md diff --git a/app/sdks/console-web/docs/examples/projects/get-task.md b/docs/examples/0.6.2/console-web/examples/projects/get-task.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/get-task.md rename to docs/examples/0.6.2/console-web/examples/projects/get-task.md diff --git a/app/sdks/console-web/docs/examples/projects/get-usage.md b/docs/examples/0.6.2/console-web/examples/projects/get-usage.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/get-usage.md rename to docs/examples/0.6.2/console-web/examples/projects/get-usage.md diff --git a/app/sdks/console-web/docs/examples/projects/get-webhook.md b/docs/examples/0.6.2/console-web/examples/projects/get-webhook.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/get-webhook.md rename to docs/examples/0.6.2/console-web/examples/projects/get-webhook.md diff --git a/app/sdks/console-web/docs/examples/projects/get.md b/docs/examples/0.6.2/console-web/examples/projects/get.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/get.md rename to docs/examples/0.6.2/console-web/examples/projects/get.md diff --git a/app/sdks/console-web/docs/examples/projects/list-domains.md b/docs/examples/0.6.2/console-web/examples/projects/list-domains.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/list-domains.md rename to docs/examples/0.6.2/console-web/examples/projects/list-domains.md diff --git a/app/sdks/console-web/docs/examples/projects/list-keys.md b/docs/examples/0.6.2/console-web/examples/projects/list-keys.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/list-keys.md rename to docs/examples/0.6.2/console-web/examples/projects/list-keys.md diff --git a/app/sdks/console-web/docs/examples/projects/list-platforms.md b/docs/examples/0.6.2/console-web/examples/projects/list-platforms.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/list-platforms.md rename to docs/examples/0.6.2/console-web/examples/projects/list-platforms.md diff --git a/app/sdks/console-web/docs/examples/projects/list-tasks.md b/docs/examples/0.6.2/console-web/examples/projects/list-tasks.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/list-tasks.md rename to docs/examples/0.6.2/console-web/examples/projects/list-tasks.md diff --git a/app/sdks/console-web/docs/examples/projects/list-webhooks.md b/docs/examples/0.6.2/console-web/examples/projects/list-webhooks.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/list-webhooks.md rename to docs/examples/0.6.2/console-web/examples/projects/list-webhooks.md diff --git a/app/sdks/console-web/docs/examples/projects/list.md b/docs/examples/0.6.2/console-web/examples/projects/list.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/list.md rename to docs/examples/0.6.2/console-web/examples/projects/list.md diff --git a/app/sdks/console-web/docs/examples/projects/update-domain-verification.md b/docs/examples/0.6.2/console-web/examples/projects/update-domain-verification.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/update-domain-verification.md rename to docs/examples/0.6.2/console-web/examples/projects/update-domain-verification.md diff --git a/app/sdks/console-web/docs/examples/projects/update-key.md b/docs/examples/0.6.2/console-web/examples/projects/update-key.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/update-key.md rename to docs/examples/0.6.2/console-web/examples/projects/update-key.md diff --git a/app/sdks/console-web/docs/examples/projects/update-o-auth2.md b/docs/examples/0.6.2/console-web/examples/projects/update-o-auth2.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/update-o-auth2.md rename to docs/examples/0.6.2/console-web/examples/projects/update-o-auth2.md diff --git a/app/sdks/console-web/docs/examples/projects/update-platform.md b/docs/examples/0.6.2/console-web/examples/projects/update-platform.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/update-platform.md rename to docs/examples/0.6.2/console-web/examples/projects/update-platform.md diff --git a/app/sdks/console-web/docs/examples/projects/update-task.md b/docs/examples/0.6.2/console-web/examples/projects/update-task.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/update-task.md rename to docs/examples/0.6.2/console-web/examples/projects/update-task.md diff --git a/docs/examples/0.6.2/console-web/examples/projects/update-webhook.md b/docs/examples/0.6.2/console-web/examples/projects/update-webhook.md new file mode 100644 index 0000000000..1e8c6f4a0f --- /dev/null +++ b/docs/examples/0.6.2/console-web/examples/projects/update-webhook.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.updateWebhook('[PROJECT_ID]', '[WEBHOOK_ID]', '[NAME]', [], '[URL]', false); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/projects/update.md b/docs/examples/0.6.2/console-web/examples/projects/update.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/update.md rename to docs/examples/0.6.2/console-web/examples/projects/update.md diff --git a/app/sdks/console-web/docs/examples/storage/create-file.md b/docs/examples/0.6.2/console-web/examples/storage/create-file.md similarity index 100% rename from app/sdks/console-web/docs/examples/storage/create-file.md rename to docs/examples/0.6.2/console-web/examples/storage/create-file.md diff --git a/app/sdks/console-web/docs/examples/storage/delete-file.md b/docs/examples/0.6.2/console-web/examples/storage/delete-file.md similarity index 100% rename from app/sdks/console-web/docs/examples/storage/delete-file.md rename to docs/examples/0.6.2/console-web/examples/storage/delete-file.md diff --git a/app/sdks/console-web/docs/examples/storage/get-file-download.md b/docs/examples/0.6.2/console-web/examples/storage/get-file-download.md similarity index 100% rename from app/sdks/console-web/docs/examples/storage/get-file-download.md rename to docs/examples/0.6.2/console-web/examples/storage/get-file-download.md diff --git a/app/sdks/console-web/docs/examples/storage/get-file-preview.md b/docs/examples/0.6.2/console-web/examples/storage/get-file-preview.md similarity index 100% rename from app/sdks/console-web/docs/examples/storage/get-file-preview.md rename to docs/examples/0.6.2/console-web/examples/storage/get-file-preview.md diff --git a/app/sdks/console-web/docs/examples/storage/get-file-view.md b/docs/examples/0.6.2/console-web/examples/storage/get-file-view.md similarity index 100% rename from app/sdks/console-web/docs/examples/storage/get-file-view.md rename to docs/examples/0.6.2/console-web/examples/storage/get-file-view.md diff --git a/app/sdks/console-web/docs/examples/storage/get-file.md b/docs/examples/0.6.2/console-web/examples/storage/get-file.md similarity index 100% rename from app/sdks/console-web/docs/examples/storage/get-file.md rename to docs/examples/0.6.2/console-web/examples/storage/get-file.md diff --git a/app/sdks/console-web/docs/examples/storage/list-files.md b/docs/examples/0.6.2/console-web/examples/storage/list-files.md similarity index 100% rename from app/sdks/console-web/docs/examples/storage/list-files.md rename to docs/examples/0.6.2/console-web/examples/storage/list-files.md diff --git a/app/sdks/console-web/docs/examples/storage/update-file.md b/docs/examples/0.6.2/console-web/examples/storage/update-file.md similarity index 100% rename from app/sdks/console-web/docs/examples/storage/update-file.md rename to docs/examples/0.6.2/console-web/examples/storage/update-file.md diff --git a/app/sdks/console-web/docs/examples/teams/create-membership.md b/docs/examples/0.6.2/console-web/examples/teams/create-membership.md similarity index 100% rename from app/sdks/console-web/docs/examples/teams/create-membership.md rename to docs/examples/0.6.2/console-web/examples/teams/create-membership.md diff --git a/app/sdks/console-web/docs/examples/teams/create.md b/docs/examples/0.6.2/console-web/examples/teams/create.md similarity index 100% rename from app/sdks/console-web/docs/examples/teams/create.md rename to docs/examples/0.6.2/console-web/examples/teams/create.md diff --git a/app/sdks/console-web/docs/examples/teams/delete-membership.md b/docs/examples/0.6.2/console-web/examples/teams/delete-membership.md similarity index 100% rename from app/sdks/console-web/docs/examples/teams/delete-membership.md rename to docs/examples/0.6.2/console-web/examples/teams/delete-membership.md diff --git a/app/sdks/console-web/docs/examples/teams/delete.md b/docs/examples/0.6.2/console-web/examples/teams/delete.md similarity index 100% rename from app/sdks/console-web/docs/examples/teams/delete.md rename to docs/examples/0.6.2/console-web/examples/teams/delete.md diff --git a/app/sdks/console-web/docs/examples/teams/get-memberships.md b/docs/examples/0.6.2/console-web/examples/teams/get-memberships.md similarity index 100% rename from app/sdks/console-web/docs/examples/teams/get-memberships.md rename to docs/examples/0.6.2/console-web/examples/teams/get-memberships.md diff --git a/app/sdks/console-web/docs/examples/teams/get.md b/docs/examples/0.6.2/console-web/examples/teams/get.md similarity index 100% rename from app/sdks/console-web/docs/examples/teams/get.md rename to docs/examples/0.6.2/console-web/examples/teams/get.md diff --git a/app/sdks/console-web/docs/examples/teams/list.md b/docs/examples/0.6.2/console-web/examples/teams/list.md similarity index 100% rename from app/sdks/console-web/docs/examples/teams/list.md rename to docs/examples/0.6.2/console-web/examples/teams/list.md diff --git a/app/sdks/console-web/docs/examples/teams/update-membership-status.md b/docs/examples/0.6.2/console-web/examples/teams/update-membership-status.md similarity index 100% rename from app/sdks/console-web/docs/examples/teams/update-membership-status.md rename to docs/examples/0.6.2/console-web/examples/teams/update-membership-status.md diff --git a/app/sdks/console-web/docs/examples/teams/update.md b/docs/examples/0.6.2/console-web/examples/teams/update.md similarity index 100% rename from app/sdks/console-web/docs/examples/teams/update.md rename to docs/examples/0.6.2/console-web/examples/teams/update.md diff --git a/app/sdks/console-web/docs/examples/users/create.md b/docs/examples/0.6.2/console-web/examples/users/create.md similarity index 100% rename from app/sdks/console-web/docs/examples/users/create.md rename to docs/examples/0.6.2/console-web/examples/users/create.md diff --git a/app/sdks/console-web/docs/examples/users/delete-session.md b/docs/examples/0.6.2/console-web/examples/users/delete-session.md similarity index 100% rename from app/sdks/console-web/docs/examples/users/delete-session.md rename to docs/examples/0.6.2/console-web/examples/users/delete-session.md diff --git a/app/sdks/console-web/docs/examples/users/delete-sessions.md b/docs/examples/0.6.2/console-web/examples/users/delete-sessions.md similarity index 100% rename from app/sdks/console-web/docs/examples/users/delete-sessions.md rename to docs/examples/0.6.2/console-web/examples/users/delete-sessions.md diff --git a/app/sdks/console-web/docs/examples/users/get-logs.md b/docs/examples/0.6.2/console-web/examples/users/get-logs.md similarity index 100% rename from app/sdks/console-web/docs/examples/users/get-logs.md rename to docs/examples/0.6.2/console-web/examples/users/get-logs.md diff --git a/app/sdks/console-web/docs/examples/users/get-prefs.md b/docs/examples/0.6.2/console-web/examples/users/get-prefs.md similarity index 100% rename from app/sdks/console-web/docs/examples/users/get-prefs.md rename to docs/examples/0.6.2/console-web/examples/users/get-prefs.md diff --git a/app/sdks/console-web/docs/examples/users/get-sessions.md b/docs/examples/0.6.2/console-web/examples/users/get-sessions.md similarity index 100% rename from app/sdks/console-web/docs/examples/users/get-sessions.md rename to docs/examples/0.6.2/console-web/examples/users/get-sessions.md diff --git a/app/sdks/console-web/docs/examples/users/get.md b/docs/examples/0.6.2/console-web/examples/users/get.md similarity index 100% rename from app/sdks/console-web/docs/examples/users/get.md rename to docs/examples/0.6.2/console-web/examples/users/get.md diff --git a/app/sdks/console-web/docs/examples/users/list.md b/docs/examples/0.6.2/console-web/examples/users/list.md similarity index 100% rename from app/sdks/console-web/docs/examples/users/list.md rename to docs/examples/0.6.2/console-web/examples/users/list.md diff --git a/app/sdks/console-web/docs/examples/users/update-prefs.md b/docs/examples/0.6.2/console-web/examples/users/update-prefs.md similarity index 100% rename from app/sdks/console-web/docs/examples/users/update-prefs.md rename to docs/examples/0.6.2/console-web/examples/users/update-prefs.md diff --git a/app/sdks/console-web/docs/examples/users/update-status.md b/docs/examples/0.6.2/console-web/examples/users/update-status.md similarity index 100% rename from app/sdks/console-web/docs/examples/users/update-status.md rename to docs/examples/0.6.2/console-web/examples/users/update-status.md diff --git a/app/sdks/server-deno/docs/examples/avatars/get-browser.md b/docs/examples/0.6.2/server-deno/examples/avatars/get-browser.md similarity index 100% rename from app/sdks/server-deno/docs/examples/avatars/get-browser.md rename to docs/examples/0.6.2/server-deno/examples/avatars/get-browser.md diff --git a/app/sdks/server-deno/docs/examples/avatars/get-credit-card.md b/docs/examples/0.6.2/server-deno/examples/avatars/get-credit-card.md similarity index 100% rename from app/sdks/server-deno/docs/examples/avatars/get-credit-card.md rename to docs/examples/0.6.2/server-deno/examples/avatars/get-credit-card.md diff --git a/app/sdks/server-deno/docs/examples/avatars/get-favicon.md b/docs/examples/0.6.2/server-deno/examples/avatars/get-favicon.md similarity index 100% rename from app/sdks/server-deno/docs/examples/avatars/get-favicon.md rename to docs/examples/0.6.2/server-deno/examples/avatars/get-favicon.md diff --git a/app/sdks/server-deno/docs/examples/avatars/get-flag.md b/docs/examples/0.6.2/server-deno/examples/avatars/get-flag.md similarity index 100% rename from app/sdks/server-deno/docs/examples/avatars/get-flag.md rename to docs/examples/0.6.2/server-deno/examples/avatars/get-flag.md diff --git a/app/sdks/server-deno/docs/examples/avatars/get-image.md b/docs/examples/0.6.2/server-deno/examples/avatars/get-image.md similarity index 100% rename from app/sdks/server-deno/docs/examples/avatars/get-image.md rename to docs/examples/0.6.2/server-deno/examples/avatars/get-image.md diff --git a/docs/examples/0.6.2/server-deno/examples/avatars/get-initials.md b/docs/examples/0.6.2/server-deno/examples/avatars/get-initials.md new file mode 100644 index 0000000000..af35445bb3 --- /dev/null +++ b/docs/examples/0.6.2/server-deno/examples/avatars/get-initials.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let avatars = new sdk.Avatars(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = avatars.getInitials(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-deno/docs/examples/avatars/get-q-r.md b/docs/examples/0.6.2/server-deno/examples/avatars/get-q-r.md similarity index 100% rename from app/sdks/server-deno/docs/examples/avatars/get-q-r.md rename to docs/examples/0.6.2/server-deno/examples/avatars/get-q-r.md diff --git a/app/sdks/server-deno/docs/examples/database/create-collection.md b/docs/examples/0.6.2/server-deno/examples/database/create-collection.md similarity index 100% rename from app/sdks/server-deno/docs/examples/database/create-collection.md rename to docs/examples/0.6.2/server-deno/examples/database/create-collection.md diff --git a/app/sdks/server-deno/docs/examples/database/create-document.md b/docs/examples/0.6.2/server-deno/examples/database/create-document.md similarity index 100% rename from app/sdks/server-deno/docs/examples/database/create-document.md rename to docs/examples/0.6.2/server-deno/examples/database/create-document.md diff --git a/app/sdks/server-deno/docs/examples/database/delete-collection.md b/docs/examples/0.6.2/server-deno/examples/database/delete-collection.md similarity index 100% rename from app/sdks/server-deno/docs/examples/database/delete-collection.md rename to docs/examples/0.6.2/server-deno/examples/database/delete-collection.md diff --git a/app/sdks/server-deno/docs/examples/database/delete-document.md b/docs/examples/0.6.2/server-deno/examples/database/delete-document.md similarity index 100% rename from app/sdks/server-deno/docs/examples/database/delete-document.md rename to docs/examples/0.6.2/server-deno/examples/database/delete-document.md diff --git a/app/sdks/server-deno/docs/examples/database/get-collection.md b/docs/examples/0.6.2/server-deno/examples/database/get-collection.md similarity index 100% rename from app/sdks/server-deno/docs/examples/database/get-collection.md rename to docs/examples/0.6.2/server-deno/examples/database/get-collection.md diff --git a/app/sdks/server-deno/docs/examples/database/get-document.md b/docs/examples/0.6.2/server-deno/examples/database/get-document.md similarity index 100% rename from app/sdks/server-deno/docs/examples/database/get-document.md rename to docs/examples/0.6.2/server-deno/examples/database/get-document.md diff --git a/app/sdks/server-deno/docs/examples/database/list-collections.md b/docs/examples/0.6.2/server-deno/examples/database/list-collections.md similarity index 100% rename from app/sdks/server-deno/docs/examples/database/list-collections.md rename to docs/examples/0.6.2/server-deno/examples/database/list-collections.md diff --git a/app/sdks/server-deno/docs/examples/database/list-documents.md b/docs/examples/0.6.2/server-deno/examples/database/list-documents.md similarity index 100% rename from app/sdks/server-deno/docs/examples/database/list-documents.md rename to docs/examples/0.6.2/server-deno/examples/database/list-documents.md diff --git a/app/sdks/server-deno/docs/examples/database/update-collection.md b/docs/examples/0.6.2/server-deno/examples/database/update-collection.md similarity index 100% rename from app/sdks/server-deno/docs/examples/database/update-collection.md rename to docs/examples/0.6.2/server-deno/examples/database/update-collection.md diff --git a/app/sdks/server-deno/docs/examples/database/update-document.md b/docs/examples/0.6.2/server-deno/examples/database/update-document.md similarity index 100% rename from app/sdks/server-deno/docs/examples/database/update-document.md rename to docs/examples/0.6.2/server-deno/examples/database/update-document.md diff --git a/app/sdks/server-deno/docs/examples/health/get-anti-virus.md b/docs/examples/0.6.2/server-deno/examples/health/get-anti-virus.md similarity index 100% rename from app/sdks/server-deno/docs/examples/health/get-anti-virus.md rename to docs/examples/0.6.2/server-deno/examples/health/get-anti-virus.md diff --git a/app/sdks/server-deno/docs/examples/health/get-cache.md b/docs/examples/0.6.2/server-deno/examples/health/get-cache.md similarity index 100% rename from app/sdks/server-deno/docs/examples/health/get-cache.md rename to docs/examples/0.6.2/server-deno/examples/health/get-cache.md diff --git a/app/sdks/server-deno/docs/examples/health/get-d-b.md b/docs/examples/0.6.2/server-deno/examples/health/get-d-b.md similarity index 100% rename from app/sdks/server-deno/docs/examples/health/get-d-b.md rename to docs/examples/0.6.2/server-deno/examples/health/get-d-b.md diff --git a/app/sdks/server-deno/docs/examples/health/get-queue-certificates.md b/docs/examples/0.6.2/server-deno/examples/health/get-queue-certificates.md similarity index 100% rename from app/sdks/server-deno/docs/examples/health/get-queue-certificates.md rename to docs/examples/0.6.2/server-deno/examples/health/get-queue-certificates.md diff --git a/app/sdks/server-deno/docs/examples/health/get-queue-functions.md b/docs/examples/0.6.2/server-deno/examples/health/get-queue-functions.md similarity index 100% rename from app/sdks/server-deno/docs/examples/health/get-queue-functions.md rename to docs/examples/0.6.2/server-deno/examples/health/get-queue-functions.md diff --git a/app/sdks/server-deno/docs/examples/health/get-queue-logs.md b/docs/examples/0.6.2/server-deno/examples/health/get-queue-logs.md similarity index 100% rename from app/sdks/server-deno/docs/examples/health/get-queue-logs.md rename to docs/examples/0.6.2/server-deno/examples/health/get-queue-logs.md diff --git a/app/sdks/server-deno/docs/examples/health/get-queue-tasks.md b/docs/examples/0.6.2/server-deno/examples/health/get-queue-tasks.md similarity index 100% rename from app/sdks/server-deno/docs/examples/health/get-queue-tasks.md rename to docs/examples/0.6.2/server-deno/examples/health/get-queue-tasks.md diff --git a/app/sdks/server-deno/docs/examples/health/get-queue-usage.md b/docs/examples/0.6.2/server-deno/examples/health/get-queue-usage.md similarity index 100% rename from app/sdks/server-deno/docs/examples/health/get-queue-usage.md rename to docs/examples/0.6.2/server-deno/examples/health/get-queue-usage.md diff --git a/app/sdks/server-deno/docs/examples/health/get-queue-webhooks.md b/docs/examples/0.6.2/server-deno/examples/health/get-queue-webhooks.md similarity index 100% rename from app/sdks/server-deno/docs/examples/health/get-queue-webhooks.md rename to docs/examples/0.6.2/server-deno/examples/health/get-queue-webhooks.md diff --git a/app/sdks/server-deno/docs/examples/health/get-storage-local.md b/docs/examples/0.6.2/server-deno/examples/health/get-storage-local.md similarity index 100% rename from app/sdks/server-deno/docs/examples/health/get-storage-local.md rename to docs/examples/0.6.2/server-deno/examples/health/get-storage-local.md diff --git a/app/sdks/server-deno/docs/examples/health/get-time.md b/docs/examples/0.6.2/server-deno/examples/health/get-time.md similarity index 100% rename from app/sdks/server-deno/docs/examples/health/get-time.md rename to docs/examples/0.6.2/server-deno/examples/health/get-time.md diff --git a/app/sdks/server-deno/docs/examples/health/get.md b/docs/examples/0.6.2/server-deno/examples/health/get.md similarity index 100% rename from app/sdks/server-deno/docs/examples/health/get.md rename to docs/examples/0.6.2/server-deno/examples/health/get.md diff --git a/app/sdks/server-deno/docs/examples/locale/get-continents.md b/docs/examples/0.6.2/server-deno/examples/locale/get-continents.md similarity index 100% rename from app/sdks/server-deno/docs/examples/locale/get-continents.md rename to docs/examples/0.6.2/server-deno/examples/locale/get-continents.md diff --git a/app/sdks/server-deno/docs/examples/locale/get-countries-e-u.md b/docs/examples/0.6.2/server-deno/examples/locale/get-countries-e-u.md similarity index 100% rename from app/sdks/server-deno/docs/examples/locale/get-countries-e-u.md rename to docs/examples/0.6.2/server-deno/examples/locale/get-countries-e-u.md diff --git a/app/sdks/server-deno/docs/examples/locale/get-countries-phones.md b/docs/examples/0.6.2/server-deno/examples/locale/get-countries-phones.md similarity index 100% rename from app/sdks/server-deno/docs/examples/locale/get-countries-phones.md rename to docs/examples/0.6.2/server-deno/examples/locale/get-countries-phones.md diff --git a/app/sdks/server-deno/docs/examples/locale/get-countries.md b/docs/examples/0.6.2/server-deno/examples/locale/get-countries.md similarity index 100% rename from app/sdks/server-deno/docs/examples/locale/get-countries.md rename to docs/examples/0.6.2/server-deno/examples/locale/get-countries.md diff --git a/app/sdks/server-deno/docs/examples/locale/get-currencies.md b/docs/examples/0.6.2/server-deno/examples/locale/get-currencies.md similarity index 100% rename from app/sdks/server-deno/docs/examples/locale/get-currencies.md rename to docs/examples/0.6.2/server-deno/examples/locale/get-currencies.md diff --git a/docs/examples/0.6.2/server-deno/examples/locale/get-languages.md b/docs/examples/0.6.2/server-deno/examples/locale/get-languages.md new file mode 100644 index 0000000000..95c5c6b355 --- /dev/null +++ b/docs/examples/0.6.2/server-deno/examples/locale/get-languages.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let locale = new sdk.Locale(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = locale.getLanguages(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-deno/docs/examples/locale/get.md b/docs/examples/0.6.2/server-deno/examples/locale/get.md similarity index 100% rename from app/sdks/server-deno/docs/examples/locale/get.md rename to docs/examples/0.6.2/server-deno/examples/locale/get.md diff --git a/app/sdks/server-deno/docs/examples/storage/create-file.md b/docs/examples/0.6.2/server-deno/examples/storage/create-file.md similarity index 100% rename from app/sdks/server-deno/docs/examples/storage/create-file.md rename to docs/examples/0.6.2/server-deno/examples/storage/create-file.md diff --git a/app/sdks/server-deno/docs/examples/storage/delete-file.md b/docs/examples/0.6.2/server-deno/examples/storage/delete-file.md similarity index 100% rename from app/sdks/server-deno/docs/examples/storage/delete-file.md rename to docs/examples/0.6.2/server-deno/examples/storage/delete-file.md diff --git a/app/sdks/server-deno/docs/examples/storage/get-file-download.md b/docs/examples/0.6.2/server-deno/examples/storage/get-file-download.md similarity index 100% rename from app/sdks/server-deno/docs/examples/storage/get-file-download.md rename to docs/examples/0.6.2/server-deno/examples/storage/get-file-download.md diff --git a/app/sdks/server-deno/docs/examples/storage/get-file-preview.md b/docs/examples/0.6.2/server-deno/examples/storage/get-file-preview.md similarity index 100% rename from app/sdks/server-deno/docs/examples/storage/get-file-preview.md rename to docs/examples/0.6.2/server-deno/examples/storage/get-file-preview.md diff --git a/app/sdks/server-deno/docs/examples/storage/get-file-view.md b/docs/examples/0.6.2/server-deno/examples/storage/get-file-view.md similarity index 100% rename from app/sdks/server-deno/docs/examples/storage/get-file-view.md rename to docs/examples/0.6.2/server-deno/examples/storage/get-file-view.md diff --git a/app/sdks/server-deno/docs/examples/storage/get-file.md b/docs/examples/0.6.2/server-deno/examples/storage/get-file.md similarity index 100% rename from app/sdks/server-deno/docs/examples/storage/get-file.md rename to docs/examples/0.6.2/server-deno/examples/storage/get-file.md diff --git a/app/sdks/server-deno/docs/examples/storage/list-files.md b/docs/examples/0.6.2/server-deno/examples/storage/list-files.md similarity index 100% rename from app/sdks/server-deno/docs/examples/storage/list-files.md rename to docs/examples/0.6.2/server-deno/examples/storage/list-files.md diff --git a/app/sdks/server-deno/docs/examples/storage/update-file.md b/docs/examples/0.6.2/server-deno/examples/storage/update-file.md similarity index 100% rename from app/sdks/server-deno/docs/examples/storage/update-file.md rename to docs/examples/0.6.2/server-deno/examples/storage/update-file.md diff --git a/app/sdks/server-deno/docs/examples/teams/create-membership.md b/docs/examples/0.6.2/server-deno/examples/teams/create-membership.md similarity index 100% rename from app/sdks/server-deno/docs/examples/teams/create-membership.md rename to docs/examples/0.6.2/server-deno/examples/teams/create-membership.md diff --git a/app/sdks/server-deno/docs/examples/teams/create.md b/docs/examples/0.6.2/server-deno/examples/teams/create.md similarity index 100% rename from app/sdks/server-deno/docs/examples/teams/create.md rename to docs/examples/0.6.2/server-deno/examples/teams/create.md diff --git a/app/sdks/server-deno/docs/examples/teams/delete-membership.md b/docs/examples/0.6.2/server-deno/examples/teams/delete-membership.md similarity index 100% rename from app/sdks/server-deno/docs/examples/teams/delete-membership.md rename to docs/examples/0.6.2/server-deno/examples/teams/delete-membership.md diff --git a/app/sdks/server-deno/docs/examples/teams/delete.md b/docs/examples/0.6.2/server-deno/examples/teams/delete.md similarity index 100% rename from app/sdks/server-deno/docs/examples/teams/delete.md rename to docs/examples/0.6.2/server-deno/examples/teams/delete.md diff --git a/app/sdks/server-deno/docs/examples/teams/get-memberships.md b/docs/examples/0.6.2/server-deno/examples/teams/get-memberships.md similarity index 100% rename from app/sdks/server-deno/docs/examples/teams/get-memberships.md rename to docs/examples/0.6.2/server-deno/examples/teams/get-memberships.md diff --git a/app/sdks/server-deno/docs/examples/teams/get.md b/docs/examples/0.6.2/server-deno/examples/teams/get.md similarity index 100% rename from app/sdks/server-deno/docs/examples/teams/get.md rename to docs/examples/0.6.2/server-deno/examples/teams/get.md diff --git a/app/sdks/server-deno/docs/examples/teams/list.md b/docs/examples/0.6.2/server-deno/examples/teams/list.md similarity index 100% rename from app/sdks/server-deno/docs/examples/teams/list.md rename to docs/examples/0.6.2/server-deno/examples/teams/list.md diff --git a/app/sdks/server-deno/docs/examples/teams/update.md b/docs/examples/0.6.2/server-deno/examples/teams/update.md similarity index 100% rename from app/sdks/server-deno/docs/examples/teams/update.md rename to docs/examples/0.6.2/server-deno/examples/teams/update.md diff --git a/app/sdks/server-deno/docs/examples/users/create.md b/docs/examples/0.6.2/server-deno/examples/users/create.md similarity index 100% rename from app/sdks/server-deno/docs/examples/users/create.md rename to docs/examples/0.6.2/server-deno/examples/users/create.md diff --git a/app/sdks/server-deno/docs/examples/users/delete-session.md b/docs/examples/0.6.2/server-deno/examples/users/delete-session.md similarity index 100% rename from app/sdks/server-deno/docs/examples/users/delete-session.md rename to docs/examples/0.6.2/server-deno/examples/users/delete-session.md diff --git a/app/sdks/server-deno/docs/examples/users/delete-sessions.md b/docs/examples/0.6.2/server-deno/examples/users/delete-sessions.md similarity index 100% rename from app/sdks/server-deno/docs/examples/users/delete-sessions.md rename to docs/examples/0.6.2/server-deno/examples/users/delete-sessions.md diff --git a/app/sdks/server-deno/docs/examples/users/get-logs.md b/docs/examples/0.6.2/server-deno/examples/users/get-logs.md similarity index 100% rename from app/sdks/server-deno/docs/examples/users/get-logs.md rename to docs/examples/0.6.2/server-deno/examples/users/get-logs.md diff --git a/app/sdks/server-deno/docs/examples/users/get-prefs.md b/docs/examples/0.6.2/server-deno/examples/users/get-prefs.md similarity index 100% rename from app/sdks/server-deno/docs/examples/users/get-prefs.md rename to docs/examples/0.6.2/server-deno/examples/users/get-prefs.md diff --git a/app/sdks/server-deno/docs/examples/users/get-sessions.md b/docs/examples/0.6.2/server-deno/examples/users/get-sessions.md similarity index 100% rename from app/sdks/server-deno/docs/examples/users/get-sessions.md rename to docs/examples/0.6.2/server-deno/examples/users/get-sessions.md diff --git a/app/sdks/server-deno/docs/examples/users/get.md b/docs/examples/0.6.2/server-deno/examples/users/get.md similarity index 100% rename from app/sdks/server-deno/docs/examples/users/get.md rename to docs/examples/0.6.2/server-deno/examples/users/get.md diff --git a/app/sdks/server-deno/docs/examples/users/list.md b/docs/examples/0.6.2/server-deno/examples/users/list.md similarity index 100% rename from app/sdks/server-deno/docs/examples/users/list.md rename to docs/examples/0.6.2/server-deno/examples/users/list.md diff --git a/app/sdks/server-deno/docs/examples/users/update-prefs.md b/docs/examples/0.6.2/server-deno/examples/users/update-prefs.md similarity index 100% rename from app/sdks/server-deno/docs/examples/users/update-prefs.md rename to docs/examples/0.6.2/server-deno/examples/users/update-prefs.md diff --git a/app/sdks/server-deno/docs/examples/users/update-status.md b/docs/examples/0.6.2/server-deno/examples/users/update-status.md similarity index 100% rename from app/sdks/server-deno/docs/examples/users/update-status.md rename to docs/examples/0.6.2/server-deno/examples/users/update-status.md diff --git a/app/sdks/server-nodejs/docs/examples/avatars/get-browser.md b/docs/examples/0.6.2/server-nodejs/examples/avatars/get-browser.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/avatars/get-browser.md rename to docs/examples/0.6.2/server-nodejs/examples/avatars/get-browser.md diff --git a/app/sdks/server-nodejs/docs/examples/avatars/get-credit-card.md b/docs/examples/0.6.2/server-nodejs/examples/avatars/get-credit-card.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/avatars/get-credit-card.md rename to docs/examples/0.6.2/server-nodejs/examples/avatars/get-credit-card.md diff --git a/app/sdks/server-nodejs/docs/examples/avatars/get-favicon.md b/docs/examples/0.6.2/server-nodejs/examples/avatars/get-favicon.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/avatars/get-favicon.md rename to docs/examples/0.6.2/server-nodejs/examples/avatars/get-favicon.md diff --git a/app/sdks/server-nodejs/docs/examples/avatars/get-flag.md b/docs/examples/0.6.2/server-nodejs/examples/avatars/get-flag.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/avatars/get-flag.md rename to docs/examples/0.6.2/server-nodejs/examples/avatars/get-flag.md diff --git a/app/sdks/server-nodejs/docs/examples/avatars/get-image.md b/docs/examples/0.6.2/server-nodejs/examples/avatars/get-image.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/avatars/get-image.md rename to docs/examples/0.6.2/server-nodejs/examples/avatars/get-image.md diff --git a/docs/examples/0.6.2/server-nodejs/examples/avatars/get-initials.md b/docs/examples/0.6.2/server-nodejs/examples/avatars/get-initials.md new file mode 100644 index 0000000000..d6175bff13 --- /dev/null +++ b/docs/examples/0.6.2/server-nodejs/examples/avatars/get-initials.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let avatars = new sdk.Avatars(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = avatars.getInitials(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/avatars/get-q-r.md b/docs/examples/0.6.2/server-nodejs/examples/avatars/get-q-r.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/avatars/get-q-r.md rename to docs/examples/0.6.2/server-nodejs/examples/avatars/get-q-r.md diff --git a/app/sdks/server-nodejs/docs/examples/database/create-collection.md b/docs/examples/0.6.2/server-nodejs/examples/database/create-collection.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/database/create-collection.md rename to docs/examples/0.6.2/server-nodejs/examples/database/create-collection.md diff --git a/app/sdks/server-nodejs/docs/examples/database/create-document.md b/docs/examples/0.6.2/server-nodejs/examples/database/create-document.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/database/create-document.md rename to docs/examples/0.6.2/server-nodejs/examples/database/create-document.md diff --git a/app/sdks/server-nodejs/docs/examples/database/delete-collection.md b/docs/examples/0.6.2/server-nodejs/examples/database/delete-collection.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/database/delete-collection.md rename to docs/examples/0.6.2/server-nodejs/examples/database/delete-collection.md diff --git a/app/sdks/server-nodejs/docs/examples/database/delete-document.md b/docs/examples/0.6.2/server-nodejs/examples/database/delete-document.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/database/delete-document.md rename to docs/examples/0.6.2/server-nodejs/examples/database/delete-document.md diff --git a/app/sdks/server-nodejs/docs/examples/database/get-collection.md b/docs/examples/0.6.2/server-nodejs/examples/database/get-collection.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/database/get-collection.md rename to docs/examples/0.6.2/server-nodejs/examples/database/get-collection.md diff --git a/app/sdks/server-nodejs/docs/examples/database/get-document.md b/docs/examples/0.6.2/server-nodejs/examples/database/get-document.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/database/get-document.md rename to docs/examples/0.6.2/server-nodejs/examples/database/get-document.md diff --git a/app/sdks/server-nodejs/docs/examples/database/list-collections.md b/docs/examples/0.6.2/server-nodejs/examples/database/list-collections.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/database/list-collections.md rename to docs/examples/0.6.2/server-nodejs/examples/database/list-collections.md diff --git a/app/sdks/server-nodejs/docs/examples/database/list-documents.md b/docs/examples/0.6.2/server-nodejs/examples/database/list-documents.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/database/list-documents.md rename to docs/examples/0.6.2/server-nodejs/examples/database/list-documents.md diff --git a/app/sdks/server-nodejs/docs/examples/database/update-collection.md b/docs/examples/0.6.2/server-nodejs/examples/database/update-collection.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/database/update-collection.md rename to docs/examples/0.6.2/server-nodejs/examples/database/update-collection.md diff --git a/app/sdks/server-nodejs/docs/examples/database/update-document.md b/docs/examples/0.6.2/server-nodejs/examples/database/update-document.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/database/update-document.md rename to docs/examples/0.6.2/server-nodejs/examples/database/update-document.md diff --git a/app/sdks/server-nodejs/docs/examples/health/get-anti-virus.md b/docs/examples/0.6.2/server-nodejs/examples/health/get-anti-virus.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/health/get-anti-virus.md rename to docs/examples/0.6.2/server-nodejs/examples/health/get-anti-virus.md diff --git a/app/sdks/server-nodejs/docs/examples/health/get-cache.md b/docs/examples/0.6.2/server-nodejs/examples/health/get-cache.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/health/get-cache.md rename to docs/examples/0.6.2/server-nodejs/examples/health/get-cache.md diff --git a/app/sdks/server-nodejs/docs/examples/health/get-d-b.md b/docs/examples/0.6.2/server-nodejs/examples/health/get-d-b.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/health/get-d-b.md rename to docs/examples/0.6.2/server-nodejs/examples/health/get-d-b.md diff --git a/app/sdks/server-nodejs/docs/examples/health/get-queue-certificates.md b/docs/examples/0.6.2/server-nodejs/examples/health/get-queue-certificates.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/health/get-queue-certificates.md rename to docs/examples/0.6.2/server-nodejs/examples/health/get-queue-certificates.md diff --git a/app/sdks/server-nodejs/docs/examples/health/get-queue-functions.md b/docs/examples/0.6.2/server-nodejs/examples/health/get-queue-functions.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/health/get-queue-functions.md rename to docs/examples/0.6.2/server-nodejs/examples/health/get-queue-functions.md diff --git a/app/sdks/server-nodejs/docs/examples/health/get-queue-logs.md b/docs/examples/0.6.2/server-nodejs/examples/health/get-queue-logs.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/health/get-queue-logs.md rename to docs/examples/0.6.2/server-nodejs/examples/health/get-queue-logs.md diff --git a/app/sdks/server-nodejs/docs/examples/health/get-queue-tasks.md b/docs/examples/0.6.2/server-nodejs/examples/health/get-queue-tasks.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/health/get-queue-tasks.md rename to docs/examples/0.6.2/server-nodejs/examples/health/get-queue-tasks.md diff --git a/app/sdks/server-nodejs/docs/examples/health/get-queue-usage.md b/docs/examples/0.6.2/server-nodejs/examples/health/get-queue-usage.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/health/get-queue-usage.md rename to docs/examples/0.6.2/server-nodejs/examples/health/get-queue-usage.md diff --git a/app/sdks/server-nodejs/docs/examples/health/get-queue-webhooks.md b/docs/examples/0.6.2/server-nodejs/examples/health/get-queue-webhooks.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/health/get-queue-webhooks.md rename to docs/examples/0.6.2/server-nodejs/examples/health/get-queue-webhooks.md diff --git a/app/sdks/server-nodejs/docs/examples/health/get-storage-local.md b/docs/examples/0.6.2/server-nodejs/examples/health/get-storage-local.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/health/get-storage-local.md rename to docs/examples/0.6.2/server-nodejs/examples/health/get-storage-local.md diff --git a/app/sdks/server-nodejs/docs/examples/health/get-time.md b/docs/examples/0.6.2/server-nodejs/examples/health/get-time.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/health/get-time.md rename to docs/examples/0.6.2/server-nodejs/examples/health/get-time.md diff --git a/app/sdks/server-nodejs/docs/examples/health/get.md b/docs/examples/0.6.2/server-nodejs/examples/health/get.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/health/get.md rename to docs/examples/0.6.2/server-nodejs/examples/health/get.md diff --git a/app/sdks/server-nodejs/docs/examples/locale/get-continents.md b/docs/examples/0.6.2/server-nodejs/examples/locale/get-continents.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/locale/get-continents.md rename to docs/examples/0.6.2/server-nodejs/examples/locale/get-continents.md diff --git a/app/sdks/server-nodejs/docs/examples/locale/get-countries-e-u.md b/docs/examples/0.6.2/server-nodejs/examples/locale/get-countries-e-u.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/locale/get-countries-e-u.md rename to docs/examples/0.6.2/server-nodejs/examples/locale/get-countries-e-u.md diff --git a/app/sdks/server-nodejs/docs/examples/locale/get-countries-phones.md b/docs/examples/0.6.2/server-nodejs/examples/locale/get-countries-phones.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/locale/get-countries-phones.md rename to docs/examples/0.6.2/server-nodejs/examples/locale/get-countries-phones.md diff --git a/app/sdks/server-nodejs/docs/examples/locale/get-countries.md b/docs/examples/0.6.2/server-nodejs/examples/locale/get-countries.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/locale/get-countries.md rename to docs/examples/0.6.2/server-nodejs/examples/locale/get-countries.md diff --git a/app/sdks/server-nodejs/docs/examples/locale/get-currencies.md b/docs/examples/0.6.2/server-nodejs/examples/locale/get-currencies.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/locale/get-currencies.md rename to docs/examples/0.6.2/server-nodejs/examples/locale/get-currencies.md diff --git a/docs/examples/0.6.2/server-nodejs/examples/locale/get-languages.md b/docs/examples/0.6.2/server-nodejs/examples/locale/get-languages.md new file mode 100644 index 0000000000..b6f45311b3 --- /dev/null +++ b/docs/examples/0.6.2/server-nodejs/examples/locale/get-languages.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let locale = new sdk.Locale(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = locale.getLanguages(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/locale/get.md b/docs/examples/0.6.2/server-nodejs/examples/locale/get.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/locale/get.md rename to docs/examples/0.6.2/server-nodejs/examples/locale/get.md diff --git a/app/sdks/server-nodejs/docs/examples/storage/create-file.md b/docs/examples/0.6.2/server-nodejs/examples/storage/create-file.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/storage/create-file.md rename to docs/examples/0.6.2/server-nodejs/examples/storage/create-file.md diff --git a/app/sdks/server-nodejs/docs/examples/storage/delete-file.md b/docs/examples/0.6.2/server-nodejs/examples/storage/delete-file.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/storage/delete-file.md rename to docs/examples/0.6.2/server-nodejs/examples/storage/delete-file.md diff --git a/app/sdks/server-nodejs/docs/examples/storage/get-file-download.md b/docs/examples/0.6.2/server-nodejs/examples/storage/get-file-download.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/storage/get-file-download.md rename to docs/examples/0.6.2/server-nodejs/examples/storage/get-file-download.md diff --git a/app/sdks/server-nodejs/docs/examples/storage/get-file-preview.md b/docs/examples/0.6.2/server-nodejs/examples/storage/get-file-preview.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/storage/get-file-preview.md rename to docs/examples/0.6.2/server-nodejs/examples/storage/get-file-preview.md diff --git a/app/sdks/server-nodejs/docs/examples/storage/get-file-view.md b/docs/examples/0.6.2/server-nodejs/examples/storage/get-file-view.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/storage/get-file-view.md rename to docs/examples/0.6.2/server-nodejs/examples/storage/get-file-view.md diff --git a/app/sdks/server-nodejs/docs/examples/storage/get-file.md b/docs/examples/0.6.2/server-nodejs/examples/storage/get-file.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/storage/get-file.md rename to docs/examples/0.6.2/server-nodejs/examples/storage/get-file.md diff --git a/app/sdks/server-nodejs/docs/examples/storage/list-files.md b/docs/examples/0.6.2/server-nodejs/examples/storage/list-files.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/storage/list-files.md rename to docs/examples/0.6.2/server-nodejs/examples/storage/list-files.md diff --git a/app/sdks/server-nodejs/docs/examples/storage/update-file.md b/docs/examples/0.6.2/server-nodejs/examples/storage/update-file.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/storage/update-file.md rename to docs/examples/0.6.2/server-nodejs/examples/storage/update-file.md diff --git a/app/sdks/server-nodejs/docs/examples/teams/create-membership.md b/docs/examples/0.6.2/server-nodejs/examples/teams/create-membership.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/teams/create-membership.md rename to docs/examples/0.6.2/server-nodejs/examples/teams/create-membership.md diff --git a/app/sdks/server-nodejs/docs/examples/teams/create.md b/docs/examples/0.6.2/server-nodejs/examples/teams/create.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/teams/create.md rename to docs/examples/0.6.2/server-nodejs/examples/teams/create.md diff --git a/app/sdks/server-nodejs/docs/examples/teams/delete-membership.md b/docs/examples/0.6.2/server-nodejs/examples/teams/delete-membership.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/teams/delete-membership.md rename to docs/examples/0.6.2/server-nodejs/examples/teams/delete-membership.md diff --git a/app/sdks/server-nodejs/docs/examples/teams/delete.md b/docs/examples/0.6.2/server-nodejs/examples/teams/delete.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/teams/delete.md rename to docs/examples/0.6.2/server-nodejs/examples/teams/delete.md diff --git a/app/sdks/server-nodejs/docs/examples/teams/get-memberships.md b/docs/examples/0.6.2/server-nodejs/examples/teams/get-memberships.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/teams/get-memberships.md rename to docs/examples/0.6.2/server-nodejs/examples/teams/get-memberships.md diff --git a/app/sdks/server-nodejs/docs/examples/teams/get.md b/docs/examples/0.6.2/server-nodejs/examples/teams/get.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/teams/get.md rename to docs/examples/0.6.2/server-nodejs/examples/teams/get.md diff --git a/app/sdks/server-nodejs/docs/examples/teams/list.md b/docs/examples/0.6.2/server-nodejs/examples/teams/list.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/teams/list.md rename to docs/examples/0.6.2/server-nodejs/examples/teams/list.md diff --git a/app/sdks/server-nodejs/docs/examples/teams/update.md b/docs/examples/0.6.2/server-nodejs/examples/teams/update.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/teams/update.md rename to docs/examples/0.6.2/server-nodejs/examples/teams/update.md diff --git a/app/sdks/server-nodejs/docs/examples/users/create.md b/docs/examples/0.6.2/server-nodejs/examples/users/create.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/users/create.md rename to docs/examples/0.6.2/server-nodejs/examples/users/create.md diff --git a/app/sdks/server-nodejs/docs/examples/users/delete-session.md b/docs/examples/0.6.2/server-nodejs/examples/users/delete-session.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/users/delete-session.md rename to docs/examples/0.6.2/server-nodejs/examples/users/delete-session.md diff --git a/app/sdks/server-nodejs/docs/examples/users/delete-sessions.md b/docs/examples/0.6.2/server-nodejs/examples/users/delete-sessions.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/users/delete-sessions.md rename to docs/examples/0.6.2/server-nodejs/examples/users/delete-sessions.md diff --git a/app/sdks/server-nodejs/docs/examples/users/get-logs.md b/docs/examples/0.6.2/server-nodejs/examples/users/get-logs.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/users/get-logs.md rename to docs/examples/0.6.2/server-nodejs/examples/users/get-logs.md diff --git a/app/sdks/server-nodejs/docs/examples/users/get-prefs.md b/docs/examples/0.6.2/server-nodejs/examples/users/get-prefs.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/users/get-prefs.md rename to docs/examples/0.6.2/server-nodejs/examples/users/get-prefs.md diff --git a/app/sdks/server-nodejs/docs/examples/users/get-sessions.md b/docs/examples/0.6.2/server-nodejs/examples/users/get-sessions.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/users/get-sessions.md rename to docs/examples/0.6.2/server-nodejs/examples/users/get-sessions.md diff --git a/app/sdks/server-nodejs/docs/examples/users/get.md b/docs/examples/0.6.2/server-nodejs/examples/users/get.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/users/get.md rename to docs/examples/0.6.2/server-nodejs/examples/users/get.md diff --git a/app/sdks/server-nodejs/docs/examples/users/list.md b/docs/examples/0.6.2/server-nodejs/examples/users/list.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/users/list.md rename to docs/examples/0.6.2/server-nodejs/examples/users/list.md diff --git a/app/sdks/server-nodejs/docs/examples/users/update-prefs.md b/docs/examples/0.6.2/server-nodejs/examples/users/update-prefs.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/users/update-prefs.md rename to docs/examples/0.6.2/server-nodejs/examples/users/update-prefs.md diff --git a/app/sdks/server-nodejs/docs/examples/users/update-status.md b/docs/examples/0.6.2/server-nodejs/examples/users/update-status.md similarity index 100% rename from app/sdks/server-nodejs/docs/examples/users/update-status.md rename to docs/examples/0.6.2/server-nodejs/examples/users/update-status.md diff --git a/app/sdks/server-php/docs/examples/avatars/get-browser.md b/docs/examples/0.6.2/server-php/examples/avatars/get-browser.md similarity index 100% rename from app/sdks/server-php/docs/examples/avatars/get-browser.md rename to docs/examples/0.6.2/server-php/examples/avatars/get-browser.md diff --git a/app/sdks/server-php/docs/examples/avatars/get-credit-card.md b/docs/examples/0.6.2/server-php/examples/avatars/get-credit-card.md similarity index 100% rename from app/sdks/server-php/docs/examples/avatars/get-credit-card.md rename to docs/examples/0.6.2/server-php/examples/avatars/get-credit-card.md diff --git a/app/sdks/server-php/docs/examples/avatars/get-favicon.md b/docs/examples/0.6.2/server-php/examples/avatars/get-favicon.md similarity index 100% rename from app/sdks/server-php/docs/examples/avatars/get-favicon.md rename to docs/examples/0.6.2/server-php/examples/avatars/get-favicon.md diff --git a/app/sdks/server-php/docs/examples/avatars/get-flag.md b/docs/examples/0.6.2/server-php/examples/avatars/get-flag.md similarity index 100% rename from app/sdks/server-php/docs/examples/avatars/get-flag.md rename to docs/examples/0.6.2/server-php/examples/avatars/get-flag.md diff --git a/app/sdks/server-php/docs/examples/avatars/get-image.md b/docs/examples/0.6.2/server-php/examples/avatars/get-image.md similarity index 100% rename from app/sdks/server-php/docs/examples/avatars/get-image.md rename to docs/examples/0.6.2/server-php/examples/avatars/get-image.md diff --git a/docs/examples/0.6.2/server-php/examples/avatars/get-initials.md b/docs/examples/0.6.2/server-php/examples/avatars/get-initials.md new file mode 100644 index 0000000000..f5e549ace6 --- /dev/null +++ b/docs/examples/0.6.2/server-php/examples/avatars/get-initials.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$avatars = new Avatars($client); + +$result = $avatars->getInitials(); \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/avatars/get-q-r.md b/docs/examples/0.6.2/server-php/examples/avatars/get-q-r.md similarity index 100% rename from app/sdks/server-php/docs/examples/avatars/get-q-r.md rename to docs/examples/0.6.2/server-php/examples/avatars/get-q-r.md diff --git a/app/sdks/server-php/docs/examples/database/create-collection.md b/docs/examples/0.6.2/server-php/examples/database/create-collection.md similarity index 100% rename from app/sdks/server-php/docs/examples/database/create-collection.md rename to docs/examples/0.6.2/server-php/examples/database/create-collection.md diff --git a/app/sdks/server-php/docs/examples/database/create-document.md b/docs/examples/0.6.2/server-php/examples/database/create-document.md similarity index 100% rename from app/sdks/server-php/docs/examples/database/create-document.md rename to docs/examples/0.6.2/server-php/examples/database/create-document.md diff --git a/app/sdks/server-php/docs/examples/database/delete-collection.md b/docs/examples/0.6.2/server-php/examples/database/delete-collection.md similarity index 100% rename from app/sdks/server-php/docs/examples/database/delete-collection.md rename to docs/examples/0.6.2/server-php/examples/database/delete-collection.md diff --git a/app/sdks/server-php/docs/examples/database/delete-document.md b/docs/examples/0.6.2/server-php/examples/database/delete-document.md similarity index 100% rename from app/sdks/server-php/docs/examples/database/delete-document.md rename to docs/examples/0.6.2/server-php/examples/database/delete-document.md diff --git a/app/sdks/server-php/docs/examples/database/get-collection.md b/docs/examples/0.6.2/server-php/examples/database/get-collection.md similarity index 100% rename from app/sdks/server-php/docs/examples/database/get-collection.md rename to docs/examples/0.6.2/server-php/examples/database/get-collection.md diff --git a/app/sdks/server-php/docs/examples/database/get-document.md b/docs/examples/0.6.2/server-php/examples/database/get-document.md similarity index 100% rename from app/sdks/server-php/docs/examples/database/get-document.md rename to docs/examples/0.6.2/server-php/examples/database/get-document.md diff --git a/app/sdks/server-php/docs/examples/database/list-collections.md b/docs/examples/0.6.2/server-php/examples/database/list-collections.md similarity index 100% rename from app/sdks/server-php/docs/examples/database/list-collections.md rename to docs/examples/0.6.2/server-php/examples/database/list-collections.md diff --git a/app/sdks/server-php/docs/examples/database/list-documents.md b/docs/examples/0.6.2/server-php/examples/database/list-documents.md similarity index 100% rename from app/sdks/server-php/docs/examples/database/list-documents.md rename to docs/examples/0.6.2/server-php/examples/database/list-documents.md diff --git a/app/sdks/server-php/docs/examples/database/update-collection.md b/docs/examples/0.6.2/server-php/examples/database/update-collection.md similarity index 100% rename from app/sdks/server-php/docs/examples/database/update-collection.md rename to docs/examples/0.6.2/server-php/examples/database/update-collection.md diff --git a/app/sdks/server-php/docs/examples/database/update-document.md b/docs/examples/0.6.2/server-php/examples/database/update-document.md similarity index 100% rename from app/sdks/server-php/docs/examples/database/update-document.md rename to docs/examples/0.6.2/server-php/examples/database/update-document.md diff --git a/app/sdks/server-php/docs/examples/health/get-anti-virus.md b/docs/examples/0.6.2/server-php/examples/health/get-anti-virus.md similarity index 100% rename from app/sdks/server-php/docs/examples/health/get-anti-virus.md rename to docs/examples/0.6.2/server-php/examples/health/get-anti-virus.md diff --git a/app/sdks/server-php/docs/examples/health/get-cache.md b/docs/examples/0.6.2/server-php/examples/health/get-cache.md similarity index 100% rename from app/sdks/server-php/docs/examples/health/get-cache.md rename to docs/examples/0.6.2/server-php/examples/health/get-cache.md diff --git a/app/sdks/server-php/docs/examples/health/get-d-b.md b/docs/examples/0.6.2/server-php/examples/health/get-d-b.md similarity index 100% rename from app/sdks/server-php/docs/examples/health/get-d-b.md rename to docs/examples/0.6.2/server-php/examples/health/get-d-b.md diff --git a/app/sdks/server-php/docs/examples/health/get-queue-certificates.md b/docs/examples/0.6.2/server-php/examples/health/get-queue-certificates.md similarity index 100% rename from app/sdks/server-php/docs/examples/health/get-queue-certificates.md rename to docs/examples/0.6.2/server-php/examples/health/get-queue-certificates.md diff --git a/app/sdks/server-php/docs/examples/health/get-queue-functions.md b/docs/examples/0.6.2/server-php/examples/health/get-queue-functions.md similarity index 100% rename from app/sdks/server-php/docs/examples/health/get-queue-functions.md rename to docs/examples/0.6.2/server-php/examples/health/get-queue-functions.md diff --git a/app/sdks/server-php/docs/examples/health/get-queue-logs.md b/docs/examples/0.6.2/server-php/examples/health/get-queue-logs.md similarity index 100% rename from app/sdks/server-php/docs/examples/health/get-queue-logs.md rename to docs/examples/0.6.2/server-php/examples/health/get-queue-logs.md diff --git a/app/sdks/server-php/docs/examples/health/get-queue-tasks.md b/docs/examples/0.6.2/server-php/examples/health/get-queue-tasks.md similarity index 100% rename from app/sdks/server-php/docs/examples/health/get-queue-tasks.md rename to docs/examples/0.6.2/server-php/examples/health/get-queue-tasks.md diff --git a/app/sdks/server-php/docs/examples/health/get-queue-usage.md b/docs/examples/0.6.2/server-php/examples/health/get-queue-usage.md similarity index 100% rename from app/sdks/server-php/docs/examples/health/get-queue-usage.md rename to docs/examples/0.6.2/server-php/examples/health/get-queue-usage.md diff --git a/app/sdks/server-php/docs/examples/health/get-queue-webhooks.md b/docs/examples/0.6.2/server-php/examples/health/get-queue-webhooks.md similarity index 100% rename from app/sdks/server-php/docs/examples/health/get-queue-webhooks.md rename to docs/examples/0.6.2/server-php/examples/health/get-queue-webhooks.md diff --git a/app/sdks/server-php/docs/examples/health/get-storage-local.md b/docs/examples/0.6.2/server-php/examples/health/get-storage-local.md similarity index 100% rename from app/sdks/server-php/docs/examples/health/get-storage-local.md rename to docs/examples/0.6.2/server-php/examples/health/get-storage-local.md diff --git a/app/sdks/server-php/docs/examples/health/get-time.md b/docs/examples/0.6.2/server-php/examples/health/get-time.md similarity index 100% rename from app/sdks/server-php/docs/examples/health/get-time.md rename to docs/examples/0.6.2/server-php/examples/health/get-time.md diff --git a/app/sdks/server-php/docs/examples/health/get.md b/docs/examples/0.6.2/server-php/examples/health/get.md similarity index 100% rename from app/sdks/server-php/docs/examples/health/get.md rename to docs/examples/0.6.2/server-php/examples/health/get.md diff --git a/app/sdks/server-php/docs/examples/locale/get-continents.md b/docs/examples/0.6.2/server-php/examples/locale/get-continents.md similarity index 100% rename from app/sdks/server-php/docs/examples/locale/get-continents.md rename to docs/examples/0.6.2/server-php/examples/locale/get-continents.md diff --git a/app/sdks/server-php/docs/examples/locale/get-countries-e-u.md b/docs/examples/0.6.2/server-php/examples/locale/get-countries-e-u.md similarity index 100% rename from app/sdks/server-php/docs/examples/locale/get-countries-e-u.md rename to docs/examples/0.6.2/server-php/examples/locale/get-countries-e-u.md diff --git a/app/sdks/server-php/docs/examples/locale/get-countries-phones.md b/docs/examples/0.6.2/server-php/examples/locale/get-countries-phones.md similarity index 100% rename from app/sdks/server-php/docs/examples/locale/get-countries-phones.md rename to docs/examples/0.6.2/server-php/examples/locale/get-countries-phones.md diff --git a/app/sdks/server-php/docs/examples/locale/get-countries.md b/docs/examples/0.6.2/server-php/examples/locale/get-countries.md similarity index 100% rename from app/sdks/server-php/docs/examples/locale/get-countries.md rename to docs/examples/0.6.2/server-php/examples/locale/get-countries.md diff --git a/app/sdks/server-php/docs/examples/locale/get-currencies.md b/docs/examples/0.6.2/server-php/examples/locale/get-currencies.md similarity index 100% rename from app/sdks/server-php/docs/examples/locale/get-currencies.md rename to docs/examples/0.6.2/server-php/examples/locale/get-currencies.md diff --git a/docs/examples/0.6.2/server-php/examples/locale/get-languages.md b/docs/examples/0.6.2/server-php/examples/locale/get-languages.md new file mode 100644 index 0000000000..47fdc6eb34 --- /dev/null +++ b/docs/examples/0.6.2/server-php/examples/locale/get-languages.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$locale = new Locale($client); + +$result = $locale->getLanguages(); \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/locale/get.md b/docs/examples/0.6.2/server-php/examples/locale/get.md similarity index 100% rename from app/sdks/server-php/docs/examples/locale/get.md rename to docs/examples/0.6.2/server-php/examples/locale/get.md diff --git a/app/sdks/server-php/docs/examples/storage/create-file.md b/docs/examples/0.6.2/server-php/examples/storage/create-file.md similarity index 100% rename from app/sdks/server-php/docs/examples/storage/create-file.md rename to docs/examples/0.6.2/server-php/examples/storage/create-file.md diff --git a/app/sdks/server-php/docs/examples/storage/delete-file.md b/docs/examples/0.6.2/server-php/examples/storage/delete-file.md similarity index 100% rename from app/sdks/server-php/docs/examples/storage/delete-file.md rename to docs/examples/0.6.2/server-php/examples/storage/delete-file.md diff --git a/app/sdks/server-php/docs/examples/storage/get-file-download.md b/docs/examples/0.6.2/server-php/examples/storage/get-file-download.md similarity index 100% rename from app/sdks/server-php/docs/examples/storage/get-file-download.md rename to docs/examples/0.6.2/server-php/examples/storage/get-file-download.md diff --git a/app/sdks/server-php/docs/examples/storage/get-file-preview.md b/docs/examples/0.6.2/server-php/examples/storage/get-file-preview.md similarity index 100% rename from app/sdks/server-php/docs/examples/storage/get-file-preview.md rename to docs/examples/0.6.2/server-php/examples/storage/get-file-preview.md diff --git a/app/sdks/server-php/docs/examples/storage/get-file-view.md b/docs/examples/0.6.2/server-php/examples/storage/get-file-view.md similarity index 100% rename from app/sdks/server-php/docs/examples/storage/get-file-view.md rename to docs/examples/0.6.2/server-php/examples/storage/get-file-view.md diff --git a/app/sdks/server-php/docs/examples/storage/get-file.md b/docs/examples/0.6.2/server-php/examples/storage/get-file.md similarity index 100% rename from app/sdks/server-php/docs/examples/storage/get-file.md rename to docs/examples/0.6.2/server-php/examples/storage/get-file.md diff --git a/app/sdks/server-php/docs/examples/storage/list-files.md b/docs/examples/0.6.2/server-php/examples/storage/list-files.md similarity index 100% rename from app/sdks/server-php/docs/examples/storage/list-files.md rename to docs/examples/0.6.2/server-php/examples/storage/list-files.md diff --git a/app/sdks/server-php/docs/examples/storage/update-file.md b/docs/examples/0.6.2/server-php/examples/storage/update-file.md similarity index 100% rename from app/sdks/server-php/docs/examples/storage/update-file.md rename to docs/examples/0.6.2/server-php/examples/storage/update-file.md diff --git a/app/sdks/server-php/docs/examples/teams/create-membership.md b/docs/examples/0.6.2/server-php/examples/teams/create-membership.md similarity index 100% rename from app/sdks/server-php/docs/examples/teams/create-membership.md rename to docs/examples/0.6.2/server-php/examples/teams/create-membership.md diff --git a/app/sdks/server-php/docs/examples/teams/create.md b/docs/examples/0.6.2/server-php/examples/teams/create.md similarity index 100% rename from app/sdks/server-php/docs/examples/teams/create.md rename to docs/examples/0.6.2/server-php/examples/teams/create.md diff --git a/app/sdks/server-php/docs/examples/teams/delete-membership.md b/docs/examples/0.6.2/server-php/examples/teams/delete-membership.md similarity index 100% rename from app/sdks/server-php/docs/examples/teams/delete-membership.md rename to docs/examples/0.6.2/server-php/examples/teams/delete-membership.md diff --git a/app/sdks/server-php/docs/examples/teams/delete.md b/docs/examples/0.6.2/server-php/examples/teams/delete.md similarity index 100% rename from app/sdks/server-php/docs/examples/teams/delete.md rename to docs/examples/0.6.2/server-php/examples/teams/delete.md diff --git a/app/sdks/server-php/docs/examples/teams/get-memberships.md b/docs/examples/0.6.2/server-php/examples/teams/get-memberships.md similarity index 100% rename from app/sdks/server-php/docs/examples/teams/get-memberships.md rename to docs/examples/0.6.2/server-php/examples/teams/get-memberships.md diff --git a/app/sdks/server-php/docs/examples/teams/get.md b/docs/examples/0.6.2/server-php/examples/teams/get.md similarity index 100% rename from app/sdks/server-php/docs/examples/teams/get.md rename to docs/examples/0.6.2/server-php/examples/teams/get.md diff --git a/app/sdks/server-php/docs/examples/teams/list.md b/docs/examples/0.6.2/server-php/examples/teams/list.md similarity index 100% rename from app/sdks/server-php/docs/examples/teams/list.md rename to docs/examples/0.6.2/server-php/examples/teams/list.md diff --git a/app/sdks/server-php/docs/examples/teams/update.md b/docs/examples/0.6.2/server-php/examples/teams/update.md similarity index 100% rename from app/sdks/server-php/docs/examples/teams/update.md rename to docs/examples/0.6.2/server-php/examples/teams/update.md diff --git a/app/sdks/server-php/docs/examples/users/create.md b/docs/examples/0.6.2/server-php/examples/users/create.md similarity index 100% rename from app/sdks/server-php/docs/examples/users/create.md rename to docs/examples/0.6.2/server-php/examples/users/create.md diff --git a/app/sdks/server-php/docs/examples/users/delete-session.md b/docs/examples/0.6.2/server-php/examples/users/delete-session.md similarity index 100% rename from app/sdks/server-php/docs/examples/users/delete-session.md rename to docs/examples/0.6.2/server-php/examples/users/delete-session.md diff --git a/app/sdks/server-php/docs/examples/users/delete-sessions.md b/docs/examples/0.6.2/server-php/examples/users/delete-sessions.md similarity index 100% rename from app/sdks/server-php/docs/examples/users/delete-sessions.md rename to docs/examples/0.6.2/server-php/examples/users/delete-sessions.md diff --git a/app/sdks/server-php/docs/examples/users/get-logs.md b/docs/examples/0.6.2/server-php/examples/users/get-logs.md similarity index 100% rename from app/sdks/server-php/docs/examples/users/get-logs.md rename to docs/examples/0.6.2/server-php/examples/users/get-logs.md diff --git a/app/sdks/server-php/docs/examples/users/get-prefs.md b/docs/examples/0.6.2/server-php/examples/users/get-prefs.md similarity index 100% rename from app/sdks/server-php/docs/examples/users/get-prefs.md rename to docs/examples/0.6.2/server-php/examples/users/get-prefs.md diff --git a/app/sdks/server-php/docs/examples/users/get-sessions.md b/docs/examples/0.6.2/server-php/examples/users/get-sessions.md similarity index 100% rename from app/sdks/server-php/docs/examples/users/get-sessions.md rename to docs/examples/0.6.2/server-php/examples/users/get-sessions.md diff --git a/app/sdks/server-php/docs/examples/users/get.md b/docs/examples/0.6.2/server-php/examples/users/get.md similarity index 100% rename from app/sdks/server-php/docs/examples/users/get.md rename to docs/examples/0.6.2/server-php/examples/users/get.md diff --git a/app/sdks/server-php/docs/examples/users/list.md b/docs/examples/0.6.2/server-php/examples/users/list.md similarity index 100% rename from app/sdks/server-php/docs/examples/users/list.md rename to docs/examples/0.6.2/server-php/examples/users/list.md diff --git a/app/sdks/server-php/docs/examples/users/update-prefs.md b/docs/examples/0.6.2/server-php/examples/users/update-prefs.md similarity index 100% rename from app/sdks/server-php/docs/examples/users/update-prefs.md rename to docs/examples/0.6.2/server-php/examples/users/update-prefs.md diff --git a/app/sdks/server-php/docs/examples/users/update-status.md b/docs/examples/0.6.2/server-php/examples/users/update-status.md similarity index 100% rename from app/sdks/server-php/docs/examples/users/update-status.md rename to docs/examples/0.6.2/server-php/examples/users/update-status.md diff --git a/app/sdks/server-python/docs/examples/avatars/get-browser.md b/docs/examples/0.6.2/server-python/examples/avatars/get-browser.md similarity index 81% rename from app/sdks/server-python/docs/examples/avatars/get-browser.md rename to docs/examples/0.6.2/server-python/examples/avatars/get-browser.md index ec783ca34d..138c0d1b3e 100644 --- a/app/sdks/server-python/docs/examples/avatars/get-browser.md +++ b/docs/examples/0.6.2/server-python/examples/avatars/get-browser.md @@ -4,7 +4,7 @@ from appwrite.services.avatars import Avatars client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/avatars/get-credit-card.md b/docs/examples/0.6.2/server-python/examples/avatars/get-credit-card.md similarity index 81% rename from app/sdks/server-python/docs/examples/avatars/get-credit-card.md rename to docs/examples/0.6.2/server-python/examples/avatars/get-credit-card.md index ce2d3f8135..83f76aca42 100644 --- a/app/sdks/server-python/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/0.6.2/server-python/examples/avatars/get-credit-card.md @@ -4,7 +4,7 @@ from appwrite.services.avatars import Avatars client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/avatars/get-favicon.md b/docs/examples/0.6.2/server-python/examples/avatars/get-favicon.md similarity index 82% rename from app/sdks/server-python/docs/examples/avatars/get-favicon.md rename to docs/examples/0.6.2/server-python/examples/avatars/get-favicon.md index 8de722c202..6946080bee 100644 --- a/app/sdks/server-python/docs/examples/avatars/get-favicon.md +++ b/docs/examples/0.6.2/server-python/examples/avatars/get-favicon.md @@ -4,7 +4,7 @@ from appwrite.services.avatars import Avatars client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/avatars/get-flag.md b/docs/examples/0.6.2/server-python/examples/avatars/get-flag.md similarity index 81% rename from app/sdks/server-python/docs/examples/avatars/get-flag.md rename to docs/examples/0.6.2/server-python/examples/avatars/get-flag.md index 0bf5657d2e..188d6d35bd 100644 --- a/app/sdks/server-python/docs/examples/avatars/get-flag.md +++ b/docs/examples/0.6.2/server-python/examples/avatars/get-flag.md @@ -4,7 +4,7 @@ from appwrite.services.avatars import Avatars client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/avatars/get-image.md b/docs/examples/0.6.2/server-python/examples/avatars/get-image.md similarity index 81% rename from app/sdks/server-python/docs/examples/avatars/get-image.md rename to docs/examples/0.6.2/server-python/examples/avatars/get-image.md index 3164a956c1..29a6430eab 100644 --- a/app/sdks/server-python/docs/examples/avatars/get-image.md +++ b/docs/examples/0.6.2/server-python/examples/avatars/get-image.md @@ -4,7 +4,7 @@ from appwrite.services.avatars import Avatars client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/docs/examples/0.6.2/server-python/examples/avatars/get-initials.md b/docs/examples/0.6.2/server-python/examples/avatars/get-initials.md new file mode 100644 index 0000000000..0c300af5da --- /dev/null +++ b/docs/examples/0.6.2/server-python/examples/avatars/get-initials.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.avatars import Avatars + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +avatars = Avatars(client) + +result = avatars.get_initials() diff --git a/app/sdks/server-python/docs/examples/avatars/get-q-r.md b/docs/examples/0.6.2/server-python/examples/avatars/get-q-r.md similarity index 81% rename from app/sdks/server-python/docs/examples/avatars/get-q-r.md rename to docs/examples/0.6.2/server-python/examples/avatars/get-q-r.md index b0c6508a8a..19551e99d7 100644 --- a/app/sdks/server-python/docs/examples/avatars/get-q-r.md +++ b/docs/examples/0.6.2/server-python/examples/avatars/get-q-r.md @@ -4,7 +4,7 @@ from appwrite.services.avatars import Avatars client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/database/create-collection.md b/docs/examples/0.6.2/server-python/examples/database/create-collection.md similarity index 82% rename from app/sdks/server-python/docs/examples/database/create-collection.md rename to docs/examples/0.6.2/server-python/examples/database/create-collection.md index 8741c13744..eb704a80a1 100644 --- a/app/sdks/server-python/docs/examples/database/create-collection.md +++ b/docs/examples/0.6.2/server-python/examples/database/create-collection.md @@ -4,7 +4,7 @@ from appwrite.services.database import Database client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/database/create-document.md b/docs/examples/0.6.2/server-python/examples/database/create-document.md similarity index 82% rename from app/sdks/server-python/docs/examples/database/create-document.md rename to docs/examples/0.6.2/server-python/examples/database/create-document.md index fff7a96bc0..919d5ebbf4 100644 --- a/app/sdks/server-python/docs/examples/database/create-document.md +++ b/docs/examples/0.6.2/server-python/examples/database/create-document.md @@ -4,7 +4,7 @@ from appwrite.services.database import Database client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/database/delete-collection.md b/docs/examples/0.6.2/server-python/examples/database/delete-collection.md similarity index 82% rename from app/sdks/server-python/docs/examples/database/delete-collection.md rename to docs/examples/0.6.2/server-python/examples/database/delete-collection.md index c3a7af45f5..0e188ade41 100644 --- a/app/sdks/server-python/docs/examples/database/delete-collection.md +++ b/docs/examples/0.6.2/server-python/examples/database/delete-collection.md @@ -4,7 +4,7 @@ from appwrite.services.database import Database client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/database/delete-document.md b/docs/examples/0.6.2/server-python/examples/database/delete-document.md similarity index 83% rename from app/sdks/server-python/docs/examples/database/delete-document.md rename to docs/examples/0.6.2/server-python/examples/database/delete-document.md index 1adacaff4e..c085547c16 100644 --- a/app/sdks/server-python/docs/examples/database/delete-document.md +++ b/docs/examples/0.6.2/server-python/examples/database/delete-document.md @@ -4,7 +4,7 @@ from appwrite.services.database import Database client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/database/get-collection.md b/docs/examples/0.6.2/server-python/examples/database/get-collection.md similarity index 82% rename from app/sdks/server-python/docs/examples/database/get-collection.md rename to docs/examples/0.6.2/server-python/examples/database/get-collection.md index 34269a7d4a..f90f51f48b 100644 --- a/app/sdks/server-python/docs/examples/database/get-collection.md +++ b/docs/examples/0.6.2/server-python/examples/database/get-collection.md @@ -4,7 +4,7 @@ from appwrite.services.database import Database client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/database/get-document.md b/docs/examples/0.6.2/server-python/examples/database/get-document.md similarity index 82% rename from app/sdks/server-python/docs/examples/database/get-document.md rename to docs/examples/0.6.2/server-python/examples/database/get-document.md index 13d313c15f..79891709d1 100644 --- a/app/sdks/server-python/docs/examples/database/get-document.md +++ b/docs/examples/0.6.2/server-python/examples/database/get-document.md @@ -4,7 +4,7 @@ from appwrite.services.database import Database client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/database/list-collections.md b/docs/examples/0.6.2/server-python/examples/database/list-collections.md similarity index 81% rename from app/sdks/server-python/docs/examples/database/list-collections.md rename to docs/examples/0.6.2/server-python/examples/database/list-collections.md index 840ae586fe..f60d4b90e5 100644 --- a/app/sdks/server-python/docs/examples/database/list-collections.md +++ b/docs/examples/0.6.2/server-python/examples/database/list-collections.md @@ -4,7 +4,7 @@ from appwrite.services.database import Database client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/database/list-documents.md b/docs/examples/0.6.2/server-python/examples/database/list-documents.md similarity index 82% rename from app/sdks/server-python/docs/examples/database/list-documents.md rename to docs/examples/0.6.2/server-python/examples/database/list-documents.md index 6969eef581..cecb57d2fa 100644 --- a/app/sdks/server-python/docs/examples/database/list-documents.md +++ b/docs/examples/0.6.2/server-python/examples/database/list-documents.md @@ -4,7 +4,7 @@ from appwrite.services.database import Database client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/database/update-collection.md b/docs/examples/0.6.2/server-python/examples/database/update-collection.md similarity index 83% rename from app/sdks/server-python/docs/examples/database/update-collection.md rename to docs/examples/0.6.2/server-python/examples/database/update-collection.md index 0bf8f29fb8..7dacd558ba 100644 --- a/app/sdks/server-python/docs/examples/database/update-collection.md +++ b/docs/examples/0.6.2/server-python/examples/database/update-collection.md @@ -4,7 +4,7 @@ from appwrite.services.database import Database client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/database/update-document.md b/docs/examples/0.6.2/server-python/examples/database/update-document.md similarity index 83% rename from app/sdks/server-python/docs/examples/database/update-document.md rename to docs/examples/0.6.2/server-python/examples/database/update-document.md index 40e11c0665..6296809dc5 100644 --- a/app/sdks/server-python/docs/examples/database/update-document.md +++ b/docs/examples/0.6.2/server-python/examples/database/update-document.md @@ -4,7 +4,7 @@ from appwrite.services.database import Database client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/health/get-anti-virus.md b/docs/examples/0.6.2/server-python/examples/health/get-anti-virus.md similarity index 80% rename from app/sdks/server-python/docs/examples/health/get-anti-virus.md rename to docs/examples/0.6.2/server-python/examples/health/get-anti-virus.md index 0c90f20750..c7628d90ea 100644 --- a/app/sdks/server-python/docs/examples/health/get-anti-virus.md +++ b/docs/examples/0.6.2/server-python/examples/health/get-anti-virus.md @@ -4,7 +4,7 @@ from appwrite.services.health import Health client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/health/get-cache.md b/docs/examples/0.6.2/server-python/examples/health/get-cache.md similarity index 80% rename from app/sdks/server-python/docs/examples/health/get-cache.md rename to docs/examples/0.6.2/server-python/examples/health/get-cache.md index e06416fdf0..57c7939b7f 100644 --- a/app/sdks/server-python/docs/examples/health/get-cache.md +++ b/docs/examples/0.6.2/server-python/examples/health/get-cache.md @@ -4,7 +4,7 @@ from appwrite.services.health import Health client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/health/get-d-b.md b/docs/examples/0.6.2/server-python/examples/health/get-d-b.md similarity index 80% rename from app/sdks/server-python/docs/examples/health/get-d-b.md rename to docs/examples/0.6.2/server-python/examples/health/get-d-b.md index 34d9446080..db8eec5ce6 100644 --- a/app/sdks/server-python/docs/examples/health/get-d-b.md +++ b/docs/examples/0.6.2/server-python/examples/health/get-d-b.md @@ -4,7 +4,7 @@ from appwrite.services.health import Health client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/health/get-queue-certificates.md b/docs/examples/0.6.2/server-python/examples/health/get-queue-certificates.md similarity index 81% rename from app/sdks/server-python/docs/examples/health/get-queue-certificates.md rename to docs/examples/0.6.2/server-python/examples/health/get-queue-certificates.md index 74f61975fc..1f87c2758a 100644 --- a/app/sdks/server-python/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/0.6.2/server-python/examples/health/get-queue-certificates.md @@ -4,7 +4,7 @@ from appwrite.services.health import Health client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/health/get-queue-functions.md b/docs/examples/0.6.2/server-python/examples/health/get-queue-functions.md similarity index 81% rename from app/sdks/server-python/docs/examples/health/get-queue-functions.md rename to docs/examples/0.6.2/server-python/examples/health/get-queue-functions.md index 6704514eb7..3e0b0c01e0 100644 --- a/app/sdks/server-python/docs/examples/health/get-queue-functions.md +++ b/docs/examples/0.6.2/server-python/examples/health/get-queue-functions.md @@ -4,7 +4,7 @@ from appwrite.services.health import Health client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/health/get-queue-logs.md b/docs/examples/0.6.2/server-python/examples/health/get-queue-logs.md similarity index 80% rename from app/sdks/server-python/docs/examples/health/get-queue-logs.md rename to docs/examples/0.6.2/server-python/examples/health/get-queue-logs.md index 79d169f51f..fdf80c6d82 100644 --- a/app/sdks/server-python/docs/examples/health/get-queue-logs.md +++ b/docs/examples/0.6.2/server-python/examples/health/get-queue-logs.md @@ -4,7 +4,7 @@ from appwrite.services.health import Health client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/health/get-queue-tasks.md b/docs/examples/0.6.2/server-python/examples/health/get-queue-tasks.md similarity index 80% rename from app/sdks/server-python/docs/examples/health/get-queue-tasks.md rename to docs/examples/0.6.2/server-python/examples/health/get-queue-tasks.md index aba8cca053..17b17a081f 100644 --- a/app/sdks/server-python/docs/examples/health/get-queue-tasks.md +++ b/docs/examples/0.6.2/server-python/examples/health/get-queue-tasks.md @@ -4,7 +4,7 @@ from appwrite.services.health import Health client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/health/get-queue-usage.md b/docs/examples/0.6.2/server-python/examples/health/get-queue-usage.md similarity index 80% rename from app/sdks/server-python/docs/examples/health/get-queue-usage.md rename to docs/examples/0.6.2/server-python/examples/health/get-queue-usage.md index cb3cc5ae6f..aeb8e83130 100644 --- a/app/sdks/server-python/docs/examples/health/get-queue-usage.md +++ b/docs/examples/0.6.2/server-python/examples/health/get-queue-usage.md @@ -4,7 +4,7 @@ from appwrite.services.health import Health client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/health/get-queue-webhooks.md b/docs/examples/0.6.2/server-python/examples/health/get-queue-webhooks.md similarity index 81% rename from app/sdks/server-python/docs/examples/health/get-queue-webhooks.md rename to docs/examples/0.6.2/server-python/examples/health/get-queue-webhooks.md index a4c9d96d66..90c4238987 100644 --- a/app/sdks/server-python/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/0.6.2/server-python/examples/health/get-queue-webhooks.md @@ -4,7 +4,7 @@ from appwrite.services.health import Health client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/health/get-storage-local.md b/docs/examples/0.6.2/server-python/examples/health/get-storage-local.md similarity index 81% rename from app/sdks/server-python/docs/examples/health/get-storage-local.md rename to docs/examples/0.6.2/server-python/examples/health/get-storage-local.md index a97ed125ad..b06dcef245 100644 --- a/app/sdks/server-python/docs/examples/health/get-storage-local.md +++ b/docs/examples/0.6.2/server-python/examples/health/get-storage-local.md @@ -4,7 +4,7 @@ from appwrite.services.health import Health client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/health/get-time.md b/docs/examples/0.6.2/server-python/examples/health/get-time.md similarity index 80% rename from app/sdks/server-python/docs/examples/health/get-time.md rename to docs/examples/0.6.2/server-python/examples/health/get-time.md index ecc66250cc..df68c1a0f9 100644 --- a/app/sdks/server-python/docs/examples/health/get-time.md +++ b/docs/examples/0.6.2/server-python/examples/health/get-time.md @@ -4,7 +4,7 @@ from appwrite.services.health import Health client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/health/get.md b/docs/examples/0.6.2/server-python/examples/health/get.md similarity index 80% rename from app/sdks/server-python/docs/examples/health/get.md rename to docs/examples/0.6.2/server-python/examples/health/get.md index 77352aafab..f3416aef75 100644 --- a/app/sdks/server-python/docs/examples/health/get.md +++ b/docs/examples/0.6.2/server-python/examples/health/get.md @@ -4,7 +4,7 @@ from appwrite.services.health import Health client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/locale/get-continents.md b/docs/examples/0.6.2/server-python/examples/locale/get-continents.md similarity index 80% rename from app/sdks/server-python/docs/examples/locale/get-continents.md rename to docs/examples/0.6.2/server-python/examples/locale/get-continents.md index bf4c255434..393326ddab 100644 --- a/app/sdks/server-python/docs/examples/locale/get-continents.md +++ b/docs/examples/0.6.2/server-python/examples/locale/get-continents.md @@ -4,7 +4,7 @@ from appwrite.services.locale import Locale client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/locale/get-countries-e-u.md b/docs/examples/0.6.2/server-python/examples/locale/get-countries-e-u.md similarity index 81% rename from app/sdks/server-python/docs/examples/locale/get-countries-e-u.md rename to docs/examples/0.6.2/server-python/examples/locale/get-countries-e-u.md index 78d69ff2dc..653fdd5abf 100644 --- a/app/sdks/server-python/docs/examples/locale/get-countries-e-u.md +++ b/docs/examples/0.6.2/server-python/examples/locale/get-countries-e-u.md @@ -4,7 +4,7 @@ from appwrite.services.locale import Locale client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/locale/get-countries-phones.md b/docs/examples/0.6.2/server-python/examples/locale/get-countries-phones.md similarity index 81% rename from app/sdks/server-python/docs/examples/locale/get-countries-phones.md rename to docs/examples/0.6.2/server-python/examples/locale/get-countries-phones.md index fb349b1442..8c7693a35c 100644 --- a/app/sdks/server-python/docs/examples/locale/get-countries-phones.md +++ b/docs/examples/0.6.2/server-python/examples/locale/get-countries-phones.md @@ -4,7 +4,7 @@ from appwrite.services.locale import Locale client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/locale/get-countries.md b/docs/examples/0.6.2/server-python/examples/locale/get-countries.md similarity index 80% rename from app/sdks/server-python/docs/examples/locale/get-countries.md rename to docs/examples/0.6.2/server-python/examples/locale/get-countries.md index ceb731073d..8a6c7cb1c3 100644 --- a/app/sdks/server-python/docs/examples/locale/get-countries.md +++ b/docs/examples/0.6.2/server-python/examples/locale/get-countries.md @@ -4,7 +4,7 @@ from appwrite.services.locale import Locale client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/locale/get-currencies.md b/docs/examples/0.6.2/server-python/examples/locale/get-currencies.md similarity index 80% rename from app/sdks/server-python/docs/examples/locale/get-currencies.md rename to docs/examples/0.6.2/server-python/examples/locale/get-currencies.md index dacb886e20..17586de230 100644 --- a/app/sdks/server-python/docs/examples/locale/get-currencies.md +++ b/docs/examples/0.6.2/server-python/examples/locale/get-currencies.md @@ -4,7 +4,7 @@ from appwrite.services.locale import Locale client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/docs/examples/0.6.2/server-python/examples/locale/get-languages.md b/docs/examples/0.6.2/server-python/examples/locale/get-languages.md new file mode 100644 index 0000000000..292a401f75 --- /dev/null +++ b/docs/examples/0.6.2/server-python/examples/locale/get-languages.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.locale import Locale + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +locale = Locale(client) + +result = locale.get_languages() diff --git a/app/sdks/server-python/docs/examples/locale/get.md b/docs/examples/0.6.2/server-python/examples/locale/get.md similarity index 80% rename from app/sdks/server-python/docs/examples/locale/get.md rename to docs/examples/0.6.2/server-python/examples/locale/get.md index 43cd2107de..752df0123d 100644 --- a/app/sdks/server-python/docs/examples/locale/get.md +++ b/docs/examples/0.6.2/server-python/examples/locale/get.md @@ -4,7 +4,7 @@ from appwrite.services.locale import Locale client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/storage/create-file.md b/docs/examples/0.6.2/server-python/examples/storage/create-file.md similarity index 82% rename from app/sdks/server-python/docs/examples/storage/create-file.md rename to docs/examples/0.6.2/server-python/examples/storage/create-file.md index fd76dd068b..52bf8b8575 100644 --- a/app/sdks/server-python/docs/examples/storage/create-file.md +++ b/docs/examples/0.6.2/server-python/examples/storage/create-file.md @@ -4,7 +4,7 @@ from appwrite.services.storage import Storage client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/storage/delete-file.md b/docs/examples/0.6.2/server-python/examples/storage/delete-file.md similarity index 81% rename from app/sdks/server-python/docs/examples/storage/delete-file.md rename to docs/examples/0.6.2/server-python/examples/storage/delete-file.md index 155e5a41d4..9379cb8820 100644 --- a/app/sdks/server-python/docs/examples/storage/delete-file.md +++ b/docs/examples/0.6.2/server-python/examples/storage/delete-file.md @@ -4,7 +4,7 @@ from appwrite.services.storage import Storage client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/storage/get-file-download.md b/docs/examples/0.6.2/server-python/examples/storage/get-file-download.md similarity index 81% rename from app/sdks/server-python/docs/examples/storage/get-file-download.md rename to docs/examples/0.6.2/server-python/examples/storage/get-file-download.md index 975a0f302d..bc815cebbe 100644 --- a/app/sdks/server-python/docs/examples/storage/get-file-download.md +++ b/docs/examples/0.6.2/server-python/examples/storage/get-file-download.md @@ -4,7 +4,7 @@ from appwrite.services.storage import Storage client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/storage/get-file-preview.md b/docs/examples/0.6.2/server-python/examples/storage/get-file-preview.md similarity index 81% rename from app/sdks/server-python/docs/examples/storage/get-file-preview.md rename to docs/examples/0.6.2/server-python/examples/storage/get-file-preview.md index ad9abe444f..2d14539513 100644 --- a/app/sdks/server-python/docs/examples/storage/get-file-preview.md +++ b/docs/examples/0.6.2/server-python/examples/storage/get-file-preview.md @@ -4,7 +4,7 @@ from appwrite.services.storage import Storage client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/storage/get-file-view.md b/docs/examples/0.6.2/server-python/examples/storage/get-file-view.md similarity index 81% rename from app/sdks/server-python/docs/examples/storage/get-file-view.md rename to docs/examples/0.6.2/server-python/examples/storage/get-file-view.md index 892b93ca97..7d0b30b376 100644 --- a/app/sdks/server-python/docs/examples/storage/get-file-view.md +++ b/docs/examples/0.6.2/server-python/examples/storage/get-file-view.md @@ -4,7 +4,7 @@ from appwrite.services.storage import Storage client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/storage/get-file.md b/docs/examples/0.6.2/server-python/examples/storage/get-file.md similarity index 81% rename from app/sdks/server-python/docs/examples/storage/get-file.md rename to docs/examples/0.6.2/server-python/examples/storage/get-file.md index cded2ba12f..e8d1202e27 100644 --- a/app/sdks/server-python/docs/examples/storage/get-file.md +++ b/docs/examples/0.6.2/server-python/examples/storage/get-file.md @@ -4,7 +4,7 @@ from appwrite.services.storage import Storage client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/storage/list-files.md b/docs/examples/0.6.2/server-python/examples/storage/list-files.md similarity index 80% rename from app/sdks/server-python/docs/examples/storage/list-files.md rename to docs/examples/0.6.2/server-python/examples/storage/list-files.md index d54bb75d79..0e72773fcb 100644 --- a/app/sdks/server-python/docs/examples/storage/list-files.md +++ b/docs/examples/0.6.2/server-python/examples/storage/list-files.md @@ -4,7 +4,7 @@ from appwrite.services.storage import Storage client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/storage/update-file.md b/docs/examples/0.6.2/server-python/examples/storage/update-file.md similarity index 81% rename from app/sdks/server-python/docs/examples/storage/update-file.md rename to docs/examples/0.6.2/server-python/examples/storage/update-file.md index 5001cbae74..7e1c5f61cd 100644 --- a/app/sdks/server-python/docs/examples/storage/update-file.md +++ b/docs/examples/0.6.2/server-python/examples/storage/update-file.md @@ -4,7 +4,7 @@ from appwrite.services.storage import Storage client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/teams/create-membership.md b/docs/examples/0.6.2/server-python/examples/teams/create-membership.md similarity index 83% rename from app/sdks/server-python/docs/examples/teams/create-membership.md rename to docs/examples/0.6.2/server-python/examples/teams/create-membership.md index e72ddc6fe3..9e2c832b3c 100644 --- a/app/sdks/server-python/docs/examples/teams/create-membership.md +++ b/docs/examples/0.6.2/server-python/examples/teams/create-membership.md @@ -4,7 +4,7 @@ from appwrite.services.teams import Teams client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/teams/create.md b/docs/examples/0.6.2/server-python/examples/teams/create.md similarity index 80% rename from app/sdks/server-python/docs/examples/teams/create.md rename to docs/examples/0.6.2/server-python/examples/teams/create.md index d4d1ba63c8..1debdc6109 100644 --- a/app/sdks/server-python/docs/examples/teams/create.md +++ b/docs/examples/0.6.2/server-python/examples/teams/create.md @@ -4,7 +4,7 @@ from appwrite.services.teams import Teams client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/teams/delete-membership.md b/docs/examples/0.6.2/server-python/examples/teams/delete-membership.md similarity index 82% rename from app/sdks/server-python/docs/examples/teams/delete-membership.md rename to docs/examples/0.6.2/server-python/examples/teams/delete-membership.md index e08e44fdcc..af30bc1cf3 100644 --- a/app/sdks/server-python/docs/examples/teams/delete-membership.md +++ b/docs/examples/0.6.2/server-python/examples/teams/delete-membership.md @@ -4,7 +4,7 @@ from appwrite.services.teams import Teams client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/teams/delete.md b/docs/examples/0.6.2/server-python/examples/teams/delete.md similarity index 80% rename from app/sdks/server-python/docs/examples/teams/delete.md rename to docs/examples/0.6.2/server-python/examples/teams/delete.md index 87d953ff5f..8fb037cd4a 100644 --- a/app/sdks/server-python/docs/examples/teams/delete.md +++ b/docs/examples/0.6.2/server-python/examples/teams/delete.md @@ -4,7 +4,7 @@ from appwrite.services.teams import Teams client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/teams/get-memberships.md b/docs/examples/0.6.2/server-python/examples/teams/get-memberships.md similarity index 81% rename from app/sdks/server-python/docs/examples/teams/get-memberships.md rename to docs/examples/0.6.2/server-python/examples/teams/get-memberships.md index 01879bb280..6c6482418b 100644 --- a/app/sdks/server-python/docs/examples/teams/get-memberships.md +++ b/docs/examples/0.6.2/server-python/examples/teams/get-memberships.md @@ -4,7 +4,7 @@ from appwrite.services.teams import Teams client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/teams/get.md b/docs/examples/0.6.2/server-python/examples/teams/get.md similarity index 80% rename from app/sdks/server-python/docs/examples/teams/get.md rename to docs/examples/0.6.2/server-python/examples/teams/get.md index c1f90c8fe1..6c2b404517 100644 --- a/app/sdks/server-python/docs/examples/teams/get.md +++ b/docs/examples/0.6.2/server-python/examples/teams/get.md @@ -4,7 +4,7 @@ from appwrite.services.teams import Teams client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/teams/list.md b/docs/examples/0.6.2/server-python/examples/teams/list.md similarity index 80% rename from app/sdks/server-python/docs/examples/teams/list.md rename to docs/examples/0.6.2/server-python/examples/teams/list.md index a3d831ff4f..c538aea340 100644 --- a/app/sdks/server-python/docs/examples/teams/list.md +++ b/docs/examples/0.6.2/server-python/examples/teams/list.md @@ -4,7 +4,7 @@ from appwrite.services.teams import Teams client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/teams/update.md b/docs/examples/0.6.2/server-python/examples/teams/update.md similarity index 81% rename from app/sdks/server-python/docs/examples/teams/update.md rename to docs/examples/0.6.2/server-python/examples/teams/update.md index 63f6acdc9b..2b9c222be0 100644 --- a/app/sdks/server-python/docs/examples/teams/update.md +++ b/docs/examples/0.6.2/server-python/examples/teams/update.md @@ -4,7 +4,7 @@ from appwrite.services.teams import Teams client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/users/create.md b/docs/examples/0.6.2/server-python/examples/users/create.md similarity index 81% rename from app/sdks/server-python/docs/examples/users/create.md rename to docs/examples/0.6.2/server-python/examples/users/create.md index 4c63f3771d..2cfe228ee0 100644 --- a/app/sdks/server-python/docs/examples/users/create.md +++ b/docs/examples/0.6.2/server-python/examples/users/create.md @@ -4,7 +4,7 @@ from appwrite.services.users import Users client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/users/delete-session.md b/docs/examples/0.6.2/server-python/examples/users/delete-session.md similarity index 82% rename from app/sdks/server-python/docs/examples/users/delete-session.md rename to docs/examples/0.6.2/server-python/examples/users/delete-session.md index ca2fa99b56..d25cfb3abc 100644 --- a/app/sdks/server-python/docs/examples/users/delete-session.md +++ b/docs/examples/0.6.2/server-python/examples/users/delete-session.md @@ -4,7 +4,7 @@ from appwrite.services.users import Users client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/users/delete-sessions.md b/docs/examples/0.6.2/server-python/examples/users/delete-sessions.md similarity index 81% rename from app/sdks/server-python/docs/examples/users/delete-sessions.md rename to docs/examples/0.6.2/server-python/examples/users/delete-sessions.md index fe4b2be3a8..9b24db1b5c 100644 --- a/app/sdks/server-python/docs/examples/users/delete-sessions.md +++ b/docs/examples/0.6.2/server-python/examples/users/delete-sessions.md @@ -4,7 +4,7 @@ from appwrite.services.users import Users client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/users/get-logs.md b/docs/examples/0.6.2/server-python/examples/users/get-logs.md similarity index 80% rename from app/sdks/server-python/docs/examples/users/get-logs.md rename to docs/examples/0.6.2/server-python/examples/users/get-logs.md index 22816871d2..c93ae244c8 100644 --- a/app/sdks/server-python/docs/examples/users/get-logs.md +++ b/docs/examples/0.6.2/server-python/examples/users/get-logs.md @@ -4,7 +4,7 @@ from appwrite.services.users import Users client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/users/get-prefs.md b/docs/examples/0.6.2/server-python/examples/users/get-prefs.md similarity index 80% rename from app/sdks/server-python/docs/examples/users/get-prefs.md rename to docs/examples/0.6.2/server-python/examples/users/get-prefs.md index 846c7c13f5..9ef100f9e6 100644 --- a/app/sdks/server-python/docs/examples/users/get-prefs.md +++ b/docs/examples/0.6.2/server-python/examples/users/get-prefs.md @@ -4,7 +4,7 @@ from appwrite.services.users import Users client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/users/get-sessions.md b/docs/examples/0.6.2/server-python/examples/users/get-sessions.md similarity index 81% rename from app/sdks/server-python/docs/examples/users/get-sessions.md rename to docs/examples/0.6.2/server-python/examples/users/get-sessions.md index 0e29608697..4de3120dfb 100644 --- a/app/sdks/server-python/docs/examples/users/get-sessions.md +++ b/docs/examples/0.6.2/server-python/examples/users/get-sessions.md @@ -4,7 +4,7 @@ from appwrite.services.users import Users client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/users/get.md b/docs/examples/0.6.2/server-python/examples/users/get.md similarity index 80% rename from app/sdks/server-python/docs/examples/users/get.md rename to docs/examples/0.6.2/server-python/examples/users/get.md index bc23f2238c..c11f96e64b 100644 --- a/app/sdks/server-python/docs/examples/users/get.md +++ b/docs/examples/0.6.2/server-python/examples/users/get.md @@ -4,7 +4,7 @@ from appwrite.services.users import Users client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/users/list.md b/docs/examples/0.6.2/server-python/examples/users/list.md similarity index 80% rename from app/sdks/server-python/docs/examples/users/list.md rename to docs/examples/0.6.2/server-python/examples/users/list.md index b7492fa9bf..c4a66e42d2 100644 --- a/app/sdks/server-python/docs/examples/users/list.md +++ b/docs/examples/0.6.2/server-python/examples/users/list.md @@ -4,7 +4,7 @@ from appwrite.services.users import Users client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/users/update-prefs.md b/docs/examples/0.6.2/server-python/examples/users/update-prefs.md similarity index 81% rename from app/sdks/server-python/docs/examples/users/update-prefs.md rename to docs/examples/0.6.2/server-python/examples/users/update-prefs.md index c78546f484..7e0fe7c35a 100644 --- a/app/sdks/server-python/docs/examples/users/update-prefs.md +++ b/docs/examples/0.6.2/server-python/examples/users/update-prefs.md @@ -4,7 +4,7 @@ from appwrite.services.users import Users client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/users/update-status.md b/docs/examples/0.6.2/server-python/examples/users/update-status.md similarity index 81% rename from app/sdks/server-python/docs/examples/users/update-status.md rename to docs/examples/0.6.2/server-python/examples/users/update-status.md index f40c83b61e..28fd587deb 100644 --- a/app/sdks/server-python/docs/examples/users/update-status.md +++ b/docs/examples/0.6.2/server-python/examples/users/update-status.md @@ -4,7 +4,7 @@ from appwrite.services.users import Users client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-ruby/docs/examples/avatars/get-browser.md b/docs/examples/0.6.2/server-ruby/examples/avatars/get-browser.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/avatars/get-browser.md rename to docs/examples/0.6.2/server-ruby/examples/avatars/get-browser.md diff --git a/app/sdks/server-ruby/docs/examples/avatars/get-credit-card.md b/docs/examples/0.6.2/server-ruby/examples/avatars/get-credit-card.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/avatars/get-credit-card.md rename to docs/examples/0.6.2/server-ruby/examples/avatars/get-credit-card.md diff --git a/app/sdks/server-ruby/docs/examples/avatars/get-favicon.md b/docs/examples/0.6.2/server-ruby/examples/avatars/get-favicon.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/avatars/get-favicon.md rename to docs/examples/0.6.2/server-ruby/examples/avatars/get-favicon.md diff --git a/app/sdks/server-ruby/docs/examples/avatars/get-flag.md b/docs/examples/0.6.2/server-ruby/examples/avatars/get-flag.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/avatars/get-flag.md rename to docs/examples/0.6.2/server-ruby/examples/avatars/get-flag.md diff --git a/app/sdks/server-ruby/docs/examples/avatars/get-image.md b/docs/examples/0.6.2/server-ruby/examples/avatars/get-image.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/avatars/get-image.md rename to docs/examples/0.6.2/server-ruby/examples/avatars/get-image.md diff --git a/docs/examples/0.6.2/server-ruby/examples/avatars/get-initials.md b/docs/examples/0.6.2/server-ruby/examples/avatars/get-initials.md new file mode 100644 index 0000000000..11878a6da7 --- /dev/null +++ b/docs/examples/0.6.2/server-ruby/examples/avatars/get-initials.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +avatars = Appwrite::Avatars.new(client); + +response = avatars.get_initials(); + +puts response \ No newline at end of file diff --git a/app/sdks/server-ruby/docs/examples/avatars/get-q-r.md b/docs/examples/0.6.2/server-ruby/examples/avatars/get-q-r.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/avatars/get-q-r.md rename to docs/examples/0.6.2/server-ruby/examples/avatars/get-q-r.md diff --git a/app/sdks/server-ruby/docs/examples/database/create-collection.md b/docs/examples/0.6.2/server-ruby/examples/database/create-collection.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/database/create-collection.md rename to docs/examples/0.6.2/server-ruby/examples/database/create-collection.md diff --git a/app/sdks/server-ruby/docs/examples/database/create-document.md b/docs/examples/0.6.2/server-ruby/examples/database/create-document.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/database/create-document.md rename to docs/examples/0.6.2/server-ruby/examples/database/create-document.md diff --git a/app/sdks/server-ruby/docs/examples/database/delete-collection.md b/docs/examples/0.6.2/server-ruby/examples/database/delete-collection.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/database/delete-collection.md rename to docs/examples/0.6.2/server-ruby/examples/database/delete-collection.md diff --git a/app/sdks/server-ruby/docs/examples/database/delete-document.md b/docs/examples/0.6.2/server-ruby/examples/database/delete-document.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/database/delete-document.md rename to docs/examples/0.6.2/server-ruby/examples/database/delete-document.md diff --git a/app/sdks/server-ruby/docs/examples/database/get-collection.md b/docs/examples/0.6.2/server-ruby/examples/database/get-collection.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/database/get-collection.md rename to docs/examples/0.6.2/server-ruby/examples/database/get-collection.md diff --git a/app/sdks/server-ruby/docs/examples/database/get-document.md b/docs/examples/0.6.2/server-ruby/examples/database/get-document.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/database/get-document.md rename to docs/examples/0.6.2/server-ruby/examples/database/get-document.md diff --git a/app/sdks/server-ruby/docs/examples/database/list-collections.md b/docs/examples/0.6.2/server-ruby/examples/database/list-collections.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/database/list-collections.md rename to docs/examples/0.6.2/server-ruby/examples/database/list-collections.md diff --git a/app/sdks/server-ruby/docs/examples/database/list-documents.md b/docs/examples/0.6.2/server-ruby/examples/database/list-documents.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/database/list-documents.md rename to docs/examples/0.6.2/server-ruby/examples/database/list-documents.md diff --git a/app/sdks/server-ruby/docs/examples/database/update-collection.md b/docs/examples/0.6.2/server-ruby/examples/database/update-collection.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/database/update-collection.md rename to docs/examples/0.6.2/server-ruby/examples/database/update-collection.md diff --git a/app/sdks/server-ruby/docs/examples/database/update-document.md b/docs/examples/0.6.2/server-ruby/examples/database/update-document.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/database/update-document.md rename to docs/examples/0.6.2/server-ruby/examples/database/update-document.md diff --git a/app/sdks/server-ruby/docs/examples/health/get-anti-virus.md b/docs/examples/0.6.2/server-ruby/examples/health/get-anti-virus.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/health/get-anti-virus.md rename to docs/examples/0.6.2/server-ruby/examples/health/get-anti-virus.md diff --git a/app/sdks/server-ruby/docs/examples/health/get-cache.md b/docs/examples/0.6.2/server-ruby/examples/health/get-cache.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/health/get-cache.md rename to docs/examples/0.6.2/server-ruby/examples/health/get-cache.md diff --git a/app/sdks/server-ruby/docs/examples/health/get-d-b.md b/docs/examples/0.6.2/server-ruby/examples/health/get-d-b.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/health/get-d-b.md rename to docs/examples/0.6.2/server-ruby/examples/health/get-d-b.md diff --git a/app/sdks/server-ruby/docs/examples/health/get-queue-certificates.md b/docs/examples/0.6.2/server-ruby/examples/health/get-queue-certificates.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/health/get-queue-certificates.md rename to docs/examples/0.6.2/server-ruby/examples/health/get-queue-certificates.md diff --git a/app/sdks/server-ruby/docs/examples/health/get-queue-functions.md b/docs/examples/0.6.2/server-ruby/examples/health/get-queue-functions.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/health/get-queue-functions.md rename to docs/examples/0.6.2/server-ruby/examples/health/get-queue-functions.md diff --git a/app/sdks/server-ruby/docs/examples/health/get-queue-logs.md b/docs/examples/0.6.2/server-ruby/examples/health/get-queue-logs.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/health/get-queue-logs.md rename to docs/examples/0.6.2/server-ruby/examples/health/get-queue-logs.md diff --git a/app/sdks/server-ruby/docs/examples/health/get-queue-tasks.md b/docs/examples/0.6.2/server-ruby/examples/health/get-queue-tasks.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/health/get-queue-tasks.md rename to docs/examples/0.6.2/server-ruby/examples/health/get-queue-tasks.md diff --git a/app/sdks/server-ruby/docs/examples/health/get-queue-usage.md b/docs/examples/0.6.2/server-ruby/examples/health/get-queue-usage.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/health/get-queue-usage.md rename to docs/examples/0.6.2/server-ruby/examples/health/get-queue-usage.md diff --git a/app/sdks/server-ruby/docs/examples/health/get-queue-webhooks.md b/docs/examples/0.6.2/server-ruby/examples/health/get-queue-webhooks.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/health/get-queue-webhooks.md rename to docs/examples/0.6.2/server-ruby/examples/health/get-queue-webhooks.md diff --git a/app/sdks/server-ruby/docs/examples/health/get-storage-local.md b/docs/examples/0.6.2/server-ruby/examples/health/get-storage-local.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/health/get-storage-local.md rename to docs/examples/0.6.2/server-ruby/examples/health/get-storage-local.md diff --git a/app/sdks/server-ruby/docs/examples/health/get-time.md b/docs/examples/0.6.2/server-ruby/examples/health/get-time.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/health/get-time.md rename to docs/examples/0.6.2/server-ruby/examples/health/get-time.md diff --git a/app/sdks/server-ruby/docs/examples/health/get.md b/docs/examples/0.6.2/server-ruby/examples/health/get.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/health/get.md rename to docs/examples/0.6.2/server-ruby/examples/health/get.md diff --git a/app/sdks/server-ruby/docs/examples/locale/get-continents.md b/docs/examples/0.6.2/server-ruby/examples/locale/get-continents.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/locale/get-continents.md rename to docs/examples/0.6.2/server-ruby/examples/locale/get-continents.md diff --git a/app/sdks/server-ruby/docs/examples/locale/get-countries-e-u.md b/docs/examples/0.6.2/server-ruby/examples/locale/get-countries-e-u.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/locale/get-countries-e-u.md rename to docs/examples/0.6.2/server-ruby/examples/locale/get-countries-e-u.md diff --git a/app/sdks/server-ruby/docs/examples/locale/get-countries-phones.md b/docs/examples/0.6.2/server-ruby/examples/locale/get-countries-phones.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/locale/get-countries-phones.md rename to docs/examples/0.6.2/server-ruby/examples/locale/get-countries-phones.md diff --git a/app/sdks/server-ruby/docs/examples/locale/get-countries.md b/docs/examples/0.6.2/server-ruby/examples/locale/get-countries.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/locale/get-countries.md rename to docs/examples/0.6.2/server-ruby/examples/locale/get-countries.md diff --git a/app/sdks/server-ruby/docs/examples/locale/get-currencies.md b/docs/examples/0.6.2/server-ruby/examples/locale/get-currencies.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/locale/get-currencies.md rename to docs/examples/0.6.2/server-ruby/examples/locale/get-currencies.md diff --git a/docs/examples/0.6.2/server-ruby/examples/locale/get-languages.md b/docs/examples/0.6.2/server-ruby/examples/locale/get-languages.md new file mode 100644 index 0000000000..64e74eece0 --- /dev/null +++ b/docs/examples/0.6.2/server-ruby/examples/locale/get-languages.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +locale = Appwrite::Locale.new(client); + +response = locale.get_languages(); + +puts response \ No newline at end of file diff --git a/app/sdks/server-ruby/docs/examples/locale/get.md b/docs/examples/0.6.2/server-ruby/examples/locale/get.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/locale/get.md rename to docs/examples/0.6.2/server-ruby/examples/locale/get.md diff --git a/app/sdks/server-ruby/docs/examples/storage/create-file.md b/docs/examples/0.6.2/server-ruby/examples/storage/create-file.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/storage/create-file.md rename to docs/examples/0.6.2/server-ruby/examples/storage/create-file.md diff --git a/app/sdks/server-ruby/docs/examples/storage/delete-file.md b/docs/examples/0.6.2/server-ruby/examples/storage/delete-file.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/storage/delete-file.md rename to docs/examples/0.6.2/server-ruby/examples/storage/delete-file.md diff --git a/app/sdks/server-ruby/docs/examples/storage/get-file-download.md b/docs/examples/0.6.2/server-ruby/examples/storage/get-file-download.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/storage/get-file-download.md rename to docs/examples/0.6.2/server-ruby/examples/storage/get-file-download.md diff --git a/app/sdks/server-ruby/docs/examples/storage/get-file-preview.md b/docs/examples/0.6.2/server-ruby/examples/storage/get-file-preview.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/storage/get-file-preview.md rename to docs/examples/0.6.2/server-ruby/examples/storage/get-file-preview.md diff --git a/app/sdks/server-ruby/docs/examples/storage/get-file-view.md b/docs/examples/0.6.2/server-ruby/examples/storage/get-file-view.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/storage/get-file-view.md rename to docs/examples/0.6.2/server-ruby/examples/storage/get-file-view.md diff --git a/app/sdks/server-ruby/docs/examples/storage/get-file.md b/docs/examples/0.6.2/server-ruby/examples/storage/get-file.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/storage/get-file.md rename to docs/examples/0.6.2/server-ruby/examples/storage/get-file.md diff --git a/app/sdks/server-ruby/docs/examples/storage/list-files.md b/docs/examples/0.6.2/server-ruby/examples/storage/list-files.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/storage/list-files.md rename to docs/examples/0.6.2/server-ruby/examples/storage/list-files.md diff --git a/app/sdks/server-ruby/docs/examples/storage/update-file.md b/docs/examples/0.6.2/server-ruby/examples/storage/update-file.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/storage/update-file.md rename to docs/examples/0.6.2/server-ruby/examples/storage/update-file.md diff --git a/app/sdks/server-ruby/docs/examples/teams/create-membership.md b/docs/examples/0.6.2/server-ruby/examples/teams/create-membership.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/teams/create-membership.md rename to docs/examples/0.6.2/server-ruby/examples/teams/create-membership.md diff --git a/app/sdks/server-ruby/docs/examples/teams/create.md b/docs/examples/0.6.2/server-ruby/examples/teams/create.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/teams/create.md rename to docs/examples/0.6.2/server-ruby/examples/teams/create.md diff --git a/app/sdks/server-ruby/docs/examples/teams/delete-membership.md b/docs/examples/0.6.2/server-ruby/examples/teams/delete-membership.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/teams/delete-membership.md rename to docs/examples/0.6.2/server-ruby/examples/teams/delete-membership.md diff --git a/app/sdks/server-ruby/docs/examples/teams/delete.md b/docs/examples/0.6.2/server-ruby/examples/teams/delete.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/teams/delete.md rename to docs/examples/0.6.2/server-ruby/examples/teams/delete.md diff --git a/app/sdks/server-ruby/docs/examples/teams/get-memberships.md b/docs/examples/0.6.2/server-ruby/examples/teams/get-memberships.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/teams/get-memberships.md rename to docs/examples/0.6.2/server-ruby/examples/teams/get-memberships.md diff --git a/app/sdks/server-ruby/docs/examples/teams/get.md b/docs/examples/0.6.2/server-ruby/examples/teams/get.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/teams/get.md rename to docs/examples/0.6.2/server-ruby/examples/teams/get.md diff --git a/app/sdks/server-ruby/docs/examples/teams/list.md b/docs/examples/0.6.2/server-ruby/examples/teams/list.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/teams/list.md rename to docs/examples/0.6.2/server-ruby/examples/teams/list.md diff --git a/app/sdks/server-ruby/docs/examples/teams/update.md b/docs/examples/0.6.2/server-ruby/examples/teams/update.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/teams/update.md rename to docs/examples/0.6.2/server-ruby/examples/teams/update.md diff --git a/app/sdks/server-ruby/docs/examples/users/create.md b/docs/examples/0.6.2/server-ruby/examples/users/create.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/users/create.md rename to docs/examples/0.6.2/server-ruby/examples/users/create.md diff --git a/app/sdks/server-ruby/docs/examples/users/delete-session.md b/docs/examples/0.6.2/server-ruby/examples/users/delete-session.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/users/delete-session.md rename to docs/examples/0.6.2/server-ruby/examples/users/delete-session.md diff --git a/app/sdks/server-ruby/docs/examples/users/delete-sessions.md b/docs/examples/0.6.2/server-ruby/examples/users/delete-sessions.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/users/delete-sessions.md rename to docs/examples/0.6.2/server-ruby/examples/users/delete-sessions.md diff --git a/app/sdks/server-ruby/docs/examples/users/get-logs.md b/docs/examples/0.6.2/server-ruby/examples/users/get-logs.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/users/get-logs.md rename to docs/examples/0.6.2/server-ruby/examples/users/get-logs.md diff --git a/app/sdks/server-ruby/docs/examples/users/get-prefs.md b/docs/examples/0.6.2/server-ruby/examples/users/get-prefs.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/users/get-prefs.md rename to docs/examples/0.6.2/server-ruby/examples/users/get-prefs.md diff --git a/app/sdks/server-ruby/docs/examples/users/get-sessions.md b/docs/examples/0.6.2/server-ruby/examples/users/get-sessions.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/users/get-sessions.md rename to docs/examples/0.6.2/server-ruby/examples/users/get-sessions.md diff --git a/app/sdks/server-ruby/docs/examples/users/get.md b/docs/examples/0.6.2/server-ruby/examples/users/get.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/users/get.md rename to docs/examples/0.6.2/server-ruby/examples/users/get.md diff --git a/app/sdks/server-ruby/docs/examples/users/list.md b/docs/examples/0.6.2/server-ruby/examples/users/list.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/users/list.md rename to docs/examples/0.6.2/server-ruby/examples/users/list.md diff --git a/app/sdks/server-ruby/docs/examples/users/update-prefs.md b/docs/examples/0.6.2/server-ruby/examples/users/update-prefs.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/users/update-prefs.md rename to docs/examples/0.6.2/server-ruby/examples/users/update-prefs.md diff --git a/app/sdks/server-ruby/docs/examples/users/update-status.md b/docs/examples/0.6.2/server-ruby/examples/users/update-status.md similarity index 100% rename from app/sdks/server-ruby/docs/examples/users/update-status.md rename to docs/examples/0.6.2/server-ruby/examples/users/update-status.md diff --git a/app/sdks/client-flutter-dev/docs/examples/account/create-o-auth2session.md b/docs/examples/0.7.0/client-flutter/examples/account/create-o-auth2session.md similarity index 84% rename from app/sdks/client-flutter-dev/docs/examples/account/create-o-auth2session.md rename to docs/examples/0.7.0/client-flutter/examples/account/create-o-auth2session.md index aae9d5f9a0..0e26dd27af 100644 --- a/app/sdks/client-flutter-dev/docs/examples/account/create-o-auth2session.md +++ b/docs/examples/0.7.0/client-flutter/examples/account/create-o-auth2session.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); @@ -10,7 +10,7 @@ void main() { // Init SDK ; Future result = account.createOAuth2Session( - provider: 'bitbucket', + provider: 'amazon', ); result diff --git a/app/sdks/client-flutter-dev/docs/examples/account/create-recovery.md b/docs/examples/0.7.0/client-flutter/examples/account/create-recovery.md similarity index 90% rename from app/sdks/client-flutter-dev/docs/examples/account/create-recovery.md rename to docs/examples/0.7.0/client-flutter/examples/account/create-recovery.md index 32fe469cff..50db45b15d 100644 --- a/app/sdks/client-flutter-dev/docs/examples/account/create-recovery.md +++ b/docs/examples/0.7.0/client-flutter/examples/account/create-recovery.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/account/create-session.md b/docs/examples/0.7.0/client-flutter/examples/account/create-session.md similarity index 90% rename from app/sdks/client-flutter-dev/docs/examples/account/create-session.md rename to docs/examples/0.7.0/client-flutter/examples/account/create-session.md index a5930877f4..ef824b4eca 100644 --- a/app/sdks/client-flutter-dev/docs/examples/account/create-session.md +++ b/docs/examples/0.7.0/client-flutter/examples/account/create-session.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/account/create-verification.md b/docs/examples/0.7.0/client-flutter/examples/account/create-verification.md similarity index 89% rename from app/sdks/client-flutter-dev/docs/examples/account/create-verification.md rename to docs/examples/0.7.0/client-flutter/examples/account/create-verification.md index 738f22df42..6b9b1ace40 100644 --- a/app/sdks/client-flutter-dev/docs/examples/account/create-verification.md +++ b/docs/examples/0.7.0/client-flutter/examples/account/create-verification.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/account/create.md b/docs/examples/0.7.0/client-flutter/examples/account/create.md similarity index 90% rename from app/sdks/client-flutter-dev/docs/examples/account/create.md rename to docs/examples/0.7.0/client-flutter/examples/account/create.md index 1f92976c39..384258ae68 100644 --- a/app/sdks/client-flutter-dev/docs/examples/account/create.md +++ b/docs/examples/0.7.0/client-flutter/examples/account/create.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/account/delete-session.md b/docs/examples/0.7.0/client-flutter/examples/account/delete-session.md similarity index 89% rename from app/sdks/client-flutter-dev/docs/examples/account/delete-session.md rename to docs/examples/0.7.0/client-flutter/examples/account/delete-session.md index 95b3641387..80a3f505d0 100644 --- a/app/sdks/client-flutter-dev/docs/examples/account/delete-session.md +++ b/docs/examples/0.7.0/client-flutter/examples/account/delete-session.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/docs/examples/0.7.0/client-flutter/examples/account/delete-sessions.md b/docs/examples/0.7.0/client-flutter/examples/account/delete-sessions.md new file mode 100644 index 0000000000..74e494db25 --- /dev/null +++ b/docs/examples/0.7.0/client-flutter/examples/account/delete-sessions.md @@ -0,0 +1,20 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = account.deleteSessions(); + + result + .then((response) { + print(response); + }).catchError((error) { + print(error.response); + }); +} \ No newline at end of file diff --git a/docs/examples/0.7.0/client-flutter/examples/account/delete.md b/docs/examples/0.7.0/client-flutter/examples/account/delete.md new file mode 100644 index 0000000000..2d9d302af0 --- /dev/null +++ b/docs/examples/0.7.0/client-flutter/examples/account/delete.md @@ -0,0 +1,20 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = account.delete(); + + result + .then((response) { + print(response); + }).catchError((error) { + print(error.response); + }); +} \ No newline at end of file diff --git a/docs/examples/0.7.0/client-flutter/examples/account/get-logs.md b/docs/examples/0.7.0/client-flutter/examples/account/get-logs.md new file mode 100644 index 0000000000..4240e55eec --- /dev/null +++ b/docs/examples/0.7.0/client-flutter/examples/account/get-logs.md @@ -0,0 +1,20 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = account.getLogs(); + + result + .then((response) { + print(response); + }).catchError((error) { + print(error.response); + }); +} \ No newline at end of file diff --git a/docs/examples/0.7.0/client-flutter/examples/account/get-prefs.md b/docs/examples/0.7.0/client-flutter/examples/account/get-prefs.md new file mode 100644 index 0000000000..d98dcd7290 --- /dev/null +++ b/docs/examples/0.7.0/client-flutter/examples/account/get-prefs.md @@ -0,0 +1,20 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = account.getPrefs(); + + result + .then((response) { + print(response); + }).catchError((error) { + print(error.response); + }); +} \ No newline at end of file diff --git a/docs/examples/0.7.0/client-flutter/examples/account/get-sessions.md b/docs/examples/0.7.0/client-flutter/examples/account/get-sessions.md new file mode 100644 index 0000000000..b5ecd34e45 --- /dev/null +++ b/docs/examples/0.7.0/client-flutter/examples/account/get-sessions.md @@ -0,0 +1,20 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = account.getSessions(); + + result + .then((response) { + print(response); + }).catchError((error) { + print(error.response); + }); +} \ No newline at end of file diff --git a/docs/examples/0.7.0/client-flutter/examples/account/get.md b/docs/examples/0.7.0/client-flutter/examples/account/get.md new file mode 100644 index 0000000000..a77fbf3ad5 --- /dev/null +++ b/docs/examples/0.7.0/client-flutter/examples/account/get.md @@ -0,0 +1,20 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = account.get(); + + result + .then((response) { + print(response); + }).catchError((error) { + print(error.response); + }); +} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/docs/examples/account/update-email.md b/docs/examples/0.7.0/client-flutter/examples/account/update-email.md similarity index 90% rename from app/sdks/client-flutter-dev/docs/examples/account/update-email.md rename to docs/examples/0.7.0/client-flutter/examples/account/update-email.md index 9fc86a7aae..4a1a002db4 100644 --- a/app/sdks/client-flutter-dev/docs/examples/account/update-email.md +++ b/docs/examples/0.7.0/client-flutter/examples/account/update-email.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/account/update-name.md b/docs/examples/0.7.0/client-flutter/examples/account/update-name.md similarity index 89% rename from app/sdks/client-flutter-dev/docs/examples/account/update-name.md rename to docs/examples/0.7.0/client-flutter/examples/account/update-name.md index e5e218a515..fa432bb34a 100644 --- a/app/sdks/client-flutter-dev/docs/examples/account/update-name.md +++ b/docs/examples/0.7.0/client-flutter/examples/account/update-name.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/account/update-password.md b/docs/examples/0.7.0/client-flutter/examples/account/update-password.md similarity index 90% rename from app/sdks/client-flutter-dev/docs/examples/account/update-password.md rename to docs/examples/0.7.0/client-flutter/examples/account/update-password.md index 869b4d9a30..9bd8ad9b77 100644 --- a/app/sdks/client-flutter-dev/docs/examples/account/update-password.md +++ b/docs/examples/0.7.0/client-flutter/examples/account/update-password.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/account/update-prefs.md b/docs/examples/0.7.0/client-flutter/examples/account/update-prefs.md similarity index 89% rename from app/sdks/client-flutter-dev/docs/examples/account/update-prefs.md rename to docs/examples/0.7.0/client-flutter/examples/account/update-prefs.md index 0d50469742..443252f89a 100644 --- a/app/sdks/client-flutter-dev/docs/examples/account/update-prefs.md +++ b/docs/examples/0.7.0/client-flutter/examples/account/update-prefs.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/account/update-recovery.md b/docs/examples/0.7.0/client-flutter/examples/account/update-recovery.md similarity index 91% rename from app/sdks/client-flutter-dev/docs/examples/account/update-recovery.md rename to docs/examples/0.7.0/client-flutter/examples/account/update-recovery.md index e028e60a7d..5140235d49 100644 --- a/app/sdks/client-flutter-dev/docs/examples/account/update-recovery.md +++ b/docs/examples/0.7.0/client-flutter/examples/account/update-recovery.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/account/update-verification.md b/docs/examples/0.7.0/client-flutter/examples/account/update-verification.md similarity index 90% rename from app/sdks/client-flutter-dev/docs/examples/account/update-verification.md rename to docs/examples/0.7.0/client-flutter/examples/account/update-verification.md index 48d669efcc..b795cde92d 100644 --- a/app/sdks/client-flutter-dev/docs/examples/account/update-verification.md +++ b/docs/examples/0.7.0/client-flutter/examples/account/update-verification.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/avatars/get-browser.md b/docs/examples/0.7.0/client-flutter/examples/avatars/get-browser.md similarity index 87% rename from app/sdks/client-flutter-dev/docs/examples/avatars/get-browser.md rename to docs/examples/0.7.0/client-flutter/examples/avatars/get-browser.md index dec7863b1f..464767c4c0 100644 --- a/app/sdks/client-flutter-dev/docs/examples/avatars/get-browser.md +++ b/docs/examples/0.7.0/client-flutter/examples/avatars/get-browser.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/avatars/get-credit-card.md b/docs/examples/0.7.0/client-flutter/examples/avatars/get-credit-card.md similarity index 87% rename from app/sdks/client-flutter-dev/docs/examples/avatars/get-credit-card.md rename to docs/examples/0.7.0/client-flutter/examples/avatars/get-credit-card.md index e2746c4999..482c642402 100644 --- a/app/sdks/client-flutter-dev/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/0.7.0/client-flutter/examples/avatars/get-credit-card.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/avatars/get-favicon.md b/docs/examples/0.7.0/client-flutter/examples/avatars/get-favicon.md similarity index 87% rename from app/sdks/client-flutter-dev/docs/examples/avatars/get-favicon.md rename to docs/examples/0.7.0/client-flutter/examples/avatars/get-favicon.md index 1c56335b9f..60397b0af2 100644 --- a/app/sdks/client-flutter-dev/docs/examples/avatars/get-favicon.md +++ b/docs/examples/0.7.0/client-flutter/examples/avatars/get-favicon.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/avatars/get-flag.md b/docs/examples/0.7.0/client-flutter/examples/avatars/get-flag.md similarity index 86% rename from app/sdks/client-flutter-dev/docs/examples/avatars/get-flag.md rename to docs/examples/0.7.0/client-flutter/examples/avatars/get-flag.md index 8a91f608ce..a9f7a711d9 100644 --- a/app/sdks/client-flutter-dev/docs/examples/avatars/get-flag.md +++ b/docs/examples/0.7.0/client-flutter/examples/avatars/get-flag.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/avatars/get-image.md b/docs/examples/0.7.0/client-flutter/examples/avatars/get-image.md similarity index 87% rename from app/sdks/client-flutter-dev/docs/examples/avatars/get-image.md rename to docs/examples/0.7.0/client-flutter/examples/avatars/get-image.md index a2cbea98e3..7cead1cb2f 100644 --- a/app/sdks/client-flutter-dev/docs/examples/avatars/get-image.md +++ b/docs/examples/0.7.0/client-flutter/examples/avatars/get-image.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/docs/examples/0.7.0/client-flutter/examples/avatars/get-initials.md b/docs/examples/0.7.0/client-flutter/examples/avatars/get-initials.md new file mode 100644 index 0000000000..b2e70788d6 --- /dev/null +++ b/docs/examples/0.7.0/client-flutter/examples/avatars/get-initials.md @@ -0,0 +1,16 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Avatars avatars = Avatars(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + String result = avatars.getInitials( + ); + + print(result); // Resource URL string +} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/docs/examples/avatars/get-q-r.md b/docs/examples/0.7.0/client-flutter/examples/avatars/get-q-r.md similarity index 87% rename from app/sdks/client-flutter-dev/docs/examples/avatars/get-q-r.md rename to docs/examples/0.7.0/client-flutter/examples/avatars/get-q-r.md index 2737297082..a5bcfd2c05 100644 --- a/app/sdks/client-flutter-dev/docs/examples/avatars/get-q-r.md +++ b/docs/examples/0.7.0/client-flutter/examples/avatars/get-q-r.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/database/create-document.md b/docs/examples/0.7.0/client-flutter/examples/database/create-document.md similarity index 90% rename from app/sdks/client-flutter-dev/docs/examples/database/create-document.md rename to docs/examples/0.7.0/client-flutter/examples/database/create-document.md index 6fc27bdfbb..b7d540bc2d 100644 --- a/app/sdks/client-flutter-dev/docs/examples/database/create-document.md +++ b/docs/examples/0.7.0/client-flutter/examples/database/create-document.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/database/delete-document.md b/docs/examples/0.7.0/client-flutter/examples/database/delete-document.md similarity index 90% rename from app/sdks/client-flutter-dev/docs/examples/database/delete-document.md rename to docs/examples/0.7.0/client-flutter/examples/database/delete-document.md index 74bcd69d9a..40c1cbdfe2 100644 --- a/app/sdks/client-flutter-dev/docs/examples/database/delete-document.md +++ b/docs/examples/0.7.0/client-flutter/examples/database/delete-document.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/database/get-document.md b/docs/examples/0.7.0/client-flutter/examples/database/get-document.md similarity index 90% rename from app/sdks/client-flutter-dev/docs/examples/database/get-document.md rename to docs/examples/0.7.0/client-flutter/examples/database/get-document.md index 639209ed3c..0c98142315 100644 --- a/app/sdks/client-flutter-dev/docs/examples/database/get-document.md +++ b/docs/examples/0.7.0/client-flutter/examples/database/get-document.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/database/list-documents.md b/docs/examples/0.7.0/client-flutter/examples/database/list-documents.md similarity index 89% rename from app/sdks/client-flutter-dev/docs/examples/database/list-documents.md rename to docs/examples/0.7.0/client-flutter/examples/database/list-documents.md index 41eac5dd9a..0685e7f1aa 100644 --- a/app/sdks/client-flutter-dev/docs/examples/database/list-documents.md +++ b/docs/examples/0.7.0/client-flutter/examples/database/list-documents.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/database/update-document.md b/docs/examples/0.7.0/client-flutter/examples/database/update-document.md similarity index 91% rename from app/sdks/client-flutter-dev/docs/examples/database/update-document.md rename to docs/examples/0.7.0/client-flutter/examples/database/update-document.md index 0b153b1595..2f37cd767a 100644 --- a/app/sdks/client-flutter-dev/docs/examples/database/update-document.md +++ b/docs/examples/0.7.0/client-flutter/examples/database/update-document.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/docs/examples/0.7.0/client-flutter/examples/locale/get-continents.md b/docs/examples/0.7.0/client-flutter/examples/locale/get-continents.md new file mode 100644 index 0000000000..60d4f32c4f --- /dev/null +++ b/docs/examples/0.7.0/client-flutter/examples/locale/get-continents.md @@ -0,0 +1,20 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Locale locale = Locale(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = locale.getContinents(); + + result + .then((response) { + print(response); + }).catchError((error) { + print(error.response); + }); +} \ No newline at end of file diff --git a/docs/examples/0.7.0/client-flutter/examples/locale/get-countries-e-u.md b/docs/examples/0.7.0/client-flutter/examples/locale/get-countries-e-u.md new file mode 100644 index 0000000000..766006fecc --- /dev/null +++ b/docs/examples/0.7.0/client-flutter/examples/locale/get-countries-e-u.md @@ -0,0 +1,20 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Locale locale = Locale(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = locale.getCountriesEU(); + + result + .then((response) { + print(response); + }).catchError((error) { + print(error.response); + }); +} \ No newline at end of file diff --git a/docs/examples/0.7.0/client-flutter/examples/locale/get-countries-phones.md b/docs/examples/0.7.0/client-flutter/examples/locale/get-countries-phones.md new file mode 100644 index 0000000000..786eeb0b70 --- /dev/null +++ b/docs/examples/0.7.0/client-flutter/examples/locale/get-countries-phones.md @@ -0,0 +1,20 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Locale locale = Locale(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = locale.getCountriesPhones(); + + result + .then((response) { + print(response); + }).catchError((error) { + print(error.response); + }); +} \ No newline at end of file diff --git a/docs/examples/0.7.0/client-flutter/examples/locale/get-countries.md b/docs/examples/0.7.0/client-flutter/examples/locale/get-countries.md new file mode 100644 index 0000000000..0570421ef9 --- /dev/null +++ b/docs/examples/0.7.0/client-flutter/examples/locale/get-countries.md @@ -0,0 +1,20 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Locale locale = Locale(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = locale.getCountries(); + + result + .then((response) { + print(response); + }).catchError((error) { + print(error.response); + }); +} \ No newline at end of file diff --git a/docs/examples/0.7.0/client-flutter/examples/locale/get-currencies.md b/docs/examples/0.7.0/client-flutter/examples/locale/get-currencies.md new file mode 100644 index 0000000000..7846c3c710 --- /dev/null +++ b/docs/examples/0.7.0/client-flutter/examples/locale/get-currencies.md @@ -0,0 +1,20 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Locale locale = Locale(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = locale.getCurrencies(); + + result + .then((response) { + print(response); + }).catchError((error) { + print(error.response); + }); +} \ No newline at end of file diff --git a/docs/examples/0.7.0/client-flutter/examples/locale/get-languages.md b/docs/examples/0.7.0/client-flutter/examples/locale/get-languages.md new file mode 100644 index 0000000000..4f526383fa --- /dev/null +++ b/docs/examples/0.7.0/client-flutter/examples/locale/get-languages.md @@ -0,0 +1,20 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Locale locale = Locale(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = locale.getLanguages(); + + result + .then((response) { + print(response); + }).catchError((error) { + print(error.response); + }); +} \ No newline at end of file diff --git a/docs/examples/0.7.0/client-flutter/examples/locale/get.md b/docs/examples/0.7.0/client-flutter/examples/locale/get.md new file mode 100644 index 0000000000..2dbdd47f63 --- /dev/null +++ b/docs/examples/0.7.0/client-flutter/examples/locale/get.md @@ -0,0 +1,20 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Locale locale = Locale(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = locale.get(); + + result + .then((response) { + print(response); + }).catchError((error) { + print(error.response); + }); +} \ No newline at end of file diff --git a/app/sdks/client-flutter-dev/docs/examples/storage/create-file.md b/docs/examples/0.7.0/client-flutter/examples/storage/create-file.md similarity index 91% rename from app/sdks/client-flutter-dev/docs/examples/storage/create-file.md rename to docs/examples/0.7.0/client-flutter/examples/storage/create-file.md index d824bd5831..9f61be12f4 100644 --- a/app/sdks/client-flutter-dev/docs/examples/storage/create-file.md +++ b/docs/examples/0.7.0/client-flutter/examples/storage/create-file.md @@ -1,5 +1,5 @@ import 'dart:io'; -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/storage/delete-file.md b/docs/examples/0.7.0/client-flutter/examples/storage/delete-file.md similarity index 89% rename from app/sdks/client-flutter-dev/docs/examples/storage/delete-file.md rename to docs/examples/0.7.0/client-flutter/examples/storage/delete-file.md index 88e7b8815c..271ed7b2dd 100644 --- a/app/sdks/client-flutter-dev/docs/examples/storage/delete-file.md +++ b/docs/examples/0.7.0/client-flutter/examples/storage/delete-file.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/storage/get-file-download.md b/docs/examples/0.7.0/client-flutter/examples/storage/get-file-download.md similarity index 87% rename from app/sdks/client-flutter-dev/docs/examples/storage/get-file-download.md rename to docs/examples/0.7.0/client-flutter/examples/storage/get-file-download.md index 483340e24a..be3385a61b 100644 --- a/app/sdks/client-flutter-dev/docs/examples/storage/get-file-download.md +++ b/docs/examples/0.7.0/client-flutter/examples/storage/get-file-download.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/storage/get-file-preview.md b/docs/examples/0.7.0/client-flutter/examples/storage/get-file-preview.md similarity index 87% rename from app/sdks/client-flutter-dev/docs/examples/storage/get-file-preview.md rename to docs/examples/0.7.0/client-flutter/examples/storage/get-file-preview.md index dd8d924fe7..8bd1a47457 100644 --- a/app/sdks/client-flutter-dev/docs/examples/storage/get-file-preview.md +++ b/docs/examples/0.7.0/client-flutter/examples/storage/get-file-preview.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/storage/get-file-view.md b/docs/examples/0.7.0/client-flutter/examples/storage/get-file-view.md similarity index 87% rename from app/sdks/client-flutter-dev/docs/examples/storage/get-file-view.md rename to docs/examples/0.7.0/client-flutter/examples/storage/get-file-view.md index 8ed6a946e0..5803fd409f 100644 --- a/app/sdks/client-flutter-dev/docs/examples/storage/get-file-view.md +++ b/docs/examples/0.7.0/client-flutter/examples/storage/get-file-view.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/storage/get-file.md b/docs/examples/0.7.0/client-flutter/examples/storage/get-file.md similarity index 89% rename from app/sdks/client-flutter-dev/docs/examples/storage/get-file.md rename to docs/examples/0.7.0/client-flutter/examples/storage/get-file.md index 4e398f88fd..feca667fa9 100644 --- a/app/sdks/client-flutter-dev/docs/examples/storage/get-file.md +++ b/docs/examples/0.7.0/client-flutter/examples/storage/get-file.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/storage/list-files.md b/docs/examples/0.7.0/client-flutter/examples/storage/list-files.md similarity index 88% rename from app/sdks/client-flutter-dev/docs/examples/storage/list-files.md rename to docs/examples/0.7.0/client-flutter/examples/storage/list-files.md index d72ba29e03..1963ec694d 100644 --- a/app/sdks/client-flutter-dev/docs/examples/storage/list-files.md +++ b/docs/examples/0.7.0/client-flutter/examples/storage/list-files.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/storage/update-file.md b/docs/examples/0.7.0/client-flutter/examples/storage/update-file.md similarity index 90% rename from app/sdks/client-flutter-dev/docs/examples/storage/update-file.md rename to docs/examples/0.7.0/client-flutter/examples/storage/update-file.md index 95e213ddc2..a5ecbfe987 100644 --- a/app/sdks/client-flutter-dev/docs/examples/storage/update-file.md +++ b/docs/examples/0.7.0/client-flutter/examples/storage/update-file.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/teams/create-membership.md b/docs/examples/0.7.0/client-flutter/examples/teams/create-membership.md similarity index 90% rename from app/sdks/client-flutter-dev/docs/examples/teams/create-membership.md rename to docs/examples/0.7.0/client-flutter/examples/teams/create-membership.md index 31bf7ec1af..e5e82de7b4 100644 --- a/app/sdks/client-flutter-dev/docs/examples/teams/create-membership.md +++ b/docs/examples/0.7.0/client-flutter/examples/teams/create-membership.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/teams/create.md b/docs/examples/0.7.0/client-flutter/examples/teams/create.md similarity index 89% rename from app/sdks/client-flutter-dev/docs/examples/teams/create.md rename to docs/examples/0.7.0/client-flutter/examples/teams/create.md index e50279de01..d11958ae6d 100644 --- a/app/sdks/client-flutter-dev/docs/examples/teams/create.md +++ b/docs/examples/0.7.0/client-flutter/examples/teams/create.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/teams/delete-membership.md b/docs/examples/0.7.0/client-flutter/examples/teams/delete-membership.md similarity index 90% rename from app/sdks/client-flutter-dev/docs/examples/teams/delete-membership.md rename to docs/examples/0.7.0/client-flutter/examples/teams/delete-membership.md index 015507d3a2..3f57b840fe 100644 --- a/app/sdks/client-flutter-dev/docs/examples/teams/delete-membership.md +++ b/docs/examples/0.7.0/client-flutter/examples/teams/delete-membership.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/teams/delete.md b/docs/examples/0.7.0/client-flutter/examples/teams/delete.md similarity index 89% rename from app/sdks/client-flutter-dev/docs/examples/teams/delete.md rename to docs/examples/0.7.0/client-flutter/examples/teams/delete.md index 6cc1367f9b..9fb488afec 100644 --- a/app/sdks/client-flutter-dev/docs/examples/teams/delete.md +++ b/docs/examples/0.7.0/client-flutter/examples/teams/delete.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/teams/get-memberships.md b/docs/examples/0.7.0/client-flutter/examples/teams/get-memberships.md similarity index 89% rename from app/sdks/client-flutter-dev/docs/examples/teams/get-memberships.md rename to docs/examples/0.7.0/client-flutter/examples/teams/get-memberships.md index d427c9ac47..4edadfa2b4 100644 --- a/app/sdks/client-flutter-dev/docs/examples/teams/get-memberships.md +++ b/docs/examples/0.7.0/client-flutter/examples/teams/get-memberships.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/teams/get.md b/docs/examples/0.7.0/client-flutter/examples/teams/get.md similarity index 89% rename from app/sdks/client-flutter-dev/docs/examples/teams/get.md rename to docs/examples/0.7.0/client-flutter/examples/teams/get.md index 1bca70a23f..083565f7a6 100644 --- a/app/sdks/client-flutter-dev/docs/examples/teams/get.md +++ b/docs/examples/0.7.0/client-flutter/examples/teams/get.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/teams/list.md b/docs/examples/0.7.0/client-flutter/examples/teams/list.md similarity index 88% rename from app/sdks/client-flutter-dev/docs/examples/teams/list.md rename to docs/examples/0.7.0/client-flutter/examples/teams/list.md index c56e7a5dd5..665020e928 100644 --- a/app/sdks/client-flutter-dev/docs/examples/teams/list.md +++ b/docs/examples/0.7.0/client-flutter/examples/teams/list.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/teams/update-membership-status.md b/docs/examples/0.7.0/client-flutter/examples/teams/update-membership-status.md similarity index 91% rename from app/sdks/client-flutter-dev/docs/examples/teams/update-membership-status.md rename to docs/examples/0.7.0/client-flutter/examples/teams/update-membership-status.md index 6098b38ed9..616f64e148 100644 --- a/app/sdks/client-flutter-dev/docs/examples/teams/update-membership-status.md +++ b/docs/examples/0.7.0/client-flutter/examples/teams/update-membership-status.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/app/sdks/client-flutter-dev/docs/examples/teams/update.md b/docs/examples/0.7.0/client-flutter/examples/teams/update.md similarity index 89% rename from app/sdks/client-flutter-dev/docs/examples/teams/update.md rename to docs/examples/0.7.0/client-flutter/examples/teams/update.md index 2494f408d9..915fb57d38 100644 --- a/app/sdks/client-flutter-dev/docs/examples/teams/update.md +++ b/docs/examples/0.7.0/client-flutter/examples/teams/update.md @@ -1,4 +1,4 @@ -import 'package:appwrite_dev/appwrite_dev.dart'; +import 'package:appwrite/appwrite.dart'; void main() { // Init SDK Client client = Client(); diff --git a/docs/examples/0.7.0/client-web/examples/account/create-o-auth2session.md b/docs/examples/0.7.0/client-web/examples/account/create-o-auth2session.md new file mode 100644 index 0000000000..25b02e632e --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/account/create-o-auth2session.md @@ -0,0 +1,10 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +// Go to OAuth provider login page +sdk.account.createOAuth2Session('amazon'); + diff --git a/docs/examples/0.7.0/client-web/examples/account/create-recovery.md b/docs/examples/0.7.0/client-web/examples/account/create-recovery.md new file mode 100644 index 0000000000..72130f4de4 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/account/create-recovery.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.account.createRecovery('email@example.com', 'https://example.com'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/account/create-session.md b/docs/examples/0.7.0/client-web/examples/account/create-session.md new file mode 100644 index 0000000000..4a7682c13d --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/account/create-session.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.account.createSession('email@example.com', 'password'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/account/create-verification.md b/docs/examples/0.7.0/client-web/examples/account/create-verification.md new file mode 100644 index 0000000000..7903384a9f --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/account/create-verification.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.account.createVerification('https://example.com'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/account/create.md b/docs/examples/0.7.0/client-web/examples/account/create.md new file mode 100644 index 0000000000..c9ce798b6a --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/account/create.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.account.create('email@example.com', 'password'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/account/delete-session.md b/docs/examples/0.7.0/client-web/examples/account/delete-session.md new file mode 100644 index 0000000000..581e5d132d --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/account/delete-session.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.account.deleteSession('[SESSION_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/account/delete-sessions.md b/docs/examples/0.7.0/client-web/examples/account/delete-sessions.md new file mode 100644 index 0000000000..d037673eb3 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/account/delete-sessions.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.account.deleteSessions(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/account/delete.md b/docs/examples/0.7.0/client-web/examples/account/delete.md new file mode 100644 index 0000000000..d952d77d7a --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/account/delete.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.account.delete(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/account/get-logs.md b/docs/examples/0.7.0/client-web/examples/account/get-logs.md new file mode 100644 index 0000000000..c53e0446e9 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/account/get-logs.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.account.getLogs(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/account/get-prefs.md b/docs/examples/0.7.0/client-web/examples/account/get-prefs.md new file mode 100644 index 0000000000..75835e37fb --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/account/get-prefs.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.account.getPrefs(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/account/get-sessions.md b/docs/examples/0.7.0/client-web/examples/account/get-sessions.md new file mode 100644 index 0000000000..b4434de336 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/account/get-sessions.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.account.getSessions(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/account/get.md b/docs/examples/0.7.0/client-web/examples/account/get.md new file mode 100644 index 0000000000..f0184a8513 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/account/get.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.account.get(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/account/update-email.md b/docs/examples/0.7.0/client-web/examples/account/update-email.md new file mode 100644 index 0000000000..f48fed78bc --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/account/update-email.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.account.updateEmail('email@example.com', 'password'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/account/update-name.md b/docs/examples/0.7.0/client-web/examples/account/update-name.md new file mode 100644 index 0000000000..e03e72c4b2 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/account/update-name.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.account.updateName('[NAME]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/account/update-password.md b/docs/examples/0.7.0/client-web/examples/account/update-password.md new file mode 100644 index 0000000000..22539f3f64 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/account/update-password.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.account.updatePassword('password', 'password'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/account/update-prefs.md b/docs/examples/0.7.0/client-web/examples/account/update-prefs.md new file mode 100644 index 0000000000..b2d4ff175e --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/account/update-prefs.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.account.updatePrefs({}); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/account/update-recovery.md b/docs/examples/0.7.0/client-web/examples/account/update-recovery.md new file mode 100644 index 0000000000..33cf1b63c9 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/account/update-recovery.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.account.updateRecovery('[USER_ID]', '[SECRET]', 'password', 'password'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/account/update-verification.md b/docs/examples/0.7.0/client-web/examples/account/update-verification.md new file mode 100644 index 0000000000..a80e125e30 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/account/update-verification.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.account.updateVerification('[USER_ID]', '[SECRET]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/avatars/get-browser.md b/docs/examples/0.7.0/client-web/examples/avatars/get-browser.md new file mode 100644 index 0000000000..0855209f58 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/avatars/get-browser.md @@ -0,0 +1,10 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let result = sdk.avatars.getBrowser('aa'); + +console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/avatars/get-credit-card.md b/docs/examples/0.7.0/client-web/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..1aa595bd65 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/avatars/get-credit-card.md @@ -0,0 +1,10 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let result = sdk.avatars.getCreditCard('amex'); + +console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/avatars/get-favicon.md b/docs/examples/0.7.0/client-web/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..a945e50bb2 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/avatars/get-favicon.md @@ -0,0 +1,10 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let result = sdk.avatars.getFavicon('https://example.com'); + +console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/avatars/get-flag.md b/docs/examples/0.7.0/client-web/examples/avatars/get-flag.md new file mode 100644 index 0000000000..222b388afc --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/avatars/get-flag.md @@ -0,0 +1,10 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let result = sdk.avatars.getFlag('af'); + +console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/avatars/get-image.md b/docs/examples/0.7.0/client-web/examples/avatars/get-image.md new file mode 100644 index 0000000000..3f15981c71 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/avatars/get-image.md @@ -0,0 +1,10 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let result = sdk.avatars.getImage('https://example.com'); + +console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/avatars/get-initials.md b/docs/examples/0.7.0/client-web/examples/avatars/get-initials.md new file mode 100644 index 0000000000..ef04988e2d --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/avatars/get-initials.md @@ -0,0 +1,10 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let result = sdk.avatars.getInitials(); + +console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/avatars/get-q-r.md b/docs/examples/0.7.0/client-web/examples/avatars/get-q-r.md new file mode 100644 index 0000000000..9d9ee3fea2 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/avatars/get-q-r.md @@ -0,0 +1,10 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let result = sdk.avatars.getQR('[TEXT]'); + +console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/database/create-document.md b/docs/examples/0.7.0/client-web/examples/database/create-document.md new file mode 100644 index 0000000000..e04f73f73e --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/database/create-document.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.database.createDocument('[COLLECTION_ID]', {}, [], []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/database/delete-document.md b/docs/examples/0.7.0/client-web/examples/database/delete-document.md new file mode 100644 index 0000000000..79799b6907 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/database/delete-document.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.database.deleteDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/database/get-document.md b/docs/examples/0.7.0/client-web/examples/database/get-document.md new file mode 100644 index 0000000000..b9605dccc6 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/database/get-document.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.database.getDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/database/list-documents.md b/docs/examples/0.7.0/client-web/examples/database/list-documents.md new file mode 100644 index 0000000000..14f8a423a1 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/database/list-documents.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.database.listDocuments('[COLLECTION_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/database/update-document.md b/docs/examples/0.7.0/client-web/examples/database/update-document.md new file mode 100644 index 0000000000..9104b77a71 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/database/update-document.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.database.updateDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', {}, [], []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/locale/get-continents.md b/docs/examples/0.7.0/client-web/examples/locale/get-continents.md new file mode 100644 index 0000000000..1dfdf8013b --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/locale/get-continents.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.locale.getContinents(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/locale/get-countries-e-u.md b/docs/examples/0.7.0/client-web/examples/locale/get-countries-e-u.md new file mode 100644 index 0000000000..6b3f210a1e --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/locale/get-countries-e-u.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.locale.getCountriesEU(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/locale/get-countries-phones.md b/docs/examples/0.7.0/client-web/examples/locale/get-countries-phones.md new file mode 100644 index 0000000000..f35e2152e4 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/locale/get-countries-phones.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.locale.getCountriesPhones(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/locale/get-countries.md b/docs/examples/0.7.0/client-web/examples/locale/get-countries.md new file mode 100644 index 0000000000..53b96375a1 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/locale/get-countries.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.locale.getCountries(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/locale/get-currencies.md b/docs/examples/0.7.0/client-web/examples/locale/get-currencies.md new file mode 100644 index 0000000000..57db66401f --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/locale/get-currencies.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.locale.getCurrencies(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/locale/get-languages.md b/docs/examples/0.7.0/client-web/examples/locale/get-languages.md new file mode 100644 index 0000000000..04e3063ee7 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/locale/get-languages.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.locale.getLanguages(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/locale/get.md b/docs/examples/0.7.0/client-web/examples/locale/get.md new file mode 100644 index 0000000000..469a046dbc --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/locale/get.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.locale.get(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/storage/create-file.md b/docs/examples/0.7.0/client-web/examples/storage/create-file.md new file mode 100644 index 0000000000..b23c47027a --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/storage/create-file.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.storage.createFile(document.getElementById('uploader').files[0], [], []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/storage/delete-file.md b/docs/examples/0.7.0/client-web/examples/storage/delete-file.md new file mode 100644 index 0000000000..c38ab4ba9c --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/storage/delete-file.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.storage.deleteFile('[FILE_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/storage/get-file-download.md b/docs/examples/0.7.0/client-web/examples/storage/get-file-download.md new file mode 100644 index 0000000000..1323b8b8df --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/storage/get-file-download.md @@ -0,0 +1,10 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let result = sdk.storage.getFileDownload('[FILE_ID]'); + +console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/storage/get-file-preview.md b/docs/examples/0.7.0/client-web/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..5ede9fdb93 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/storage/get-file-preview.md @@ -0,0 +1,10 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let result = sdk.storage.getFilePreview('[FILE_ID]'); + +console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/storage/get-file-view.md b/docs/examples/0.7.0/client-web/examples/storage/get-file-view.md new file mode 100644 index 0000000000..53877ae352 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/storage/get-file-view.md @@ -0,0 +1,10 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let result = sdk.storage.getFileView('[FILE_ID]'); + +console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/storage/get-file.md b/docs/examples/0.7.0/client-web/examples/storage/get-file.md new file mode 100644 index 0000000000..a1f94c08a6 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/storage/get-file.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.storage.getFile('[FILE_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/storage/list-files.md b/docs/examples/0.7.0/client-web/examples/storage/list-files.md new file mode 100644 index 0000000000..c489a0b46d --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/storage/list-files.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.storage.listFiles(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/storage/update-file.md b/docs/examples/0.7.0/client-web/examples/storage/update-file.md new file mode 100644 index 0000000000..2a2f579b3b --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/storage/update-file.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.storage.updateFile('[FILE_ID]', [], []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/teams/create-membership.md b/docs/examples/0.7.0/client-web/examples/teams/create-membership.md new file mode 100644 index 0000000000..78b2d7fa77 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/teams/create-membership.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.teams.createMembership('[TEAM_ID]', 'email@example.com', [], 'https://example.com'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/teams/create.md b/docs/examples/0.7.0/client-web/examples/teams/create.md new file mode 100644 index 0000000000..43205ba888 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/teams/create.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.teams.create('[NAME]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/teams/delete-membership.md b/docs/examples/0.7.0/client-web/examples/teams/delete-membership.md new file mode 100644 index 0000000000..1b85ef08da --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/teams/delete-membership.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.teams.deleteMembership('[TEAM_ID]', '[INVITE_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/teams/delete.md b/docs/examples/0.7.0/client-web/examples/teams/delete.md new file mode 100644 index 0000000000..4665ad5773 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/teams/delete.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.teams.delete('[TEAM_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/teams/get-memberships.md b/docs/examples/0.7.0/client-web/examples/teams/get-memberships.md new file mode 100644 index 0000000000..6235ce33f4 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/teams/get-memberships.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.teams.getMemberships('[TEAM_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/teams/get.md b/docs/examples/0.7.0/client-web/examples/teams/get.md new file mode 100644 index 0000000000..f4b0f040b1 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/teams/get.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.teams.get('[TEAM_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/teams/list.md b/docs/examples/0.7.0/client-web/examples/teams/list.md new file mode 100644 index 0000000000..c4229e2400 --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/teams/list.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.teams.list(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/teams/update-membership-status.md b/docs/examples/0.7.0/client-web/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..e8b3de0a0b --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/teams/update-membership-status.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.teams.updateMembershipStatus('[TEAM_ID]', '[INVITE_ID]', '[USER_ID]', '[SECRET]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/client-web/examples/teams/update.md b/docs/examples/0.7.0/client-web/examples/teams/update.md new file mode 100644 index 0000000000..bbab80937d --- /dev/null +++ b/docs/examples/0.7.0/client-web/examples/teams/update.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID +; + +let promise = sdk.teams.update('[TEAM_ID]', '[NAME]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/account/create-o-auth2session.md b/docs/examples/0.7.0/console-web/examples/account/create-o-auth2session.md new file mode 100644 index 0000000000..3a2dcba651 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/account/create-o-auth2session.md @@ -0,0 +1,11 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +// Go to OAuth provider login page +sdk.account.createOAuth2Session('amazon'); + diff --git a/docs/examples/0.7.0/console-web/examples/account/create-recovery.md b/docs/examples/0.7.0/console-web/examples/account/create-recovery.md new file mode 100644 index 0000000000..d69269b351 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/account/create-recovery.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.account.createRecovery('email@example.com', 'https://example.com'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/account/create-session.md b/docs/examples/0.7.0/console-web/examples/account/create-session.md new file mode 100644 index 0000000000..0734a84aaa --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/account/create-session.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.account.createSession('email@example.com', 'password'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/account/create-verification.md b/docs/examples/0.7.0/console-web/examples/account/create-verification.md new file mode 100644 index 0000000000..1211b5c642 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/account/create-verification.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.account.createVerification('https://example.com'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/account/create.md b/docs/examples/0.7.0/console-web/examples/account/create.md new file mode 100644 index 0000000000..e61b1fbac4 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/account/create.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.account.create('email@example.com', 'password'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/account/delete-session.md b/docs/examples/0.7.0/console-web/examples/account/delete-session.md new file mode 100644 index 0000000000..84505281f0 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/account/delete-session.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.account.deleteSession('[SESSION_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/account/delete-sessions.md b/docs/examples/0.7.0/console-web/examples/account/delete-sessions.md new file mode 100644 index 0000000000..61bec86399 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/account/delete-sessions.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.account.deleteSessions(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/account/delete.md b/docs/examples/0.7.0/console-web/examples/account/delete.md new file mode 100644 index 0000000000..dbb8dbf250 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/account/delete.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.account.delete(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/account/get-logs.md b/docs/examples/0.7.0/console-web/examples/account/get-logs.md new file mode 100644 index 0000000000..12e6656c96 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/account/get-logs.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.account.getLogs(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/account/get-prefs.md b/docs/examples/0.7.0/console-web/examples/account/get-prefs.md new file mode 100644 index 0000000000..e328baba32 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/account/get-prefs.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.account.getPrefs(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/account/get-sessions.md b/docs/examples/0.7.0/console-web/examples/account/get-sessions.md new file mode 100644 index 0000000000..cb281dd4db --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/account/get-sessions.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.account.getSessions(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/account/get.md b/docs/examples/0.7.0/console-web/examples/account/get.md new file mode 100644 index 0000000000..82c96fb9db --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/account/get.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.account.get(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/account/update-email.md b/docs/examples/0.7.0/console-web/examples/account/update-email.md new file mode 100644 index 0000000000..c2caaf060e --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/account/update-email.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.account.updateEmail('email@example.com', 'password'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/account/update-name.md b/docs/examples/0.7.0/console-web/examples/account/update-name.md new file mode 100644 index 0000000000..047eba688b --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/account/update-name.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.account.updateName('[NAME]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/account/update-password.md b/docs/examples/0.7.0/console-web/examples/account/update-password.md new file mode 100644 index 0000000000..d305031fa0 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/account/update-password.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.account.updatePassword('password', 'password'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/account/update-prefs.md b/docs/examples/0.7.0/console-web/examples/account/update-prefs.md new file mode 100644 index 0000000000..8c4e402ae1 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/account/update-prefs.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.account.updatePrefs({}); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/account/update-recovery.md b/docs/examples/0.7.0/console-web/examples/account/update-recovery.md new file mode 100644 index 0000000000..235a4db481 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/account/update-recovery.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.account.updateRecovery('[USER_ID]', '[SECRET]', 'password', 'password'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/account/update-verification.md b/docs/examples/0.7.0/console-web/examples/account/update-verification.md new file mode 100644 index 0000000000..ef2c384853 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/account/update-verification.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.account.updateVerification('[USER_ID]', '[SECRET]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/avatars/get-browser.md b/docs/examples/0.7.0/console-web/examples/avatars/get-browser.md new file mode 100644 index 0000000000..bbbdb9738f --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/avatars/get-browser.md @@ -0,0 +1,11 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let result = sdk.avatars.getBrowser('aa'); + +console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/avatars/get-credit-card.md b/docs/examples/0.7.0/console-web/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..e1fab01cf2 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/avatars/get-credit-card.md @@ -0,0 +1,11 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let result = sdk.avatars.getCreditCard('amex'); + +console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/avatars/get-favicon.md b/docs/examples/0.7.0/console-web/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..397986b11a --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/avatars/get-favicon.md @@ -0,0 +1,11 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let result = sdk.avatars.getFavicon('https://example.com'); + +console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/avatars/get-flag.md b/docs/examples/0.7.0/console-web/examples/avatars/get-flag.md new file mode 100644 index 0000000000..6e90b72feb --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/avatars/get-flag.md @@ -0,0 +1,11 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let result = sdk.avatars.getFlag('af'); + +console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/avatars/get-image.md b/docs/examples/0.7.0/console-web/examples/avatars/get-image.md new file mode 100644 index 0000000000..afd1a17cb5 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/avatars/get-image.md @@ -0,0 +1,11 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let result = sdk.avatars.getImage('https://example.com'); + +console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/avatars/get-initials.md b/docs/examples/0.7.0/console-web/examples/avatars/get-initials.md new file mode 100644 index 0000000000..dab6417ca5 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/avatars/get-initials.md @@ -0,0 +1,11 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let result = sdk.avatars.getInitials(); + +console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/avatars/get-q-r.md b/docs/examples/0.7.0/console-web/examples/avatars/get-q-r.md new file mode 100644 index 0000000000..31f490cedd --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/avatars/get-q-r.md @@ -0,0 +1,11 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let result = sdk.avatars.getQR('[TEXT]'); + +console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/database/create-collection.md b/docs/examples/0.7.0/console-web/examples/database/create-collection.md new file mode 100644 index 0000000000..a7a4b90197 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/database/create-collection.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.database.createCollection('[NAME]', [], [], []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/database/create-document.md b/docs/examples/0.7.0/console-web/examples/database/create-document.md new file mode 100644 index 0000000000..64809c6156 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/database/create-document.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.database.createDocument('[COLLECTION_ID]', {}, [], []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/database/delete-collection.md b/docs/examples/0.7.0/console-web/examples/database/delete-collection.md new file mode 100644 index 0000000000..bfb0706bf5 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/database/delete-collection.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.database.deleteCollection('[COLLECTION_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/database/delete-document.md b/docs/examples/0.7.0/console-web/examples/database/delete-document.md new file mode 100644 index 0000000000..356a71a437 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/database/delete-document.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.database.deleteDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/database/get-collection.md b/docs/examples/0.7.0/console-web/examples/database/get-collection.md new file mode 100644 index 0000000000..d74d4b3225 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/database/get-collection.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.database.getCollection('[COLLECTION_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/database/get-document.md b/docs/examples/0.7.0/console-web/examples/database/get-document.md new file mode 100644 index 0000000000..51638880c5 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/database/get-document.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.database.getDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/database/list-collections.md b/docs/examples/0.7.0/console-web/examples/database/list-collections.md new file mode 100644 index 0000000000..8a18249748 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/database/list-collections.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.database.listCollections(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/database/list-documents.md b/docs/examples/0.7.0/console-web/examples/database/list-documents.md new file mode 100644 index 0000000000..1d895a566a --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/database/list-documents.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.database.listDocuments('[COLLECTION_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/database/update-collection.md b/docs/examples/0.7.0/console-web/examples/database/update-collection.md new file mode 100644 index 0000000000..f00a6c6f8c --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/database/update-collection.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.database.updateCollection('[COLLECTION_ID]', '[NAME]', [], []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/database/update-document.md b/docs/examples/0.7.0/console-web/examples/database/update-document.md new file mode 100644 index 0000000000..52c172ab6a --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/database/update-document.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.database.updateDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', {}, [], []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/functions/create-execution.md b/docs/examples/0.7.0/console-web/examples/functions/create-execution.md similarity index 100% rename from app/sdks/console-web/docs/examples/functions/create-execution.md rename to docs/examples/0.7.0/console-web/examples/functions/create-execution.md diff --git a/app/sdks/console-web/docs/examples/functions/create-tag.md b/docs/examples/0.7.0/console-web/examples/functions/create-tag.md similarity index 100% rename from app/sdks/console-web/docs/examples/functions/create-tag.md rename to docs/examples/0.7.0/console-web/examples/functions/create-tag.md diff --git a/app/sdks/console-web/docs/examples/functions/create.md b/docs/examples/0.7.0/console-web/examples/functions/create.md similarity index 100% rename from app/sdks/console-web/docs/examples/functions/create.md rename to docs/examples/0.7.0/console-web/examples/functions/create.md diff --git a/app/sdks/console-web/docs/examples/functions/delete-tag.md b/docs/examples/0.7.0/console-web/examples/functions/delete-tag.md similarity index 100% rename from app/sdks/console-web/docs/examples/functions/delete-tag.md rename to docs/examples/0.7.0/console-web/examples/functions/delete-tag.md diff --git a/app/sdks/console-web/docs/examples/functions/delete.md b/docs/examples/0.7.0/console-web/examples/functions/delete.md similarity index 100% rename from app/sdks/console-web/docs/examples/functions/delete.md rename to docs/examples/0.7.0/console-web/examples/functions/delete.md diff --git a/app/sdks/console-web/docs/examples/functions/get-execution.md b/docs/examples/0.7.0/console-web/examples/functions/get-execution.md similarity index 100% rename from app/sdks/console-web/docs/examples/functions/get-execution.md rename to docs/examples/0.7.0/console-web/examples/functions/get-execution.md diff --git a/app/sdks/console-web/docs/examples/functions/get-tag.md b/docs/examples/0.7.0/console-web/examples/functions/get-tag.md similarity index 100% rename from app/sdks/console-web/docs/examples/functions/get-tag.md rename to docs/examples/0.7.0/console-web/examples/functions/get-tag.md diff --git a/docs/examples/0.7.0/console-web/examples/functions/get-usage.md b/docs/examples/0.7.0/console-web/examples/functions/get-usage.md new file mode 100644 index 0000000000..7515c0fe5c --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/functions/get-usage.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.functions.getUsage('[FUNCTION_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/functions/get.md b/docs/examples/0.7.0/console-web/examples/functions/get.md similarity index 100% rename from app/sdks/console-web/docs/examples/functions/get.md rename to docs/examples/0.7.0/console-web/examples/functions/get.md diff --git a/app/sdks/console-web/docs/examples/functions/list-executions.md b/docs/examples/0.7.0/console-web/examples/functions/list-executions.md similarity index 100% rename from app/sdks/console-web/docs/examples/functions/list-executions.md rename to docs/examples/0.7.0/console-web/examples/functions/list-executions.md diff --git a/app/sdks/console-web/docs/examples/functions/list-tags.md b/docs/examples/0.7.0/console-web/examples/functions/list-tags.md similarity index 100% rename from app/sdks/console-web/docs/examples/functions/list-tags.md rename to docs/examples/0.7.0/console-web/examples/functions/list-tags.md diff --git a/app/sdks/console-web/docs/examples/functions/list.md b/docs/examples/0.7.0/console-web/examples/functions/list.md similarity index 100% rename from app/sdks/console-web/docs/examples/functions/list.md rename to docs/examples/0.7.0/console-web/examples/functions/list.md diff --git a/app/sdks/console-web/docs/examples/functions/update-tag.md b/docs/examples/0.7.0/console-web/examples/functions/update-tag.md similarity index 100% rename from app/sdks/console-web/docs/examples/functions/update-tag.md rename to docs/examples/0.7.0/console-web/examples/functions/update-tag.md diff --git a/app/sdks/console-web/docs/examples/functions/update.md b/docs/examples/0.7.0/console-web/examples/functions/update.md similarity index 100% rename from app/sdks/console-web/docs/examples/functions/update.md rename to docs/examples/0.7.0/console-web/examples/functions/update.md diff --git a/docs/examples/0.7.0/console-web/examples/health/get-anti-virus.md b/docs/examples/0.7.0/console-web/examples/health/get-anti-virus.md new file mode 100644 index 0000000000..95b671992b --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/health/get-anti-virus.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.health.getAntiVirus(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/health/get-cache.md b/docs/examples/0.7.0/console-web/examples/health/get-cache.md new file mode 100644 index 0000000000..5c41d81868 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/health/get-cache.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.health.getCache(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/health/get-d-b.md b/docs/examples/0.7.0/console-web/examples/health/get-d-b.md new file mode 100644 index 0000000000..407f87e2a1 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/health/get-d-b.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.health.getDB(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/health/get-queue-certificates.md b/docs/examples/0.7.0/console-web/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..a115c869ba --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/health/get-queue-certificates.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.health.getQueueCertificates(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/health/get-queue-functions.md b/docs/examples/0.7.0/console-web/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..3c0dc33acf --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/health/get-queue-functions.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.health.getQueueFunctions(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/health/get-queue-logs.md b/docs/examples/0.7.0/console-web/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..b3d41b49c6 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/health/get-queue-logs.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.health.getQueueLogs(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/health/get-queue-tasks.md b/docs/examples/0.7.0/console-web/examples/health/get-queue-tasks.md new file mode 100644 index 0000000000..4f34f670a6 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/health/get-queue-tasks.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.health.getQueueTasks(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/health/get-queue-usage.md b/docs/examples/0.7.0/console-web/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..3d234be2de --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/health/get-queue-usage.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.health.getQueueUsage(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/health/get-queue-webhooks.md b/docs/examples/0.7.0/console-web/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..c5825dcf6c --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/health/get-queue-webhooks.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.health.getQueueWebhooks(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/health/get-storage-local.md b/docs/examples/0.7.0/console-web/examples/health/get-storage-local.md new file mode 100644 index 0000000000..7287745704 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/health/get-storage-local.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.health.getStorageLocal(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/health/get-time.md b/docs/examples/0.7.0/console-web/examples/health/get-time.md new file mode 100644 index 0000000000..b6087b73d5 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/health/get-time.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.health.getTime(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/functions/update-active.md b/docs/examples/0.7.0/console-web/examples/health/get.md similarity index 74% rename from app/sdks/console-web/docs/examples/functions/update-active.md rename to docs/examples/0.7.0/console-web/examples/health/get.md index eed2be885c..1e7d6fe4e8 100644 --- a/app/sdks/console-web/docs/examples/functions/update-active.md +++ b/docs/examples/0.7.0/console-web/examples/health/get.md @@ -1,11 +1,12 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = sdk.functions.updateActive('[FUNCTION_ID]', '[ACTIVE]'); +let promise = sdk.health.get(); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.7.0/console-web/examples/locale/get-continents.md b/docs/examples/0.7.0/console-web/examples/locale/get-continents.md new file mode 100644 index 0000000000..93144335ea --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/locale/get-continents.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.locale.getContinents(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/locale/get-countries-e-u.md b/docs/examples/0.7.0/console-web/examples/locale/get-countries-e-u.md new file mode 100644 index 0000000000..fffc8696e8 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/locale/get-countries-e-u.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.locale.getCountriesEU(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/locale/get-countries-phones.md b/docs/examples/0.7.0/console-web/examples/locale/get-countries-phones.md new file mode 100644 index 0000000000..751f4f6cc4 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/locale/get-countries-phones.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.locale.getCountriesPhones(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/locale/get-countries.md b/docs/examples/0.7.0/console-web/examples/locale/get-countries.md new file mode 100644 index 0000000000..30b1dd95c7 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/locale/get-countries.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.locale.getCountries(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/locale/get-currencies.md b/docs/examples/0.7.0/console-web/examples/locale/get-currencies.md new file mode 100644 index 0000000000..4c92714062 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/locale/get-currencies.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.locale.getCurrencies(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/locale/get-languages.md b/docs/examples/0.7.0/console-web/examples/locale/get-languages.md new file mode 100644 index 0000000000..2d1f713eeb --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/locale/get-languages.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.locale.getLanguages(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/locale/get.md b/docs/examples/0.7.0/console-web/examples/locale/get.md new file mode 100644 index 0000000000..1fba9877b5 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/locale/get.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.locale.get(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/create-domain.md b/docs/examples/0.7.0/console-web/examples/projects/create-domain.md new file mode 100644 index 0000000000..756b869a85 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/create-domain.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.createDomain('[PROJECT_ID]', ''); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/create-key.md b/docs/examples/0.7.0/console-web/examples/projects/create-key.md new file mode 100644 index 0000000000..9556f5b7f7 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/create-key.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.createKey('[PROJECT_ID]', '[NAME]', []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/create-platform.md b/docs/examples/0.7.0/console-web/examples/projects/create-platform.md new file mode 100644 index 0000000000..f4476fe599 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/create-platform.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.createPlatform('[PROJECT_ID]', 'web', '[NAME]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/create-task.md b/docs/examples/0.7.0/console-web/examples/projects/create-task.md new file mode 100644 index 0000000000..9b0f3c1e03 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/create-task.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.createTask('[PROJECT_ID]', '[NAME]', 'play', '', false, 'GET', 'https://example.com'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/projects/create-webhook.md b/docs/examples/0.7.0/console-web/examples/projects/create-webhook.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/create-webhook.md rename to docs/examples/0.7.0/console-web/examples/projects/create-webhook.md diff --git a/docs/examples/0.7.0/console-web/examples/projects/create.md b/docs/examples/0.7.0/console-web/examples/projects/create.md new file mode 100644 index 0000000000..8041ed154e --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/create.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.create('[NAME]', '[TEAM_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/delete-domain.md b/docs/examples/0.7.0/console-web/examples/projects/delete-domain.md new file mode 100644 index 0000000000..1b3df9363b --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/delete-domain.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.deleteDomain('[PROJECT_ID]', '[DOMAIN_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/delete-key.md b/docs/examples/0.7.0/console-web/examples/projects/delete-key.md new file mode 100644 index 0000000000..dc855bcc30 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/delete-key.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.deleteKey('[PROJECT_ID]', '[KEY_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/delete-platform.md b/docs/examples/0.7.0/console-web/examples/projects/delete-platform.md new file mode 100644 index 0000000000..2a180c47e4 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/delete-platform.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.deletePlatform('[PROJECT_ID]', '[PLATFORM_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/delete-task.md b/docs/examples/0.7.0/console-web/examples/projects/delete-task.md new file mode 100644 index 0000000000..b7f9ad3e47 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/delete-task.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.deleteTask('[PROJECT_ID]', '[TASK_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/delete-webhook.md b/docs/examples/0.7.0/console-web/examples/projects/delete-webhook.md new file mode 100644 index 0000000000..c5e0588ad1 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/delete-webhook.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.deleteWebhook('[PROJECT_ID]', '[WEBHOOK_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/database/get-collection-logs.md b/docs/examples/0.7.0/console-web/examples/projects/delete.md similarity index 84% rename from app/sdks/console-web/docs/examples/database/get-collection-logs.md rename to docs/examples/0.7.0/console-web/examples/projects/delete.md index 8934910901..20b67370f0 100644 --- a/app/sdks/console-web/docs/examples/database/get-collection-logs.md +++ b/docs/examples/0.7.0/console-web/examples/projects/delete.md @@ -6,7 +6,7 @@ sdk .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = sdk.database.getCollectionLogs('[COLLECTION_ID]'); +let promise = sdk.projects.delete('[PROJECT_ID]', '[PASSWORD]'); promise.then(function (response) { console.log(response); // Success diff --git a/docs/examples/0.7.0/console-web/examples/projects/get-domain.md b/docs/examples/0.7.0/console-web/examples/projects/get-domain.md new file mode 100644 index 0000000000..1622546719 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/get-domain.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.getDomain('[PROJECT_ID]', '[DOMAIN_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/get-key.md b/docs/examples/0.7.0/console-web/examples/projects/get-key.md new file mode 100644 index 0000000000..8bb458c335 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/get-key.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.getKey('[PROJECT_ID]', '[KEY_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/get-platform.md b/docs/examples/0.7.0/console-web/examples/projects/get-platform.md new file mode 100644 index 0000000000..bfeb49393b --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/get-platform.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.getPlatform('[PROJECT_ID]', '[PLATFORM_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/get-task.md b/docs/examples/0.7.0/console-web/examples/projects/get-task.md new file mode 100644 index 0000000000..c405299d74 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/get-task.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.getTask('[PROJECT_ID]', '[TASK_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/get-usage.md b/docs/examples/0.7.0/console-web/examples/projects/get-usage.md new file mode 100644 index 0000000000..e024a2966c --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/get-usage.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.getUsage('[PROJECT_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/get-webhook.md b/docs/examples/0.7.0/console-web/examples/projects/get-webhook.md new file mode 100644 index 0000000000..2629d4424d --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/get-webhook.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.getWebhook('[PROJECT_ID]', '[WEBHOOK_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/get.md b/docs/examples/0.7.0/console-web/examples/projects/get.md new file mode 100644 index 0000000000..bcfb35186b --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/get.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.get('[PROJECT_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/list-domains.md b/docs/examples/0.7.0/console-web/examples/projects/list-domains.md new file mode 100644 index 0000000000..5ddfec49b5 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/list-domains.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.listDomains('[PROJECT_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/list-keys.md b/docs/examples/0.7.0/console-web/examples/projects/list-keys.md new file mode 100644 index 0000000000..497ddf9bac --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/list-keys.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.listKeys('[PROJECT_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/list-platforms.md b/docs/examples/0.7.0/console-web/examples/projects/list-platforms.md new file mode 100644 index 0000000000..4fd2d311f3 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/list-platforms.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.listPlatforms('[PROJECT_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/list-tasks.md b/docs/examples/0.7.0/console-web/examples/projects/list-tasks.md new file mode 100644 index 0000000000..d42efc2b80 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/list-tasks.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.listTasks('[PROJECT_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/list-webhooks.md b/docs/examples/0.7.0/console-web/examples/projects/list-webhooks.md new file mode 100644 index 0000000000..6c45849399 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/list-webhooks.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.listWebhooks('[PROJECT_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/list.md b/docs/examples/0.7.0/console-web/examples/projects/list.md new file mode 100644 index 0000000000..428fc4545f --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/list.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.list(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/update-domain-verification.md b/docs/examples/0.7.0/console-web/examples/projects/update-domain-verification.md new file mode 100644 index 0000000000..ea53295bcf --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/update-domain-verification.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.updateDomainVerification('[PROJECT_ID]', '[DOMAIN_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/update-key.md b/docs/examples/0.7.0/console-web/examples/projects/update-key.md new file mode 100644 index 0000000000..f19b593c9f --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/update-key.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.updateKey('[PROJECT_ID]', '[KEY_ID]', '[NAME]', []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/update-o-auth2.md b/docs/examples/0.7.0/console-web/examples/projects/update-o-auth2.md new file mode 100644 index 0000000000..479c5e9d30 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/update-o-auth2.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.updateOAuth2('[PROJECT_ID]', 'amazon'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/update-platform.md b/docs/examples/0.7.0/console-web/examples/projects/update-platform.md new file mode 100644 index 0000000000..0e22080ed0 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/update-platform.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.updatePlatform('[PROJECT_ID]', '[PLATFORM_ID]', '[NAME]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/projects/update-task.md b/docs/examples/0.7.0/console-web/examples/projects/update-task.md new file mode 100644 index 0000000000..38744a36bd --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/update-task.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.updateTask('[PROJECT_ID]', '[TASK_ID]', '[NAME]', 'play', '', false, 'GET', 'https://example.com'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/projects/update-webhook.md b/docs/examples/0.7.0/console-web/examples/projects/update-webhook.md similarity index 100% rename from app/sdks/console-web/docs/examples/projects/update-webhook.md rename to docs/examples/0.7.0/console-web/examples/projects/update-webhook.md diff --git a/docs/examples/0.7.0/console-web/examples/projects/update.md b/docs/examples/0.7.0/console-web/examples/projects/update.md new file mode 100644 index 0000000000..9d06850534 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/projects/update.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.projects.update('[PROJECT_ID]', '[NAME]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/storage/create-file.md b/docs/examples/0.7.0/console-web/examples/storage/create-file.md new file mode 100644 index 0000000000..673777e380 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/storage/create-file.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.storage.createFile(document.getElementById('uploader').files[0], [], []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/storage/delete-file.md b/docs/examples/0.7.0/console-web/examples/storage/delete-file.md new file mode 100644 index 0000000000..7278b682ae --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/storage/delete-file.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.storage.deleteFile('[FILE_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/storage/get-file-download.md b/docs/examples/0.7.0/console-web/examples/storage/get-file-download.md new file mode 100644 index 0000000000..0a4677fe80 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/storage/get-file-download.md @@ -0,0 +1,11 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let result = sdk.storage.getFileDownload('[FILE_ID]'); + +console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/storage/get-file-preview.md b/docs/examples/0.7.0/console-web/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..a44cb6479c --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/storage/get-file-preview.md @@ -0,0 +1,11 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let result = sdk.storage.getFilePreview('[FILE_ID]'); + +console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/storage/get-file-view.md b/docs/examples/0.7.0/console-web/examples/storage/get-file-view.md new file mode 100644 index 0000000000..adfb6320c3 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/storage/get-file-view.md @@ -0,0 +1,11 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let result = sdk.storage.getFileView('[FILE_ID]'); + +console.log(result); // Resource URL \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/storage/get-file.md b/docs/examples/0.7.0/console-web/examples/storage/get-file.md new file mode 100644 index 0000000000..9691be3056 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/storage/get-file.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.storage.getFile('[FILE_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/storage/list-files.md b/docs/examples/0.7.0/console-web/examples/storage/list-files.md new file mode 100644 index 0000000000..5c2560d06d --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/storage/list-files.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.storage.listFiles(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/storage/update-file.md b/docs/examples/0.7.0/console-web/examples/storage/update-file.md new file mode 100644 index 0000000000..c053d60470 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/storage/update-file.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.storage.updateFile('[FILE_ID]', [], []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/teams/create-membership.md b/docs/examples/0.7.0/console-web/examples/teams/create-membership.md new file mode 100644 index 0000000000..534577ead3 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/teams/create-membership.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.teams.createMembership('[TEAM_ID]', 'email@example.com', [], 'https://example.com'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/teams/create.md b/docs/examples/0.7.0/console-web/examples/teams/create.md new file mode 100644 index 0000000000..6f7232b9c5 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/teams/create.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.teams.create('[NAME]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/teams/delete-membership.md b/docs/examples/0.7.0/console-web/examples/teams/delete-membership.md new file mode 100644 index 0000000000..fa1efe401b --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/teams/delete-membership.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.teams.deleteMembership('[TEAM_ID]', '[INVITE_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/teams/delete.md b/docs/examples/0.7.0/console-web/examples/teams/delete.md new file mode 100644 index 0000000000..cacad26c02 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/teams/delete.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.teams.delete('[TEAM_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/teams/get-memberships.md b/docs/examples/0.7.0/console-web/examples/teams/get-memberships.md new file mode 100644 index 0000000000..e1b959d1eb --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/teams/get-memberships.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.teams.getMemberships('[TEAM_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/teams/get.md b/docs/examples/0.7.0/console-web/examples/teams/get.md new file mode 100644 index 0000000000..a8496ad76d --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/teams/get.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.teams.get('[TEAM_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/teams/list.md b/docs/examples/0.7.0/console-web/examples/teams/list.md new file mode 100644 index 0000000000..b94d6c32ff --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/teams/list.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.teams.list(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/teams/update-membership-status.md b/docs/examples/0.7.0/console-web/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..4931f02689 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/teams/update-membership-status.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.teams.updateMembershipStatus('[TEAM_ID]', '[INVITE_ID]', '[USER_ID]', '[SECRET]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/teams/update.md b/docs/examples/0.7.0/console-web/examples/teams/update.md new file mode 100644 index 0000000000..5b73121518 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/teams/update.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.teams.update('[TEAM_ID]', '[NAME]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/users/create.md b/docs/examples/0.7.0/console-web/examples/users/create.md new file mode 100644 index 0000000000..9adc060ff5 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/users/create.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.users.create('email@example.com', 'password'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/users/delete-session.md b/docs/examples/0.7.0/console-web/examples/users/delete-session.md new file mode 100644 index 0000000000..96a9b5c94f --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/users/delete-session.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.users.deleteSession('[USER_ID]', '[SESSION_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/users/delete-sessions.md b/docs/examples/0.7.0/console-web/examples/users/delete-sessions.md new file mode 100644 index 0000000000..56092ab5fc --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/users/delete-sessions.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.users.deleteSessions('[USER_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/users/delete-user.md b/docs/examples/0.7.0/console-web/examples/users/delete-user.md similarity index 100% rename from app/sdks/console-web/docs/examples/users/delete-user.md rename to docs/examples/0.7.0/console-web/examples/users/delete-user.md diff --git a/docs/examples/0.7.0/console-web/examples/users/get-logs.md b/docs/examples/0.7.0/console-web/examples/users/get-logs.md new file mode 100644 index 0000000000..c349383ec1 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/users/get-logs.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.users.getLogs('[USER_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/users/get-prefs.md b/docs/examples/0.7.0/console-web/examples/users/get-prefs.md new file mode 100644 index 0000000000..7d8a3cd33f --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/users/get-prefs.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.users.getPrefs('[USER_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/users/get-sessions.md b/docs/examples/0.7.0/console-web/examples/users/get-sessions.md new file mode 100644 index 0000000000..1b7535855e --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/users/get-sessions.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.users.getSessions('[USER_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/users/get.md b/docs/examples/0.7.0/console-web/examples/users/get.md new file mode 100644 index 0000000000..751798de39 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/users/get.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.users.get('[USER_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/users/list.md b/docs/examples/0.7.0/console-web/examples/users/list.md new file mode 100644 index 0000000000..bbc4895412 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/users/list.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.users.list(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/users/update-prefs.md b/docs/examples/0.7.0/console-web/examples/users/update-prefs.md new file mode 100644 index 0000000000..877aa309a1 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/users/update-prefs.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.users.updatePrefs('[USER_ID]', {}); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/console-web/examples/users/update-status.md b/docs/examples/0.7.0/console-web/examples/users/update-status.md new file mode 100644 index 0000000000..6c432ff4c6 --- /dev/null +++ b/docs/examples/0.7.0/console-web/examples/users/update-status.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.users.updateStatus('[USER_ID]', '1'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/avatars/get-browser.md b/docs/examples/0.7.0/server-deno/examples/avatars/get-browser.md new file mode 100644 index 0000000000..27c0336054 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/avatars/get-browser.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let avatars = new sdk.Avatars(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = avatars.getBrowser('aa'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/avatars/get-credit-card.md b/docs/examples/0.7.0/server-deno/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..998356a106 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/avatars/get-credit-card.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let avatars = new sdk.Avatars(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = avatars.getCreditCard('amex'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/avatars/get-favicon.md b/docs/examples/0.7.0/server-deno/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..43afe096c4 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/avatars/get-favicon.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let avatars = new sdk.Avatars(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = avatars.getFavicon('https://example.com'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/avatars/get-flag.md b/docs/examples/0.7.0/server-deno/examples/avatars/get-flag.md new file mode 100644 index 0000000000..6b28e5db2f --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/avatars/get-flag.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let avatars = new sdk.Avatars(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = avatars.getFlag('af'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/avatars/get-image.md b/docs/examples/0.7.0/server-deno/examples/avatars/get-image.md new file mode 100644 index 0000000000..0a2693c768 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/avatars/get-image.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let avatars = new sdk.Avatars(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = avatars.getImage('https://example.com'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/avatars/get-initials.md b/docs/examples/0.7.0/server-deno/examples/avatars/get-initials.md new file mode 100644 index 0000000000..af35445bb3 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/avatars/get-initials.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let avatars = new sdk.Avatars(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = avatars.getInitials(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/avatars/get-q-r.md b/docs/examples/0.7.0/server-deno/examples/avatars/get-q-r.md new file mode 100644 index 0000000000..6d8446b105 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/avatars/get-q-r.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let avatars = new sdk.Avatars(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = avatars.getQR('[TEXT]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/database/create-collection.md b/docs/examples/0.7.0/server-deno/examples/database/create-collection.md new file mode 100644 index 0000000000..316ae6b222 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/database/create-collection.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let database = new sdk.Database(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = database.createCollection('[NAME]', [], [], []); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/database/create-document.md b/docs/examples/0.7.0/server-deno/examples/database/create-document.md new file mode 100644 index 0000000000..ef78a839a4 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/database/create-document.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let database = new sdk.Database(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = database.createDocument('[COLLECTION_ID]', {}, [], []); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-deno/docs/examples/database/get-collection-logs.md b/docs/examples/0.7.0/server-deno/examples/database/delete-collection.md similarity index 86% rename from app/sdks/server-deno/docs/examples/database/get-collection-logs.md rename to docs/examples/0.7.0/server-deno/examples/database/delete-collection.md index a72c17bc16..e9b5d6392b 100644 --- a/app/sdks/server-deno/docs/examples/database/get-collection-logs.md +++ b/docs/examples/0.7.0/server-deno/examples/database/delete-collection.md @@ -11,7 +11,7 @@ client ; -let promise = database.getCollectionLogs('[COLLECTION_ID]'); +let promise = database.deleteCollection('[COLLECTION_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.7.0/server-deno/examples/database/delete-document.md b/docs/examples/0.7.0/server-deno/examples/database/delete-document.md new file mode 100644 index 0000000000..b7d3f52c71 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/database/delete-document.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let database = new sdk.Database(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = database.deleteDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/database/get-collection.md b/docs/examples/0.7.0/server-deno/examples/database/get-collection.md new file mode 100644 index 0000000000..323bc7ec74 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/database/get-collection.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let database = new sdk.Database(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = database.getCollection('[COLLECTION_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/database/get-document.md b/docs/examples/0.7.0/server-deno/examples/database/get-document.md new file mode 100644 index 0000000000..7a0332251a --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/database/get-document.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let database = new sdk.Database(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = database.getDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/database/list-collections.md b/docs/examples/0.7.0/server-deno/examples/database/list-collections.md new file mode 100644 index 0000000000..292e46f860 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/database/list-collections.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let database = new sdk.Database(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = database.listCollections(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/database/list-documents.md b/docs/examples/0.7.0/server-deno/examples/database/list-documents.md new file mode 100644 index 0000000000..bb22a3956a --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/database/list-documents.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let database = new sdk.Database(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = database.listDocuments('[COLLECTION_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/database/update-collection.md b/docs/examples/0.7.0/server-deno/examples/database/update-collection.md new file mode 100644 index 0000000000..8239e45f28 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/database/update-collection.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let database = new sdk.Database(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = database.updateCollection('[COLLECTION_ID]', '[NAME]', [], []); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/database/update-document.md b/docs/examples/0.7.0/server-deno/examples/database/update-document.md new file mode 100644 index 0000000000..cd079c8f2d --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/database/update-document.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let database = new sdk.Database(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = database.updateDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', {}, [], []); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/functions/create-execution.md b/docs/examples/0.7.0/server-deno/examples/functions/create-execution.md similarity index 86% rename from app/sdks/server-nodejs/docs/examples/functions/create-execution.md rename to docs/examples/0.7.0/server-deno/examples/functions/create-execution.md index 9ed33ae50b..8ba9844d64 100644 --- a/app/sdks/server-nodejs/docs/examples/functions/create-execution.md +++ b/docs/examples/0.7.0/server-deno/examples/functions/create-execution.md @@ -1,4 +1,4 @@ -const sdk = require('node-appwrite'); +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); @@ -10,6 +10,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; + let promise = functions.createExecution('[FUNCTION_ID]'); promise.then(function (response) { diff --git a/docs/examples/0.7.0/server-deno/examples/functions/create-tag.md b/docs/examples/0.7.0/server-deno/examples/functions/create-tag.md new file mode 100644 index 0000000000..7fcaaa8725 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/functions/create-tag.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = functions.createTag('[FUNCTION_ID]', '[COMMAND]', new File([fileBlob], 'file.png')); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/functions/create.md b/docs/examples/0.7.0/server-deno/examples/functions/create.md new file mode 100644 index 0000000000..95a0760ec0 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/functions/create.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = functions.create('[NAME]', 'node-14'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/functions/delete-tag.md b/docs/examples/0.7.0/server-deno/examples/functions/delete-tag.md similarity index 86% rename from app/sdks/server-nodejs/docs/examples/functions/delete-tag.md rename to docs/examples/0.7.0/server-deno/examples/functions/delete-tag.md index fc2fe8a53b..da50cdd77f 100644 --- a/app/sdks/server-nodejs/docs/examples/functions/delete-tag.md +++ b/docs/examples/0.7.0/server-deno/examples/functions/delete-tag.md @@ -1,4 +1,4 @@ -const sdk = require('node-appwrite'); +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); @@ -10,6 +10,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; + let promise = functions.deleteTag('[FUNCTION_ID]', '[TAG_ID]'); promise.then(function (response) { diff --git a/app/sdks/server-nodejs/docs/examples/functions/delete.md b/docs/examples/0.7.0/server-deno/examples/functions/delete.md similarity index 86% rename from app/sdks/server-nodejs/docs/examples/functions/delete.md rename to docs/examples/0.7.0/server-deno/examples/functions/delete.md index 048c96d99c..f987765b93 100644 --- a/app/sdks/server-nodejs/docs/examples/functions/delete.md +++ b/docs/examples/0.7.0/server-deno/examples/functions/delete.md @@ -1,4 +1,4 @@ -const sdk = require('node-appwrite'); +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); @@ -10,6 +10,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; + let promise = functions.delete('[FUNCTION_ID]'); promise.then(function (response) { diff --git a/app/sdks/server-nodejs/docs/examples/functions/get-execution.md b/docs/examples/0.7.0/server-deno/examples/functions/get-execution.md similarity index 86% rename from app/sdks/server-nodejs/docs/examples/functions/get-execution.md rename to docs/examples/0.7.0/server-deno/examples/functions/get-execution.md index 482f7ee713..49ed2abe8d 100644 --- a/app/sdks/server-nodejs/docs/examples/functions/get-execution.md +++ b/docs/examples/0.7.0/server-deno/examples/functions/get-execution.md @@ -1,4 +1,4 @@ -const sdk = require('node-appwrite'); +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); @@ -10,6 +10,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; + let promise = functions.getExecution('[FUNCTION_ID]', '[EXECUTION_ID]'); promise.then(function (response) { diff --git a/app/sdks/server-nodejs/docs/examples/functions/get-tag.md b/docs/examples/0.7.0/server-deno/examples/functions/get-tag.md similarity index 86% rename from app/sdks/server-nodejs/docs/examples/functions/get-tag.md rename to docs/examples/0.7.0/server-deno/examples/functions/get-tag.md index 5caa2134b6..8d267eabf2 100644 --- a/app/sdks/server-nodejs/docs/examples/functions/get-tag.md +++ b/docs/examples/0.7.0/server-deno/examples/functions/get-tag.md @@ -1,4 +1,4 @@ -const sdk = require('node-appwrite'); +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); @@ -10,6 +10,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; + let promise = functions.getTag('[FUNCTION_ID]', '[TAG_ID]'); promise.then(function (response) { diff --git a/app/sdks/server-nodejs/docs/examples/functions/get.md b/docs/examples/0.7.0/server-deno/examples/functions/get.md similarity index 86% rename from app/sdks/server-nodejs/docs/examples/functions/get.md rename to docs/examples/0.7.0/server-deno/examples/functions/get.md index cfc2d0fae2..0be5a98de8 100644 --- a/app/sdks/server-nodejs/docs/examples/functions/get.md +++ b/docs/examples/0.7.0/server-deno/examples/functions/get.md @@ -1,4 +1,4 @@ -const sdk = require('node-appwrite'); +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); @@ -10,6 +10,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; + let promise = functions.get('[FUNCTION_ID]'); promise.then(function (response) { diff --git a/app/sdks/server-nodejs/docs/examples/functions/list-executions.md b/docs/examples/0.7.0/server-deno/examples/functions/list-executions.md similarity index 86% rename from app/sdks/server-nodejs/docs/examples/functions/list-executions.md rename to docs/examples/0.7.0/server-deno/examples/functions/list-executions.md index ceecf677a6..862e81f01e 100644 --- a/app/sdks/server-nodejs/docs/examples/functions/list-executions.md +++ b/docs/examples/0.7.0/server-deno/examples/functions/list-executions.md @@ -1,4 +1,4 @@ -const sdk = require('node-appwrite'); +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); @@ -10,6 +10,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; + let promise = functions.listExecutions('[FUNCTION_ID]'); promise.then(function (response) { diff --git a/app/sdks/server-nodejs/docs/examples/functions/list-tags.md b/docs/examples/0.7.0/server-deno/examples/functions/list-tags.md similarity index 86% rename from app/sdks/server-nodejs/docs/examples/functions/list-tags.md rename to docs/examples/0.7.0/server-deno/examples/functions/list-tags.md index 147d65afe2..5ca2da7b61 100644 --- a/app/sdks/server-nodejs/docs/examples/functions/list-tags.md +++ b/docs/examples/0.7.0/server-deno/examples/functions/list-tags.md @@ -1,4 +1,4 @@ -const sdk = require('node-appwrite'); +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); @@ -10,6 +10,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; + let promise = functions.listTags('[FUNCTION_ID]'); promise.then(function (response) { diff --git a/app/sdks/server-nodejs/docs/examples/functions/list.md b/docs/examples/0.7.0/server-deno/examples/functions/list.md similarity index 85% rename from app/sdks/server-nodejs/docs/examples/functions/list.md rename to docs/examples/0.7.0/server-deno/examples/functions/list.md index 3cb999c51b..43e0201e82 100644 --- a/app/sdks/server-nodejs/docs/examples/functions/list.md +++ b/docs/examples/0.7.0/server-deno/examples/functions/list.md @@ -1,4 +1,4 @@ -const sdk = require('node-appwrite'); +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); @@ -10,6 +10,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; + let promise = functions.list(); promise.then(function (response) { diff --git a/app/sdks/server-nodejs/docs/examples/functions/update-tag.md b/docs/examples/0.7.0/server-deno/examples/functions/update-tag.md similarity index 86% rename from app/sdks/server-nodejs/docs/examples/functions/update-tag.md rename to docs/examples/0.7.0/server-deno/examples/functions/update-tag.md index 8b9baefaf0..cfa961cb25 100644 --- a/app/sdks/server-nodejs/docs/examples/functions/update-tag.md +++ b/docs/examples/0.7.0/server-deno/examples/functions/update-tag.md @@ -1,4 +1,4 @@ -const sdk = require('node-appwrite'); +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); @@ -10,6 +10,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; + let promise = functions.updateTag('[FUNCTION_ID]', '[TAG]'); promise.then(function (response) { diff --git a/app/sdks/server-nodejs/docs/examples/functions/update.md b/docs/examples/0.7.0/server-deno/examples/functions/update.md similarity index 86% rename from app/sdks/server-nodejs/docs/examples/functions/update.md rename to docs/examples/0.7.0/server-deno/examples/functions/update.md index 73672ae162..579b6b7d21 100644 --- a/app/sdks/server-nodejs/docs/examples/functions/update.md +++ b/docs/examples/0.7.0/server-deno/examples/functions/update.md @@ -1,4 +1,4 @@ -const sdk = require('node-appwrite'); +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); @@ -10,6 +10,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; + let promise = functions.update('[FUNCTION_ID]', '[NAME]'); promise.then(function (response) { diff --git a/docs/examples/0.7.0/server-deno/examples/health/get-anti-virus.md b/docs/examples/0.7.0/server-deno/examples/health/get-anti-virus.md new file mode 100644 index 0000000000..e06fbf86de --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/health/get-anti-virus.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = health.getAntiVirus(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/health/get-cache.md b/docs/examples/0.7.0/server-deno/examples/health/get-cache.md new file mode 100644 index 0000000000..b58ca1bc15 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/health/get-cache.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = health.getCache(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/health/get-d-b.md b/docs/examples/0.7.0/server-deno/examples/health/get-d-b.md new file mode 100644 index 0000000000..946cfb03a8 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/health/get-d-b.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = health.getDB(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/health/get-queue-certificates.md b/docs/examples/0.7.0/server-deno/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..a86358bb22 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/health/get-queue-certificates.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = health.getQueueCertificates(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/health/get-queue-functions.md b/docs/examples/0.7.0/server-deno/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..033248b118 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/health/get-queue-functions.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = health.getQueueFunctions(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/health/get-queue-logs.md b/docs/examples/0.7.0/server-deno/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..d4c3300a35 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/health/get-queue-logs.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = health.getQueueLogs(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/health/get-queue-tasks.md b/docs/examples/0.7.0/server-deno/examples/health/get-queue-tasks.md new file mode 100644 index 0000000000..01e3094ffc --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/health/get-queue-tasks.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = health.getQueueTasks(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/health/get-queue-usage.md b/docs/examples/0.7.0/server-deno/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..d0d8faf7b6 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/health/get-queue-usage.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = health.getQueueUsage(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/health/get-queue-webhooks.md b/docs/examples/0.7.0/server-deno/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..268c521373 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/health/get-queue-webhooks.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = health.getQueueWebhooks(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/health/get-storage-local.md b/docs/examples/0.7.0/server-deno/examples/health/get-storage-local.md new file mode 100644 index 0000000000..77bb658f9a --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/health/get-storage-local.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = health.getStorageLocal(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/health/get-time.md b/docs/examples/0.7.0/server-deno/examples/health/get-time.md new file mode 100644 index 0000000000..0e5205b075 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/health/get-time.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = health.getTime(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/health/get.md b/docs/examples/0.7.0/server-deno/examples/health/get.md new file mode 100644 index 0000000000..c2e6ecdf65 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/health/get.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = health.get(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/locale/get-continents.md b/docs/examples/0.7.0/server-deno/examples/locale/get-continents.md new file mode 100644 index 0000000000..18221d44b4 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/locale/get-continents.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let locale = new sdk.Locale(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = locale.getContinents(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/locale/get-countries-e-u.md b/docs/examples/0.7.0/server-deno/examples/locale/get-countries-e-u.md new file mode 100644 index 0000000000..4a3e49f755 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/locale/get-countries-e-u.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let locale = new sdk.Locale(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = locale.getCountriesEU(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/locale/get-countries-phones.md b/docs/examples/0.7.0/server-deno/examples/locale/get-countries-phones.md new file mode 100644 index 0000000000..61a1790806 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/locale/get-countries-phones.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let locale = new sdk.Locale(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = locale.getCountriesPhones(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/locale/get-countries.md b/docs/examples/0.7.0/server-deno/examples/locale/get-countries.md new file mode 100644 index 0000000000..20f544e617 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/locale/get-countries.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let locale = new sdk.Locale(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = locale.getCountries(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/locale/get-currencies.md b/docs/examples/0.7.0/server-deno/examples/locale/get-currencies.md new file mode 100644 index 0000000000..13b975291d --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/locale/get-currencies.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let locale = new sdk.Locale(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = locale.getCurrencies(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/locale/get-languages.md b/docs/examples/0.7.0/server-deno/examples/locale/get-languages.md new file mode 100644 index 0000000000..95c5c6b355 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/locale/get-languages.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let locale = new sdk.Locale(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = locale.getLanguages(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/locale/get.md b/docs/examples/0.7.0/server-deno/examples/locale/get.md new file mode 100644 index 0000000000..2336c3289d --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/locale/get.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let locale = new sdk.Locale(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = locale.get(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/storage/create-file.md b/docs/examples/0.7.0/server-deno/examples/storage/create-file.md new file mode 100644 index 0000000000..5b446e1a38 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/storage/create-file.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let storage = new sdk.Storage(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = storage.createFile(new File([fileBlob], 'file.png'), [], []); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/storage/delete-file.md b/docs/examples/0.7.0/server-deno/examples/storage/delete-file.md new file mode 100644 index 0000000000..6469308c74 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/storage/delete-file.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let storage = new sdk.Storage(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = storage.deleteFile('[FILE_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/storage/get-file-download.md b/docs/examples/0.7.0/server-deno/examples/storage/get-file-download.md new file mode 100644 index 0000000000..4510257bad --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/storage/get-file-download.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let storage = new sdk.Storage(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = storage.getFileDownload('[FILE_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/storage/get-file-preview.md b/docs/examples/0.7.0/server-deno/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..282fb30324 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/storage/get-file-preview.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let storage = new sdk.Storage(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = storage.getFilePreview('[FILE_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/storage/get-file-view.md b/docs/examples/0.7.0/server-deno/examples/storage/get-file-view.md new file mode 100644 index 0000000000..8af5391017 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/storage/get-file-view.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let storage = new sdk.Storage(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = storage.getFileView('[FILE_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/storage/get-file.md b/docs/examples/0.7.0/server-deno/examples/storage/get-file.md new file mode 100644 index 0000000000..393ce229cb --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/storage/get-file.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let storage = new sdk.Storage(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = storage.getFile('[FILE_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/storage/list-files.md b/docs/examples/0.7.0/server-deno/examples/storage/list-files.md new file mode 100644 index 0000000000..0e57cd01de --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/storage/list-files.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let storage = new sdk.Storage(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = storage.listFiles(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/storage/update-file.md b/docs/examples/0.7.0/server-deno/examples/storage/update-file.md new file mode 100644 index 0000000000..33b2263540 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/storage/update-file.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let storage = new sdk.Storage(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = storage.updateFile('[FILE_ID]', [], []); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/teams/create-membership.md b/docs/examples/0.7.0/server-deno/examples/teams/create-membership.md new file mode 100644 index 0000000000..b277899c91 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/teams/create-membership.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let teams = new sdk.Teams(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = teams.createMembership('[TEAM_ID]', 'email@example.com', [], 'https://example.com'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/teams/create.md b/docs/examples/0.7.0/server-deno/examples/teams/create.md new file mode 100644 index 0000000000..1ef3e01b81 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/teams/create.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let teams = new sdk.Teams(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = teams.create('[NAME]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/teams/delete-membership.md b/docs/examples/0.7.0/server-deno/examples/teams/delete-membership.md new file mode 100644 index 0000000000..911fa30075 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/teams/delete-membership.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let teams = new sdk.Teams(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = teams.deleteMembership('[TEAM_ID]', '[INVITE_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/teams/delete.md b/docs/examples/0.7.0/server-deno/examples/teams/delete.md new file mode 100644 index 0000000000..61ac03483f --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/teams/delete.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let teams = new sdk.Teams(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = teams.delete('[TEAM_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/teams/get-memberships.md b/docs/examples/0.7.0/server-deno/examples/teams/get-memberships.md new file mode 100644 index 0000000000..b652f8e4e5 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/teams/get-memberships.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let teams = new sdk.Teams(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = teams.getMemberships('[TEAM_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/teams/get.md b/docs/examples/0.7.0/server-deno/examples/teams/get.md new file mode 100644 index 0000000000..69496e3eef --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/teams/get.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let teams = new sdk.Teams(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = teams.get('[TEAM_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/teams/list.md b/docs/examples/0.7.0/server-deno/examples/teams/list.md new file mode 100644 index 0000000000..70851dda51 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/teams/list.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let teams = new sdk.Teams(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = teams.list(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/teams/update.md b/docs/examples/0.7.0/server-deno/examples/teams/update.md new file mode 100644 index 0000000000..7b815b4050 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/teams/update.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let teams = new sdk.Teams(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = teams.update('[TEAM_ID]', '[NAME]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/users/create.md b/docs/examples/0.7.0/server-deno/examples/users/create.md new file mode 100644 index 0000000000..593eee6e9f --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/users/create.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = users.create('email@example.com', 'password'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/users/delete-session.md b/docs/examples/0.7.0/server-deno/examples/users/delete-session.md new file mode 100644 index 0000000000..e4940773e4 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/users/delete-session.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = users.deleteSession('[USER_ID]', '[SESSION_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/users/delete-sessions.md b/docs/examples/0.7.0/server-deno/examples/users/delete-sessions.md new file mode 100644 index 0000000000..e772c00a5f --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/users/delete-sessions.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = users.deleteSessions('[USER_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/users/delete-user.md b/docs/examples/0.7.0/server-deno/examples/users/delete-user.md new file mode 100644 index 0000000000..657cf61bcb --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/users/delete-user.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = users.deleteUser('[USER_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/users/get-logs.md b/docs/examples/0.7.0/server-deno/examples/users/get-logs.md new file mode 100644 index 0000000000..58cc4fc529 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/users/get-logs.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = users.getLogs('[USER_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/users/get-prefs.md b/docs/examples/0.7.0/server-deno/examples/users/get-prefs.md new file mode 100644 index 0000000000..4cda0bb73e --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/users/get-prefs.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = users.getPrefs('[USER_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/users/get-sessions.md b/docs/examples/0.7.0/server-deno/examples/users/get-sessions.md new file mode 100644 index 0000000000..6686e21564 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/users/get-sessions.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = users.getSessions('[USER_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/users/get.md b/docs/examples/0.7.0/server-deno/examples/users/get.md new file mode 100644 index 0000000000..dce73d62c5 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/users/get.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = users.get('[USER_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/users/list.md b/docs/examples/0.7.0/server-deno/examples/users/list.md new file mode 100644 index 0000000000..b089c3e7e9 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/users/list.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = users.list(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/users/update-prefs.md b/docs/examples/0.7.0/server-deno/examples/users/update-prefs.md new file mode 100644 index 0000000000..b06185ee91 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/users/update-prefs.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = users.updatePrefs('[USER_ID]', {}); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-deno/examples/users/update-status.md b/docs/examples/0.7.0/server-deno/examples/users/update-status.md new file mode 100644 index 0000000000..a0f028bde5 --- /dev/null +++ b/docs/examples/0.7.0/server-deno/examples/users/update-status.md @@ -0,0 +1,20 @@ +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + + +let promise = users.updateStatus('[USER_ID]', '1'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/avatars/get-browser.md b/docs/examples/0.7.0/server-nodejs/examples/avatars/get-browser.md new file mode 100644 index 0000000000..2a670ce08b --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/avatars/get-browser.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let avatars = new sdk.Avatars(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = avatars.getBrowser('aa'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/avatars/get-credit-card.md b/docs/examples/0.7.0/server-nodejs/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..afd38f5a97 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/avatars/get-credit-card.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let avatars = new sdk.Avatars(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = avatars.getCreditCard('amex'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/avatars/get-favicon.md b/docs/examples/0.7.0/server-nodejs/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..bb347371d4 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/avatars/get-favicon.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let avatars = new sdk.Avatars(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = avatars.getFavicon('https://example.com'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/avatars/get-flag.md b/docs/examples/0.7.0/server-nodejs/examples/avatars/get-flag.md new file mode 100644 index 0000000000..db677bc4f8 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/avatars/get-flag.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let avatars = new sdk.Avatars(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = avatars.getFlag('af'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/avatars/get-image.md b/docs/examples/0.7.0/server-nodejs/examples/avatars/get-image.md new file mode 100644 index 0000000000..efa871ea63 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/avatars/get-image.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let avatars = new sdk.Avatars(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = avatars.getImage('https://example.com'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/avatars/get-initials.md b/docs/examples/0.7.0/server-nodejs/examples/avatars/get-initials.md new file mode 100644 index 0000000000..d6175bff13 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/avatars/get-initials.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let avatars = new sdk.Avatars(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = avatars.getInitials(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/avatars/get-q-r.md b/docs/examples/0.7.0/server-nodejs/examples/avatars/get-q-r.md new file mode 100644 index 0000000000..e79b3235af --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/avatars/get-q-r.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let avatars = new sdk.Avatars(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = avatars.getQR('[TEXT]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/database/create-collection.md b/docs/examples/0.7.0/server-nodejs/examples/database/create-collection.md new file mode 100644 index 0000000000..c0207f30f0 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/database/create-collection.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let database = new sdk.Database(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = database.createCollection('[NAME]', [], [], []); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/database/create-document.md b/docs/examples/0.7.0/server-nodejs/examples/database/create-document.md new file mode 100644 index 0000000000..8676dfb84d --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/database/create-document.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let database = new sdk.Database(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = database.createDocument('[COLLECTION_ID]', {}, [], []); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/database/get-collection-logs.md b/docs/examples/0.7.0/server-nodejs/examples/database/delete-collection.md similarity index 87% rename from app/sdks/server-nodejs/docs/examples/database/get-collection-logs.md rename to docs/examples/0.7.0/server-nodejs/examples/database/delete-collection.md index 5bc911624b..503da98a73 100644 --- a/app/sdks/server-nodejs/docs/examples/database/get-collection-logs.md +++ b/docs/examples/0.7.0/server-nodejs/examples/database/delete-collection.md @@ -11,7 +11,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = database.getCollectionLogs('[COLLECTION_ID]'); +let promise = database.deleteCollection('[COLLECTION_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.7.0/server-nodejs/examples/database/delete-document.md b/docs/examples/0.7.0/server-nodejs/examples/database/delete-document.md new file mode 100644 index 0000000000..f14c985e83 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/database/delete-document.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let database = new sdk.Database(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = database.deleteDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/database/get-collection.md b/docs/examples/0.7.0/server-nodejs/examples/database/get-collection.md new file mode 100644 index 0000000000..a14ce0d49a --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/database/get-collection.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let database = new sdk.Database(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = database.getCollection('[COLLECTION_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/database/get-document.md b/docs/examples/0.7.0/server-nodejs/examples/database/get-document.md new file mode 100644 index 0000000000..55cce32b9b --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/database/get-document.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let database = new sdk.Database(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = database.getDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/database/list-collections.md b/docs/examples/0.7.0/server-nodejs/examples/database/list-collections.md new file mode 100644 index 0000000000..bacfdb062c --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/database/list-collections.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let database = new sdk.Database(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = database.listCollections(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/database/list-documents.md b/docs/examples/0.7.0/server-nodejs/examples/database/list-documents.md new file mode 100644 index 0000000000..ad02d05e2a --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/database/list-documents.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let database = new sdk.Database(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = database.listDocuments('[COLLECTION_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/database/update-collection.md b/docs/examples/0.7.0/server-nodejs/examples/database/update-collection.md new file mode 100644 index 0000000000..eb9326565a --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/database/update-collection.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let database = new sdk.Database(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = database.updateCollection('[COLLECTION_ID]', '[NAME]', [], []); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/database/update-document.md b/docs/examples/0.7.0/server-nodejs/examples/database/update-document.md new file mode 100644 index 0000000000..131722cd26 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/database/update-document.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let database = new sdk.Database(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = database.updateDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', {}, [], []); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/functions/create-execution.md b/docs/examples/0.7.0/server-nodejs/examples/functions/create-execution.md new file mode 100644 index 0000000000..895b70cd1b --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/functions/create-execution.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.createExecution('[FUNCTION_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/functions/create-tag.md b/docs/examples/0.7.0/server-nodejs/examples/functions/create-tag.md new file mode 100644 index 0000000000..7949790f16 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/functions/create-tag.md @@ -0,0 +1,21 @@ +const sdk = require('node-appwrite'); +const fs = require('fs'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.createTag('[FUNCTION_ID]', '[COMMAND]', fs.createReadStream(__dirname + '/file.png'))); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/functions/create.md b/docs/examples/0.7.0/server-nodejs/examples/functions/create.md new file mode 100644 index 0000000000..1e1a255bc2 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/functions/create.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.create('[NAME]', 'node-14'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/functions/delete-tag.md b/docs/examples/0.7.0/server-nodejs/examples/functions/delete-tag.md new file mode 100644 index 0000000000..938bb5cc19 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/functions/delete-tag.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.deleteTag('[FUNCTION_ID]', '[TAG_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/functions/create-tag.md b/docs/examples/0.7.0/server-nodejs/examples/functions/delete.md similarity index 75% rename from app/sdks/server-nodejs/docs/examples/functions/create-tag.md rename to docs/examples/0.7.0/server-nodejs/examples/functions/delete.md index 5048701d05..6f079cb7f7 100644 --- a/app/sdks/server-nodejs/docs/examples/functions/create-tag.md +++ b/docs/examples/0.7.0/server-nodejs/examples/functions/delete.md @@ -6,11 +6,12 @@ let client = new sdk.Client(); let functions = new sdk.Functions(client); client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = functions.createTag('[FUNCTION_ID]', 'node-14', '[COMMAND]', '[CODE]'); +let promise = functions.delete('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.7.0/server-nodejs/examples/functions/get-execution.md b/docs/examples/0.7.0/server-nodejs/examples/functions/get-execution.md new file mode 100644 index 0000000000..1e2f5ea88a --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/functions/get-execution.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.getExecution('[FUNCTION_ID]', '[EXECUTION_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/functions/get-tag.md b/docs/examples/0.7.0/server-nodejs/examples/functions/get-tag.md new file mode 100644 index 0000000000..a016699a11 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/functions/get-tag.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.getTag('[FUNCTION_ID]', '[TAG_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/functions/get.md b/docs/examples/0.7.0/server-nodejs/examples/functions/get.md new file mode 100644 index 0000000000..620deec88c --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/functions/get.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.get('[FUNCTION_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/functions/list-executions.md b/docs/examples/0.7.0/server-nodejs/examples/functions/list-executions.md new file mode 100644 index 0000000000..40c44b12e5 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/functions/list-executions.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.listExecutions('[FUNCTION_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/functions/list-tags.md b/docs/examples/0.7.0/server-nodejs/examples/functions/list-tags.md new file mode 100644 index 0000000000..c9c043a8b4 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/functions/list-tags.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.listTags('[FUNCTION_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/functions/create.md b/docs/examples/0.7.0/server-nodejs/examples/functions/list.md similarity index 78% rename from app/sdks/server-nodejs/docs/examples/functions/create.md rename to docs/examples/0.7.0/server-nodejs/examples/functions/list.md index 3ac02eb506..9ecd37237d 100644 --- a/app/sdks/server-nodejs/docs/examples/functions/create.md +++ b/docs/examples/0.7.0/server-nodejs/examples/functions/list.md @@ -6,11 +6,12 @@ let client = new sdk.Client(); let functions = new sdk.Functions(client); client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = functions.create('[NAME]'); +let promise = functions.list(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.7.0/server-nodejs/examples/functions/update-tag.md b/docs/examples/0.7.0/server-nodejs/examples/functions/update-tag.md new file mode 100644 index 0000000000..0ea180e1d9 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/functions/update-tag.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.updateTag('[FUNCTION_ID]', '[TAG]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/functions/update.md b/docs/examples/0.7.0/server-nodejs/examples/functions/update.md new file mode 100644 index 0000000000..209346ef89 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/functions/update.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.update('[FUNCTION_ID]', '[NAME]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/health/get-anti-virus.md b/docs/examples/0.7.0/server-nodejs/examples/health/get-anti-virus.md new file mode 100644 index 0000000000..c08e612bcf --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/health/get-anti-virus.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = health.getAntiVirus(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/health/get-cache.md b/docs/examples/0.7.0/server-nodejs/examples/health/get-cache.md new file mode 100644 index 0000000000..d19cc8abd5 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/health/get-cache.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = health.getCache(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/health/get-d-b.md b/docs/examples/0.7.0/server-nodejs/examples/health/get-d-b.md new file mode 100644 index 0000000000..08505367d4 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/health/get-d-b.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = health.getDB(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/health/get-queue-certificates.md b/docs/examples/0.7.0/server-nodejs/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..2eb69e0126 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/health/get-queue-certificates.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = health.getQueueCertificates(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/health/get-queue-functions.md b/docs/examples/0.7.0/server-nodejs/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..9470e11646 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/health/get-queue-functions.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = health.getQueueFunctions(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/health/get-queue-logs.md b/docs/examples/0.7.0/server-nodejs/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..10f1cb24e3 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/health/get-queue-logs.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = health.getQueueLogs(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/health/get-queue-tasks.md b/docs/examples/0.7.0/server-nodejs/examples/health/get-queue-tasks.md new file mode 100644 index 0000000000..c159f4e6ee --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/health/get-queue-tasks.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = health.getQueueTasks(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/health/get-queue-usage.md b/docs/examples/0.7.0/server-nodejs/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..6286c741ee --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/health/get-queue-usage.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = health.getQueueUsage(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/health/get-queue-webhooks.md b/docs/examples/0.7.0/server-nodejs/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..3a788eb895 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/health/get-queue-webhooks.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = health.getQueueWebhooks(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/health/get-storage-local.md b/docs/examples/0.7.0/server-nodejs/examples/health/get-storage-local.md new file mode 100644 index 0000000000..84b8fb47a6 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/health/get-storage-local.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = health.getStorageLocal(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/health/get-time.md b/docs/examples/0.7.0/server-nodejs/examples/health/get-time.md new file mode 100644 index 0000000000..563bf2fb52 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/health/get-time.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let health = new sdk.Health(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = health.getTime(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/health/get-storage-anti-virus.md b/docs/examples/0.7.0/server-nodejs/examples/health/get.md similarity index 79% rename from app/sdks/server-nodejs/docs/examples/health/get-storage-anti-virus.md rename to docs/examples/0.7.0/server-nodejs/examples/health/get.md index 70c3850375..20c3d40801 100644 --- a/app/sdks/server-nodejs/docs/examples/health/get-storage-anti-virus.md +++ b/docs/examples/0.7.0/server-nodejs/examples/health/get.md @@ -6,11 +6,12 @@ let client = new sdk.Client(); let health = new sdk.Health(client); client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = health.getStorageAntiVirus(); +let promise = health.get(); promise.then(function (response) { console.log(response); diff --git a/docs/examples/0.7.0/server-nodejs/examples/locale/get-continents.md b/docs/examples/0.7.0/server-nodejs/examples/locale/get-continents.md new file mode 100644 index 0000000000..323237b4ab --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/locale/get-continents.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let locale = new sdk.Locale(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = locale.getContinents(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/locale/get-countries-e-u.md b/docs/examples/0.7.0/server-nodejs/examples/locale/get-countries-e-u.md new file mode 100644 index 0000000000..fc9170dba4 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/locale/get-countries-e-u.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let locale = new sdk.Locale(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = locale.getCountriesEU(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/locale/get-countries-phones.md b/docs/examples/0.7.0/server-nodejs/examples/locale/get-countries-phones.md new file mode 100644 index 0000000000..42be901677 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/locale/get-countries-phones.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let locale = new sdk.Locale(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = locale.getCountriesPhones(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/locale/get-countries.md b/docs/examples/0.7.0/server-nodejs/examples/locale/get-countries.md new file mode 100644 index 0000000000..437c9bb502 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/locale/get-countries.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let locale = new sdk.Locale(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = locale.getCountries(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/locale/get-currencies.md b/docs/examples/0.7.0/server-nodejs/examples/locale/get-currencies.md new file mode 100644 index 0000000000..1b7d605760 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/locale/get-currencies.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let locale = new sdk.Locale(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = locale.getCurrencies(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/locale/get-languages.md b/docs/examples/0.7.0/server-nodejs/examples/locale/get-languages.md new file mode 100644 index 0000000000..b6f45311b3 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/locale/get-languages.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let locale = new sdk.Locale(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = locale.getLanguages(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/locale/get.md b/docs/examples/0.7.0/server-nodejs/examples/locale/get.md new file mode 100644 index 0000000000..2f2eb95d90 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/locale/get.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let locale = new sdk.Locale(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = locale.get(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/storage/create-file.md b/docs/examples/0.7.0/server-nodejs/examples/storage/create-file.md new file mode 100644 index 0000000000..1eda9fd868 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/storage/create-file.md @@ -0,0 +1,21 @@ +const sdk = require('node-appwrite'); +const fs = require('fs'); + +// Init SDK +let client = new sdk.Client(); + +let storage = new sdk.Storage(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = storage.createFile(fs.createReadStream(__dirname + '/file.png')), [], []); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/storage/delete-file.md b/docs/examples/0.7.0/server-nodejs/examples/storage/delete-file.md new file mode 100644 index 0000000000..9ce0ff7f2e --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/storage/delete-file.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let storage = new sdk.Storage(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = storage.deleteFile('[FILE_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/storage/get-file-download.md b/docs/examples/0.7.0/server-nodejs/examples/storage/get-file-download.md new file mode 100644 index 0000000000..1683ed87e0 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/storage/get-file-download.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let storage = new sdk.Storage(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = storage.getFileDownload('[FILE_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/storage/get-file-preview.md b/docs/examples/0.7.0/server-nodejs/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..771dcd35f0 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/storage/get-file-preview.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let storage = new sdk.Storage(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = storage.getFilePreview('[FILE_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/storage/get-file-view.md b/docs/examples/0.7.0/server-nodejs/examples/storage/get-file-view.md new file mode 100644 index 0000000000..83029ecdee --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/storage/get-file-view.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let storage = new sdk.Storage(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = storage.getFileView('[FILE_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/storage/get-file.md b/docs/examples/0.7.0/server-nodejs/examples/storage/get-file.md new file mode 100644 index 0000000000..2a76fdf189 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/storage/get-file.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let storage = new sdk.Storage(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = storage.getFile('[FILE_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/storage/list-files.md b/docs/examples/0.7.0/server-nodejs/examples/storage/list-files.md new file mode 100644 index 0000000000..e11fd95300 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/storage/list-files.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let storage = new sdk.Storage(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = storage.listFiles(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/storage/update-file.md b/docs/examples/0.7.0/server-nodejs/examples/storage/update-file.md new file mode 100644 index 0000000000..4726169146 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/storage/update-file.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let storage = new sdk.Storage(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = storage.updateFile('[FILE_ID]', [], []); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/teams/create-membership.md b/docs/examples/0.7.0/server-nodejs/examples/teams/create-membership.md new file mode 100644 index 0000000000..cd17042e58 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/teams/create-membership.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let teams = new sdk.Teams(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = teams.createMembership('[TEAM_ID]', 'email@example.com', [], 'https://example.com'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/teams/create.md b/docs/examples/0.7.0/server-nodejs/examples/teams/create.md new file mode 100644 index 0000000000..c0d0611a49 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/teams/create.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let teams = new sdk.Teams(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = teams.create('[NAME]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/teams/delete-membership.md b/docs/examples/0.7.0/server-nodejs/examples/teams/delete-membership.md new file mode 100644 index 0000000000..f9a76f3ec0 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/teams/delete-membership.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let teams = new sdk.Teams(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = teams.deleteMembership('[TEAM_ID]', '[INVITE_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/teams/delete.md b/docs/examples/0.7.0/server-nodejs/examples/teams/delete.md new file mode 100644 index 0000000000..e833fdfb9b --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/teams/delete.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let teams = new sdk.Teams(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = teams.delete('[TEAM_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/teams/get-memberships.md b/docs/examples/0.7.0/server-nodejs/examples/teams/get-memberships.md new file mode 100644 index 0000000000..75cdf38e5c --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/teams/get-memberships.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let teams = new sdk.Teams(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = teams.getMemberships('[TEAM_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/teams/get.md b/docs/examples/0.7.0/server-nodejs/examples/teams/get.md new file mode 100644 index 0000000000..a51322df27 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/teams/get.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let teams = new sdk.Teams(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = teams.get('[TEAM_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/teams/list.md b/docs/examples/0.7.0/server-nodejs/examples/teams/list.md new file mode 100644 index 0000000000..259bbd22b2 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/teams/list.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let teams = new sdk.Teams(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = teams.list(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/teams/update.md b/docs/examples/0.7.0/server-nodejs/examples/teams/update.md new file mode 100644 index 0000000000..2118e8a90f --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/teams/update.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let teams = new sdk.Teams(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = teams.update('[TEAM_ID]', '[NAME]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/users/create.md b/docs/examples/0.7.0/server-nodejs/examples/users/create.md new file mode 100644 index 0000000000..83704cbd9d --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/users/create.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = users.create('email@example.com', 'password'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/users/delete-session.md b/docs/examples/0.7.0/server-nodejs/examples/users/delete-session.md new file mode 100644 index 0000000000..22308d4fa6 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/users/delete-session.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = users.deleteSession('[USER_ID]', '[SESSION_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/users/delete-sessions.md b/docs/examples/0.7.0/server-nodejs/examples/users/delete-sessions.md new file mode 100644 index 0000000000..75f8f96bda --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/users/delete-sessions.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = users.deleteSessions('[USER_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/users/delete-user.md b/docs/examples/0.7.0/server-nodejs/examples/users/delete-user.md new file mode 100644 index 0000000000..e72e600015 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/users/delete-user.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = users.deleteUser('[USER_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/users/get-logs.md b/docs/examples/0.7.0/server-nodejs/examples/users/get-logs.md new file mode 100644 index 0000000000..1287b5ef5f --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/users/get-logs.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = users.getLogs('[USER_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/users/get-prefs.md b/docs/examples/0.7.0/server-nodejs/examples/users/get-prefs.md new file mode 100644 index 0000000000..088e6b0811 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/users/get-prefs.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = users.getPrefs('[USER_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/users/get-sessions.md b/docs/examples/0.7.0/server-nodejs/examples/users/get-sessions.md new file mode 100644 index 0000000000..f5ad029ebe --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/users/get-sessions.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = users.getSessions('[USER_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/users/get.md b/docs/examples/0.7.0/server-nodejs/examples/users/get.md new file mode 100644 index 0000000000..5b91577284 --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/users/get.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = users.get('[USER_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/users/list.md b/docs/examples/0.7.0/server-nodejs/examples/users/list.md new file mode 100644 index 0000000000..0bc83b06bf --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/users/list.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = users.list(); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/users/update-prefs.md b/docs/examples/0.7.0/server-nodejs/examples/users/update-prefs.md new file mode 100644 index 0000000000..7d1011d6be --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/users/update-prefs.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = users.updatePrefs('[USER_ID]', {}); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-nodejs/examples/users/update-status.md b/docs/examples/0.7.0/server-nodejs/examples/users/update-status.md new file mode 100644 index 0000000000..86f54381da --- /dev/null +++ b/docs/examples/0.7.0/server-nodejs/examples/users/update-status.md @@ -0,0 +1,20 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let users = new sdk.Users(client); + +client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = users.updateStatus('[USER_ID]', '1'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/avatars/get-browser.md b/docs/examples/0.7.0/server-php/examples/avatars/get-browser.md new file mode 100644 index 0000000000..795d79157e --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/avatars/get-browser.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$avatars = new Avatars($client); + +$result = $avatars->getBrowser('aa'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/avatars/get-credit-card.md b/docs/examples/0.7.0/server-php/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..33879d0179 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/avatars/get-credit-card.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$avatars = new Avatars($client); + +$result = $avatars->getCreditCard('amex'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/avatars/get-favicon.md b/docs/examples/0.7.0/server-php/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..dee19dbf04 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/avatars/get-favicon.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$avatars = new Avatars($client); + +$result = $avatars->getFavicon('https://example.com'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/avatars/get-flag.md b/docs/examples/0.7.0/server-php/examples/avatars/get-flag.md new file mode 100644 index 0000000000..d70d7e43ec --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/avatars/get-flag.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$avatars = new Avatars($client); + +$result = $avatars->getFlag('af'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/avatars/get-image.md b/docs/examples/0.7.0/server-php/examples/avatars/get-image.md new file mode 100644 index 0000000000..a46b9fbe37 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/avatars/get-image.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$avatars = new Avatars($client); + +$result = $avatars->getImage('https://example.com'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/avatars/get-initials.md b/docs/examples/0.7.0/server-php/examples/avatars/get-initials.md new file mode 100644 index 0000000000..f5e549ace6 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/avatars/get-initials.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$avatars = new Avatars($client); + +$result = $avatars->getInitials(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/avatars/get-q-r.md b/docs/examples/0.7.0/server-php/examples/avatars/get-q-r.md new file mode 100644 index 0000000000..95b5a6d7b3 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/avatars/get-q-r.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$avatars = new Avatars($client); + +$result = $avatars->getQR('[TEXT]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/database/create-collection.md b/docs/examples/0.7.0/server-php/examples/database/create-collection.md new file mode 100644 index 0000000000..276d5049fe --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/database/create-collection.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$database = new Database($client); + +$result = $database->createCollection('[NAME]', [], [], []); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/database/create-document.md b/docs/examples/0.7.0/server-php/examples/database/create-document.md new file mode 100644 index 0000000000..6c32cdf950 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/database/create-document.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$database = new Database($client); + +$result = $database->createDocument('[COLLECTION_ID]', [], [], []); \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/database/get-collection-logs.md b/docs/examples/0.7.0/server-php/examples/database/delete-collection.md similarity index 85% rename from app/sdks/server-php/docs/examples/database/get-collection-logs.md rename to docs/examples/0.7.0/server-php/examples/database/delete-collection.md index 22c547eb39..4018420188 100644 --- a/app/sdks/server-php/docs/examples/database/get-collection-logs.md +++ b/docs/examples/0.7.0/server-php/examples/database/delete-collection.md @@ -13,4 +13,4 @@ $client $database = new Database($client); -$result = $database->getCollectionLogs('[COLLECTION_ID]'); \ No newline at end of file +$result = $database->deleteCollection('[COLLECTION_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/database/delete-document.md b/docs/examples/0.7.0/server-php/examples/database/delete-document.md new file mode 100644 index 0000000000..3ed45d6ee1 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/database/delete-document.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$database = new Database($client); + +$result = $database->deleteDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/database/get-collection.md b/docs/examples/0.7.0/server-php/examples/database/get-collection.md new file mode 100644 index 0000000000..a088b24bb6 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/database/get-collection.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$database = new Database($client); + +$result = $database->getCollection('[COLLECTION_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/database/get-document.md b/docs/examples/0.7.0/server-php/examples/database/get-document.md new file mode 100644 index 0000000000..d506bd8414 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/database/get-document.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$database = new Database($client); + +$result = $database->getDocument('[COLLECTION_ID]', '[DOCUMENT_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/database/list-collections.md b/docs/examples/0.7.0/server-php/examples/database/list-collections.md new file mode 100644 index 0000000000..4f4aa1b775 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/database/list-collections.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$database = new Database($client); + +$result = $database->listCollections(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/database/list-documents.md b/docs/examples/0.7.0/server-php/examples/database/list-documents.md new file mode 100644 index 0000000000..359da4ce33 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/database/list-documents.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$database = new Database($client); + +$result = $database->listDocuments('[COLLECTION_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/database/update-collection.md b/docs/examples/0.7.0/server-php/examples/database/update-collection.md new file mode 100644 index 0000000000..70d596066a --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/database/update-collection.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$database = new Database($client); + +$result = $database->updateCollection('[COLLECTION_ID]', '[NAME]', [], []); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/database/update-document.md b/docs/examples/0.7.0/server-php/examples/database/update-document.md new file mode 100644 index 0000000000..4389034640 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/database/update-document.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$database = new Database($client); + +$result = $database->updateDocument('[COLLECTION_ID]', '[DOCUMENT_ID]', [], [], []); \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/functions/create-execution.md b/docs/examples/0.7.0/server-php/examples/functions/create-execution.md similarity index 81% rename from app/sdks/server-php/docs/examples/functions/create-execution.md rename to docs/examples/0.7.0/server-php/examples/functions/create-execution.md index ca232c8771..422331a0df 100644 --- a/app/sdks/server-php/docs/examples/functions/create-execution.md +++ b/docs/examples/0.7.0/server-php/examples/functions/create-execution.md @@ -6,6 +6,7 @@ use Appwrite\Services\Functions; $client = new Client(); $client + ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; diff --git a/app/sdks/server-php/docs/examples/functions/create-tag.md b/docs/examples/0.7.0/server-php/examples/functions/create-tag.md similarity index 57% rename from app/sdks/server-php/docs/examples/functions/create-tag.md rename to docs/examples/0.7.0/server-php/examples/functions/create-tag.md index cc4ff73e90..72007a7d4f 100644 --- a/app/sdks/server-php/docs/examples/functions/create-tag.md +++ b/docs/examples/0.7.0/server-php/examples/functions/create-tag.md @@ -6,10 +6,11 @@ use Appwrite\Services\Functions; $client = new Client(); $client + ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $functions = new Functions($client); -$result = $functions->createTag('[FUNCTION_ID]', 'node-14', '[COMMAND]', '[CODE]'); \ No newline at end of file +$result = $functions->createTag('[FUNCTION_ID]', '[COMMAND]', new \CURLFile('/path/to/file.png', 'image/png', 'file.png')); \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/functions/create.md b/docs/examples/0.7.0/server-php/examples/functions/create.md similarity index 68% rename from app/sdks/server-php/docs/examples/functions/create.md rename to docs/examples/0.7.0/server-php/examples/functions/create.md index 7ec5dc2831..2e7b8ea044 100644 --- a/app/sdks/server-php/docs/examples/functions/create.md +++ b/docs/examples/0.7.0/server-php/examples/functions/create.md @@ -6,10 +6,11 @@ use Appwrite\Services\Functions; $client = new Client(); $client + ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $functions = new Functions($client); -$result = $functions->create('[NAME]'); \ No newline at end of file +$result = $functions->create('[NAME]', 'node-14'); \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/functions/delete-tag.md b/docs/examples/0.7.0/server-php/examples/functions/delete-tag.md similarity index 82% rename from app/sdks/server-php/docs/examples/functions/delete-tag.md rename to docs/examples/0.7.0/server-php/examples/functions/delete-tag.md index 681c9c3aa7..0a47accec9 100644 --- a/app/sdks/server-php/docs/examples/functions/delete-tag.md +++ b/docs/examples/0.7.0/server-php/examples/functions/delete-tag.md @@ -6,6 +6,7 @@ use Appwrite\Services\Functions; $client = new Client(); $client + ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; diff --git a/app/sdks/server-php/docs/examples/functions/delete.md b/docs/examples/0.7.0/server-php/examples/functions/delete.md similarity index 81% rename from app/sdks/server-php/docs/examples/functions/delete.md rename to docs/examples/0.7.0/server-php/examples/functions/delete.md index 12476f1d6a..319856522e 100644 --- a/app/sdks/server-php/docs/examples/functions/delete.md +++ b/docs/examples/0.7.0/server-php/examples/functions/delete.md @@ -6,6 +6,7 @@ use Appwrite\Services\Functions; $client = new Client(); $client + ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; diff --git a/app/sdks/server-php/docs/examples/functions/get-execution.md b/docs/examples/0.7.0/server-php/examples/functions/get-execution.md similarity index 82% rename from app/sdks/server-php/docs/examples/functions/get-execution.md rename to docs/examples/0.7.0/server-php/examples/functions/get-execution.md index 774c7ecc3f..b02cfa08f7 100644 --- a/app/sdks/server-php/docs/examples/functions/get-execution.md +++ b/docs/examples/0.7.0/server-php/examples/functions/get-execution.md @@ -6,6 +6,7 @@ use Appwrite\Services\Functions; $client = new Client(); $client + ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; diff --git a/app/sdks/server-php/docs/examples/functions/get-tag.md b/docs/examples/0.7.0/server-php/examples/functions/get-tag.md similarity index 82% rename from app/sdks/server-php/docs/examples/functions/get-tag.md rename to docs/examples/0.7.0/server-php/examples/functions/get-tag.md index b1c2f23dcf..5cee355f7e 100644 --- a/app/sdks/server-php/docs/examples/functions/get-tag.md +++ b/docs/examples/0.7.0/server-php/examples/functions/get-tag.md @@ -6,6 +6,7 @@ use Appwrite\Services\Functions; $client = new Client(); $client + ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; diff --git a/app/sdks/server-php/docs/examples/functions/get.md b/docs/examples/0.7.0/server-php/examples/functions/get.md similarity index 81% rename from app/sdks/server-php/docs/examples/functions/get.md rename to docs/examples/0.7.0/server-php/examples/functions/get.md index 0b6b438c65..06ddece1ca 100644 --- a/app/sdks/server-php/docs/examples/functions/get.md +++ b/docs/examples/0.7.0/server-php/examples/functions/get.md @@ -6,6 +6,7 @@ use Appwrite\Services\Functions; $client = new Client(); $client + ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; diff --git a/app/sdks/server-php/docs/examples/functions/list-executions.md b/docs/examples/0.7.0/server-php/examples/functions/list-executions.md similarity index 81% rename from app/sdks/server-php/docs/examples/functions/list-executions.md rename to docs/examples/0.7.0/server-php/examples/functions/list-executions.md index a0403c653d..4417fc8860 100644 --- a/app/sdks/server-php/docs/examples/functions/list-executions.md +++ b/docs/examples/0.7.0/server-php/examples/functions/list-executions.md @@ -6,6 +6,7 @@ use Appwrite\Services\Functions; $client = new Client(); $client + ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; diff --git a/app/sdks/server-php/docs/examples/functions/list-tags.md b/docs/examples/0.7.0/server-php/examples/functions/list-tags.md similarity index 81% rename from app/sdks/server-php/docs/examples/functions/list-tags.md rename to docs/examples/0.7.0/server-php/examples/functions/list-tags.md index 3c2e6b6e87..ac652d5647 100644 --- a/app/sdks/server-php/docs/examples/functions/list-tags.md +++ b/docs/examples/0.7.0/server-php/examples/functions/list-tags.md @@ -6,6 +6,7 @@ use Appwrite\Services\Functions; $client = new Client(); $client + ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; diff --git a/app/sdks/server-php/docs/examples/functions/list.md b/docs/examples/0.7.0/server-php/examples/functions/list.md similarity index 80% rename from app/sdks/server-php/docs/examples/functions/list.md rename to docs/examples/0.7.0/server-php/examples/functions/list.md index bfbfde406f..3eaa8c567e 100644 --- a/app/sdks/server-php/docs/examples/functions/list.md +++ b/docs/examples/0.7.0/server-php/examples/functions/list.md @@ -6,6 +6,7 @@ use Appwrite\Services\Functions; $client = new Client(); $client + ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; diff --git a/app/sdks/server-php/docs/examples/functions/update-tag.md b/docs/examples/0.7.0/server-php/examples/functions/update-tag.md similarity index 82% rename from app/sdks/server-php/docs/examples/functions/update-tag.md rename to docs/examples/0.7.0/server-php/examples/functions/update-tag.md index 68099d8fbb..42c74d4f95 100644 --- a/app/sdks/server-php/docs/examples/functions/update-tag.md +++ b/docs/examples/0.7.0/server-php/examples/functions/update-tag.md @@ -6,6 +6,7 @@ use Appwrite\Services\Functions; $client = new Client(); $client + ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; diff --git a/app/sdks/server-php/docs/examples/functions/update.md b/docs/examples/0.7.0/server-php/examples/functions/update.md similarity index 81% rename from app/sdks/server-php/docs/examples/functions/update.md rename to docs/examples/0.7.0/server-php/examples/functions/update.md index 34315a129a..c9ca3f5071 100644 --- a/app/sdks/server-php/docs/examples/functions/update.md +++ b/docs/examples/0.7.0/server-php/examples/functions/update.md @@ -6,6 +6,7 @@ use Appwrite\Services\Functions; $client = new Client(); $client + ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; diff --git a/docs/examples/0.7.0/server-php/examples/health/get-anti-virus.md b/docs/examples/0.7.0/server-php/examples/health/get-anti-virus.md new file mode 100644 index 0000000000..89a5fb2a7a --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/health/get-anti-virus.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$health = new Health($client); + +$result = $health->getAntiVirus(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/health/get-cache.md b/docs/examples/0.7.0/server-php/examples/health/get-cache.md new file mode 100644 index 0000000000..e654c26f51 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/health/get-cache.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$health = new Health($client); + +$result = $health->getCache(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/health/get-d-b.md b/docs/examples/0.7.0/server-php/examples/health/get-d-b.md new file mode 100644 index 0000000000..2d37991a3d --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/health/get-d-b.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$health = new Health($client); + +$result = $health->getDB(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/health/get-queue-certificates.md b/docs/examples/0.7.0/server-php/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..57f2c5793e --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/health/get-queue-certificates.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$health = new Health($client); + +$result = $health->getQueueCertificates(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/health/get-queue-functions.md b/docs/examples/0.7.0/server-php/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..8ff6510e1c --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/health/get-queue-functions.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$health = new Health($client); + +$result = $health->getQueueFunctions(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/health/get-queue-logs.md b/docs/examples/0.7.0/server-php/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..fa723d7391 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/health/get-queue-logs.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$health = new Health($client); + +$result = $health->getQueueLogs(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/health/get-queue-tasks.md b/docs/examples/0.7.0/server-php/examples/health/get-queue-tasks.md new file mode 100644 index 0000000000..b8f1794a1a --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/health/get-queue-tasks.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$health = new Health($client); + +$result = $health->getQueueTasks(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/health/get-queue-usage.md b/docs/examples/0.7.0/server-php/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..371d02f5b4 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/health/get-queue-usage.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$health = new Health($client); + +$result = $health->getQueueUsage(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/health/get-queue-webhooks.md b/docs/examples/0.7.0/server-php/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..af48a72d06 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/health/get-queue-webhooks.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$health = new Health($client); + +$result = $health->getQueueWebhooks(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/health/get-storage-local.md b/docs/examples/0.7.0/server-php/examples/health/get-storage-local.md new file mode 100644 index 0000000000..eba15a1652 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/health/get-storage-local.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$health = new Health($client); + +$result = $health->getStorageLocal(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/health/get-time.md b/docs/examples/0.7.0/server-php/examples/health/get-time.md new file mode 100644 index 0000000000..849f499460 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/health/get-time.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$health = new Health($client); + +$result = $health->getTime(); \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/health/get-storage-anti-virus.md b/docs/examples/0.7.0/server-php/examples/health/get.md similarity index 72% rename from app/sdks/server-php/docs/examples/health/get-storage-anti-virus.md rename to docs/examples/0.7.0/server-php/examples/health/get.md index 0d1958e4f2..9f1ec8970c 100644 --- a/app/sdks/server-php/docs/examples/health/get-storage-anti-virus.md +++ b/docs/examples/0.7.0/server-php/examples/health/get.md @@ -6,10 +6,11 @@ use Appwrite\Services\Health; $client = new Client(); $client + ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $health = new Health($client); -$result = $health->getStorageAntiVirus(); \ No newline at end of file +$result = $health->get(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/locale/get-continents.md b/docs/examples/0.7.0/server-php/examples/locale/get-continents.md new file mode 100644 index 0000000000..bb099d31f5 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/locale/get-continents.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$locale = new Locale($client); + +$result = $locale->getContinents(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/locale/get-countries-e-u.md b/docs/examples/0.7.0/server-php/examples/locale/get-countries-e-u.md new file mode 100644 index 0000000000..87287a5cea --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/locale/get-countries-e-u.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$locale = new Locale($client); + +$result = $locale->getCountriesEU(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/locale/get-countries-phones.md b/docs/examples/0.7.0/server-php/examples/locale/get-countries-phones.md new file mode 100644 index 0000000000..71a39303da --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/locale/get-countries-phones.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$locale = new Locale($client); + +$result = $locale->getCountriesPhones(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/locale/get-countries.md b/docs/examples/0.7.0/server-php/examples/locale/get-countries.md new file mode 100644 index 0000000000..1c8f863a76 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/locale/get-countries.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$locale = new Locale($client); + +$result = $locale->getCountries(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/locale/get-currencies.md b/docs/examples/0.7.0/server-php/examples/locale/get-currencies.md new file mode 100644 index 0000000000..b799bf6b80 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/locale/get-currencies.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$locale = new Locale($client); + +$result = $locale->getCurrencies(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/locale/get-languages.md b/docs/examples/0.7.0/server-php/examples/locale/get-languages.md new file mode 100644 index 0000000000..47fdc6eb34 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/locale/get-languages.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$locale = new Locale($client); + +$result = $locale->getLanguages(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/locale/get.md b/docs/examples/0.7.0/server-php/examples/locale/get.md new file mode 100644 index 0000000000..8e11f17689 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/locale/get.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$locale = new Locale($client); + +$result = $locale->get(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/storage/create-file.md b/docs/examples/0.7.0/server-php/examples/storage/create-file.md new file mode 100644 index 0000000000..ba533dd2e7 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/storage/create-file.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$storage = new Storage($client); + +$result = $storage->createFile(new \CURLFile('/path/to/file.png', 'image/png', 'file.png'), [], []); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/storage/delete-file.md b/docs/examples/0.7.0/server-php/examples/storage/delete-file.md new file mode 100644 index 0000000000..23d4013d22 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/storage/delete-file.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$storage = new Storage($client); + +$result = $storage->deleteFile('[FILE_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/storage/get-file-download.md b/docs/examples/0.7.0/server-php/examples/storage/get-file-download.md new file mode 100644 index 0000000000..3064481141 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/storage/get-file-download.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$storage = new Storage($client); + +$result = $storage->getFileDownload('[FILE_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/storage/get-file-preview.md b/docs/examples/0.7.0/server-php/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..00cb63696b --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/storage/get-file-preview.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$storage = new Storage($client); + +$result = $storage->getFilePreview('[FILE_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/storage/get-file-view.md b/docs/examples/0.7.0/server-php/examples/storage/get-file-view.md new file mode 100644 index 0000000000..07b7ab32ba --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/storage/get-file-view.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$storage = new Storage($client); + +$result = $storage->getFileView('[FILE_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/storage/get-file.md b/docs/examples/0.7.0/server-php/examples/storage/get-file.md new file mode 100644 index 0000000000..c8b6495f18 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/storage/get-file.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$storage = new Storage($client); + +$result = $storage->getFile('[FILE_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/storage/list-files.md b/docs/examples/0.7.0/server-php/examples/storage/list-files.md new file mode 100644 index 0000000000..787c38e320 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/storage/list-files.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$storage = new Storage($client); + +$result = $storage->listFiles(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/storage/update-file.md b/docs/examples/0.7.0/server-php/examples/storage/update-file.md new file mode 100644 index 0000000000..7515217b97 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/storage/update-file.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$storage = new Storage($client); + +$result = $storage->updateFile('[FILE_ID]', [], []); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/teams/create-membership.md b/docs/examples/0.7.0/server-php/examples/teams/create-membership.md new file mode 100644 index 0000000000..9c88b1bba5 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/teams/create-membership.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$teams = new Teams($client); + +$result = $teams->createMembership('[TEAM_ID]', 'email@example.com', [], 'https://example.com'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/teams/create.md b/docs/examples/0.7.0/server-php/examples/teams/create.md new file mode 100644 index 0000000000..7b0946bc83 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/teams/create.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$teams = new Teams($client); + +$result = $teams->create('[NAME]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/teams/delete-membership.md b/docs/examples/0.7.0/server-php/examples/teams/delete-membership.md new file mode 100644 index 0000000000..ca9d3d57c0 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/teams/delete-membership.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$teams = new Teams($client); + +$result = $teams->deleteMembership('[TEAM_ID]', '[INVITE_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/teams/delete.md b/docs/examples/0.7.0/server-php/examples/teams/delete.md new file mode 100644 index 0000000000..394a1940fc --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/teams/delete.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$teams = new Teams($client); + +$result = $teams->delete('[TEAM_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/teams/get-memberships.md b/docs/examples/0.7.0/server-php/examples/teams/get-memberships.md new file mode 100644 index 0000000000..56f6d59063 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/teams/get-memberships.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$teams = new Teams($client); + +$result = $teams->getMemberships('[TEAM_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/teams/get.md b/docs/examples/0.7.0/server-php/examples/teams/get.md new file mode 100644 index 0000000000..6f0b705707 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/teams/get.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$teams = new Teams($client); + +$result = $teams->get('[TEAM_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/teams/list.md b/docs/examples/0.7.0/server-php/examples/teams/list.md new file mode 100644 index 0000000000..d17bb7689b --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/teams/list.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$teams = new Teams($client); + +$result = $teams->list(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/teams/update.md b/docs/examples/0.7.0/server-php/examples/teams/update.md new file mode 100644 index 0000000000..945001dc36 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/teams/update.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$teams = new Teams($client); + +$result = $teams->update('[TEAM_ID]', '[NAME]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/users/create.md b/docs/examples/0.7.0/server-php/examples/users/create.md new file mode 100644 index 0000000000..53497b4277 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/users/create.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$users = new Users($client); + +$result = $users->create('email@example.com', 'password'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/users/delete-session.md b/docs/examples/0.7.0/server-php/examples/users/delete-session.md new file mode 100644 index 0000000000..ead6de7549 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/users/delete-session.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$users = new Users($client); + +$result = $users->deleteSession('[USER_ID]', '[SESSION_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/users/delete-sessions.md b/docs/examples/0.7.0/server-php/examples/users/delete-sessions.md new file mode 100644 index 0000000000..968d788ea7 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/users/delete-sessions.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$users = new Users($client); + +$result = $users->deleteSessions('[USER_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/users/delete-user.md b/docs/examples/0.7.0/server-php/examples/users/delete-user.md new file mode 100644 index 0000000000..1e9f0cb227 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/users/delete-user.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$users = new Users($client); + +$result = $users->deleteUser('[USER_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/users/get-logs.md b/docs/examples/0.7.0/server-php/examples/users/get-logs.md new file mode 100644 index 0000000000..5602536920 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/users/get-logs.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$users = new Users($client); + +$result = $users->getLogs('[USER_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/users/get-prefs.md b/docs/examples/0.7.0/server-php/examples/users/get-prefs.md new file mode 100644 index 0000000000..1c9978a0fb --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/users/get-prefs.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$users = new Users($client); + +$result = $users->getPrefs('[USER_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/users/get-sessions.md b/docs/examples/0.7.0/server-php/examples/users/get-sessions.md new file mode 100644 index 0000000000..fef9f1db74 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/users/get-sessions.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$users = new Users($client); + +$result = $users->getSessions('[USER_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/users/get.md b/docs/examples/0.7.0/server-php/examples/users/get.md new file mode 100644 index 0000000000..16c29f9a5a --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/users/get.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$users = new Users($client); + +$result = $users->get('[USER_ID]'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/users/list.md b/docs/examples/0.7.0/server-php/examples/users/list.md new file mode 100644 index 0000000000..efce771ea1 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/users/list.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$users = new Users($client); + +$result = $users->list(); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/users/update-prefs.md b/docs/examples/0.7.0/server-php/examples/users/update-prefs.md new file mode 100644 index 0000000000..9e9141f8a7 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/users/update-prefs.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$users = new Users($client); + +$result = $users->updatePrefs('[USER_ID]', []); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-php/examples/users/update-status.md b/docs/examples/0.7.0/server-php/examples/users/update-status.md new file mode 100644 index 0000000000..87f9bceb46 --- /dev/null +++ b/docs/examples/0.7.0/server-php/examples/users/update-status.md @@ -0,0 +1,16 @@ +setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$users = new Users($client); + +$result = $users->updateStatus('[USER_ID]', '1'); \ No newline at end of file diff --git a/docs/examples/0.7.0/server-python/examples/avatars/get-browser.md b/docs/examples/0.7.0/server-python/examples/avatars/get-browser.md new file mode 100644 index 0000000000..138c0d1b3e --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/avatars/get-browser.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.avatars import Avatars + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +avatars = Avatars(client) + +result = avatars.get_browser('aa') diff --git a/docs/examples/0.7.0/server-python/examples/avatars/get-credit-card.md b/docs/examples/0.7.0/server-python/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..83f76aca42 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/avatars/get-credit-card.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.avatars import Avatars + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +avatars = Avatars(client) + +result = avatars.get_credit_card('amex') diff --git a/docs/examples/0.7.0/server-python/examples/avatars/get-favicon.md b/docs/examples/0.7.0/server-python/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..6946080bee --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/avatars/get-favicon.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.avatars import Avatars + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +avatars = Avatars(client) + +result = avatars.get_favicon('https://example.com') diff --git a/docs/examples/0.7.0/server-python/examples/avatars/get-flag.md b/docs/examples/0.7.0/server-python/examples/avatars/get-flag.md new file mode 100644 index 0000000000..188d6d35bd --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/avatars/get-flag.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.avatars import Avatars + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +avatars = Avatars(client) + +result = avatars.get_flag('af') diff --git a/docs/examples/0.7.0/server-python/examples/avatars/get-image.md b/docs/examples/0.7.0/server-python/examples/avatars/get-image.md new file mode 100644 index 0000000000..29a6430eab --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/avatars/get-image.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.avatars import Avatars + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +avatars = Avatars(client) + +result = avatars.get_image('https://example.com') diff --git a/docs/examples/0.7.0/server-python/examples/avatars/get-initials.md b/docs/examples/0.7.0/server-python/examples/avatars/get-initials.md new file mode 100644 index 0000000000..0c300af5da --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/avatars/get-initials.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.avatars import Avatars + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +avatars = Avatars(client) + +result = avatars.get_initials() diff --git a/docs/examples/0.7.0/server-python/examples/avatars/get-q-r.md b/docs/examples/0.7.0/server-python/examples/avatars/get-q-r.md new file mode 100644 index 0000000000..19551e99d7 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/avatars/get-q-r.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.avatars import Avatars + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +avatars = Avatars(client) + +result = avatars.get_q_r('[TEXT]') diff --git a/app/sdks/server-python/docs/examples/database/get-collection-logs.md b/docs/examples/0.7.0/server-python/examples/database/create-collection.md similarity index 67% rename from app/sdks/server-python/docs/examples/database/get-collection-logs.md rename to docs/examples/0.7.0/server-python/examples/database/create-collection.md index 4abaa17f24..eb704a80a1 100644 --- a/app/sdks/server-python/docs/examples/database/get-collection-logs.md +++ b/docs/examples/0.7.0/server-python/examples/database/create-collection.md @@ -4,11 +4,11 @@ from appwrite.services.database import Database client = Client() (client - .set_endpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) database = Database(client) -result = database.get_collection_logs('[COLLECTION_ID]') +result = database.create_collection('[NAME]', [], [], []) diff --git a/docs/examples/0.7.0/server-python/examples/database/create-document.md b/docs/examples/0.7.0/server-python/examples/database/create-document.md new file mode 100644 index 0000000000..919d5ebbf4 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/database/create-document.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.database import Database + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +database = Database(client) + +result = database.create_document('[COLLECTION_ID]', {}, [], []) diff --git a/docs/examples/0.7.0/server-python/examples/database/delete-collection.md b/docs/examples/0.7.0/server-python/examples/database/delete-collection.md new file mode 100644 index 0000000000..0e188ade41 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/database/delete-collection.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.database import Database + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +database = Database(client) + +result = database.delete_collection('[COLLECTION_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/database/delete-document.md b/docs/examples/0.7.0/server-python/examples/database/delete-document.md new file mode 100644 index 0000000000..c085547c16 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/database/delete-document.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.database import Database + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +database = Database(client) + +result = database.delete_document('[COLLECTION_ID]', '[DOCUMENT_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/database/get-collection.md b/docs/examples/0.7.0/server-python/examples/database/get-collection.md new file mode 100644 index 0000000000..f90f51f48b --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/database/get-collection.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.database import Database + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +database = Database(client) + +result = database.get_collection('[COLLECTION_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/database/get-document.md b/docs/examples/0.7.0/server-python/examples/database/get-document.md new file mode 100644 index 0000000000..79891709d1 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/database/get-document.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.database import Database + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +database = Database(client) + +result = database.get_document('[COLLECTION_ID]', '[DOCUMENT_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/database/list-collections.md b/docs/examples/0.7.0/server-python/examples/database/list-collections.md new file mode 100644 index 0000000000..f60d4b90e5 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/database/list-collections.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.database import Database + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +database = Database(client) + +result = database.list_collections() diff --git a/docs/examples/0.7.0/server-python/examples/database/list-documents.md b/docs/examples/0.7.0/server-python/examples/database/list-documents.md new file mode 100644 index 0000000000..cecb57d2fa --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/database/list-documents.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.database import Database + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +database = Database(client) + +result = database.list_documents('[COLLECTION_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/database/update-collection.md b/docs/examples/0.7.0/server-python/examples/database/update-collection.md new file mode 100644 index 0000000000..7dacd558ba --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/database/update-collection.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.database import Database + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +database = Database(client) + +result = database.update_collection('[COLLECTION_ID]', '[NAME]', [], []) diff --git a/docs/examples/0.7.0/server-python/examples/database/update-document.md b/docs/examples/0.7.0/server-python/examples/database/update-document.md new file mode 100644 index 0000000000..6296809dc5 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/database/update-document.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.database import Database + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +database = Database(client) + +result = database.update_document('[COLLECTION_ID]', '[DOCUMENT_ID]', {}, [], []) diff --git a/app/sdks/server-python/docs/examples/functions/create-execution.md b/docs/examples/0.7.0/server-python/examples/functions/create-execution.md similarity index 82% rename from app/sdks/server-python/docs/examples/functions/create-execution.md rename to docs/examples/0.7.0/server-python/examples/functions/create-execution.md index aa8e955751..dc4442cd84 100644 --- a/app/sdks/server-python/docs/examples/functions/create-execution.md +++ b/docs/examples/0.7.0/server-python/examples/functions/create-execution.md @@ -4,6 +4,7 @@ from appwrite.services.functions import Functions client = Client() (client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/functions/create-tag.md b/docs/examples/0.7.0/server-python/examples/functions/create-tag.md similarity index 62% rename from app/sdks/server-python/docs/examples/functions/create-tag.md rename to docs/examples/0.7.0/server-python/examples/functions/create-tag.md index 533f3095c3..1995a64c33 100644 --- a/app/sdks/server-python/docs/examples/functions/create-tag.md +++ b/docs/examples/0.7.0/server-python/examples/functions/create-tag.md @@ -4,10 +4,11 @@ from appwrite.services.functions import Functions client = Client() (client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) functions = Functions(client) -result = functions.create_tag('[FUNCTION_ID]', 'node-14', '[COMMAND]', '[CODE]') +result = functions.create_tag('[FUNCTION_ID]', '[COMMAND]', open('/path/to/file.png', 'rb')) diff --git a/app/sdks/server-python/docs/examples/functions/create.md b/docs/examples/0.7.0/server-python/examples/functions/create.md similarity index 70% rename from app/sdks/server-python/docs/examples/functions/create.md rename to docs/examples/0.7.0/server-python/examples/functions/create.md index 2b63ea7191..c6fd31bcb1 100644 --- a/app/sdks/server-python/docs/examples/functions/create.md +++ b/docs/examples/0.7.0/server-python/examples/functions/create.md @@ -4,10 +4,11 @@ from appwrite.services.functions import Functions client = Client() (client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) functions = Functions(client) -result = functions.create('[NAME]') +result = functions.create('[NAME]', 'node-14') diff --git a/app/sdks/server-python/docs/examples/functions/delete-tag.md b/docs/examples/0.7.0/server-python/examples/functions/delete-tag.md similarity index 82% rename from app/sdks/server-python/docs/examples/functions/delete-tag.md rename to docs/examples/0.7.0/server-python/examples/functions/delete-tag.md index 554817cf5e..a4cb1b7a85 100644 --- a/app/sdks/server-python/docs/examples/functions/delete-tag.md +++ b/docs/examples/0.7.0/server-python/examples/functions/delete-tag.md @@ -4,6 +4,7 @@ from appwrite.services.functions import Functions client = Client() (client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/functions/delete.md b/docs/examples/0.7.0/server-python/examples/functions/delete.md similarity index 82% rename from app/sdks/server-python/docs/examples/functions/delete.md rename to docs/examples/0.7.0/server-python/examples/functions/delete.md index 9c1575c1e8..52658e8c30 100644 --- a/app/sdks/server-python/docs/examples/functions/delete.md +++ b/docs/examples/0.7.0/server-python/examples/functions/delete.md @@ -4,6 +4,7 @@ from appwrite.services.functions import Functions client = Client() (client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/functions/get-execution.md b/docs/examples/0.7.0/server-python/examples/functions/get-execution.md similarity index 83% rename from app/sdks/server-python/docs/examples/functions/get-execution.md rename to docs/examples/0.7.0/server-python/examples/functions/get-execution.md index b979241983..1e101304d3 100644 --- a/app/sdks/server-python/docs/examples/functions/get-execution.md +++ b/docs/examples/0.7.0/server-python/examples/functions/get-execution.md @@ -4,6 +4,7 @@ from appwrite.services.functions import Functions client = Client() (client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/functions/get-tag.md b/docs/examples/0.7.0/server-python/examples/functions/get-tag.md similarity index 82% rename from app/sdks/server-python/docs/examples/functions/get-tag.md rename to docs/examples/0.7.0/server-python/examples/functions/get-tag.md index b5c3f23059..4cded469dd 100644 --- a/app/sdks/server-python/docs/examples/functions/get-tag.md +++ b/docs/examples/0.7.0/server-python/examples/functions/get-tag.md @@ -4,6 +4,7 @@ from appwrite.services.functions import Functions client = Client() (client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/functions/get.md b/docs/examples/0.7.0/server-python/examples/functions/get.md similarity index 82% rename from app/sdks/server-python/docs/examples/functions/get.md rename to docs/examples/0.7.0/server-python/examples/functions/get.md index 0e4036db4d..0007667da6 100644 --- a/app/sdks/server-python/docs/examples/functions/get.md +++ b/docs/examples/0.7.0/server-python/examples/functions/get.md @@ -4,6 +4,7 @@ from appwrite.services.functions import Functions client = Client() (client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/functions/list-executions.md b/docs/examples/0.7.0/server-python/examples/functions/list-executions.md similarity index 82% rename from app/sdks/server-python/docs/examples/functions/list-executions.md rename to docs/examples/0.7.0/server-python/examples/functions/list-executions.md index 75f5260b46..6d75e093f4 100644 --- a/app/sdks/server-python/docs/examples/functions/list-executions.md +++ b/docs/examples/0.7.0/server-python/examples/functions/list-executions.md @@ -4,6 +4,7 @@ from appwrite.services.functions import Functions client = Client() (client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/functions/list-tags.md b/docs/examples/0.7.0/server-python/examples/functions/list-tags.md similarity index 82% rename from app/sdks/server-python/docs/examples/functions/list-tags.md rename to docs/examples/0.7.0/server-python/examples/functions/list-tags.md index a992416640..67a81a9d89 100644 --- a/app/sdks/server-python/docs/examples/functions/list-tags.md +++ b/docs/examples/0.7.0/server-python/examples/functions/list-tags.md @@ -4,6 +4,7 @@ from appwrite.services.functions import Functions client = Client() (client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/functions/list.md b/docs/examples/0.7.0/server-python/examples/functions/list.md similarity index 81% rename from app/sdks/server-python/docs/examples/functions/list.md rename to docs/examples/0.7.0/server-python/examples/functions/list.md index a2b1e7d3db..cc1f04d9c6 100644 --- a/app/sdks/server-python/docs/examples/functions/list.md +++ b/docs/examples/0.7.0/server-python/examples/functions/list.md @@ -4,6 +4,7 @@ from appwrite.services.functions import Functions client = Client() (client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/functions/update-tag.md b/docs/examples/0.7.0/server-python/examples/functions/update-tag.md similarity index 82% rename from app/sdks/server-python/docs/examples/functions/update-tag.md rename to docs/examples/0.7.0/server-python/examples/functions/update-tag.md index 4ab93d1b6a..7a9da50b2f 100644 --- a/app/sdks/server-python/docs/examples/functions/update-tag.md +++ b/docs/examples/0.7.0/server-python/examples/functions/update-tag.md @@ -4,6 +4,7 @@ from appwrite.services.functions import Functions client = Client() (client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/app/sdks/server-python/docs/examples/functions/update.md b/docs/examples/0.7.0/server-python/examples/functions/update.md similarity index 82% rename from app/sdks/server-python/docs/examples/functions/update.md rename to docs/examples/0.7.0/server-python/examples/functions/update.md index 751a5d2538..f55767d0ae 100644 --- a/app/sdks/server-python/docs/examples/functions/update.md +++ b/docs/examples/0.7.0/server-python/examples/functions/update.md @@ -4,6 +4,7 @@ from appwrite.services.functions import Functions client = Client() (client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) diff --git a/docs/examples/0.7.0/server-python/examples/health/get-anti-virus.md b/docs/examples/0.7.0/server-python/examples/health/get-anti-virus.md new file mode 100644 index 0000000000..c7628d90ea --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/health/get-anti-virus.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +health = Health(client) + +result = health.get_anti_virus() diff --git a/docs/examples/0.7.0/server-python/examples/health/get-cache.md b/docs/examples/0.7.0/server-python/examples/health/get-cache.md new file mode 100644 index 0000000000..57c7939b7f --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/health/get-cache.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +health = Health(client) + +result = health.get_cache() diff --git a/docs/examples/0.7.0/server-python/examples/health/get-d-b.md b/docs/examples/0.7.0/server-python/examples/health/get-d-b.md new file mode 100644 index 0000000000..db8eec5ce6 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/health/get-d-b.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +health = Health(client) + +result = health.get_d_b() diff --git a/docs/examples/0.7.0/server-python/examples/health/get-queue-certificates.md b/docs/examples/0.7.0/server-python/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..1f87c2758a --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/health/get-queue-certificates.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +health = Health(client) + +result = health.get_queue_certificates() diff --git a/docs/examples/0.7.0/server-python/examples/health/get-queue-functions.md b/docs/examples/0.7.0/server-python/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..3e0b0c01e0 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/health/get-queue-functions.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +health = Health(client) + +result = health.get_queue_functions() diff --git a/docs/examples/0.7.0/server-python/examples/health/get-queue-logs.md b/docs/examples/0.7.0/server-python/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..fdf80c6d82 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/health/get-queue-logs.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +health = Health(client) + +result = health.get_queue_logs() diff --git a/docs/examples/0.7.0/server-python/examples/health/get-queue-tasks.md b/docs/examples/0.7.0/server-python/examples/health/get-queue-tasks.md new file mode 100644 index 0000000000..17b17a081f --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/health/get-queue-tasks.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +health = Health(client) + +result = health.get_queue_tasks() diff --git a/docs/examples/0.7.0/server-python/examples/health/get-queue-usage.md b/docs/examples/0.7.0/server-python/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..aeb8e83130 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/health/get-queue-usage.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +health = Health(client) + +result = health.get_queue_usage() diff --git a/docs/examples/0.7.0/server-python/examples/health/get-queue-webhooks.md b/docs/examples/0.7.0/server-python/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..90c4238987 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/health/get-queue-webhooks.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +health = Health(client) + +result = health.get_queue_webhooks() diff --git a/docs/examples/0.7.0/server-python/examples/health/get-storage-local.md b/docs/examples/0.7.0/server-python/examples/health/get-storage-local.md new file mode 100644 index 0000000000..b06dcef245 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/health/get-storage-local.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +health = Health(client) + +result = health.get_storage_local() diff --git a/docs/examples/0.7.0/server-python/examples/health/get-time.md b/docs/examples/0.7.0/server-python/examples/health/get-time.md new file mode 100644 index 0000000000..df68c1a0f9 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/health/get-time.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.health import Health + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +health = Health(client) + +result = health.get_time() diff --git a/app/sdks/server-python/docs/examples/health/get-storage-anti-virus.md b/docs/examples/0.7.0/server-python/examples/health/get.md similarity index 74% rename from app/sdks/server-python/docs/examples/health/get-storage-anti-virus.md rename to docs/examples/0.7.0/server-python/examples/health/get.md index 5ce63ac816..f3416aef75 100644 --- a/app/sdks/server-python/docs/examples/health/get-storage-anti-virus.md +++ b/docs/examples/0.7.0/server-python/examples/health/get.md @@ -4,10 +4,11 @@ from appwrite.services.health import Health client = Client() (client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) health = Health(client) -result = health.get_storage_anti_virus() +result = health.get() diff --git a/docs/examples/0.7.0/server-python/examples/locale/get-continents.md b/docs/examples/0.7.0/server-python/examples/locale/get-continents.md new file mode 100644 index 0000000000..393326ddab --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/locale/get-continents.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.locale import Locale + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +locale = Locale(client) + +result = locale.get_continents() diff --git a/docs/examples/0.7.0/server-python/examples/locale/get-countries-e-u.md b/docs/examples/0.7.0/server-python/examples/locale/get-countries-e-u.md new file mode 100644 index 0000000000..653fdd5abf --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/locale/get-countries-e-u.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.locale import Locale + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +locale = Locale(client) + +result = locale.get_countries_e_u() diff --git a/docs/examples/0.7.0/server-python/examples/locale/get-countries-phones.md b/docs/examples/0.7.0/server-python/examples/locale/get-countries-phones.md new file mode 100644 index 0000000000..8c7693a35c --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/locale/get-countries-phones.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.locale import Locale + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +locale = Locale(client) + +result = locale.get_countries_phones() diff --git a/docs/examples/0.7.0/server-python/examples/locale/get-countries.md b/docs/examples/0.7.0/server-python/examples/locale/get-countries.md new file mode 100644 index 0000000000..8a6c7cb1c3 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/locale/get-countries.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.locale import Locale + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +locale = Locale(client) + +result = locale.get_countries() diff --git a/docs/examples/0.7.0/server-python/examples/locale/get-currencies.md b/docs/examples/0.7.0/server-python/examples/locale/get-currencies.md new file mode 100644 index 0000000000..17586de230 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/locale/get-currencies.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.locale import Locale + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +locale = Locale(client) + +result = locale.get_currencies() diff --git a/docs/examples/0.7.0/server-python/examples/locale/get-languages.md b/docs/examples/0.7.0/server-python/examples/locale/get-languages.md new file mode 100644 index 0000000000..292a401f75 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/locale/get-languages.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.locale import Locale + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +locale = Locale(client) + +result = locale.get_languages() diff --git a/docs/examples/0.7.0/server-python/examples/locale/get.md b/docs/examples/0.7.0/server-python/examples/locale/get.md new file mode 100644 index 0000000000..752df0123d --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/locale/get.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.locale import Locale + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +locale = Locale(client) + +result = locale.get() diff --git a/docs/examples/0.7.0/server-python/examples/storage/create-file.md b/docs/examples/0.7.0/server-python/examples/storage/create-file.md new file mode 100644 index 0000000000..52bf8b8575 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/storage/create-file.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +storage = Storage(client) + +result = storage.create_file(open('/path/to/file.png', 'rb'), [], []) diff --git a/docs/examples/0.7.0/server-python/examples/storage/delete-file.md b/docs/examples/0.7.0/server-python/examples/storage/delete-file.md new file mode 100644 index 0000000000..9379cb8820 --- /dev/null +++ b/docs/examples/0.7.0/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://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +storage = Storage(client) + +result = storage.delete_file('[FILE_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/storage/get-file-download.md b/docs/examples/0.7.0/server-python/examples/storage/get-file-download.md new file mode 100644 index 0000000000..bc815cebbe --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/storage/get-file-download.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +storage = Storage(client) + +result = storage.get_file_download('[FILE_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/storage/get-file-preview.md b/docs/examples/0.7.0/server-python/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..2d14539513 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/storage/get-file-preview.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +storage = Storage(client) + +result = storage.get_file_preview('[FILE_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/storage/get-file-view.md b/docs/examples/0.7.0/server-python/examples/storage/get-file-view.md new file mode 100644 index 0000000000..7d0b30b376 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/storage/get-file-view.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +storage = Storage(client) + +result = storage.get_file_view('[FILE_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/storage/get-file.md b/docs/examples/0.7.0/server-python/examples/storage/get-file.md new file mode 100644 index 0000000000..e8d1202e27 --- /dev/null +++ b/docs/examples/0.7.0/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://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +storage = Storage(client) + +result = storage.get_file('[FILE_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/storage/list-files.md b/docs/examples/0.7.0/server-python/examples/storage/list-files.md new file mode 100644 index 0000000000..0e72773fcb --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/storage/list-files.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +storage = Storage(client) + +result = storage.list_files() diff --git a/docs/examples/0.7.0/server-python/examples/storage/update-file.md b/docs/examples/0.7.0/server-python/examples/storage/update-file.md new file mode 100644 index 0000000000..7e1c5f61cd --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/storage/update-file.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.storage import Storage + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +storage = Storage(client) + +result = storage.update_file('[FILE_ID]', [], []) diff --git a/docs/examples/0.7.0/server-python/examples/teams/create-membership.md b/docs/examples/0.7.0/server-python/examples/teams/create-membership.md new file mode 100644 index 0000000000..9e2c832b3c --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/teams/create-membership.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +teams = Teams(client) + +result = teams.create_membership('[TEAM_ID]', 'email@example.com', [], 'https://example.com') diff --git a/docs/examples/0.7.0/server-python/examples/teams/create.md b/docs/examples/0.7.0/server-python/examples/teams/create.md new file mode 100644 index 0000000000..1debdc6109 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/teams/create.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +teams = Teams(client) + +result = teams.create('[NAME]') diff --git a/docs/examples/0.7.0/server-python/examples/teams/delete-membership.md b/docs/examples/0.7.0/server-python/examples/teams/delete-membership.md new file mode 100644 index 0000000000..af30bc1cf3 --- /dev/null +++ b/docs/examples/0.7.0/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://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +teams = Teams(client) + +result = teams.delete_membership('[TEAM_ID]', '[INVITE_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/teams/delete.md b/docs/examples/0.7.0/server-python/examples/teams/delete.md new file mode 100644 index 0000000000..8fb037cd4a --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/teams/delete.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +teams = Teams(client) + +result = teams.delete('[TEAM_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/teams/get-memberships.md b/docs/examples/0.7.0/server-python/examples/teams/get-memberships.md new file mode 100644 index 0000000000..6c6482418b --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/teams/get-memberships.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +teams = Teams(client) + +result = teams.get_memberships('[TEAM_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/teams/get.md b/docs/examples/0.7.0/server-python/examples/teams/get.md new file mode 100644 index 0000000000..6c2b404517 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/teams/get.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +teams = Teams(client) + +result = teams.get('[TEAM_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/teams/list.md b/docs/examples/0.7.0/server-python/examples/teams/list.md new file mode 100644 index 0000000000..c538aea340 --- /dev/null +++ b/docs/examples/0.7.0/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://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +teams = Teams(client) + +result = teams.list() diff --git a/docs/examples/0.7.0/server-python/examples/teams/update.md b/docs/examples/0.7.0/server-python/examples/teams/update.md new file mode 100644 index 0000000000..2b9c222be0 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/teams/update.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.teams import Teams + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +teams = Teams(client) + +result = teams.update('[TEAM_ID]', '[NAME]') diff --git a/docs/examples/0.7.0/server-python/examples/users/create.md b/docs/examples/0.7.0/server-python/examples/users/create.md new file mode 100644 index 0000000000..2cfe228ee0 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/users/create.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.create('email@example.com', 'password') diff --git a/docs/examples/0.7.0/server-python/examples/users/delete-session.md b/docs/examples/0.7.0/server-python/examples/users/delete-session.md new file mode 100644 index 0000000000..d25cfb3abc --- /dev/null +++ b/docs/examples/0.7.0/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://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.delete_session('[USER_ID]', '[SESSION_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/users/delete-sessions.md b/docs/examples/0.7.0/server-python/examples/users/delete-sessions.md new file mode 100644 index 0000000000..9b24db1b5c --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/users/delete-sessions.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.delete_sessions('[USER_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/users/delete-user.md b/docs/examples/0.7.0/server-python/examples/users/delete-user.md new file mode 100644 index 0000000000..1520823a36 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/users/delete-user.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.delete_user('[USER_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/users/get-logs.md b/docs/examples/0.7.0/server-python/examples/users/get-logs.md new file mode 100644 index 0000000000..c93ae244c8 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/users/get-logs.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.get_logs('[USER_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/users/get-prefs.md b/docs/examples/0.7.0/server-python/examples/users/get-prefs.md new file mode 100644 index 0000000000..9ef100f9e6 --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/users/get-prefs.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.get_prefs('[USER_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/users/get-sessions.md b/docs/examples/0.7.0/server-python/examples/users/get-sessions.md new file mode 100644 index 0000000000..4de3120dfb --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/users/get-sessions.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.get_sessions('[USER_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/users/get.md b/docs/examples/0.7.0/server-python/examples/users/get.md new file mode 100644 index 0000000000..c11f96e64b --- /dev/null +++ b/docs/examples/0.7.0/server-python/examples/users/get.md @@ -0,0 +1,14 @@ +from appwrite.client import Client +from appwrite.services.users import Users + +client = Client() + +(client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.get('[USER_ID]') diff --git a/docs/examples/0.7.0/server-python/examples/users/list.md b/docs/examples/0.7.0/server-python/examples/users/list.md new file mode 100644 index 0000000000..c4a66e42d2 --- /dev/null +++ b/docs/examples/0.7.0/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://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.list() diff --git a/docs/examples/0.7.0/server-python/examples/users/update-prefs.md b/docs/examples/0.7.0/server-python/examples/users/update-prefs.md new file mode 100644 index 0000000000..7e0fe7c35a --- /dev/null +++ b/docs/examples/0.7.0/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://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.update_prefs('[USER_ID]', {}) diff --git a/docs/examples/0.7.0/server-python/examples/users/update-status.md b/docs/examples/0.7.0/server-python/examples/users/update-status.md new file mode 100644 index 0000000000..28fd587deb --- /dev/null +++ b/docs/examples/0.7.0/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://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +users = Users(client) + +result = users.update_status('[USER_ID]', '1') diff --git a/docs/examples/0.7.0/server-ruby/examples/avatars/get-browser.md b/docs/examples/0.7.0/server-ruby/examples/avatars/get-browser.md new file mode 100644 index 0000000000..fc0cfc913f --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/avatars/get-browser.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +avatars = Appwrite::Avatars.new(client); + +response = avatars.get_browser(code: 'aa'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/avatars/get-credit-card.md b/docs/examples/0.7.0/server-ruby/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..b3763f0846 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/avatars/get-credit-card.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +avatars = Appwrite::Avatars.new(client); + +response = avatars.get_credit_card(code: 'amex'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/avatars/get-favicon.md b/docs/examples/0.7.0/server-ruby/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..2ee4e75789 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/avatars/get-favicon.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +avatars = Appwrite::Avatars.new(client); + +response = avatars.get_favicon(url: 'https://example.com'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/avatars/get-flag.md b/docs/examples/0.7.0/server-ruby/examples/avatars/get-flag.md new file mode 100644 index 0000000000..2e2f01f0f9 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/avatars/get-flag.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +avatars = Appwrite::Avatars.new(client); + +response = avatars.get_flag(code: 'af'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/avatars/get-image.md b/docs/examples/0.7.0/server-ruby/examples/avatars/get-image.md new file mode 100644 index 0000000000..682d6bf9df --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/avatars/get-image.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +avatars = Appwrite::Avatars.new(client); + +response = avatars.get_image(url: 'https://example.com'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/avatars/get-initials.md b/docs/examples/0.7.0/server-ruby/examples/avatars/get-initials.md new file mode 100644 index 0000000000..11878a6da7 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/avatars/get-initials.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +avatars = Appwrite::Avatars.new(client); + +response = avatars.get_initials(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/avatars/get-q-r.md b/docs/examples/0.7.0/server-ruby/examples/avatars/get-q-r.md new file mode 100644 index 0000000000..f145425ca2 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/avatars/get-q-r.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +avatars = Appwrite::Avatars.new(client); + +response = avatars.get_q_r(text: '[TEXT]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/database/create-collection.md b/docs/examples/0.7.0/server-ruby/examples/database/create-collection.md new file mode 100644 index 0000000000..0317ed9f05 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/database/create-collection.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.create_collection(name: '[NAME]', read: [], write: [], rules: []); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/database/create-document.md b/docs/examples/0.7.0/server-ruby/examples/database/create-document.md new file mode 100644 index 0000000000..0101c746b4 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/database/create-document.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.create_document(collection_id: '[COLLECTION_ID]', data: {}, read: [], write: []); + +puts response \ No newline at end of file diff --git a/app/sdks/server-ruby/docs/examples/database/get-collection-logs.md b/docs/examples/0.7.0/server-ruby/examples/database/delete-collection.md similarity index 80% rename from app/sdks/server-ruby/docs/examples/database/get-collection-logs.md rename to docs/examples/0.7.0/server-ruby/examples/database/delete-collection.md index 65938d1af9..b91c369da7 100644 --- a/app/sdks/server-ruby/docs/examples/database/get-collection-logs.md +++ b/docs/examples/0.7.0/server-ruby/examples/database/delete-collection.md @@ -10,6 +10,6 @@ client database = Appwrite::Database.new(client); -response = database.get_collection_logs(collection_id: '[COLLECTION_ID]'); +response = database.delete_collection(collection_id: '[COLLECTION_ID]'); puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/database/delete-document.md b/docs/examples/0.7.0/server-ruby/examples/database/delete-document.md new file mode 100644 index 0000000000..6548ec2946 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/database/delete-document.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.delete_document(collection_id: '[COLLECTION_ID]', document_id: '[DOCUMENT_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/database/get-collection.md b/docs/examples/0.7.0/server-ruby/examples/database/get-collection.md new file mode 100644 index 0000000000..1e54e94c10 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/database/get-collection.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.get_collection(collection_id: '[COLLECTION_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/database/get-document.md b/docs/examples/0.7.0/server-ruby/examples/database/get-document.md new file mode 100644 index 0000000000..3040b82c03 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/database/get-document.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.get_document(collection_id: '[COLLECTION_ID]', document_id: '[DOCUMENT_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/database/list-collections.md b/docs/examples/0.7.0/server-ruby/examples/database/list-collections.md new file mode 100644 index 0000000000..ec15fe3b08 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/database/list-collections.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.list_collections(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/database/list-documents.md b/docs/examples/0.7.0/server-ruby/examples/database/list-documents.md new file mode 100644 index 0000000000..fa33f10ccf --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/database/list-documents.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.list_documents(collection_id: '[COLLECTION_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/database/update-collection.md b/docs/examples/0.7.0/server-ruby/examples/database/update-collection.md new file mode 100644 index 0000000000..3ecfbdb4ab --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/database/update-collection.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.update_collection(collection_id: '[COLLECTION_ID]', name: '[NAME]', read: [], write: []); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/database/update-document.md b/docs/examples/0.7.0/server-ruby/examples/database/update-document.md new file mode 100644 index 0000000000..492d4f3edc --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/database/update-document.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.update_document(collection_id: '[COLLECTION_ID]', document_id: '[DOCUMENT_ID]', data: {}, read: [], write: []); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/functions/create-execution.md b/docs/examples/0.7.0/server-ruby/examples/functions/create-execution.md new file mode 100644 index 0000000000..775b4d7a98 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/functions/create-execution.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +functions = Appwrite::Functions.new(client); + +response = functions.create_execution(function_id: '[FUNCTION_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/functions/create-tag.md b/docs/examples/0.7.0/server-ruby/examples/functions/create-tag.md new file mode 100644 index 0000000000..3e05f11b94 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/functions/create-tag.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +functions = Appwrite::Functions.new(client); + +response = functions.create_tag(function_id: '[FUNCTION_ID]', command: '[COMMAND]', code: File.new()); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/functions/create.md b/docs/examples/0.7.0/server-ruby/examples/functions/create.md new file mode 100644 index 0000000000..e790c1ae1a --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/functions/create.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +functions = Appwrite::Functions.new(client); + +response = functions.create(name: '[NAME]', env: 'node-14'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/functions/delete-tag.md b/docs/examples/0.7.0/server-ruby/examples/functions/delete-tag.md new file mode 100644 index 0000000000..72e9b00164 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/functions/delete-tag.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +functions = Appwrite::Functions.new(client); + +response = functions.delete_tag(function_id: '[FUNCTION_ID]', tag_id: '[TAG_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/functions/delete.md b/docs/examples/0.7.0/server-ruby/examples/functions/delete.md new file mode 100644 index 0000000000..41a02e994e --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/functions/delete.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +functions = Appwrite::Functions.new(client); + +response = functions.delete(function_id: '[FUNCTION_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/functions/get-execution.md b/docs/examples/0.7.0/server-ruby/examples/functions/get-execution.md new file mode 100644 index 0000000000..73e2ddd5d6 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/functions/get-execution.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +functions = Appwrite::Functions.new(client); + +response = functions.get_execution(function_id: '[FUNCTION_ID]', execution_id: '[EXECUTION_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/functions/get-tag.md b/docs/examples/0.7.0/server-ruby/examples/functions/get-tag.md new file mode 100644 index 0000000000..61c78a0d61 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/functions/get-tag.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +functions = Appwrite::Functions.new(client); + +response = functions.get_tag(function_id: '[FUNCTION_ID]', tag_id: '[TAG_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/functions/get.md b/docs/examples/0.7.0/server-ruby/examples/functions/get.md new file mode 100644 index 0000000000..44d89f873b --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/functions/get.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +functions = Appwrite::Functions.new(client); + +response = functions.get(function_id: '[FUNCTION_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/functions/list-executions.md b/docs/examples/0.7.0/server-ruby/examples/functions/list-executions.md new file mode 100644 index 0000000000..cd7eef772a --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/functions/list-executions.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +functions = Appwrite::Functions.new(client); + +response = functions.list_executions(function_id: '[FUNCTION_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/functions/list-tags.md b/docs/examples/0.7.0/server-ruby/examples/functions/list-tags.md new file mode 100644 index 0000000000..ea1a613570 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/functions/list-tags.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +functions = Appwrite::Functions.new(client); + +response = functions.list_tags(function_id: '[FUNCTION_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/functions/list.md b/docs/examples/0.7.0/server-ruby/examples/functions/list.md new file mode 100644 index 0000000000..6d5a151bba --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/functions/list.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +functions = Appwrite::Functions.new(client); + +response = functions.list(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/functions/update-tag.md b/docs/examples/0.7.0/server-ruby/examples/functions/update-tag.md new file mode 100644 index 0000000000..e95c8fb945 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/functions/update-tag.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +functions = Appwrite::Functions.new(client); + +response = functions.update_tag(function_id: '[FUNCTION_ID]', tag: '[TAG]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/functions/update.md b/docs/examples/0.7.0/server-ruby/examples/functions/update.md new file mode 100644 index 0000000000..16133e9e59 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/functions/update.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +functions = Appwrite::Functions.new(client); + +response = functions.update(function_id: '[FUNCTION_ID]', name: '[NAME]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/health/get-anti-virus.md b/docs/examples/0.7.0/server-ruby/examples/health/get-anti-virus.md new file mode 100644 index 0000000000..0c83a06cf8 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/health/get-anti-virus.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_anti_virus(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/health/get-cache.md b/docs/examples/0.7.0/server-ruby/examples/health/get-cache.md new file mode 100644 index 0000000000..6f51fb6e00 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/health/get-cache.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_cache(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/health/get-d-b.md b/docs/examples/0.7.0/server-ruby/examples/health/get-d-b.md new file mode 100644 index 0000000000..4bb00577a7 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/health/get-d-b.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_d_b(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/health/get-queue-certificates.md b/docs/examples/0.7.0/server-ruby/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..f758b7c3a4 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/health/get-queue-certificates.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_queue_certificates(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/health/get-queue-functions.md b/docs/examples/0.7.0/server-ruby/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..653607f79d --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/health/get-queue-functions.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_queue_functions(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/health/get-queue-logs.md b/docs/examples/0.7.0/server-ruby/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..c6751f7f91 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/health/get-queue-logs.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_queue_logs(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/health/get-queue-tasks.md b/docs/examples/0.7.0/server-ruby/examples/health/get-queue-tasks.md new file mode 100644 index 0000000000..c6da38832e --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/health/get-queue-tasks.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_queue_tasks(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/health/get-queue-usage.md b/docs/examples/0.7.0/server-ruby/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..ed81452d86 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/health/get-queue-usage.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_queue_usage(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/health/get-queue-webhooks.md b/docs/examples/0.7.0/server-ruby/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..9e55ab1d87 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/health/get-queue-webhooks.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_queue_webhooks(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/health/get-storage-local.md b/docs/examples/0.7.0/server-ruby/examples/health/get-storage-local.md new file mode 100644 index 0000000000..09c47ae437 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/health/get-storage-local.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_storage_local(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/health/get-time.md b/docs/examples/0.7.0/server-ruby/examples/health/get-time.md new file mode 100644 index 0000000000..3d72794e93 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/health/get-time.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_time(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/health/get.md b/docs/examples/0.7.0/server-ruby/examples/health/get.md new file mode 100644 index 0000000000..9496c31b36 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/health/get.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/locale/get-continents.md b/docs/examples/0.7.0/server-ruby/examples/locale/get-continents.md new file mode 100644 index 0000000000..92f38922e1 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/locale/get-continents.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +locale = Appwrite::Locale.new(client); + +response = locale.get_continents(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/locale/get-countries-e-u.md b/docs/examples/0.7.0/server-ruby/examples/locale/get-countries-e-u.md new file mode 100644 index 0000000000..b83125d4a6 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/locale/get-countries-e-u.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +locale = Appwrite::Locale.new(client); + +response = locale.get_countries_e_u(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/locale/get-countries-phones.md b/docs/examples/0.7.0/server-ruby/examples/locale/get-countries-phones.md new file mode 100644 index 0000000000..728a1b3cdc --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/locale/get-countries-phones.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +locale = Appwrite::Locale.new(client); + +response = locale.get_countries_phones(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/locale/get-countries.md b/docs/examples/0.7.0/server-ruby/examples/locale/get-countries.md new file mode 100644 index 0000000000..54975db928 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/locale/get-countries.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +locale = Appwrite::Locale.new(client); + +response = locale.get_countries(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/locale/get-currencies.md b/docs/examples/0.7.0/server-ruby/examples/locale/get-currencies.md new file mode 100644 index 0000000000..4e39b435e1 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/locale/get-currencies.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +locale = Appwrite::Locale.new(client); + +response = locale.get_currencies(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/locale/get-languages.md b/docs/examples/0.7.0/server-ruby/examples/locale/get-languages.md new file mode 100644 index 0000000000..64e74eece0 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/locale/get-languages.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +locale = Appwrite::Locale.new(client); + +response = locale.get_languages(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/locale/get.md b/docs/examples/0.7.0/server-ruby/examples/locale/get.md new file mode 100644 index 0000000000..b390d505c4 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/locale/get.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +locale = Appwrite::Locale.new(client); + +response = locale.get(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/storage/create-file.md b/docs/examples/0.7.0/server-ruby/examples/storage/create-file.md new file mode 100644 index 0000000000..b044e35b86 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/storage/create-file.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +storage = Appwrite::Storage.new(client); + +response = storage.create_file(file: File.new(), read: [], write: []); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/storage/delete-file.md b/docs/examples/0.7.0/server-ruby/examples/storage/delete-file.md new file mode 100644 index 0000000000..1aa67b3537 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/storage/delete-file.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +storage = Appwrite::Storage.new(client); + +response = storage.delete_file(file_id: '[FILE_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/storage/get-file-download.md b/docs/examples/0.7.0/server-ruby/examples/storage/get-file-download.md new file mode 100644 index 0000000000..777c565d06 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/storage/get-file-download.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +storage = Appwrite::Storage.new(client); + +response = storage.get_file_download(file_id: '[FILE_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/storage/get-file-preview.md b/docs/examples/0.7.0/server-ruby/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..48be3a044e --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/storage/get-file-preview.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +storage = Appwrite::Storage.new(client); + +response = storage.get_file_preview(file_id: '[FILE_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/storage/get-file-view.md b/docs/examples/0.7.0/server-ruby/examples/storage/get-file-view.md new file mode 100644 index 0000000000..a3dc012098 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/storage/get-file-view.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +storage = Appwrite::Storage.new(client); + +response = storage.get_file_view(file_id: '[FILE_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/storage/get-file.md b/docs/examples/0.7.0/server-ruby/examples/storage/get-file.md new file mode 100644 index 0000000000..203a4dff7c --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/storage/get-file.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +storage = Appwrite::Storage.new(client); + +response = storage.get_file(file_id: '[FILE_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/storage/list-files.md b/docs/examples/0.7.0/server-ruby/examples/storage/list-files.md new file mode 100644 index 0000000000..a148da78f9 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/storage/list-files.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +storage = Appwrite::Storage.new(client); + +response = storage.list_files(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/storage/update-file.md b/docs/examples/0.7.0/server-ruby/examples/storage/update-file.md new file mode 100644 index 0000000000..36d5049816 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/storage/update-file.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +storage = Appwrite::Storage.new(client); + +response = storage.update_file(file_id: '[FILE_ID]', read: [], write: []); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/teams/create-membership.md b/docs/examples/0.7.0/server-ruby/examples/teams/create-membership.md new file mode 100644 index 0000000000..fc0a249361 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/teams/create-membership.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +teams = Appwrite::Teams.new(client); + +response = teams.create_membership(team_id: '[TEAM_ID]', email: 'email@example.com', roles: [], url: 'https://example.com'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/teams/create.md b/docs/examples/0.7.0/server-ruby/examples/teams/create.md new file mode 100644 index 0000000000..d7f9c2f8c0 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/teams/create.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +teams = Appwrite::Teams.new(client); + +response = teams.create(name: '[NAME]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/teams/delete-membership.md b/docs/examples/0.7.0/server-ruby/examples/teams/delete-membership.md new file mode 100644 index 0000000000..545cacc51f --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/teams/delete-membership.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +teams = Appwrite::Teams.new(client); + +response = teams.delete_membership(team_id: '[TEAM_ID]', invite_id: '[INVITE_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/teams/delete.md b/docs/examples/0.7.0/server-ruby/examples/teams/delete.md new file mode 100644 index 0000000000..d28907f741 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/teams/delete.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +teams = Appwrite::Teams.new(client); + +response = teams.delete(team_id: '[TEAM_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/teams/get-memberships.md b/docs/examples/0.7.0/server-ruby/examples/teams/get-memberships.md new file mode 100644 index 0000000000..013d952afc --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/teams/get-memberships.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +teams = Appwrite::Teams.new(client); + +response = teams.get_memberships(team_id: '[TEAM_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/teams/get.md b/docs/examples/0.7.0/server-ruby/examples/teams/get.md new file mode 100644 index 0000000000..1dd4918a12 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/teams/get.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +teams = Appwrite::Teams.new(client); + +response = teams.get(team_id: '[TEAM_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/teams/list.md b/docs/examples/0.7.0/server-ruby/examples/teams/list.md new file mode 100644 index 0000000000..c0cd72a362 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/teams/list.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +teams = Appwrite::Teams.new(client); + +response = teams.list(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/teams/update.md b/docs/examples/0.7.0/server-ruby/examples/teams/update.md new file mode 100644 index 0000000000..b7e87a8e09 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/teams/update.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +teams = Appwrite::Teams.new(client); + +response = teams.update(team_id: '[TEAM_ID]', name: '[NAME]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/users/create.md b/docs/examples/0.7.0/server-ruby/examples/users/create.md new file mode 100644 index 0000000000..0a152ac366 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/users/create.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.create(email: 'email@example.com', password: 'password'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/users/delete-session.md b/docs/examples/0.7.0/server-ruby/examples/users/delete-session.md new file mode 100644 index 0000000000..149c7d9293 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/users/delete-session.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.delete_session(user_id: '[USER_ID]', session_id: '[SESSION_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/users/delete-sessions.md b/docs/examples/0.7.0/server-ruby/examples/users/delete-sessions.md new file mode 100644 index 0000000000..3f02e08dd1 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/users/delete-sessions.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.delete_sessions(user_id: '[USER_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/users/delete-user.md b/docs/examples/0.7.0/server-ruby/examples/users/delete-user.md new file mode 100644 index 0000000000..3a0bcb0407 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/users/delete-user.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.delete_user(user_id: '[USER_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/users/get-logs.md b/docs/examples/0.7.0/server-ruby/examples/users/get-logs.md new file mode 100644 index 0000000000..695a77ad27 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/users/get-logs.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.get_logs(user_id: '[USER_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/users/get-prefs.md b/docs/examples/0.7.0/server-ruby/examples/users/get-prefs.md new file mode 100644 index 0000000000..4a0761e283 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/users/get-prefs.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.get_prefs(user_id: '[USER_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/users/get-sessions.md b/docs/examples/0.7.0/server-ruby/examples/users/get-sessions.md new file mode 100644 index 0000000000..52f37a4609 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/users/get-sessions.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.get_sessions(user_id: '[USER_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/users/get.md b/docs/examples/0.7.0/server-ruby/examples/users/get.md new file mode 100644 index 0000000000..562ac958c3 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/users/get.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.get(user_id: '[USER_ID]'); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/users/list.md b/docs/examples/0.7.0/server-ruby/examples/users/list.md new file mode 100644 index 0000000000..096ce859e3 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/users/list.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.list(); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/users/update-prefs.md b/docs/examples/0.7.0/server-ruby/examples/users/update-prefs.md new file mode 100644 index 0000000000..2bb2d42e16 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/users/update-prefs.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.update_prefs(user_id: '[USER_ID]', prefs: {}); + +puts response \ No newline at end of file diff --git a/docs/examples/0.7.0/server-ruby/examples/users/update-status.md b/docs/examples/0.7.0/server-ruby/examples/users/update-status.md new file mode 100644 index 0000000000..088ee380d8 --- /dev/null +++ b/docs/examples/0.7.0/server-ruby/examples/users/update-status.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.update_status(user_id: '[USER_ID]', status: '1'); + +puts response \ No newline at end of file diff --git a/docs/examples/README.md b/docs/examples/README.md new file mode 100644 index 0000000000..edcb3f29fa --- /dev/null +++ b/docs/examples/README.md @@ -0,0 +1 @@ +All code examples in the version named directories are auto-generated using the Appwrite SDK Generator, Please refer to https://github.com/appwrite/sdk-generator for submmiting any pull-requests. \ No newline at end of file diff --git a/docs/examples/javascript/auth/login.md b/docs/examples/javascript/auth/login.md index 2254a3bc0d..5edb2547e4 100644 --- a/docs/examples/javascript/auth/login.md +++ b/docs/examples/javascript/auth/login.md @@ -11,6 +11,6 @@ sdk sdk.auth.login( 'email@example.com', 'password', - 'http://example.com/success', // required for JS SDK - 'http://example.com/failure' // required for JS SDK + 'http://example.com/success', // required for Web SDK + 'http://example.com/failure' // required for Web SDK ); \ No newline at end of file diff --git a/docs/examples/javascript/auth/register.md b/docs/examples/javascript/auth/register.md index b0943d7e55..715c36cef1 100644 --- a/docs/examples/javascript/auth/register.md +++ b/docs/examples/javascript/auth/register.md @@ -12,6 +12,6 @@ sdk.auth.register( 'email@example.com', 'password', 'http://example.com/confirm', - 'http://example.com/success', // required for JS SDK - 'http://example.com/failure' // required for JS SDK + 'http://example.com/success', // required for Web SDK + 'http://example.com/failure' // required for Web SDK ); \ No newline at end of file diff --git a/docs/lists/clients.json b/docs/lists/clients.json new file mode 100644 index 0000000000..1f80f9ef04 --- /dev/null +++ b/docs/lists/clients.json @@ -0,0 +1,122 @@ +{ + "36": "360 Phone Browser", + "3B": "360 Browser", + "AA": "Avant Browser", + "AB": "ABrowse", + "AG": "ANTGalio", + "AM": "Amaya", + "AO": "Amigo", + "AN": "Android Browser", + "AR": "Arora", + "AV": "Amiga Voyager", + "AW": "Amiga Aweb", + "BB": "BlackBerry Browser", + "BD": "Baidu Browser", + "BS": "Baidu Spark", + "BE": "Beonex", + "BJ": "Bunjalloo", + "BX": "BrowseX", + "CA": "Camino", + "CC": "Coc Coc", + "CD": "Comodo Dragon", + "CX": "Charon", + "CF": "Chrome Frame", + "CH": "Chrome", + "CI": "Chrome Mobile iOS", + "CK": "Conkeror", + "CM": "Chrome Mobile", + "CN": "CoolNovo", + "CO": "CometBird", + "CP": "ChromePlus", + "CR": "Chromium", + "CS": "Cheshire", + "DE": "Deepnet Explorer", + "DF": "Dolphin", + "DI": "Dillo", + "EL": "Elinks", + "EP": "Epiphany", + "ES": "Espial TV Browser", + "FB": "Firebird", + "FD": "Fluid", + "FE": "Fennec", + "FF": "Firefox", + "FL": "Flock", + "FN": "Fireweb Navigator", + "GA": "Galeon", + "GE": "Google Earth", + "HJ": "HotJava", + "IA": "Iceape", + "IB": "IBrowse", + "IC": "iCab", + "ID": "IceDragon", + "IW": "Iceweasel", + "IE": "Internet Explorer", + "IM": "IE Mobile", + "IR": "Iron", + "JS": "Jasmine", + "KI": "Kindle Browser", + "KM": "K-meleon", + "KO": "Konqueror", + "KP": "Kapiko", + "KY": "Kylo", + "KZ": "Kazehakase", + "LB": "Liebao", + "LI": "Links", + "LS": "Lunascape", + "LX": "Lynx", + "MB": "MicroB", + "MC": "NCSA Mosaic", + "ME": "Mercury", + "MF": "Mobile Safari", + "MI": "Midori", + "MU": "MIUI Browser", + "MS": "Mobile Silk", + "MX": "Maxthon", + "NB": "Nokia Browser", + "NO": "Nokia OSS Browser", + "NV": "Nokia Ovi Browser", + "NF": "NetFront", + "NL": "NetFront Life", + "NP": "NetPositive", + "NS": "Netscape", + "OB": "Obigo", + "OD": "Odyssey Web Browser", + "OF": "Off By One", + "OE": "ONE Browser", + "OI": "Opera Mini", + "OM": "Opera Mobile", + "OP": "Opera", + "ON": "Opera Next", + "OR": "Oregano", + "OV": "Openwave Mobile Browser", + "OW": "OmniWeb", + "PL": "Palm Blazer", + "PM": "Pale Moon", + "PR": "Palm Pre", + "PU": "Puffin", + "PW": "Palm WebPro", + "PX": "Phoenix", + "PO": "Polaris", + "PS": "Microsoft Edge", + "QQ": "QQ Browser", + "RK": "Rekonq", + "RM": "RockMelt", + "SA": "Sailfish Browser", + "SC": "SEMC-Browser", + "SE": "Sogou Explorer", + "SF": "Safari", + "SH": "Shiira", + "SL": "Sleipnir", + "SM": "SeaMonkey", + "SN": "Snowshoe", + "SR": "Sunrise", + "SX": "Swiftfox", + "TZ": "Tizen Browser", + "UC": "UC Browser", + "VI": "Vivaldi", + "WE": "WebPositive", + "WO": "wOSBrowser", + "WT": "WeTab Browser", + "YA": "Yandex Browser", + "XI": "Xiino" +} \ No newline at end of file diff --git a/docs/lists/os.json b/docs/lists/os.json new file mode 100644 index 0000000000..6f78847227 --- /dev/null +++ b/docs/lists/os.json @@ -0,0 +1,78 @@ +{ + "AIX": "AIX", + "AND": "Android", + "AMG": "AmigaOS", + "ATV": "Apple TV", + "ARL": "Arch Linux", + "BTR": "BackTrack", + "SBA": "Bada", + "BEO": "BeOS", + "BLB": "BlackBerry OS", + "QNX": "BlackBerry Tablet OS", + "BMP": "Brew", + "CES": "CentOS", + "COS": "Chrome OS", + "CYN": "CyanogenMod", + "DEB": "Debian", + "DFB": "DragonFly", + "FED": "Fedora", + "FOS": "Firefox OS", + "BSD": "FreeBSD", + "GNT": "Gentoo", + "GTV": "Google TV", + "HPX": "HP-UX", + "HAI": "Haiku OS", + "IRI": "IRIX", + "INF": "Inferno", + "KNO": "Knoppix", + "KBT": "Kubuntu", + "LIN": "GNU\/Linux", + "LBT": "Lubuntu", + "VLN": "VectorLinux", + "MAC": "Mac", + "MAE": "Maemo", + "MDR": "Mandriva", + "SMG": "MeeGo", + "MCD": "MocorDroid", + "MIN": "Mint", + "MLD": "MildWild", + "MOR": "MorphOS", + "NBS": "NetBSD", + "MTK": "MTK \/ Nucleus", + "WII": "Nintendo", + "NDS": "Nintendo Mobile", + "OS2": "OS\/2", + "T64": "OSF1", + "OBS": "OpenBSD", + "PSP": "PlayStation Portable", + "PS3": "PlayStation", + "RHT": "Red Hat", + "ROS": "RISC OS", + "RZD": "RazoDroiD", + "SAB": "Sabayon", + "SSE": "SUSE", + "SAF": "Sailfish OS", + "SLW": "Slackware", + "SOS": "Solaris", + "SYL": "Syllable", + "SYM": "Symbian", + "SYS": "Symbian OS", + "S40": "Symbian OS Series 40", + "S60": "Symbian OS Series 60", + "SY3": "Symbian^3", + "TDX": "ThreadX", + "TIZ": "Tizen", + "UBT": "Ubuntu", + "WTV": "WebTV", + "WIN": "Windows", + "WCE": "Windows CE", + "WMO": "Windows Mobile", + "WPH": "Windows Phone", + "WRT": "Windows RT", + "XBX": "Xbox", + "XBT": "Xubuntu", + "YNS": "YunOs", + "IOS": "iOS", + "POS": "palmOS", + "WOS": "webOS" +} \ No newline at end of file diff --git a/docs/references/avatars/get-credit-card.md b/docs/references/avatars/get-credit-card.md index e0b3e97ace..8e7fb59bbd 100644 --- a/docs/references/avatars/get-credit-card.md +++ b/docs/references/avatars/get-credit-card.md @@ -1 +1 @@ -Need to display your users with your billing method or their payment methods? 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. \ No newline at end of file +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. \ No newline at end of file diff --git a/docs/references/database/list-collections.md b/docs/references/database/list-collections.md index b71a823f0b..1cf18ef8b9 100644 --- a/docs/references/database/list-collections.md +++ b/docs/references/database/list-collections.md @@ -1 +1 @@ -Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](/docs/admin). \ No newline at end of file +Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's collections. [Learn more about different API modes](/docs/admin). \ No newline at end of file diff --git a/docs/references/database/list-documents.md b/docs/references/database/list-documents.md index 8d8edbdb85..7c93be3a63 100644 --- a/docs/references/database/list-documents.md +++ b/docs/references/database/list-documents.md @@ -1 +1 @@ -Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](/docs/admin). \ No newline at end of file +Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's documents. [Learn more about different API modes](/docs/admin). \ No newline at end of file diff --git a/docs/references/functions/create-execution.md b/docs/references/functions/create-execution.md new file mode 100644 index 0000000000..6089c4ff01 --- /dev/null +++ b/docs/references/functions/create-execution.md @@ -0,0 +1 @@ +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. \ No newline at end of file diff --git a/docs/references/functions/create-function.md b/docs/references/functions/create-function.md new file mode 100644 index 0000000000..1461b06e0f --- /dev/null +++ b/docs/references/functions/create-function.md @@ -0,0 +1 @@ +Create a new function. You can pass a list of [permissions](/docs/permissions) to allow different project users or team with access to execute the function using the client API. \ No newline at end of file diff --git a/docs/references/functions/create-tag.md b/docs/references/functions/create-tag.md new file mode 100644 index 0000000000..15f1bb1c65 --- /dev/null +++ b/docs/references/functions/create-tag.md @@ -0,0 +1,5 @@ +Create a new function code tag. 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 tag to use your new tag UID. + +This 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](/docs/functions). + +Use the "command" param to set the entry point used to execute your code. \ No newline at end of file diff --git a/docs/references/functions/delete-function.md b/docs/references/functions/delete-function.md new file mode 100644 index 0000000000..92835e3c82 --- /dev/null +++ b/docs/references/functions/delete-function.md @@ -0,0 +1 @@ +Delete a function by its unique ID. \ No newline at end of file diff --git a/docs/references/functions/delete-tag.md b/docs/references/functions/delete-tag.md new file mode 100644 index 0000000000..698ecc8927 --- /dev/null +++ b/docs/references/functions/delete-tag.md @@ -0,0 +1 @@ +Delete a code tag by its unique ID. \ No newline at end of file diff --git a/docs/references/functions/get-execution.md b/docs/references/functions/get-execution.md new file mode 100644 index 0000000000..fc38260bdb --- /dev/null +++ b/docs/references/functions/get-execution.md @@ -0,0 +1 @@ +Get a function execution log by its unique ID. \ No newline at end of file diff --git a/docs/references/functions/get-function.md b/docs/references/functions/get-function.md new file mode 100644 index 0000000000..557ec316ba --- /dev/null +++ b/docs/references/functions/get-function.md @@ -0,0 +1 @@ +Get a function by its unique ID. \ No newline at end of file diff --git a/docs/references/functions/get-tag.md b/docs/references/functions/get-tag.md new file mode 100644 index 0000000000..804e1bc87f --- /dev/null +++ b/docs/references/functions/get-tag.md @@ -0,0 +1 @@ +Get a code tag by its unique ID. \ No newline at end of file diff --git a/docs/references/functions/list-executions.md b/docs/references/functions/list-executions.md new file mode 100644 index 0000000000..82faa3b913 --- /dev/null +++ b/docs/references/functions/list-executions.md @@ -0,0 +1 @@ +Get a list of all the current user function execution logs. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's teams. [Learn more about different API modes](/docs/admin). \ No newline at end of file diff --git a/docs/references/functions/list-functions.md b/docs/references/functions/list-functions.md new file mode 100644 index 0000000000..9ad432fdc0 --- /dev/null +++ b/docs/references/functions/list-functions.md @@ -0,0 +1 @@ +Get a list of all the project's functions. You can use the query params to filter your results. \ No newline at end of file diff --git a/docs/references/functions/list-tags.md b/docs/references/functions/list-tags.md new file mode 100644 index 0000000000..d872894a64 --- /dev/null +++ b/docs/references/functions/list-tags.md @@ -0,0 +1 @@ +Get a list of all the project's code tags. You can use the query params to filter your results. \ No newline at end of file diff --git a/docs/references/functions/update-function-tag.md b/docs/references/functions/update-function-tag.md new file mode 100644 index 0000000000..5d38628682 --- /dev/null +++ b/docs/references/functions/update-function-tag.md @@ -0,0 +1 @@ +Update the function code tag ID using the unique function ID. Use this endpoint to switch the code tag that should be executed by the execution endpoint. \ No newline at end of file diff --git a/docs/references/functions/update-function.md b/docs/references/functions/update-function.md new file mode 100644 index 0000000000..5a9a84ad94 --- /dev/null +++ b/docs/references/functions/update-function.md @@ -0,0 +1 @@ +Update function by its unique ID. \ No newline at end of file diff --git a/docs/references/storage/get-file-download.md b/docs/references/storage/get-file-download.md index 11cb96a9f5..044d58340f 100644 --- a/docs/references/storage/get-file-download.md +++ b/docs/references/storage/get-file-download.md @@ -1 +1 @@ -Get 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. \ No newline at end of file +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. \ No newline at end of file diff --git a/docs/references/storage/get-file-view.md b/docs/references/storage/get-file-view.md index 4bb5abb3c7..1263364b15 100644 --- a/docs/references/storage/get-file-view.md +++ b/docs/references/storage/get-file-view.md @@ -1 +1 @@ -Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. \ No newline at end of file +Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. \ No newline at end of file diff --git a/docs/references/storage/get-file.md b/docs/references/storage/get-file.md index 56db5c8457..0b7069ae57 100644 --- a/docs/references/storage/get-file.md +++ b/docs/references/storage/get-file.md @@ -1 +1 @@ -Get file by its unique ID. This endpoint response returns a JSON object with the file metadata. \ No newline at end of file +Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata. \ No newline at end of file diff --git a/docs/references/storage/list-files.md b/docs/references/storage/list-files.md index 39cb76750b..9bf3618974 100644 --- a/docs/references/storage/list-files.md +++ b/docs/references/storage/list-files.md @@ -1 +1 @@ -Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](/docs/admin). \ No newline at end of file +Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's files. [Learn more about different API modes](/docs/admin). \ No newline at end of file diff --git a/docs/references/storage/update-file.md b/docs/references/storage/update-file.md index abc44a782c..461c137c5c 100644 --- a/docs/references/storage/update-file.md +++ b/docs/references/storage/update-file.md @@ -1 +1 @@ -Update file by its unique ID. Only users with write permissions have access to update this resource. \ No newline at end of file +Update a file by its unique ID. Only users with write permissions have access to update this resource. \ No newline at end of file diff --git a/docs/references/teams/delete-team.md b/docs/references/teams/delete-team.md index a9e48c5a43..887dfcc06f 100644 --- a/docs/references/teams/delete-team.md +++ b/docs/references/teams/delete-team.md @@ -1 +1 @@ -Delete team by its unique ID. Only team owners have write access for this resource. \ No newline at end of file +Delete a team by its unique ID. Only team owners have write access for this resource. \ No newline at end of file diff --git a/docs/references/teams/get-team-members.md b/docs/references/teams/get-team-members.md index b5a33667d9..ee939b9978 100644 --- a/docs/references/teams/get-team-members.md +++ b/docs/references/teams/get-team-members.md @@ -1 +1 @@ -Get team members by the team unique ID. All team members have read access for this list of resources. \ No newline at end of file +Get a team members by the team unique ID. All team members have read access for this list of resources. \ No newline at end of file diff --git a/docs/references/teams/get-team.md b/docs/references/teams/get-team.md index eda8865e78..800612ab15 100644 --- a/docs/references/teams/get-team.md +++ b/docs/references/teams/get-team.md @@ -1 +1 @@ -Get team by its unique ID. All team members have read access for this resource. \ No newline at end of file +Get a team by its unique ID. All team members have read access for this resource. \ No newline at end of file diff --git a/docs/references/teams/list-teams.md b/docs/references/teams/list-teams.md index 8df8128b8c..04a3959e4c 100644 --- a/docs/references/teams/list-teams.md +++ b/docs/references/teams/list-teams.md @@ -1 +1 @@ -Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](/docs/admin). \ No newline at end of file +Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's teams. [Learn more about different API modes](/docs/admin). \ No newline at end of file diff --git a/docs/references/teams/update-team.md b/docs/references/teams/update-team.md index 219989f0cd..afa84135a2 100644 --- a/docs/references/teams/update-team.md +++ b/docs/references/teams/update-team.md @@ -1 +1 @@ -Update team by its unique ID. Only team owners have write access for this resource. \ No newline at end of file +Update a team by its unique ID. Only team owners have write access for this resource. \ No newline at end of file diff --git a/docs/references/users/delete-user-session.md b/docs/references/users/delete-user-session.md index 7ce030a4a3..c207a78c53 100644 --- a/docs/references/users/delete-user-session.md +++ b/docs/references/users/delete-user-session.md @@ -1 +1 @@ -Delete user sessions by its unique ID. \ No newline at end of file +Delete a user sessions by its unique ID. \ No newline at end of file diff --git a/docs/references/users/delete-user-sessions.md b/docs/references/users/delete-user-sessions.md index 7c78dcd637..35375365d6 100644 --- a/docs/references/users/delete-user-sessions.md +++ b/docs/references/users/delete-user-sessions.md @@ -1 +1 @@ -Delete all user sessions by its unique ID. \ No newline at end of file +Delete all user's sessions by using the user's unique ID. \ No newline at end of file diff --git a/docs/references/users/get-user-logs.md b/docs/references/users/get-user-logs.md index e188651e80..b86d419a85 100644 --- a/docs/references/users/get-user-logs.md +++ b/docs/references/users/get-user-logs.md @@ -1 +1 @@ -Get user activity logs list by its unique ID. \ No newline at end of file +Get a user activity logs list by its unique ID. \ No newline at end of file diff --git a/docs/references/users/get-user-prefs.md b/docs/references/users/get-user-prefs.md index 0a704cfa34..d24a4f9608 100644 --- a/docs/references/users/get-user-prefs.md +++ b/docs/references/users/get-user-prefs.md @@ -1 +1 @@ -Get user preferences by its unique ID. \ No newline at end of file +Get the user preferences by its unique ID. \ No newline at end of file diff --git a/docs/references/users/get-user-sessions.md b/docs/references/users/get-user-sessions.md index acb9005302..844600e86b 100644 --- a/docs/references/users/get-user-sessions.md +++ b/docs/references/users/get-user-sessions.md @@ -1 +1 @@ -Get user sessions list by its unique ID. \ No newline at end of file +Get the user sessions list by its unique ID. \ No newline at end of file diff --git a/docs/references/users/get-user.md b/docs/references/users/get-user.md index 60cdf21cac..35d82f2a8a 100644 --- a/docs/references/users/get-user.md +++ b/docs/references/users/get-user.md @@ -1 +1 @@ -Get user by its unique ID. \ No newline at end of file +Get a user by its unique ID. \ No newline at end of file diff --git a/docs/references/users/list-users.md b/docs/references/users/list-users.md index fa7855bc22..76f1470119 100644 --- a/docs/references/users/list-users.md +++ b/docs/references/users/list-users.md @@ -1 +1 @@ -Get a list of all the project users. You can use the query params to filter your results. \ No newline at end of file +Get a list of all the project's users. You can use the query params to filter your results. \ No newline at end of file diff --git a/docs/references/users/update-user-prefs.md b/docs/references/users/update-user-prefs.md index b61a54c6a6..cb06d4a7f3 100644 --- a/docs/references/users/update-user-prefs.md +++ b/docs/references/users/update-user-prefs.md @@ -1 +1 @@ -Update user preferences by its unique ID. You can pass only the specific settings you wish to update. \ No newline at end of file +Update the user preferences by its unique ID. You can pass only the specific settings you wish to update. \ No newline at end of file diff --git a/docs/references/users/update-user-status.md b/docs/references/users/update-user-status.md index fc334c322b..0eee46ec51 100644 --- a/docs/references/users/update-user-status.md +++ b/docs/references/users/update-user-status.md @@ -1 +1 @@ -Update user status by its unique ID. \ No newline at end of file +Update the user status by its unique ID. \ No newline at end of file diff --git a/docs/sdks/javascript/CHANGELOG.md b/docs/sdks/javascript/CHANGELOG.md deleted file mode 100644 index fa4d35e687..0000000000 --- a/docs/sdks/javascript/CHANGELOG.md +++ /dev/null @@ -1 +0,0 @@ -# Change Log \ No newline at end of file diff --git a/app/sdks/client-swift/CHANGELOG.md b/docs/sdks/web/CHANGELOG.md similarity index 100% rename from app/sdks/client-swift/CHANGELOG.md rename to docs/sdks/web/CHANGELOG.md diff --git a/docs/sdks/javascript/README.md b/docs/sdks/web/README.md similarity index 93% rename from docs/sdks/javascript/README.md rename to docs/sdks/web/README.md index 8ab72889ee..d1becb4c31 100644 --- a/docs/sdks/javascript/README.md +++ b/docs/sdks/web/README.md @@ -4,7 +4,7 @@ Initialise the Appwrite SDK in your code, and setup your API credentials: ```js -// Init your JS SDK +// Init your Web SDK var appwrite = new Appwrite(); appwrite diff --git a/docs/tutorials/add-oauth2-provider.md b/docs/tutorials/add-oauth2-provider.md index 5d46cac1f2..21e8f8495a 100644 --- a/docs/tutorials/add-oauth2-provider.md +++ b/docs/tutorials/add-oauth2-provider.md @@ -49,7 +49,7 @@ After you finished adding your new provider to Appwrite you should be able to se Add credentials and check both a successful and a failed login (where the user denies integration on provider page). -You can test your OAuth2 provider by trying to login using the [OAuth2 method](https://appwrite.io/docs/client/account#createOAuth2Session) when integrating the Appwrite JS SDK in a demo app. +You can test your OAuth2 provider by trying to login using the [OAuth2 method](https://appwrite.io/docs/client/account#createOAuth2Session) when integrating the Appwrite Web SDK in a demo app. Pass your new adapter name as the provider parameter. If login is successful, you will be redirected to your success URL parameter. Otherwise, you will be redirected to your failure URL. diff --git a/package-lock.json b/package-lock.json index 379c63882a..681d22522d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3455,8 +3455,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", - "dev": true, - "optional": true + "dev": true }, "gulp": { "version": "4.0.2", @@ -4274,7 +4273,6 @@ "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", "dev": true, - "optional": true, "requires": { "is-docker": "^2.0.0" } @@ -6003,6 +6001,15 @@ "signal-exit": "^3.0.0" } }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, "ls-service-form2json": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/ls-service-form2json/-/ls-service-form2json-1.0.0.tgz", @@ -6311,11 +6318,10 @@ "dev": true }, "node-notifier": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-8.0.0.tgz", - "integrity": "sha512-46z7DUmcjoYdaWyXouuFNNfUo6eFa94t23c53c+lG/9Cvauk4a98rAUp9672X5dxGdQmLpPzTxzu8f/OeEPaFA==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-8.0.1.tgz", + "integrity": "sha512-BvEXF+UmsnAfYfoapKM9nGxnP+Wn7P91YfXmrKnfcYCx6VBeoN5Ez5Ogck6I8Bi5k4RlpqRYaw75pAwzX9OphA==", "dev": true, - "optional": true, "requires": { "growly": "^1.3.0", "is-wsl": "^2.2.0", @@ -6326,25 +6332,25 @@ }, "dependencies": { "semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", "dev": true, - "optional": true + "requires": { + "lru-cache": "^6.0.0" + } }, "uuid": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.0.tgz", - "integrity": "sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ==", - "dev": true, - "optional": true + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, - "optional": true, "requires": { "isexe": "^2.0.0" } @@ -7311,8 +7317,7 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", - "dev": true, - "optional": true + "dev": true }, "signal-exit": { "version": "3.0.2", @@ -8445,6 +8450,12 @@ "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", "dev": true }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "yargs": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", diff --git a/public/dist/scripts/app-all.js b/public/dist/scripts/app-all.js index dafe2bb8e1..2fce7ece17 100644 --- a/public/dist/scripts/app-all.js +++ b/public/dist/scripts/app-all.js @@ -205,7 +205,9 @@ return http.post(path,{'content-type':'multipart/form-data',},payload);},getTag: if(tagId===undefined){throw new Error('Missing required parameter: "tagId"');} let path='/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}','g'),functionId).replace(new RegExp('{tagId}','g'),tagId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},deleteTag:function(functionId,tagId){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} if(tagId===undefined){throw new Error('Missing required parameter: "tagId"');} -let path='/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}','g'),functionId).replace(new RegExp('{tagId}','g'),tagId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);}};let health={get:function(){let path='/health';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getAntiVirus:function(){let path='/health/anti-virus';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCache:function(){let path='/health/cache';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getDB:function(){let path='/health/db';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueCertificates:function(){let path='/health/queue/certificates';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueFunctions:function(){let path='/health/queue/functions';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueLogs:function(){let path='/health/queue/logs';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueTasks:function(){let path='/health/queue/tasks';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueUsage:function(){let path='/health/queue/usage';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueWebhooks:function(){let path='/health/queue/webhooks';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getStorageLocal:function(){let path='/health/storage/local';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getTime:function(){let path='/health/time';let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let locale={get:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getContinents:function(){let path='/locale/continents';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getLanguages:function(){let path='/locale/languages';let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let projects={list:function(search='',limit=25,offset=0,orderType='ASC'){let path='/projects';let payload={};if(search){payload['search']=search;} +let path='/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}','g'),functionId).replace(new RegExp('{tagId}','g'),tagId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getUsage:function(functionId,range='last30'){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} +let path='/functions/{functionId}/usage'.replace(new RegExp('{functionId}','g'),functionId);let payload={};if(range){payload['range']=range;} +return http.get(path,{'content-type':'application/json',},payload);}};let health={get:function(){let path='/health';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getAntiVirus:function(){let path='/health/anti-virus';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCache:function(){let path='/health/cache';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getDB:function(){let path='/health/db';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueCertificates:function(){let path='/health/queue/certificates';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueFunctions:function(){let path='/health/queue/functions';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueLogs:function(){let path='/health/queue/logs';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueTasks:function(){let path='/health/queue/tasks';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueUsage:function(){let path='/health/queue/usage';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueWebhooks:function(){let path='/health/queue/webhooks';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getStorageLocal:function(){let path='/health/storage/local';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getTime:function(){let path='/health/time';let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let locale={get:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getContinents:function(){let path='/locale/continents';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getLanguages:function(){let path='/locale/languages';let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let projects={list:function(search='',limit=25,offset=0,orderType='ASC'){let path='/projects';let payload={};if(search){payload['search']=search;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderType){payload['orderType']=orderType;} @@ -1959,7 +1961,8 @@ if(service.instance){return service.instance;} let instance=(typeof service.object==='function')?this.resolve(service.object):service.object;let skip=false;if(service.watch&&name!=='window'&&name!=='document'&&name!=='element'&&typeof instance==='object'&&instance!==null){let handler={name:service.name,watch:function(){},get:function(target,key){if(key==="__name"){return this.name;} if(key==="__watch"){return this.watch;} if(key==="__proxy"){return true;} -if(typeof target[key]==='object'&&target[key]!==null&&!target[key].__proxy){let handler=Object.assign({},this);handler.name=handler.name+'.'+key;return new Proxy(target[key],handler)}else{return target[key];}},set:function(target,key,value,receiver){if(key==="__name"){return this.name=value;} +if(typeof target[key]==='object'&&target[key]!==null&&!target[key].__proxy){let handler=Object.assign({},this);handler.name=handler.name+'.'+key;return new Proxy(target[key],handler)} +else{return target[key];}},set:function(target,key,value,receiver){if(key==="__name"){return this.name=value;} if(key==="__watch"){return this.watch=value;} target[key]=value;let path=receiver.__name+'.'+key;document.dispatchEvent(new CustomEvent(path+'.changed'));if(skip){return true;} skip=true;container.set('$prop',key,true);container.set('$value',value,true);container.resolve(this.watch);container.set('$key',null,true);container.set('$value',null,true);skip=false;return true;},};instance=new Proxy(instance,handler);} @@ -1976,7 +1979,8 @@ object[shift].unshift(value);break;case'splice':if(!Array.isArray(object[shift]) object[shift].splice(value,1);break;default:object[shift]=value;} return true;} if(!object){return null;} -if(!shift){result=object;}else{return object[shift];} +if(!shift){result=object;} +else{return object[shift];} return result;};let bind=function(element,path,callback){let event=container.scope(path)+'.changed';let service=event.split('.').slice(0,1).pop();let debug=element.getAttribute('data-debug')||false;listeners[service]=listeners[service]||{};listeners[service][event]=true;let printer=(function(x){return function(){if(!document.body.contains(element)){element=null;document.removeEventListener(event,printer,false);return false;} let oldNamespaces=namespaces;namespaces=x;callback();namespaces=oldNamespaces;}}(Object.assign({},namespaces)));document.addEventListener(event,printer);};let addNamespace=function(key,scope){namespaces[key]=scope;return this;} let removeNamespace=function(key){delete namespaces[key];return this;} @@ -1987,9 +1991,10 @@ if(typeof url!=='string'){throw new Error('var url must be of type string');} if(typeof headers!=='object'){throw new Error('var headers must be of type object');} if(typeof url!=='string'){throw new Error('var url must be of type string');} for(i=0;i-1?part.substr(0,eq):part;let val=eq>-1?decodeURIComponent(part.substr(eq+1)):'';let from=key.indexOf('[');if(from===-1){result[decodeURIComponent(key)]=val;}else{let to=key.indexOf(']');let index=decodeURIComponent(key.substring(from+1,to));key=decodeURIComponent(key.substring(0,from));if(!result[key]){result[key]=[];} -if(!index){result[key].push(val);}else{result[key][index]=val;}}});return result;};let states=[];let params=getJsonFromUrl(window.location.search);let hash=window.location.hash;let current=null;let previous=null;let getPrevious=()=>previous;let getCurrent=()=>current;let setPrevious=(value)=>{previous=value;return this;};let setCurrent=(value)=>{current=value;return this;};let setParam=function(key,value){params[key]=value;return this;};let getParam=function(key,def){if(key in params){return params[key];} +part=part.split('+').join(' ');let eq=part.indexOf('=');let key=eq>-1?part.substr(0,eq):part;let val=eq>-1?decodeURIComponent(part.substr(eq+1)):'';let from=key.indexOf('[');if(from===-1){result[decodeURIComponent(key)]=val;} +else{let to=key.indexOf(']');let index=decodeURIComponent(key.substring(from+1,to));key=decodeURIComponent(key.substring(0,from));if(!result[key]){result[key]=[];} +if(!index){result[key].push(val);} +else{result[key][index]=val;}}});return result;};let states=[];let params=getJsonFromUrl(window.location.search);let hash=window.location.hash;let current=null;let previous=null;let getPrevious=()=>previous;let getCurrent=()=>current;let setPrevious=(value)=>{previous=value;return this;};let setCurrent=(value)=>{current=value;return this;};let setParam=function(key,value){params[key]=value;return this;};let getParam=function(key,def){if(key in params){return params[key];} return def;};let getParams=function(){return params;};let getURL=function(){return window.location.href;};let add=function(path,view){if(typeof path!=='string'){throw new Error('path must be of type string');} if(typeof view!=='object'){throw new Error('view must be of type object');} states[states.length++]={path:path,view:view};return this;};let match=function(location){let url=location.pathname;states.sort(function(a,b){return b.path.length-a.path.length;});states.sort(function(a,b){let n=b.path.split('/').length-a.path.split('/').length;if(n!==0){return n;} return b.path.length-a.path.length;});for(let i=0;i{let reference=match.substring(2,match.length-2).replace('[\'','.').replace('\']','').trim();reference=reference.split('|');let path=container.scope((reference[0]||''));let result=container.path(path);path=container.scope(path);if(!paths.includes(path)){paths.push(path);} if(reference.length>=2){for(let i=1;ipaths,}},true,false);window.ls.container.set('filter',function(container){let filters={};let add=function(name,callback){filters[name]=callback;return this;};let apply=function(name,value){container.set('$value',value,true,false);return container.resolve(filters[name]);};add('uppercase',($value)=>{if(typeof $value!=='string'){return $value;} return $value.toUpperCase();});add('lowercase',($value)=>{if(typeof $value!=='string'){return $value;} return $value.toLowerCase();});return{add:add,apply:apply}},true,false);window.ls.container.get('filter').add('escape',value=>{if(typeof value!=='string'){return value;} -return value.replace(/&/g,'&').replace(//g,'>').replace(/\"/g,'"').replace(/\'/g,''').replace(/\//g,'/');});window.ls=window.ls||{};window.ls.container.set('window',window,true,false).set('document',window.document,true,false).set('element',window.document,true,false);window.ls.run=function(window){try{this.view.render(window.document);}catch(error){let handler=window.ls.container.resolve(this.error);handler(error);}};window.ls.error=()=>{return error=>{console.error('ls-error',error.message,error.stack,error.toString());}};window.ls.router=window.ls.container.get('router');window.ls.view=window.ls.container.get('view');window.ls.filter=window.ls.container.get('filter');window.ls.container.get('view').add({selector:'data-ls-router',repeat:false,controller:function(element,window,document,view,router){let firstFromServer=(element.getAttribute('data-first-from-server')==='true');let scope={selector:'data-ls-scope',template:false,repeat:true,controller:function(){},};let init=function(route){let count=parseInt(element.getAttribute('data-ls-scope-count')||0);element.setAttribute('data-ls-scope-count',count+1);window.scrollTo(0,0);if(window.document.body.scrollTo){window.document.body.scrollTo(0,0);} +return value.replace(/&/g,'&').replace(//g,'>').replace(/\"/g,'"').replace(/\'/g,''').replace(/\//g,'/');});window.ls=window.ls||{};window.ls.container.set('window',window,true,false).set('document',window.document,true,false).set('element',window.document,true,false);window.ls.run=function(window){try{this.view.render(window.document);} +catch(error){let handler=window.ls.container.resolve(this.error);handler(error);}};window.ls.error=()=>{return error=>{console.error('ls-error',error.message,error.stack,error.toString());}};window.ls.router=window.ls.container.get('router');window.ls.view=window.ls.container.get('view');window.ls.filter=window.ls.container.get('filter');window.ls.container.get('view').add({selector:'data-ls-router',controller:function(element,window,document,view,router){let firstFromServer=(element.getAttribute('data-first-from-server')==='true');let scope={selector:'data-ls-scope',template:false,repeat:true,controller:function(){},};let init=function(route){let count=parseInt(element.getAttribute('data-ls-scope-count')||0);element.setAttribute('data-ls-scope-count',count+1);window.scrollTo(0,0);if(window.document.body.scrollTo){window.document.body.scrollTo(0,0);} router.reset();if(null===route){return;} -scope.template=(undefined!==route.view.template)?route.view.template:null;scope.controller=(undefined!==route.view.controller)?route.view.controller:function(){};document.dispatchEvent(new CustomEvent('state-change'));if(firstFromServer&&null===router.getPrevious()){scope.template='';document.dispatchEvent(new CustomEvent('state-changed'));}else if(count===1){view.render(element,function(){document.dispatchEvent(new CustomEvent('state-changed'));});}else if(null!==router.getPrevious()){view.render(element,function(){document.dispatchEvent(new CustomEvent('state-changed'));});}};let findParent=function(tagName,el){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;} +scope.template=(undefined!==route.view.template)?route.view.template:null;scope.controller=(undefined!==route.view.controller)?route.view.controller:function(){};document.dispatchEvent(new CustomEvent('state-change'));if(firstFromServer&&null===router.getPrevious()){scope.template='';document.dispatchEvent(new CustomEvent('state-changed'));} +else if(count===1){view.render(element,function(){document.dispatchEvent(new CustomEvent('state-changed'));});} +else if(null!==router.getPrevious()){view.render(element,function(){document.dispatchEvent(new CustomEvent('state-changed'));});}};let findParent=function(tagName,el){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;} while(el=el.parentNode){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;}} return null;};element.removeAttribute('data-ls-router');element.setAttribute('data-ls-scope','');element.setAttribute('data-ls-scope-count',1);view.add(scope);document.addEventListener('click',function(event){let target=findParent('a',event.target);if(!target){return false;} if(!target.href){return false;} @@ -2041,32 +2054,40 @@ window.history.pushState({},'Unknown',target.href);} init(route);return true;});window.addEventListener('popstate',function(){init(router.match(window.location));});window.addEventListener('hashchange',function(){init(router.match(window.location));});init(router.match(window.location));}});window.ls.container.get('view').add({selector:'data-ls-attrs',controller:function(element,expression,container){let attrs=element.getAttribute('data-ls-attrs').trim().split(',');let paths=[];let debug=element.getAttribute('data-debug')||false;let check=()=>{container.set('element',element,true,false);if(debug){console.info('debug-ls-attrs attributes:',attrs);} for(let i=0;i{for(let i=0;i-1));value=element.value;}catch{return null;}} +if('checkbox'===type){if(typeof value==='boolean'||value==='true'||value==='false'){if(value===true||value==='true'){element.setAttribute('checked','checked');element.checked=true;} +else{element.removeAttribute('checked');element.checked=false;}} +else{try{value=JSON.parse(value);element.checked=(Array.isArray(value)&&(value.indexOf(element.value)>-1));value=element.value;} +catch{return null;}} if(bind){element.addEventListener('change',()=>{for(let i=0;i-1){value.splice(index,1);} container.path(paths[i],value);}});} return;} if(element.value!==value){element.value=value;element.dispatchEvent(new Event('change'));} -if(bind){element.addEventListener('input',sync);element.addEventListener('change',sync);}}else{if(element.textContent!=value){element.innerHTML=value;}}};let sync=(()=>{return()=>{if(debug){console.info('debug-ls-bind','sync-path',paths);console.info('debug-ls-bind','sync-syntax',syntax);console.info('debug-ls-bind','sync-syntax-parsed',parsedSyntax);console.info('debug-ls-bind','sync-value',element.value);} +if(bind){element.addEventListener('input',sync);element.addEventListener('change',sync);}} +else{if(element.innerHTML!=value){element.innerHTML=value;}}};let sync=(()=>{return()=>{if(debug){console.info('debug-ls-bind','sync-path',paths);console.info('debug-ls-bind','sync-syntax',syntax);console.info('debug-ls-bind','sync-syntax-parsed',parsedSyntax);console.info('debug-ls-bind','sync-value',element.value);} for(let i=0;i{echo(expression.parse(parsedSyntax),false);});path.pop();}}}});window.ls.container.get('view').add({selector:'data-ls-if',controller:function(element,expression,container,view){let result='';let syntax=element.getAttribute('data-ls-if')||'';let debug=element.getAttribute('data-debug')||false;let paths=[];let check=()=>{if(debug){console.info('debug-ls-if',expression.parse(syntax.replace(/(\r\n|\n|\r)/gm,' '),'undefined',true));} -try{result=(eval(expression.parse(syntax.replace(/(\r\n|\n|\r)/gm,' '),'undefined',true)));}catch(error){throw new Error('Failed to evaluate expression "'+syntax+' (resulted with: "'+result+'")": '+error);} +try{result=(eval(expression.parse(syntax.replace(/(\r\n|\n|\r)/gm,' '),'undefined',true)));} +catch(error){throw new Error('Failed to evaluate expression "'+syntax+' (resulted with: "'+result+'")": '+error);} if(debug){console.info('debug-ls-if result:',result);} -paths=expression.getPaths();let prv=element.$lsSkip;element.$lsSkip=!result;if(!result){element.style.visibility='hidden';element.style.display='none';}else{element.style.removeProperty('display');element.style.removeProperty('visibility');} -if(prv===true&&element.$lsSkip===false){view.render(element)}};check();for(let i=0;i{let context=expr+'.'+index;container.addNamespace(as,context);if(debug){console.info('debug-ls-loop','index',index);console.info('debug-ls-loop','context',context);console.info('debug-ls-loop','context-path',container.path(context).name);console.info('debug-ls-loop','namespaces',container.namespaces);} container.set(as,container.path(context),true,watch);container.set(key,index,true,false);view.render(children[prop]);container.removeNamespace(as);})(prop);} -element.dispatchEvent(new Event('looped'));};let template=(element.children.length===1)?element.children[0]:window.document.createElement('li');echo();container.bind(element,expr+'.length',echo);let path=(expr+'.length').split('.');while(path.length){container.bind(element,path.join('.'),echo);path.pop();}}});window.ls.container.get('view').add({selector:'data-ls-template',template:false,repeat:false,controller:function(element,view,http,expression,document,container){let template=element.getAttribute('data-ls-template')||'';let type=element.getAttribute('data-type')||'url';let debug=element.getAttribute('data-debug')||false;let paths=[];let check=function(init=false){let source=expression.parse(template);paths=expression.getPaths();element.innerHTML='';if('script'===type){let inlineTemplate=document.getElementById(source);if(inlineTemplate&&inlineTemplate.innerHTML){element.innerHTML=inlineTemplate.innerHTML;element.dispatchEvent(new CustomEvent('template-loaded',{bubbles:true,cancelable:false}));}else{if(debug){console.error('Missing template "'+source+'"');}} +element.dispatchEvent(new Event('looped'));};let template=(element.children.length===1)?element.children[0]:window.document.createElement('li');echo();container.bind(element,expr+'.length',echo);let path=(expr+'.length').split('.');while(path.length){container.bind(element,path.join('.'),echo);path.pop();}}});window.ls.container.get('view').add({selector:'data-ls-template',template:false,controller:function(element,view,http,expression,document,container){let template=element.getAttribute('data-ls-template')||'';let type=element.getAttribute('data-type')||'url';let debug=element.getAttribute('data-debug')||false;let paths=[];let check=function(init=false){let source=expression.parse(template);paths=expression.getPaths();element.innerHTML='';if('script'===type){let inlineTemplate=document.getElementById(source);if(inlineTemplate&&inlineTemplate.innerHTML){element.innerHTML=inlineTemplate.innerHTML;element.dispatchEvent(new CustomEvent('template-loaded',{bubbles:true,cancelable:false}));} +else{if(debug){console.error('Missing template "'+source+'"');}} if(!init){view.render(element);} return;} http.get(source).then(function(element){return function(data){element.innerHTML=data;view.render(element);element.dispatchEvent(new CustomEvent('template-loaded',{bubbles:true,cancelable:false}));}}(element),function(){throw new Error('Failed loading template');});};check(true);for(let i=0;iscope.max){scope.list.pop();scope.counter--;} diff --git a/public/dist/scripts/app-dep.js b/public/dist/scripts/app-dep.js index ffd1339d07..d51698ef7f 100644 --- a/public/dist/scripts/app-dep.js +++ b/public/dist/scripts/app-dep.js @@ -205,7 +205,9 @@ return http.post(path,{'content-type':'multipart/form-data',},payload);},getTag: if(tagId===undefined){throw new Error('Missing required parameter: "tagId"');} let path='/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}','g'),functionId).replace(new RegExp('{tagId}','g'),tagId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},deleteTag:function(functionId,tagId){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} if(tagId===undefined){throw new Error('Missing required parameter: "tagId"');} -let path='/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}','g'),functionId).replace(new RegExp('{tagId}','g'),tagId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);}};let health={get:function(){let path='/health';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getAntiVirus:function(){let path='/health/anti-virus';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCache:function(){let path='/health/cache';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getDB:function(){let path='/health/db';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueCertificates:function(){let path='/health/queue/certificates';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueFunctions:function(){let path='/health/queue/functions';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueLogs:function(){let path='/health/queue/logs';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueTasks:function(){let path='/health/queue/tasks';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueUsage:function(){let path='/health/queue/usage';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueWebhooks:function(){let path='/health/queue/webhooks';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getStorageLocal:function(){let path='/health/storage/local';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getTime:function(){let path='/health/time';let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let locale={get:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getContinents:function(){let path='/locale/continents';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getLanguages:function(){let path='/locale/languages';let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let projects={list:function(search='',limit=25,offset=0,orderType='ASC'){let path='/projects';let payload={};if(search){payload['search']=search;} +let path='/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}','g'),functionId).replace(new RegExp('{tagId}','g'),tagId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getUsage:function(functionId,range='last30'){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} +let path='/functions/{functionId}/usage'.replace(new RegExp('{functionId}','g'),functionId);let payload={};if(range){payload['range']=range;} +return http.get(path,{'content-type':'application/json',},payload);}};let health={get:function(){let path='/health';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getAntiVirus:function(){let path='/health/anti-virus';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCache:function(){let path='/health/cache';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getDB:function(){let path='/health/db';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueCertificates:function(){let path='/health/queue/certificates';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueFunctions:function(){let path='/health/queue/functions';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueLogs:function(){let path='/health/queue/logs';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueTasks:function(){let path='/health/queue/tasks';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueUsage:function(){let path='/health/queue/usage';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueWebhooks:function(){let path='/health/queue/webhooks';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getStorageLocal:function(){let path='/health/storage/local';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getTime:function(){let path='/health/time';let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let locale={get:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getContinents:function(){let path='/locale/continents';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getLanguages:function(){let path='/locale/languages';let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let projects={list:function(search='',limit=25,offset=0,orderType='ASC'){let path='/projects';let payload={};if(search){payload['search']=search;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderType){payload['orderType']=orderType;} diff --git a/public/dist/scripts/app.js b/public/dist/scripts/app.js index 2c73bc0649..63fed54b1b 100644 --- a/public/dist/scripts/app.js +++ b/public/dist/scripts/app.js @@ -8,7 +8,8 @@ if(service.instance){return service.instance;} let instance=(typeof service.object==='function')?this.resolve(service.object):service.object;let skip=false;if(service.watch&&name!=='window'&&name!=='document'&&name!=='element'&&typeof instance==='object'&&instance!==null){let handler={name:service.name,watch:function(){},get:function(target,key){if(key==="__name"){return this.name;} if(key==="__watch"){return this.watch;} if(key==="__proxy"){return true;} -if(typeof target[key]==='object'&&target[key]!==null&&!target[key].__proxy){let handler=Object.assign({},this);handler.name=handler.name+'.'+key;return new Proxy(target[key],handler)}else{return target[key];}},set:function(target,key,value,receiver){if(key==="__name"){return this.name=value;} +if(typeof target[key]==='object'&&target[key]!==null&&!target[key].__proxy){let handler=Object.assign({},this);handler.name=handler.name+'.'+key;return new Proxy(target[key],handler)} +else{return target[key];}},set:function(target,key,value,receiver){if(key==="__name"){return this.name=value;} if(key==="__watch"){return this.watch=value;} target[key]=value;let path=receiver.__name+'.'+key;document.dispatchEvent(new CustomEvent(path+'.changed'));if(skip){return true;} skip=true;container.set('$prop',key,true);container.set('$value',value,true);container.resolve(this.watch);container.set('$key',null,true);container.set('$value',null,true);skip=false;return true;},};instance=new Proxy(instance,handler);} @@ -25,7 +26,8 @@ object[shift].unshift(value);break;case'splice':if(!Array.isArray(object[shift]) object[shift].splice(value,1);break;default:object[shift]=value;} return true;} if(!object){return null;} -if(!shift){result=object;}else{return object[shift];} +if(!shift){result=object;} +else{return object[shift];} return result;};let bind=function(element,path,callback){let event=container.scope(path)+'.changed';let service=event.split('.').slice(0,1).pop();let debug=element.getAttribute('data-debug')||false;listeners[service]=listeners[service]||{};listeners[service][event]=true;let printer=(function(x){return function(){if(!document.body.contains(element)){element=null;document.removeEventListener(event,printer,false);return false;} let oldNamespaces=namespaces;namespaces=x;callback();namespaces=oldNamespaces;}}(Object.assign({},namespaces)));document.addEventListener(event,printer);};let addNamespace=function(key,scope){namespaces[key]=scope;return this;} let removeNamespace=function(key){delete namespaces[key];return this;} @@ -36,9 +38,10 @@ if(typeof url!=='string'){throw new Error('var url must be of type string');} if(typeof headers!=='object'){throw new Error('var headers must be of type object');} if(typeof url!=='string'){throw new Error('var url must be of type string');} for(i=0;i-1?part.substr(0,eq):part;let val=eq>-1?decodeURIComponent(part.substr(eq+1)):'';let from=key.indexOf('[');if(from===-1){result[decodeURIComponent(key)]=val;}else{let to=key.indexOf(']');let index=decodeURIComponent(key.substring(from+1,to));key=decodeURIComponent(key.substring(0,from));if(!result[key]){result[key]=[];} -if(!index){result[key].push(val);}else{result[key][index]=val;}}});return result;};let states=[];let params=getJsonFromUrl(window.location.search);let hash=window.location.hash;let current=null;let previous=null;let getPrevious=()=>previous;let getCurrent=()=>current;let setPrevious=(value)=>{previous=value;return this;};let setCurrent=(value)=>{current=value;return this;};let setParam=function(key,value){params[key]=value;return this;};let getParam=function(key,def){if(key in params){return params[key];} +part=part.split('+').join(' ');let eq=part.indexOf('=');let key=eq>-1?part.substr(0,eq):part;let val=eq>-1?decodeURIComponent(part.substr(eq+1)):'';let from=key.indexOf('[');if(from===-1){result[decodeURIComponent(key)]=val;} +else{let to=key.indexOf(']');let index=decodeURIComponent(key.substring(from+1,to));key=decodeURIComponent(key.substring(0,from));if(!result[key]){result[key]=[];} +if(!index){result[key].push(val);} +else{result[key][index]=val;}}});return result;};let states=[];let params=getJsonFromUrl(window.location.search);let hash=window.location.hash;let current=null;let previous=null;let getPrevious=()=>previous;let getCurrent=()=>current;let setPrevious=(value)=>{previous=value;return this;};let setCurrent=(value)=>{current=value;return this;};let setParam=function(key,value){params[key]=value;return this;};let getParam=function(key,def){if(key in params){return params[key];} return def;};let getParams=function(){return params;};let getURL=function(){return window.location.href;};let add=function(path,view){if(typeof path!=='string'){throw new Error('path must be of type string');} if(typeof view!=='object'){throw new Error('view must be of type object');} states[states.length++]={path:path,view:view};return this;};let match=function(location){let url=location.pathname;states.sort(function(a,b){return b.path.length-a.path.length;});states.sort(function(a,b){let n=b.path.split('/').length-a.path.split('/').length;if(n!==0){return n;} return b.path.length-a.path.length;});for(let i=0;i{let reference=match.substring(2,match.length-2).replace('[\'','.').replace('\']','').trim();reference=reference.split('|');let path=container.scope((reference[0]||''));let result=container.path(path);path=container.scope(path);if(!paths.includes(path)){paths.push(path);} if(reference.length>=2){for(let i=1;ipaths,}},true,false);window.ls.container.set('filter',function(container){let filters={};let add=function(name,callback){filters[name]=callback;return this;};let apply=function(name,value){container.set('$value',value,true,false);return container.resolve(filters[name]);};add('uppercase',($value)=>{if(typeof $value!=='string'){return $value;} return $value.toUpperCase();});add('lowercase',($value)=>{if(typeof $value!=='string'){return $value;} return $value.toLowerCase();});return{add:add,apply:apply}},true,false);window.ls.container.get('filter').add('escape',value=>{if(typeof value!=='string'){return value;} -return value.replace(/&/g,'&').replace(//g,'>').replace(/\"/g,'"').replace(/\'/g,''').replace(/\//g,'/');});window.ls=window.ls||{};window.ls.container.set('window',window,true,false).set('document',window.document,true,false).set('element',window.document,true,false);window.ls.run=function(window){try{this.view.render(window.document);}catch(error){let handler=window.ls.container.resolve(this.error);handler(error);}};window.ls.error=()=>{return error=>{console.error('ls-error',error.message,error.stack,error.toString());}};window.ls.router=window.ls.container.get('router');window.ls.view=window.ls.container.get('view');window.ls.filter=window.ls.container.get('filter');window.ls.container.get('view').add({selector:'data-ls-router',repeat:false,controller:function(element,window,document,view,router){let firstFromServer=(element.getAttribute('data-first-from-server')==='true');let scope={selector:'data-ls-scope',template:false,repeat:true,controller:function(){},};let init=function(route){let count=parseInt(element.getAttribute('data-ls-scope-count')||0);element.setAttribute('data-ls-scope-count',count+1);window.scrollTo(0,0);if(window.document.body.scrollTo){window.document.body.scrollTo(0,0);} +return value.replace(/&/g,'&').replace(//g,'>').replace(/\"/g,'"').replace(/\'/g,''').replace(/\//g,'/');});window.ls=window.ls||{};window.ls.container.set('window',window,true,false).set('document',window.document,true,false).set('element',window.document,true,false);window.ls.run=function(window){try{this.view.render(window.document);} +catch(error){let handler=window.ls.container.resolve(this.error);handler(error);}};window.ls.error=()=>{return error=>{console.error('ls-error',error.message,error.stack,error.toString());}};window.ls.router=window.ls.container.get('router');window.ls.view=window.ls.container.get('view');window.ls.filter=window.ls.container.get('filter');window.ls.container.get('view').add({selector:'data-ls-router',controller:function(element,window,document,view,router){let firstFromServer=(element.getAttribute('data-first-from-server')==='true');let scope={selector:'data-ls-scope',template:false,repeat:true,controller:function(){},};let init=function(route){let count=parseInt(element.getAttribute('data-ls-scope-count')||0);element.setAttribute('data-ls-scope-count',count+1);window.scrollTo(0,0);if(window.document.body.scrollTo){window.document.body.scrollTo(0,0);} router.reset();if(null===route){return;} -scope.template=(undefined!==route.view.template)?route.view.template:null;scope.controller=(undefined!==route.view.controller)?route.view.controller:function(){};document.dispatchEvent(new CustomEvent('state-change'));if(firstFromServer&&null===router.getPrevious()){scope.template='';document.dispatchEvent(new CustomEvent('state-changed'));}else if(count===1){view.render(element,function(){document.dispatchEvent(new CustomEvent('state-changed'));});}else if(null!==router.getPrevious()){view.render(element,function(){document.dispatchEvent(new CustomEvent('state-changed'));});}};let findParent=function(tagName,el){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;} +scope.template=(undefined!==route.view.template)?route.view.template:null;scope.controller=(undefined!==route.view.controller)?route.view.controller:function(){};document.dispatchEvent(new CustomEvent('state-change'));if(firstFromServer&&null===router.getPrevious()){scope.template='';document.dispatchEvent(new CustomEvent('state-changed'));} +else if(count===1){view.render(element,function(){document.dispatchEvent(new CustomEvent('state-changed'));});} +else if(null!==router.getPrevious()){view.render(element,function(){document.dispatchEvent(new CustomEvent('state-changed'));});}};let findParent=function(tagName,el){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;} while(el=el.parentNode){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;}} return null;};element.removeAttribute('data-ls-router');element.setAttribute('data-ls-scope','');element.setAttribute('data-ls-scope-count',1);view.add(scope);document.addEventListener('click',function(event){let target=findParent('a',event.target);if(!target){return false;} if(!target.href){return false;} @@ -90,32 +101,40 @@ window.history.pushState({},'Unknown',target.href);} init(route);return true;});window.addEventListener('popstate',function(){init(router.match(window.location));});window.addEventListener('hashchange',function(){init(router.match(window.location));});init(router.match(window.location));}});window.ls.container.get('view').add({selector:'data-ls-attrs',controller:function(element,expression,container){let attrs=element.getAttribute('data-ls-attrs').trim().split(',');let paths=[];let debug=element.getAttribute('data-debug')||false;let check=()=>{container.set('element',element,true,false);if(debug){console.info('debug-ls-attrs attributes:',attrs);} for(let i=0;i{for(let i=0;i-1));value=element.value;}catch{return null;}} +if('checkbox'===type){if(typeof value==='boolean'||value==='true'||value==='false'){if(value===true||value==='true'){element.setAttribute('checked','checked');element.checked=true;} +else{element.removeAttribute('checked');element.checked=false;}} +else{try{value=JSON.parse(value);element.checked=(Array.isArray(value)&&(value.indexOf(element.value)>-1));value=element.value;} +catch{return null;}} if(bind){element.addEventListener('change',()=>{for(let i=0;i-1){value.splice(index,1);} container.path(paths[i],value);}});} return;} if(element.value!==value){element.value=value;element.dispatchEvent(new Event('change'));} -if(bind){element.addEventListener('input',sync);element.addEventListener('change',sync);}}else{if(element.textContent!=value){element.innerHTML=value;}}};let sync=(()=>{return()=>{if(debug){console.info('debug-ls-bind','sync-path',paths);console.info('debug-ls-bind','sync-syntax',syntax);console.info('debug-ls-bind','sync-syntax-parsed',parsedSyntax);console.info('debug-ls-bind','sync-value',element.value);} +if(bind){element.addEventListener('input',sync);element.addEventListener('change',sync);}} +else{if(element.innerHTML!=value){element.innerHTML=value;}}};let sync=(()=>{return()=>{if(debug){console.info('debug-ls-bind','sync-path',paths);console.info('debug-ls-bind','sync-syntax',syntax);console.info('debug-ls-bind','sync-syntax-parsed',parsedSyntax);console.info('debug-ls-bind','sync-value',element.value);} for(let i=0;i{echo(expression.parse(parsedSyntax),false);});path.pop();}}}});window.ls.container.get('view').add({selector:'data-ls-if',controller:function(element,expression,container,view){let result='';let syntax=element.getAttribute('data-ls-if')||'';let debug=element.getAttribute('data-debug')||false;let paths=[];let check=()=>{if(debug){console.info('debug-ls-if',expression.parse(syntax.replace(/(\r\n|\n|\r)/gm,' '),'undefined',true));} -try{result=(eval(expression.parse(syntax.replace(/(\r\n|\n|\r)/gm,' '),'undefined',true)));}catch(error){throw new Error('Failed to evaluate expression "'+syntax+' (resulted with: "'+result+'")": '+error);} +try{result=(eval(expression.parse(syntax.replace(/(\r\n|\n|\r)/gm,' '),'undefined',true)));} +catch(error){throw new Error('Failed to evaluate expression "'+syntax+' (resulted with: "'+result+'")": '+error);} if(debug){console.info('debug-ls-if result:',result);} -paths=expression.getPaths();let prv=element.$lsSkip;element.$lsSkip=!result;if(!result){element.style.visibility='hidden';element.style.display='none';}else{element.style.removeProperty('display');element.style.removeProperty('visibility');} -if(prv===true&&element.$lsSkip===false){view.render(element)}};check();for(let i=0;i{let context=expr+'.'+index;container.addNamespace(as,context);if(debug){console.info('debug-ls-loop','index',index);console.info('debug-ls-loop','context',context);console.info('debug-ls-loop','context-path',container.path(context).name);console.info('debug-ls-loop','namespaces',container.namespaces);} container.set(as,container.path(context),true,watch);container.set(key,index,true,false);view.render(children[prop]);container.removeNamespace(as);})(prop);} -element.dispatchEvent(new Event('looped'));};let template=(element.children.length===1)?element.children[0]:window.document.createElement('li');echo();container.bind(element,expr+'.length',echo);let path=(expr+'.length').split('.');while(path.length){container.bind(element,path.join('.'),echo);path.pop();}}});window.ls.container.get('view').add({selector:'data-ls-template',template:false,repeat:false,controller:function(element,view,http,expression,document,container){let template=element.getAttribute('data-ls-template')||'';let type=element.getAttribute('data-type')||'url';let debug=element.getAttribute('data-debug')||false;let paths=[];let check=function(init=false){let source=expression.parse(template);paths=expression.getPaths();element.innerHTML='';if('script'===type){let inlineTemplate=document.getElementById(source);if(inlineTemplate&&inlineTemplate.innerHTML){element.innerHTML=inlineTemplate.innerHTML;element.dispatchEvent(new CustomEvent('template-loaded',{bubbles:true,cancelable:false}));}else{if(debug){console.error('Missing template "'+source+'"');}} +element.dispatchEvent(new Event('looped'));};let template=(element.children.length===1)?element.children[0]:window.document.createElement('li');echo();container.bind(element,expr+'.length',echo);let path=(expr+'.length').split('.');while(path.length){container.bind(element,path.join('.'),echo);path.pop();}}});window.ls.container.get('view').add({selector:'data-ls-template',template:false,controller:function(element,view,http,expression,document,container){let template=element.getAttribute('data-ls-template')||'';let type=element.getAttribute('data-type')||'url';let debug=element.getAttribute('data-debug')||false;let paths=[];let check=function(init=false){let source=expression.parse(template);paths=expression.getPaths();element.innerHTML='';if('script'===type){let inlineTemplate=document.getElementById(source);if(inlineTemplate&&inlineTemplate.innerHTML){element.innerHTML=inlineTemplate.innerHTML;element.dispatchEvent(new CustomEvent('template-loaded',{bubbles:true,cancelable:false}));} +else{if(debug){console.error('Missing template "'+source+'"');}} if(!init){view.render(element);} return;} http.get(source).then(function(element){return function(data){element.innerHTML=data;view.render(element);element.dispatchEvent(new CustomEvent('template-loaded',{bubbles:true,cancelable:false}));}}(element),function(){throw new Error('Failed loading template');});};check(true);for(let i=0;iscope.max){scope.list.pop();scope.counter--;} diff --git a/public/scripts/dependencies/appwrite.js b/public/scripts/dependencies/appwrite.js index fc8da5a1c2..62644b6689 100644 --- a/public/scripts/dependencies/appwrite.js +++ b/public/scripts/dependencies/appwrite.js @@ -2238,6 +2238,34 @@ .delete(path, { 'content-type': 'application/json', }, payload); + }, + + /** + * Get Function Usage + * + * + * @param {string} functionId + * @param {string} range + * @throws {Error} + * @return {Promise} + */ + getUsage: function(functionId, range = 'last30') { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + let path = '/functions/{functionId}/usage'.replace(new RegExp('{functionId}', 'g'), functionId); + + let payload = {}; + + if(range) { + payload['range'] = range; + } + + return http + .get(path, { + 'content-type': 'application/json', + }, payload); } }; diff --git a/public/scripts/dependencies/litespeed.js b/public/scripts/dependencies/litespeed.js index 57557f7c68..4ea4c8784e 100644 --- a/public/scripts/dependencies/litespeed.js +++ b/public/scripts/dependencies/litespeed.js @@ -1,1091 +1,140 @@ -window.ls = window.ls || {}; -window.ls.container = function() { - let stock = {}; - let listeners = {}; - let namespaces = {}; - let set = function(name, object, singleton, watch = true) { - if (typeof name !== 'string') { - throw new Error('var name must be of type string'); - } - if (typeof singleton !== 'boolean') { - throw new Error('var singleton "' + singleton + '" of service "' + name + '" must be of type boolean'); - } - stock[name] = { - name: name, - object: object, - singleton: singleton, - instance: null, - watch: watch, - }; - if (!watch) { - return this; - } - let binds = listeners[name] || {}; - for (let key in binds) { - if (binds.hasOwnProperty(key)) { - document.dispatchEvent(new CustomEvent(key)); - } - } - return this; - }; - let get = function(name) { - let service = (undefined !== stock[name]) ? stock[name] : null; - if (null == service) { - return null; - } - if (service.instance) { - return service.instance; - } - let instance = (typeof service.object === 'function') ? this.resolve(service.object) : service.object; - let skip = false; - if (service.watch && name !== 'window' && name !== 'document' && name !== 'element' && typeof instance === 'object' && instance !== null) { - let handler = { - name: service.name, - watch: function() {}, - get: function(target, key) { - if (key === "__name") { - return this.name; - } - if (key === "__watch") { - return this.watch; - } - if (key === "__proxy") { - return true; - } - if (typeof target[key] === 'object' && target[key] !== null && !target[key].__proxy) { - let handler = Object.assign({}, this); - handler.name = handler.name + '.' + key; - return new Proxy(target[key], handler) - } else { - return target[key]; - } - }, - set: function(target, key, value, receiver) { - if (key === "__name") { - return this.name = value; - } - if (key === "__watch") { - return this.watch = value; - } - target[key] = value; - let path = receiver.__name + '.' + key; - document.dispatchEvent(new CustomEvent(path + '.changed')); - if (skip) { - return true; - } - skip = true; - container.set('$prop', key, true); - container.set('$value', value, true); - container.resolve(this.watch); - container.set('$key', null, true); - container.set('$value', null, true); - skip = false; - return true; - }, - }; - instance = new Proxy(instance, handler); - } - if (service.singleton) { - service.instance = instance; - } - return instance; - }; - let resolve = function(target) { - if (!target) { - return () => {}; - } - let self = this; - const REGEX_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; - const REGEX_FUNCTION_PARAMS = /(?:\s*(?:function\s*[^(]*)?\s*)((?:[^'"]|(?:(?:(['"])(?:(?:.*?[^\\]\2)|\2))))*?)\s*(?=(?:=>)|{)/m; - const REGEX_PARAMETERS_VALUES = /\s*([\w\\$]+)\s*(?:=\s*((?:(?:(['"])(?:\3|(?:.*?[^\\]\3)))((\s*\+\s*)(?:(?:(['"])(?:\6|(?:.*?[^\\]\6)))|(?:[\w$]*)))*)|.*?))?\s*(?:,|$)/gm; - function getParams(func) { - let functionAsString = func.toString(); - let params = []; - let match; - functionAsString = functionAsString.replace(REGEX_COMMENTS, ''); - functionAsString = functionAsString.match(REGEX_FUNCTION_PARAMS)[1]; - if (functionAsString.charAt(0) === '(') { - functionAsString = functionAsString.slice(1, -1); - } - while (match = REGEX_PARAMETERS_VALUES.exec(functionAsString)) { - params.push(match[1]); - } - return params; - } - let args = getParams(target); - return target.apply(target, args.map(function(value) { - return self.get(value.trim()); - })); - }; - let path = function(path, value, type) { - type = (type) ? type : 'assign'; - path = container.scope(path).split('.'); - let name = path.shift(); - let object = container.get(name); - let result = null; - while (path.length > 1) { - if (!object) { - return null; - } - object = object[path.shift()]; - } - let shift = path.shift(); - if (value !== null && value !== undefined && object && shift && (object[shift] !== undefined || object[shift] !== null)) { - switch (type) { - case 'append': - if (!Array.isArray(object[shift])) { - object[shift] = []; - } - object[shift].push(value); - break; - case 'prepend': - if (!Array.isArray(object[shift])) { - object[shift] = []; - } - object[shift].unshift(value); - break; - case 'splice': - if (!Array.isArray(object[shift])) { - object[shift] = []; - } - object[shift].splice(value, 1); - break; - default: - object[shift] = value; - } - return true; - } - if (!object) { - return null; - } - if (!shift) { - result = object; - } else { - return object[shift]; - } - return result; - }; - let bind = function(element, path, callback) { - let event = container.scope(path) + '.changed'; - let service = event.split('.').slice(0, 1).pop(); - let debug = element.getAttribute('data-debug') || false; - listeners[service] = listeners[service] || {}; - listeners[service][event] = true; - let printer = (function(x) { - return function() { - if (!document.body.contains(element)) { - element = null; - document.removeEventListener(event, printer, false); - return false; - } - let oldNamespaces = namespaces; - namespaces = x; - callback(); - namespaces = oldNamespaces; - } - }(Object.assign({}, namespaces))); - document.addEventListener(event, printer); - }; - let addNamespace = function(key, scope) { - namespaces[key] = scope; - return this; - } - let removeNamespace = function(key) { - delete namespaces[key]; - return this; - } - let scope = function(path) { - for (let [key, value] of Object.entries(namespaces)) { - path = (path.indexOf('.') > -1) ? path.replace(key + '.', value + '.') : path.replace(key, value); - } - return path; - } - let container = { - set: set, - get: get, - resolve: resolve, - path: path, - bind: bind, - scope: scope, - addNamespace: addNamespace, - removeNamespace: removeNamespace, - stock: stock, - listeners: listeners, - namespaces: namespaces, - }; - set('container', container, true, false); - return container; -}(); -window.ls.container.set('http', function(document) { - let globalParams = [], - globalHeaders = []; - let addParam = function(url, param, value) { - param = encodeURIComponent(param); - let a = document.createElement('a'); - param += (value ? "=" + encodeURIComponent(value) : ""); - a.href = url; - a.search += (a.search ? "&" : "") + param; - return a.href; - }; - let request = function(method, url, headers, payload, progress) { - let i; - if (-1 === ['GET', 'POST', 'PUT', 'DELETE', 'TRACE', 'HEAD', 'OPTIONS', 'CONNECT', 'PATCH'].indexOf(method)) { - throw new Error('var method must contain a valid HTTP method name'); - } - if (typeof url !== 'string') { - throw new Error('var url must be of type string'); - } - if (typeof headers !== 'object') { - throw new Error('var headers must be of type object'); - } - if (typeof url !== 'string') { - throw new Error('var url must be of type string'); - } - for (i = 0; i < globalParams.length; i++) { - url = addParam(url, globalParams[i].key, globalParams[i].value); - } - return new Promise(function(resolve, reject) { - let xmlhttp = new XMLHttpRequest(); - xmlhttp.open(method, url, true); - xmlhttp.setRequestHeader('Ajax', '1'); - for (i = 0; i < globalHeaders.length; i++) { - xmlhttp.setRequestHeader(globalHeaders[i].key, globalHeaders[i].value); - } - for (let key in headers) { - if (headers.hasOwnProperty(key)) { - xmlhttp.setRequestHeader(key, headers[key]); - } - } - xmlhttp.onload = function() { - if (4 === xmlhttp.readyState && 200 === xmlhttp.status) { - resolve(xmlhttp.response); - } else { - document.dispatchEvent(new CustomEvent('http-' + method.toLowerCase() + '-' + xmlhttp.status)); - reject(new Error(xmlhttp.statusText)); - } - }; - if (progress) { - xmlhttp.addEventListener('progress', progress); - xmlhttp.upload.addEventListener('progress', progress, false); - } - xmlhttp.onerror = function() { - reject(new Error("Network Error")); - }; - xmlhttp.send(payload); - }) - }; - return { - 'get': function(url) { - return request('GET', url, {}, '') - }, - 'post': function(url, headers, payload) { - return request('POST', url, headers, payload) - }, - 'put': function(url, headers, payload) { - return request('PUT', url, headers, payload) - }, - 'patch': function(url, headers, payload) { - return request('PATCH', url, headers, payload) - }, - 'delete': function(url) { - return request('DELETE', url, {}, '') - }, - 'addGlobalParam': function(key, value) { - globalParams.push({ - key: key, - value: value - }); - }, - 'addGlobalHeader': function(key, value) { - globalHeaders.push({ - key: key, - value: value - }); - } - } -}, true, false); -window.ls.container.set('cookie', function(document) { - function get(name) { - let value = "; " + document.cookie, - parts = value.split("; " + name + "="); - if (parts.length === 2) { - return parts.pop().split(";").shift(); - } - return null; - } - - function set(name, value, days) { - let date = new Date(); - date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); - let expires = (0 < days) ? 'expires=' + date.toUTCString() : 'expires=0'; - document.cookie = name + "=" + value + ";" + expires + ";path=/"; - return this; - } - return { - 'get': get, - 'set': set - } -}, true, false); -window.ls.container.set('view', function(http, container) { - let stock = {}; - let execute = function(view, node, container) { - container.set('element', node, true, false); - container.resolve(view.controller); - if (true !== view.repeat) { - node.removeAttribute(view.selector); - } - }; - let parse = function(node, skip, callback) { - if (node.tagName === 'SCRIPT') { - return; - } - if (node.attributes && skip !== true) { - let attrs = []; - let attrsLen = node.attributes.length; - for (let x = 0; x < attrsLen; x++) { - attrs.push(node.attributes[x].nodeName); - } - if (1 !== node.nodeType) { - return; - } - if (attrs && attrsLen) { - for (let x = 0; x < attrsLen; x++) { - if (node.$lsSkip === true) { - break; - } - let pointer = (!/Edge/.test(navigator.userAgent)) ? x : (attrsLen - 1) - x; - let length = attrsLen; - let attr = attrs[pointer]; - if (!stock[attr]) { - continue; - } - let comp = stock[attr]; - if (typeof comp.template === "function") { - comp.template = container.resolve(comp.template); - } - if (!comp.template) { - (function(comp, node, container) { - execute(comp, node, container); - })(comp, node, container); - if (length !== attrsLen) { - x--; - } - if (callback) { - callback(); - } - continue; - } - node.classList.remove('load-end'); - node.classList.add('load-start'); - node.$lsSkip = true; - http.get(comp.template).then(function(node, comp) { - return function(data) { - node.$lsSkip = false; - node.innerHTML = data; - node.classList.remove('load-start'); - node.classList.add('load-end'); - (function(comp, node, container) { - execute(comp, node, container); - })(comp, node, container); - parse(node, true); - if (callback) { - callback(); - } - } - }(node, comp), function(error) { - throw new Error('Failed to load comp template: ' + error.message); - }); - } - } - } - if (true === node.$lsSkip) { - return; - } - let list = (node) ? node.childNodes : []; - if (node.$lsSkip === true) { - list = []; - } - for (let i = 0; i < list.length; i++) { - let child = list[i]; - parse(child); - } - }; - return { - stock: stock, - add: function(object) { - if (typeof object !== 'object') { - throw new Error('object must be of type object'); - } - let defaults = { - 'selector': '', - 'controller': function() {}, - 'template': '', - 'repeat': false, - 'protected': false - }; - for (let prop in defaults) { - if (!defaults.hasOwnProperty(prop)) { - continue; - } - if (prop in object) { - continue; - } - object[prop] = defaults[prop]; - } - if (!object.selector) { - throw new Error('View component is missing a selector attribute'); - } - stock[object.selector] = object; - return this; - }, - render: function(element, callback) { - parse(element, false, callback); - element.dispatchEvent(new window.Event('rendered', { - bubbles: false - })); - } - } -}, true, false); -window.ls.container.set('router', function(window) { - let getJsonFromUrl = function(URL) { - let query; - if (URL) { - let pos = location.search.indexOf('?'); - if (pos === -1) return []; - query = location.search.substr(pos + 1); - } else { - query = location.search.substr(1); - } - let result = {}; - query.split('&').forEach(function(part) { - if (!part) { - return; - } - part = part.split('+').join(' '); - let eq = part.indexOf('='); - let key = eq > -1 ? part.substr(0, eq) : part; - let val = eq > -1 ? decodeURIComponent(part.substr(eq + 1)) : ''; - let from = key.indexOf('['); - if (from === -1) { - result[decodeURIComponent(key)] = val; - } else { - let to = key.indexOf(']'); - let index = decodeURIComponent(key.substring(from + 1, to)); - key = decodeURIComponent(key.substring(0, from)); - if (!result[key]) { - result[key] = []; - } - if (!index) { - result[key].push(val); - } else { - result[key][index] = val; - } - } - }); - return result; - }; - let states = []; - let params = getJsonFromUrl(window.location.search); - let hash = window.location.hash; - let current = null; - let previous = null; - let getPrevious = () => previous; - let getCurrent = () => current; - let setPrevious = (value) => { - previous = value; - return this; - }; - let setCurrent = (value) => { - current = value; - return this; - }; - let setParam = function(key, value) { - params[key] = value; - return this; - }; - let getParam = function(key, def) { - if (key in params) { - return params[key]; - } - return def; - }; - let getParams = function() { - return params; - }; - let getURL = function() { - return window.location.href; - }; - let add = function(path, view) { - if (typeof path !== 'string') { - throw new Error('path must be of type string'); - } - if (typeof view !== 'object') { - throw new Error('view must be of type object'); - } - states[states.length++] = { - path: path, - view: view - }; - return this; - }; - let match = function(location) { - let url = location.pathname; - states.sort(function(a, b) { - return b.path.length - a.path.length; - }); - states.sort(function(a, b) { - let n = b.path.split('/').length - a.path.split('/').length; - if (n !== 0) { - return n; - } - return b.path.length - a.path.length; - }); - for (let i = 0; i < states.length; i++) { - let value = states[i]; - value.path = (value.path.substring(0, 1) !== '/') ? location.pathname + value.path : value.path; - let match = new RegExp("^" + value.path.replace(/:[^\s/]+/g, '([\\w-]+)') + "$"); - let found = url.match(match); - if (found) { - previous = current; - current = value; - return value; - } - } - return null - }; - let change = function(URL, replace) { - if (!replace) { - window.history.pushState({}, '', URL); - } else { - window.history.replaceState({}, '', URL); - } - window.dispatchEvent(new PopStateEvent('popstate', {})); - return this; - }; - let reload = function() { - return change(window.location.href); - }; - return { - setParam: setParam, - getParam: getParam, - getParams: getParams, - getURL: getURL, - add: add, - change: change, - reload: reload, - match: match, - getCurrent: getCurrent, - setCurrent: setCurrent, - getPrevious: getPrevious, - setPrevious: setPrevious, - params: params, - hash: hash, - reset: function() { - this.params = getJsonFromUrl(window.location.search); - this.hash = window.location.hash; - } - }; -}, true, true); -window.ls.container.set('expression', function(container, filter) { - let paths = []; - return { - regex: /(\{{.*?\}})/gi, - parse: function(string, def, cast = false) { - def = def || ''; - paths = []; - return string.replace(this.regex, match => { - let reference = match.substring(2, match.length - 2).replace('[\'', '.').replace('\']', '').trim(); - reference = reference.split('|'); - let path = container.scope((reference[0] || '')); - let result = container.path(path); - path = container.scope(path); - if (!paths.includes(path)) { - paths.push(path); - } - if (reference.length >= 2) { - for (let i = 1; i < reference.length; i++) { - result = filter.apply(reference[i], result); - } - } - if (null === result || undefined === result) { - result = def; - } else if (typeof result === 'object') { - result = JSON.stringify(result, null, 4); - } else if (((typeof result === 'object') || (typeof result === 'string')) && cast) { - result = '\'' + result + '\''; - } - return result; - }).replace(/\\{/g, "{").replace(/\\}/g, "}"); - }, - getPaths: () => paths, - } -}, true, false); -window.ls.container.set('filter', function(container) { - let filters = {}; - let add = function(name, callback) { - filters[name] = callback; - return this; - }; - let apply = function(name, value) { - container.set('$value', value, true, false); - return container.resolve(filters[name]); - }; - add('uppercase', ($value) => { - if (typeof $value !== 'string') { - return $value; - } - return $value.toUpperCase(); - }); - add('lowercase', ($value) => { - if (typeof $value !== 'string') { - return $value; - } - return $value.toLowerCase(); - }); - return { - add: add, - apply: apply - } -}, true, false); -window.ls.container.get('filter').add('escape', value => { - if (typeof value !== 'string') { - return value; - } - return value.replace(/&/g, '&').replace(//g, '>').replace(/\"/g, '"').replace(/\'/g, ''').replace(/\//g, '/'); -}); -window.ls = window.ls || {}; -window.ls.container.set('window', window, true, false).set('document', window.document, true, false).set('element', window.document, true, false); -window.ls.run = function(window) { - try { - this.view.render(window.document); - } catch (error) { - let handler = window.ls.container.resolve(this.error); - handler(error); - } -}; -window.ls.error = () => { - return error => { - console.error('ls-error', error.message, error.stack, error.toString()); - } -}; -window.ls.router = window.ls.container.get('router'); -window.ls.view = window.ls.container.get('view'); -window.ls.filter = window.ls.container.get('filter'); -window.ls.container.get('view').add({ - selector: 'data-ls-router', - repeat: false, - controller: function(element, window, document, view, router) { - let firstFromServer = (element.getAttribute('data-first-from-server') === 'true'); - let scope = { - selector: 'data-ls-scope', - template: false, - repeat: true, - controller: function() {}, - }; - let init = function(route) { - let count = parseInt(element.getAttribute('data-ls-scope-count') || 0); - element.setAttribute('data-ls-scope-count', count + 1); - window.scrollTo(0, 0); - if (window.document.body.scrollTo) { - window.document.body.scrollTo(0, 0); - } - router.reset(); - if (null === route) { - return; - } - scope.template = (undefined !== route.view.template) ? route.view.template : null; - scope.controller = (undefined !== route.view.controller) ? route.view.controller : function() {}; - document.dispatchEvent(new CustomEvent('state-change')); - if (firstFromServer && null === router.getPrevious()) { - scope.template = ''; - document.dispatchEvent(new CustomEvent('state-changed')); - } else if (count === 1) { - view.render(element, function() { - document.dispatchEvent(new CustomEvent('state-changed')); - }); - } else if (null !== router.getPrevious()) { - view.render(element, function() { - document.dispatchEvent(new CustomEvent('state-changed')); - }); - } - }; - let findParent = function(tagName, el) { - if ((el.nodeName || el.tagName).toLowerCase() === tagName.toLowerCase()) { - return el; - } - while (el = el.parentNode) { - if ((el.nodeName || el.tagName).toLowerCase() === tagName.toLowerCase()) { - return el; - } - } - return null; - }; - element.removeAttribute('data-ls-router'); - element.setAttribute('data-ls-scope', ''); - element.setAttribute('data-ls-scope-count', 1); - view.add(scope); - document.addEventListener('click', function(event) { - let target = findParent('a', event.target); - if (!target) { - return false; - } - if (!target.href) { - return false; - } - if ((event.metaKey)) { - return false; - } - if ((target.hasAttribute('target')) && ('_blank' === target.getAttribute('target'))) { - return false; - } - if (target.hostname !== window.location.hostname) { - return false; - } - let route = router.match(target); - if (null === route) { - return false; - } - event.preventDefault(); - if (window.location === target.href) { - return false; - } - route.view.state = (undefined === route.view.state) ? true : route.view.state; - if (true === route.view.state) { - if (router.getPrevious() && router.getPrevious().view && (router.getPrevious().view.scope !== route.view.scope)) { - window.location.href = target.href; - return false; - } - window.history.pushState({}, 'Unknown', target.href); - } - init(route); - return true; - }); - window.addEventListener('popstate', function() { - init(router.match(window.location)); - }); - window.addEventListener('hashchange', function() { - init(router.match(window.location)); - }); - init(router.match(window.location)); - } -}); -window.ls.container.get('view').add({ - selector: 'data-ls-attrs', - controller: function(element, expression, container) { - let attrs = element.getAttribute('data-ls-attrs').trim().split(','); - let paths = []; - let debug = element.getAttribute('data-debug') || false; - let check = () => { - container.set('element', element, true, false); - if (debug) { - console.info('debug-ls-attrs attributes:', attrs); - } - for (let i = 0; i < attrs.length; i++) { - let attr = attrs[i]; - let key = expression.parse((attr.substring(0, attr.indexOf('=')) || attr)); - paths = paths.concat(expression.getPaths()); - let value = ''; - if (attr.indexOf('=') > -1) { - value = expression.parse(attr.substring(attr.indexOf('=') + 1)) || ''; - paths = paths.concat(expression.getPaths()); - } - if (!key) { - return null; - } - element.setAttribute(key, value); - } - }; - check(); - for (let i = 0; i < paths.length; i++) { - let path = paths[i].split('.'); - while (path.length) { - container.bind(element, path.join('.'), check); - path.pop(); - } - } - } -}); -window.ls.container.get('view').add({ - selector: 'data-ls-bind', - controller: function(element, expression, container) { - let debug = element.getAttribute('data-debug') || false; - let echo = function(value, bind = true) { - if (element.tagName === 'INPUT' || element.tagName === 'SELECT' || element.tagName === 'BUTTON' || element.tagName === 'TEXTAREA') { - let type = element.getAttribute('type'); - if ('radio' === type) { - if (value.toString() === element.value) { - element.setAttribute('checked', 'checked'); - } else { - element.removeAttribute('checked'); - } - if (bind) { - element.addEventListener('change', () => { - for (let i = 0; i < paths.length; i++) { - if (element.checked) { - value = element.value; - } - container.path(paths[i], value); - } - }); - } - return; - } - if ('checkbox' === type) { - if (typeof value === 'boolean' || value === 'true' || value === 'false') { - if (value === true || value === 'true') { - element.setAttribute('checked', 'checked'); - element.checked = true; - } else { - element.removeAttribute('checked'); - element.checked = false; - } - } else { - try { - value = JSON.parse(value); - element.checked = (Array.isArray(value) && (value.indexOf(element.value) > -1)); - value = element.value; - } catch { - return null; - } - } - if (bind) { - element.addEventListener('change', () => { - for (let i = 0; i < paths.length; i++) { - let value = container.path(paths[i]); - let index = value.indexOf(element.value); - if (element.checked && index < 0) { - value.push(element.value); - } - if (!element.checked && index > -1) { - value.splice(index, 1); - } - container.path(paths[i], value); - } - }); - } - return; - } - if (element.value !== value) { - element.value = value; - element.dispatchEvent(new Event('change')); - } - if (bind) { - element.addEventListener('input', sync); - element.addEventListener('change', sync); - } - } else { - if (element.textContent != value) { - element.innerHTML = value; - } - } - }; - let sync = (() => { - return () => { - if (debug) { - console.info('debug-ls-bind', 'sync-path', paths); - console.info('debug-ls-bind', 'sync-syntax', syntax); - console.info('debug-ls-bind', 'sync-syntax-parsed', parsedSyntax); - console.info('debug-ls-bind', 'sync-value', element.value); - } - for (let i = 0; i < paths.length; i++) { - if ('{{' + paths[i] + '}}' !== parsedSyntax) { - if (debug) { - console.info('debug-ls-bind', 'sync-skipped-path', paths[i]); - console.info('debug-ls-bind', 'sync-skipped-syntax', syntax); - console.info('debug-ls-bind', 'sync-skipped-syntax-parsed', parsedSyntax); - } - continue; - } - if (debug) { - console.info('debug-ls-bind', 'sync-loop-path', paths[i]); - console.info('debug-ls-bind', 'sync-loop-syntax', parsedSyntax); - } - container.path(paths[i], element.value); - } - } - })(); - let syntax = element.getAttribute('data-ls-bind'); - let parsedSyntax = container.scope(syntax); - let unsync = (!!element.getAttribute('data-unsync')) || false; - let result = expression.parse(syntax); - let paths = expression.getPaths(); - echo(result, !unsync); - element.addEventListener('looped', function() { - echo(expression.parse(parsedSyntax), false); - }); - for (let i = 0; i < paths.length; i++) { - let path = paths[i].split('.'); - if (debug) { - console.info('debug-ls-bind', 'bind-path', path); - console.info('debug-ls-bind', 'bind-syntax', syntax); - } - while (path.length) { - container.bind(element, path.join('.'), () => { - echo(expression.parse(parsedSyntax), false); - }); - path.pop(); - } - } - } -}); -window.ls.container.get('view').add({ - selector: 'data-ls-if', - controller: function(element, expression, container, view) { - let result = ''; - let syntax = element.getAttribute('data-ls-if') || ''; - let debug = element.getAttribute('data-debug') || false; - let paths = []; - let check = () => { - if (debug) { - console.info('debug-ls-if', expression.parse(syntax.replace(/(\r\n|\n|\r)/gm, ' '), 'undefined', true)); - } - try { - result = (eval(expression.parse(syntax.replace(/(\r\n|\n|\r)/gm, ' '), 'undefined', true))); - } catch (error) { - throw new Error('Failed to evaluate expression "' + syntax + ' (resulted with: "' + result + '")": ' + error); - } - if (debug) { - console.info('debug-ls-if result:', result); - } - paths = expression.getPaths(); - let prv = element.$lsSkip; - element.$lsSkip = !result; - if (!result) { - element.style.visibility = 'hidden'; - element.style.display = 'none'; - } else { - element.style.removeProperty('display'); - element.style.removeProperty('visibility'); - } - if (prv === true && element.$lsSkip === false) { - view.render(element) - } - }; - check(); - for (let i = 0; i < paths.length; i++) { - let path = paths[i].split('.'); - while (path.length) { - container.bind(element, path.join('.'), check); - path.pop(); - } - } - } -}); -window.ls.container.get('view').add({ - selector: 'data-ls-loop', - template: false, - repeat: false, - nested: false, - controller: function(element, view, container, window, expression) { - let expr = expression.parse(element.getAttribute('data-ls-loop')); - let as = element.getAttribute('data-ls-as'); - let key = element.getAttribute('data-ls-key') || '$index'; - let limit = parseInt(expression.parse(element.getAttribute('data-limit') || '') || -1); - let debug = element.getAttribute('data-debug') || false; - let echo = function() { - let array = container.path(expr); - let counter = 0; - array = (!array) ? [] : array; - let watch = !!(array && array.__proxy); - while (element.hasChildNodes()) { - element.removeChild(element.lastChild); - element.lastChild = null; - } - if (array instanceof Array && typeof array !== 'object') { - throw new Error('Reference value must be array or object. ' + (typeof array) + ' given'); - } - let children = []; - element.$lsSkip = true; - element.style.visibility = (0 === array.length) ? 'hidden' : 'visible'; - for (let prop in array) { - if (counter == limit) { - break; - } - counter++; - if (!array.hasOwnProperty(prop)) { - continue; - } - children[prop] = template.cloneNode(true); - element.appendChild(children[prop]); - (index => { - let context = expr + '.' + index; - container.addNamespace(as, context); - if (debug) { - console.info('debug-ls-loop', 'index', index); - console.info('debug-ls-loop', 'context', context); - console.info('debug-ls-loop', 'context-path', container.path(context).name); - console.info('debug-ls-loop', 'namespaces', container.namespaces); - } - container.set(as, container.path(context), true, watch); - container.set(key, index, true, false); - view.render(children[prop]); - container.removeNamespace(as); - })(prop); - } - element.dispatchEvent(new Event('looped')); - }; - let template = (element.children.length === 1) ? element.children[0] : window.document.createElement('li'); - echo(); - container.bind(element, expr + '.length', echo); - let path = (expr + '.length').split('.'); - while (path.length) { - container.bind(element, path.join('.'), echo); - path.pop(); - } - } -}); -window.ls.container.get('view').add({ - selector: 'data-ls-template', - template: false, - repeat: false, - controller: function(element, view, http, expression, document, container) { - let template = element.getAttribute('data-ls-template') || ''; - let type = element.getAttribute('data-type') || 'url'; - let debug = element.getAttribute('data-debug') || false; - let paths = []; - let check = function(init = false) { - let source = expression.parse(template); - paths = expression.getPaths(); - element.innerHTML = ''; - if ('script' === type) { - let inlineTemplate = document.getElementById(source); - if (inlineTemplate && inlineTemplate.innerHTML) { - element.innerHTML = inlineTemplate.innerHTML; - element.dispatchEvent(new CustomEvent('template-loaded', { - bubbles: true, - cancelable: false - })); - } else { - if (debug) { - console.error('Missing template "' + source + '"'); - } - } - if (!init) { - view.render(element); - } - return; - } - http.get(source).then(function(element) { - return function(data) { - element.innerHTML = data; - view.render(element); - element.dispatchEvent(new CustomEvent('template-loaded', { - bubbles: true, - cancelable: false - })); - } - }(element), function() { - throw new Error('Failed loading template'); - }); - }; - check(true); - for (let i = 0; i < paths.length; i++) { - let path = paths[i].split('.'); - while (path.length) { - container.bind(element, path.join('.'), check); - path.pop(); - } - } - } -}); +window.ls=window.ls||{};window.ls.container=function(){let stock={};let listeners={};let namespaces={};let set=function(name,object,singleton,watch=true){if(typeof name!=='string'){throw new Error('var name must be of type string');} +if(typeof singleton!=='boolean'){throw new Error('var singleton "'+singleton+'" of service "'+name+'" must be of type boolean');} +stock[name]={name:name,object:object,singleton:singleton,instance:null,watch:watch,};if(!watch){return this;} +let binds=listeners[name]||{};for(let key in binds){if(binds.hasOwnProperty(key)){document.dispatchEvent(new CustomEvent(key));}} +return this;};let get=function(name){let service=(undefined!==stock[name])?stock[name]:null;if(null==service){return null;} +if(service.instance){return service.instance;} +let instance=(typeof service.object==='function')?this.resolve(service.object):service.object;let skip=false;if(service.watch&&name!=='window'&&name!=='document'&&name!=='element'&&typeof instance==='object'&&instance!==null){let handler={name:service.name,watch:function(){},get:function(target,key){if(key==="__name"){return this.name;} +if(key==="__watch"){return this.watch;} +if(key==="__proxy"){return true;} +if(typeof target[key]==='object'&&target[key]!==null&&!target[key].__proxy){let handler=Object.assign({},this);handler.name=handler.name+'.'+key;return new Proxy(target[key],handler)} +else{return target[key];}},set:function(target,key,value,receiver){if(key==="__name"){return this.name=value;} +if(key==="__watch"){return this.watch=value;} +target[key]=value;let path=receiver.__name+'.'+key;document.dispatchEvent(new CustomEvent(path+'.changed'));if(skip){return true;} +skip=true;container.set('$prop',key,true);container.set('$value',value,true);container.resolve(this.watch);container.set('$key',null,true);container.set('$value',null,true);skip=false;return true;},};instance=new Proxy(instance,handler);} +if(service.singleton){service.instance=instance;} +return instance;};let resolve=function(target){if(!target){return()=>{};} +let self=this;const REGEX_COMMENTS=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;const REGEX_FUNCTION_PARAMS=/(?:\s*(?:function\s*[^(]*)?\s*)((?:[^'"]|(?:(?:(['"])(?:(?:.*?[^\\]\2)|\2))))*?)\s*(?=(?:=>)|{)/m;const REGEX_PARAMETERS_VALUES=/\s*([\w\\$]+)\s*(?:=\s*((?:(?:(['"])(?:\3|(?:.*?[^\\]\3)))((\s*\+\s*)(?:(?:(['"])(?:\6|(?:.*?[^\\]\6)))|(?:[\w$]*)))*)|.*?))?\s*(?:,|$)/gm;function getParams(func){let functionAsString=func.toString();let params=[];let match;functionAsString=functionAsString.replace(REGEX_COMMENTS,'');functionAsString=functionAsString.match(REGEX_FUNCTION_PARAMS)[1];if(functionAsString.charAt(0)==='('){functionAsString=functionAsString.slice(1,-1);} +while(match=REGEX_PARAMETERS_VALUES.exec(functionAsString)){params.push(match[1]);} +return params;} +let args=getParams(target);return target.apply(target,args.map(function(value){return self.get(value.trim());}));};let path=function(path,value,type){type=(type)?type:'assign';path=container.scope(path).split('.');let name=path.shift();let object=container.get(name);let result=null;while(path.length>1){if(!object){return null;} +object=object[path.shift()];} +let shift=path.shift();if(value!==null&&value!==undefined&&object&&shift&&(object[shift]!==undefined||object[shift]!==null)){switch(type){case'append':if(!Array.isArray(object[shift])){object[shift]=[];} +object[shift].push(value);break;case'prepend':if(!Array.isArray(object[shift])){object[shift]=[];} +object[shift].unshift(value);break;case'splice':if(!Array.isArray(object[shift])){object[shift]=[];} +object[shift].splice(value,1);break;default:object[shift]=value;} +return true;} +if(!object){return null;} +if(!shift){result=object;} +else{return object[shift];} +return result;};let bind=function(element,path,callback){let event=container.scope(path)+'.changed';let service=event.split('.').slice(0,1).pop();let debug=element.getAttribute('data-debug')||false;listeners[service]=listeners[service]||{};listeners[service][event]=true;let printer=(function(x){return function(){if(!document.body.contains(element)){element=null;document.removeEventListener(event,printer,false);return false;} +let oldNamespaces=namespaces;namespaces=x;callback();namespaces=oldNamespaces;}}(Object.assign({},namespaces)));document.addEventListener(event,printer);};let addNamespace=function(key,scope){namespaces[key]=scope;return this;} +let removeNamespace=function(key){delete namespaces[key];return this;} +let scope=function(path){for(let[key,value]of Object.entries(namespaces)){path=(path.indexOf('.')>-1)?path.replace(key+'.',value+'.'):path.replace(key,value);} +return path;} +let container={set:set,get:get,resolve:resolve,path:path,bind:bind,scope:scope,addNamespace:addNamespace,removeNamespace:removeNamespace,stock:stock,listeners:listeners,namespaces:namespaces,};set('container',container,true,false);return container;}();window.ls.container.set('http',function(document){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){param=encodeURIComponent(param);let a=document.createElement('a');param+=(value?"="+encodeURIComponent(value):"");a.href=url;a.search+=(a.search?"&":"")+param;return a.href;};let request=function(method,url,headers,payload,progress){let i;if(-1===['GET','POST','PUT','DELETE','TRACE','HEAD','OPTIONS','CONNECT','PATCH'].indexOf(method)){throw new Error('var method must contain a valid HTTP method name');} +if(typeof url!=='string'){throw new Error('var url must be of type string');} +if(typeof headers!=='object'){throw new Error('var headers must be of type object');} +if(typeof url!=='string'){throw new Error('var url must be of type string');} +for(i=0;i-1?part.substr(0,eq):part;let val=eq>-1?decodeURIComponent(part.substr(eq+1)):'';let from=key.indexOf('[');if(from===-1){result[decodeURIComponent(key)]=val;} +else{let to=key.indexOf(']');let index=decodeURIComponent(key.substring(from+1,to));key=decodeURIComponent(key.substring(0,from));if(!result[key]){result[key]=[];} +if(!index){result[key].push(val);} +else{result[key][index]=val;}}});return result;};let states=[];let params=getJsonFromUrl(window.location.search);let hash=window.location.hash;let current=null;let previous=null;let getPrevious=()=>previous;let getCurrent=()=>current;let setPrevious=(value)=>{previous=value;return this;};let setCurrent=(value)=>{current=value;return this;};let setParam=function(key,value){params[key]=value;return this;};let getParam=function(key,def){if(key in params){return params[key];} +return def;};let getParams=function(){return params;};let getURL=function(){return window.location.href;};let add=function(path,view){if(typeof path!=='string'){throw new Error('path must be of type string');} +if(typeof view!=='object'){throw new Error('view must be of type object');} +states[states.length++]={path:path,view:view};return this;};let match=function(location){let url=location.pathname;states.sort(function(a,b){return b.path.length-a.path.length;});states.sort(function(a,b){let n=b.path.split('/').length-a.path.split('/').length;if(n!==0){return n;} +return b.path.length-a.path.length;});for(let i=0;i{let reference=match.substring(2,match.length-2).replace('[\'','.').replace('\']','').trim();reference=reference.split('|');let path=container.scope((reference[0]||''));let result=container.path(path);path=container.scope(path);if(!paths.includes(path)){paths.push(path);} +if(reference.length>=2){for(let i=1;ipaths,}},true,false);window.ls.container.set('filter',function(container){let filters={};let add=function(name,callback){filters[name]=callback;return this;};let apply=function(name,value){container.set('$value',value,true,false);return container.resolve(filters[name]);};add('uppercase',($value)=>{if(typeof $value!=='string'){return $value;} +return $value.toUpperCase();});add('lowercase',($value)=>{if(typeof $value!=='string'){return $value;} +return $value.toLowerCase();});return{add:add,apply:apply}},true,false);window.ls.container.get('filter').add('escape',value=>{if(typeof value!=='string'){return value;} +return value.replace(/&/g,'&').replace(//g,'>').replace(/\"/g,'"').replace(/\'/g,''').replace(/\//g,'/');});window.ls=window.ls||{};window.ls.container.set('window',window,true,false).set('document',window.document,true,false).set('element',window.document,true,false);window.ls.run=function(window){try{this.view.render(window.document);} +catch(error){let handler=window.ls.container.resolve(this.error);handler(error);}};window.ls.error=()=>{return error=>{console.error('ls-error',error.message,error.stack,error.toString());}};window.ls.router=window.ls.container.get('router');window.ls.view=window.ls.container.get('view');window.ls.filter=window.ls.container.get('filter');window.ls.container.get('view').add({selector:'data-ls-router',controller:function(element,window,document,view,router){let firstFromServer=(element.getAttribute('data-first-from-server')==='true');let scope={selector:'data-ls-scope',template:false,repeat:true,controller:function(){},};let init=function(route){let count=parseInt(element.getAttribute('data-ls-scope-count')||0);element.setAttribute('data-ls-scope-count',count+1);window.scrollTo(0,0);if(window.document.body.scrollTo){window.document.body.scrollTo(0,0);} +router.reset();if(null===route){return;} +scope.template=(undefined!==route.view.template)?route.view.template:null;scope.controller=(undefined!==route.view.controller)?route.view.controller:function(){};document.dispatchEvent(new CustomEvent('state-change'));if(firstFromServer&&null===router.getPrevious()){scope.template='';document.dispatchEvent(new CustomEvent('state-changed'));} +else if(count===1){view.render(element,function(){document.dispatchEvent(new CustomEvent('state-changed'));});} +else if(null!==router.getPrevious()){view.render(element,function(){document.dispatchEvent(new CustomEvent('state-changed'));});}};let findParent=function(tagName,el){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;} +while(el=el.parentNode){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;}} +return null;};element.removeAttribute('data-ls-router');element.setAttribute('data-ls-scope','');element.setAttribute('data-ls-scope-count',1);view.add(scope);document.addEventListener('click',function(event){let target=findParent('a',event.target);if(!target){return false;} +if(!target.href){return false;} +if((event.metaKey)){return false;} +if((target.hasAttribute('target'))&&('_blank'===target.getAttribute('target'))){return false;} +if(target.hostname!==window.location.hostname){return false;} +let route=router.match(target);if(null===route){return false;} +event.preventDefault();if(window.location===target.href){return false;} +route.view.state=(undefined===route.view.state)?true:route.view.state;if(true===route.view.state){if(router.getPrevious()&&router.getPrevious().view&&(router.getPrevious().view.scope!==route.view.scope)){window.location.href=target.href;return false;} +window.history.pushState({},'Unknown',target.href);} +init(route);return true;});window.addEventListener('popstate',function(){init(router.match(window.location));});window.addEventListener('hashchange',function(){init(router.match(window.location));});init(router.match(window.location));}});window.ls.container.get('view').add({selector:'data-ls-attrs',controller:function(element,expression,container){let attrs=element.getAttribute('data-ls-attrs').trim().split(',');let paths=[];let debug=element.getAttribute('data-debug')||false;let check=()=>{container.set('element',element,true,false);if(debug){console.info('debug-ls-attrs attributes:',attrs);} +for(let i=0;i{for(let i=0;i-1));value=element.value;} +catch{return null;}} +if(bind){element.addEventListener('change',()=>{for(let i=0;i-1){value.splice(index,1);} +container.path(paths[i],value);}});} +return;} +if(element.value!==value){element.value=value;element.dispatchEvent(new Event('change'));} +if(bind){element.addEventListener('input',sync);element.addEventListener('change',sync);}} +else{if(element.innerHTML!=value){element.innerHTML=value;}}};let sync=(()=>{return()=>{if(debug){console.info('debug-ls-bind','sync-path',paths);console.info('debug-ls-bind','sync-syntax',syntax);console.info('debug-ls-bind','sync-syntax-parsed',parsedSyntax);console.info('debug-ls-bind','sync-value',element.value);} +for(let i=0;i{echo(expression.parse(parsedSyntax),false);});path.pop();}}}});window.ls.container.get('view').add({selector:'data-ls-if',controller:function(element,expression,container,view){let result='';let syntax=element.getAttribute('data-ls-if')||'';let debug=element.getAttribute('data-debug')||false;let paths=[];let check=()=>{if(debug){console.info('debug-ls-if',expression.parse(syntax.replace(/(\r\n|\n|\r)/gm,' '),'undefined',true));} +try{result=(eval(expression.parse(syntax.replace(/(\r\n|\n|\r)/gm,' '),'undefined',true)));} +catch(error){throw new Error('Failed to evaluate expression "'+syntax+' (resulted with: "'+result+'")": '+error);} +if(debug){console.info('debug-ls-if result:',result);} +paths=expression.getPaths();let prv=element.$lsSkip;element.$lsSkip=!result;if(!result){element.style.visibility='hidden';element.style.display='none';} +else{element.style.removeProperty('display');element.style.removeProperty('visibility');} +if(prv===true&&element.$lsSkip===false){view.render(element)}};check();for(let i=0;i{let context=expr+'.'+index;container.addNamespace(as,context);if(debug){console.info('debug-ls-loop','index',index);console.info('debug-ls-loop','context',context);console.info('debug-ls-loop','context-path',container.path(context).name);console.info('debug-ls-loop','namespaces',container.namespaces);} +container.set(as,container.path(context),true,watch);container.set(key,index,true,false);view.render(children[prop]);container.removeNamespace(as);})(prop);} +element.dispatchEvent(new Event('looped'));};let template=(element.children.length===1)?element.children[0]:window.document.createElement('li');echo();container.bind(element,expr+'.length',echo);let path=(expr+'.length').split('.');while(path.length){container.bind(element,path.join('.'),echo);path.pop();}}});window.ls.container.get('view').add({selector:'data-ls-template',template:false,controller:function(element,view,http,expression,document,container){let template=element.getAttribute('data-ls-template')||'';let type=element.getAttribute('data-type')||'url';let debug=element.getAttribute('data-debug')||false;let paths=[];let check=function(init=false){let source=expression.parse(template);paths=expression.getPaths();element.innerHTML='';if('script'===type){let inlineTemplate=document.getElementById(source);if(inlineTemplate&&inlineTemplate.innerHTML){element.innerHTML=inlineTemplate.innerHTML;element.dispatchEvent(new CustomEvent('template-loaded',{bubbles:true,cancelable:false}));} +else{if(debug){console.error('Missing template "'+source+'"');}} +if(!init){view.render(element);} +return;} +http.get(source).then(function(element){return function(data){element.innerHTML=data;view.render(element);element.dispatchEvent(new CustomEvent('template-loaded',{bubbles:true,cancelable:false}));}}(element),function(){throw new Error('Failed loading template');});};check(true);for(let i=0;i $route->getOrder(), 'cookies' => $route->getLabel('sdk.cookies', false), 'type' => $route->getLabel('sdk.methodType', ''), - 'demo' => 'docs/examples/'. Template::fromCamelCaseToDash($route->getLabel('sdk.namespace', 'default')).'/'.Template::fromCamelCaseToDash($id).'.md', + 'demo' => Template::fromCamelCaseToDash($route->getLabel('sdk.namespace', 'default')).'/'.Template::fromCamelCaseToDash($id).'.md', 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $route->getLabel('sdk.description', ''), 'rate-limit' => $route->getLabel('abuse-limit', 0), 'rate-time' => $route->getLabel('abuse-time', 3600), @@ -178,7 +178,7 @@ class OpenAPI3 extends Format $bodyRequired = []; foreach ($route->getParams() as $name => $param) { // Set params - $validator = (\is_callable($param['validator'])) ? call_user_func_array($param['validator'], $this->app->getResources($param['resources'])) : $param['validator']; /* @var $validator \Utopia\Validator */ + $validator = (\is_callable($param['validator'])) ? call_user_func_array($param['validator'], $this->app->getResources($param['injections'])) : $param['validator']; /* @var $validator \Utopia\Validator */ $node = [ 'name' => $name, diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 6bd21055ed..d187cbc8d9 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -107,7 +107,7 @@ class Swagger2 extends Format 'weight' => $route->getOrder(), 'cookies' => $route->getLabel('sdk.cookies', false), 'type' => $route->getLabel('sdk.methodType', ''), - 'demo' => 'docs/examples/'. Template::fromCamelCaseToDash($route->getLabel('sdk.namespace', 'default')).'/'.Template::fromCamelCaseToDash($id).'.md', + 'demo' => Template::fromCamelCaseToDash($route->getLabel('sdk.namespace', 'default')).'/'.Template::fromCamelCaseToDash($id).'.md', 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $route->getLabel('sdk.description', ''), 'rate-limit' => $route->getLabel('abuse-limit', 0), 'rate-time' => $route->getLabel('abuse-time', 3600), @@ -170,7 +170,7 @@ class Swagger2 extends Format $bodyRequired = []; foreach ($route->getParams() as $name => $param) { // Set params - $validator = (\is_callable($param['validator'])) ? call_user_func_array($param['validator'], $this->app->getResources($param['resources'])) : $param['validator']; /* @var $validator \Utopia\Validator */ + $validator = (\is_callable($param['validator'])) ? call_user_func_array($param['validator'], $this->app->getResources($param['injections'])) : $param['validator']; /* @var $validator \Utopia\Validator */ $node = [ 'name' => $name, diff --git a/tests/e2e/General/HTTPTest.php b/tests/e2e/General/HTTPTest.php index 08e0b3f3b5..46672c1a71 100644 --- a/tests/e2e/General/HTTPTest.php +++ b/tests/e2e/General/HTTPTest.php @@ -1,14 +1,12 @@ client->call(Client::METHOD_POST, '/account', array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), [ + 'email' => $email, + 'password' => $password, + 'name' => $name, + ]); + + $id = $response['body']['$id']; + + $this->assertEquals($response['headers']['status-code'], 201); + + $response = $this->client->call(Client::METHOD_POST, '/account/sessions', array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), [ + 'email' => $email, + 'password' => $password, + ]); + + $this->assertEquals($response['headers']['status-code'], 201); + + $sessionId = $response['body']['$id']; + $session = $this->client->parseCookie((string)$response['headers']['set-cookie'])['a_session_'.$this->getProject()['$id']]; + + $response = $this->client->call(Client::METHOD_GET, '/account', array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + ])); + + $this->assertEquals($response['headers']['status-code'], 200); + + $response = $this->client->call(Client::METHOD_PATCH, '/users/' . $id . '/status', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], [ + 'status' => 2, + ]); + + $this->assertEquals($response['headers']['status-code'], 200); + + $response = $this->client->call(Client::METHOD_GET, '/account', array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + ])); + + $this->assertEquals($response['headers']['status-code'], 401); + + $response = $this->client->call(Client::METHOD_POST, '/account/sessions', array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), [ + 'email' => $email, + 'password' => $password, + ]); + + $this->assertEquals($response['headers']['status-code'], 401); + + return []; + } } \ No newline at end of file diff --git a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php index cf66784a19..e0c6e1177d 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php @@ -7,7 +7,7 @@ use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; -class FunctionsConsoleClientTest extends Scope +class FunctionsCustomClientTest extends Scope { use FunctionsBase; use ProjectCustom; diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index b8f31fb879..f44f121a01 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -7,8 +7,9 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; +use Utopia\CLI\Console; -class FunctionsConsoleServerTest extends Scope +class FunctionsCustomServerTest extends Scope { use FunctionsBase; use ProjectCustom; @@ -183,7 +184,7 @@ class FunctionsConsoleServerTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ 'command' => 'php function.php', - 'code' => new CURLFile(realpath(__DIR__ . '/../../../resources/functions/php-fx.tar.gz'), 'application/x-gzip', 'php-fx.tar.gz'), + 'code' => new CURLFile(realpath(__DIR__ . '/../../../resources/functions/php.tar.gz'), 'application/x-gzip', 'php-fx.tar.gz'), ]); $tagId = $tag['body']['$id'] ?? ''; @@ -192,7 +193,7 @@ class FunctionsConsoleServerTest extends Scope $this->assertNotEmpty($tag['body']['$id']); $this->assertIsInt($tag['body']['dateCreated']); $this->assertEquals('php function.php', $tag['body']['command']); - $this->assertEquals(751, $tag['body']['size']); + $this->assertGreaterThan(10000, $tag['body']['size']); /** * Test for FAILURE @@ -264,7 +265,7 @@ class FunctionsConsoleServerTest extends Scope ], $this->getHeaders())); $this->assertEquals(200, $function['headers']['status-code']); - $this->assertEquals(751, $function['body']['size']); + $this->assertGreaterThan(10000, $function['body']['size']); /** * Test for FAILURE @@ -279,7 +280,6 @@ class FunctionsConsoleServerTest extends Scope return $data; } - /** * @depends testUpdateTag */ @@ -337,10 +337,11 @@ class FunctionsConsoleServerTest extends Scope * Test for FAILURE */ + sleep(10); + return array_merge($data, ['executionId' => $executionId]); } - /** * @depends testCreateExecution */ @@ -451,4 +452,254 @@ class FunctionsConsoleServerTest extends Scope return $data; } + + public function testENVS():array + { + /** + * Test for SUCCESS + */ + $file = $this->client->call(Client::METHOD_POST, '/storage/files', array_merge([ + 'content-type' => 'multipart/form-data', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'file' => new CURLFile(realpath(__DIR__ . '/../../../resources/logo.png'), 'image/png', 'logo.png'), + 'read' => ['*'], + 'write' => ['*'], + 'folderId' => 'xyz', + ]); + + $this->assertEquals($file['headers']['status-code'], 201); + $this->assertNotEmpty($file['body']['$id']); + + $fileId = $file['body']['$id'] ?? ''; + + $functions = realpath(__DIR__ . '/../../../resources/functions'); + + /** + * Command for rebuilding code packages: + * bash tests/resources/functions/package-*.sh + */ + $envs = [ + [ + 'language' => 'PHP', + 'version' => '7.4', + 'name' => 'php-7.4', + 'code' => $functions.'/php.tar.gz', + 'command' => 'php index.php', + 'timeout' => 15, + ], + [ + 'language' => 'PHP', + 'version' => '8.0', + 'name' => 'php-8.0', + 'code' => $functions.'/php.tar.gz', + 'command' => 'php index.php', + 'timeout' => 15, + ], + [ + 'language' => 'Python', + 'version' => '3.8', + 'name' => 'python-3.8', + 'code' => $functions.'/python.tar.gz', + 'command' => 'python main.py', + 'timeout' => 15, + ], + [ + 'language' => 'Node.js', + 'version' => '14.5', + 'name' => 'node-14', + 'code' => $functions.'/node.tar.gz', + 'command' => 'node index.js', + 'timeout' => 15, + ], + [ + 'language' => 'Ruby', + 'version' => '2.7', + 'name' => 'ruby-2.7', + 'code' => $functions.'/ruby.tar.gz', + 'command' => 'ruby app.rb', + 'timeout' => 15, + ], + [ + 'language' => 'Deno', + 'version' => '1.5', + 'name' => 'deno-1.5', + 'code' => $functions.'/deno.tar.gz', + 'command' => 'deno run --allow-env index.ts', + 'timeout' => 15, + ], + ]; + + foreach ($envs as $key => $env) { + $language = $env['language'] ?? ''; + $version = $env['version'] ?? ''; + $name = $env['name'] ?? ''; + $code = $env['code'] ?? ''; + $command = $env['command'] ?? ''; + $timeout = $env['timeout'] ?? 15; + + $function = $this->client->call(Client::METHOD_POST, '/functions', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Test '.$name, + 'env' => $name, + 'vars' => [ + 'APPWRITE_ENDPOINT' => 'http://appwrite.test/v1', + 'APPWRITE_PROJECT' => $this->getProject()['$id'], + 'APPWRITE_SECRET' => $this->getProject()['apiKey'], + 'APPWRITE_FILEID' => $fileId, + ], + 'events' => [], + 'schedule' => '', + 'timeout' => $timeout, + ]); + + // var_dump('http://'.gethostbyname(trim(`hostname`)).'/v1'); + + $functionId = $function['body']['$id'] ?? ''; + + $this->assertEquals(201, $function['headers']['status-code']); + + $tag = $this->client->call(Client::METHOD_POST, '/functions/'.$functionId.'/tags', array_merge([ + 'content-type' => 'multipart/form-data', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'command' => $command, + 'code' => new CURLFile($code, 'application/x-gzip', basename($code)), + ]); + + $tagId = $tag['body']['$id'] ?? ''; + $this->assertEquals(201, $tag['headers']['status-code']); + + $tag = $this->client->call(Client::METHOD_PATCH, '/functions/'.$functionId.'/tag', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'tag' => $tagId, + ]); + + $this->assertEquals(200, $tag['headers']['status-code']); + + $execution = $this->client->call(Client::METHOD_POST, '/functions/'.$functionId.'/executions', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'async' => 1, + ]); + + $executionId = $execution['body']['$id'] ?? ''; + $this->assertEquals(201, $execution['headers']['status-code']); + + sleep(15); + + $executions = $this->client->call(Client::METHOD_GET, '/functions/'.$functionId.'/executions', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + if($executions['body']['executions'][0]['status'] === 'failed') { + var_dump($executions['body']['executions'][0]); + } + + $this->assertEquals($executions['headers']['status-code'], 200); + $this->assertEquals($executions['body']['sum'], 1); + $this->assertIsArray($executions['body']['executions']); + $this->assertCount(1, $executions['body']['executions']); + $this->assertEquals($executions['body']['executions'][0]['$id'], $executionId); + $this->assertEquals($executions['body']['executions'][0]['trigger'], 'http'); + $this->assertEquals($executions['body']['executions'][0]['status'], 'completed'); + $this->assertEquals($executions['body']['executions'][0]['exitCode'], 0); + + $stdout = explode("\n", $executions['body']['executions'][0]['stdout']); + + $this->assertEquals($stdout[0], $functionId); + $this->assertEquals($stdout[1], 'Test '.$name); + $this->assertEquals($stdout[2], $tagId); + $this->assertEquals($stdout[3], 'http'); + $this->assertEquals($stdout[4], $language); + $this->assertEquals($stdout[5], $version); + // $this->assertEquals($stdout[6], $fileId); + } + + return [ + 'functionId' => $functionId, + ]; + } + /** + * @depends testENVS + */ + public function testTimeout() + { + $name = 'php-8.0'; + $code = realpath(__DIR__ . '/../../../resources/functions').'/timeout.tar.gz'; + $command = 'php index.php'; + $timeout = 2; + + $function = $this->client->call(Client::METHOD_POST, '/functions', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Test '.$name, + 'env' => $name, + 'vars' => [], + 'events' => [], + 'schedule' => '', + 'timeout' => $timeout, + ]); + + $functionId = $function['body']['$id'] ?? ''; + + $this->assertEquals(201, $function['headers']['status-code']); + + $tag = $this->client->call(Client::METHOD_POST, '/functions/'.$functionId.'/tags', array_merge([ + 'content-type' => 'multipart/form-data', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'command' => $command, + 'code' => new CURLFile($code, 'application/x-gzip', basename($code)), + ]); + + $tagId = $tag['body']['$id'] ?? ''; + $this->assertEquals(201, $tag['headers']['status-code']); + + $tag = $this->client->call(Client::METHOD_PATCH, '/functions/'.$functionId.'/tag', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'tag' => $tagId, + ]); + + $this->assertEquals(200, $tag['headers']['status-code']); + + $execution = $this->client->call(Client::METHOD_POST, '/functions/'.$functionId.'/executions', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'async' => 1, + ]); + + $executionId = $execution['body']['$id'] ?? ''; + $this->assertEquals(201, $execution['headers']['status-code']); + + sleep(15); + + $executions = $this->client->call(Client::METHOD_GET, '/functions/'.$functionId.'/executions', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals($executions['headers']['status-code'], 200); + $this->assertEquals($executions['body']['sum'], 1); + $this->assertIsArray($executions['body']['executions']); + $this->assertCount(1, $executions['body']['executions']); + $this->assertEquals($executions['body']['executions'][0]['$id'], $executionId); + $this->assertEquals($executions['body']['executions'][0]['trigger'], 'http'); + $this->assertEquals($executions['body']['executions'][0]['status'], 'failed'); + $this->assertEquals($executions['body']['executions'][0]['exitCode'], 1); + $this->assertGreaterThan(2, $executions['body']['executions'][0]['time']); + $this->assertLessThan(3, $executions['body']['executions'][0]['time']); + $this->assertEquals($executions['body']['executions'][0]['stdout'], ''); + $this->assertEquals($executions['body']['executions'][0]['stderr'], ''); + } } \ No newline at end of file diff --git a/tests/e2e/Services/Health/HealthCustomServerTest.php b/tests/e2e/Services/Health/HealthCustomServerTest.php index 52b0437a74..5fe758e28c 100644 --- a/tests/e2e/Services/Health/HealthCustomServerTest.php +++ b/tests/e2e/Services/Health/HealthCustomServerTest.php @@ -8,7 +8,7 @@ use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\SideClient; use Tests\E2E\Scopes\SideServer; -class HealthCustomClientTest extends Scope +class HealthCustomServerTest extends Scope { use HealthBase; use ProjectCustom; @@ -59,7 +59,7 @@ class HealthCustomClientTest extends Scope /** * Test for SUCCESS */ - $response = $this->client->call(Client::METHOD_GET, '/health/db', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/health/cache', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index 3e2f84d1b1..f761d92ed2 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -1,6 +1,6 @@ =7.4.0", + "ext-curl": "*", + "ext-json": "*", + "appwrite/appwrite": "1.1.*" + } +} diff --git a/tests/resources/functions/php/composer.lock b/tests/resources/functions/php/composer.lock new file mode 100644 index 0000000000..758c73c3f9 --- /dev/null +++ b/tests/resources/functions/php/composer.lock @@ -0,0 +1,64 @@ +{ + "_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/index.php b/tests/resources/functions/php/index.php new file mode 100644 index 0000000000..58f8004c12 --- /dev/null +++ b/tests/resources/functions/php/index.php @@ -0,0 +1,28 @@ +setEndpoint($_ENV['APPWRITE_ENDPOINT']) // Your API Endpoint + ->setProject($_ENV['APPWRITE_PROJECT']) // Your project ID + ->setKey($_ENV['APPWRITE_SECRET']) // Your secret API key +; + +$storage = new Storage($client); + +// $result = $storage->getFile($_ENV['APPWRITE_FILEID']); + +echo $_ENV['APPWRITE_FUNCTION_ID']."\n"; +echo $_ENV['APPWRITE_FUNCTION_NAME']."\n"; +echo $_ENV['APPWRITE_FUNCTION_TAG']."\n"; +echo $_ENV['APPWRITE_FUNCTION_TRIGGER']."\n"; +echo $_ENV['APPWRITE_FUNCTION_ENV_NAME']."\n"; +echo $_ENV['APPWRITE_FUNCTION_ENV_VERSION']."\n"; +// echo $result['$id']; +echo $_ENV['APPWRITE_FUNCTION_EVENT']."\n"; +echo $_ENV['APPWRITE_FUNCTION_EVENT_PAYLOAD']."\n"; \ No newline at end of file diff --git a/tests/resources/functions/python-fx.tar.gz b/tests/resources/functions/python-fx.tar.gz deleted file mode 100644 index 22edb784b1..0000000000 Binary files a/tests/resources/functions/python-fx.tar.gz and /dev/null differ diff --git a/tests/resources/functions/python.tar.gz b/tests/resources/functions/python.tar.gz new file mode 100644 index 0000000000..dbb07c3f53 Binary files /dev/null and b/tests/resources/functions/python.tar.gz differ diff --git a/tests/resources/functions/python/main.py b/tests/resources/functions/python/main.py new file mode 100644 index 0000000000..5da8f43f77 --- /dev/null +++ b/tests/resources/functions/python/main.py @@ -0,0 +1,23 @@ +import json +import os +from appwrite.client import Client +from appwrite.services.storage import Storage + +# Setup appwrite client +client = Client() +client.set_endpoint(os.environ["APPWRITE_ENDPOINT"]) # PRIVATE IP OF YOUR APPWRITE CONTAINER +client.set_project(os.environ["APPWRITE_PROJECT"]) # YOUR PROJECT ID +client.set_key(os.environ["APPWRITE_SECRET"]) + +storage = Storage(client) +# result = storage.get_file(os.environ["APPWRITE_FILEID"]) + +print(os.environ["APPWRITE_FUNCTION_ID"]) +print(os.environ["APPWRITE_FUNCTION_NAME"]) +print(os.environ["APPWRITE_FUNCTION_TAG"]) +print(os.environ["APPWRITE_FUNCTION_TRIGGER"]) +print(os.environ["APPWRITE_FUNCTION_ENV_NAME"]) +print(os.environ["APPWRITE_FUNCTION_ENV_VERSION"]) +# print(result["$id"]) +print(os.environ["APPWRITE_FUNCTION_EVENT"]) +print(os.environ["APPWRITE_FUNCTION_EVENT_PAYLOAD"]) \ No newline at end of file diff --git a/tests/resources/functions/python/requirements.txt b/tests/resources/functions/python/requirements.txt new file mode 100644 index 0000000000..7a6977edfb --- /dev/null +++ b/tests/resources/functions/python/requirements.txt @@ -0,0 +1 @@ +appwrite \ No newline at end of file diff --git a/tests/resources/functions/ruby.tar.gz b/tests/resources/functions/ruby.tar.gz new file mode 100644 index 0000000000..62efb011c9 Binary files /dev/null and b/tests/resources/functions/ruby.tar.gz differ diff --git a/tests/resources/functions/ruby/Gemfile b/tests/resources/functions/ruby/Gemfile new file mode 100644 index 0000000000..02c1a52ac3 --- /dev/null +++ b/tests/resources/functions/ruby/Gemfile @@ -0,0 +1,5 @@ +source "https://rubygems.org" + +ruby "~> 2.7.0" + +gem 'appwrite', '~> 1.0', '>= 1.0.11' \ No newline at end of file diff --git a/tests/resources/functions/ruby/Gemfile.lock b/tests/resources/functions/ruby/Gemfile.lock new file mode 100644 index 0000000000..08d06664d4 --- /dev/null +++ b/tests/resources/functions/ruby/Gemfile.lock @@ -0,0 +1,16 @@ +GEM + remote: https://rubygems.org/ + specs: + appwrite (1.0.11) + +PLATFORMS + ruby + +DEPENDENCIES + appwrite (~> 1.0, >= 1.0.11) + +RUBY VERSION + ruby 2.7.2p137 + +BUNDLED WITH + 2.1.4 diff --git a/tests/resources/functions/ruby/app.rb b/tests/resources/functions/ruby/app.rb new file mode 100644 index 0000000000..f9c4b08e2f --- /dev/null +++ b/tests/resources/functions/ruby/app.rb @@ -0,0 +1,23 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint(ENV["APPWRITE_ENDPOINT"]) # Your API Endpoint + .set_project(ENV["APPWRITE_PROJECT"]) # Your project ID + .set_key(ENV["APPWRITE_SECRET"]) # Your secret API key +; + +storage = Appwrite::Storage.new(client); + +# result = storage.get_file(ENV["APPWRITE_FILEID"]); + +puts ENV["APPWRITE_FUNCTION_ID"] +puts ENV["APPWRITE_FUNCTION_NAME"] +puts ENV["APPWRITE_FUNCTION_TAG"] +puts ENV["APPWRITE_FUNCTION_TRIGGER"] +puts ENV["APPWRITE_FUNCTION_ENV_NAME"] +puts ENV["APPWRITE_FUNCTION_ENV_VERSION"] +# puts result["$id"] +puts ENV["APPWRITE_FUNCTION_EVENT"] +puts ENV["APPWRITE_FUNCTION_EVENT_PAYLOAD"] \ No newline at end of file diff --git a/tests/resources/functions/timeout.tar.gz b/tests/resources/functions/timeout.tar.gz new file mode 100644 index 0000000000..16a2bec08b Binary files /dev/null and b/tests/resources/functions/timeout.tar.gz differ diff --git a/tests/resources/functions/timeout/index.php b/tests/resources/functions/timeout/index.php new file mode 100644 index 0000000000..83cb8e1b56 --- /dev/null +++ b/tests/resources/functions/timeout/index.php @@ -0,0 +1,3 @@ +