diff --git a/CHANGES.md b/CHANGES.md index 5c3ab7703a..0a7887c4c9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,171 +1,204 @@ +# Version 0.6.2 (PRE-RELEASE) + +## Features + +- New route in Locale API to fetch list of languages + +## Bug Fixes + +- Fixed custom domain not setting correct domain +- Fixed wrong SDK method type in avatars browser route +- Fixed bug denied public documents (*) to be accessed by guest users +- Fixed cache control issue not allowing collection UI to update properly +- Fixed a bug where single permission tag in the console was not being saved +- Added missing webhooks events in the console +- Added missing option to delete project +- Fixed a bug where the session was not set properly when the API used an IP with non-standard port as hostname +- Fixed bug where requests number on the dashboard was hidden when the number got too long + +## Security + +- [low severity] Patch for email library (https://github.com/advisories/GHSA-f7hx-fqxw-rvvj) + +# Version 0.6.1 (PRE-RELEASE) + +## Bug Fixes + +- Fix for Google OAuth provider not working properly +- Fix for login error when using a remote host with non-default ports +- Removed empty activity tab on the document editor +- Changed upgrade script name to ‘migrate’ to better reflect what it actually does +- Fixed bug where after clicking the cancel option in the confirmation dialog the button got disabled +- Fixed a small grammar error in the documents list screen + # Version 0.6.0 (PRE-RELEASE) ## Features -* New collections UI with ability to create and update a collection -* New documents UI with ability to create and update a document -* Added support for Flutter iOS & Android apps -* Added support for default DB document values -* Exposed health API to all the server SDKs -* New locale for Khmer -* Added TypeScript type hinting to the JS SDK (@zevektor) -* Added LTR/RTL support for markdown editor -* Added cachebuster to version number on footer -* New OAuth logos -* Minor fixes to the dark mode theme -* Added JSON view for a project user -* Removed setKey and setMode methods from all client SDKs +- New collections UI with ability to create and update a collection +- New documents UI with ability to create and update a document +- Added support for Flutter iOS & Android apps +- Added support for default DB document values +- Exposed health API to all the server SDKs +- New locale for Khmer +- Added TypeScript type hinting to the JS SDK (@zevektor) +- Added LTR/RTL support for markdown editor +- Added cachebuster to version number on footer +- New OAuth logos +- Minor fixes to the dark mode theme +- Added JSON view for a project user +- Removed setKey and setMode methods from all client SDKs ## Breaking Changes -* Updated all the REST API query params to be in camelCase -* Normalized locale phone codes response body +- Updated all the REST API query params to be in camelCase +- Normalized locale phone codes response body ## Bug Fixes -* Fixed project users logout button -* Fixed wrong target in database back link +- Fixed project users logout button +- Fixed wrong target in database back link # Version 0.5.3 (PRE-RELEASE) ## Bug Fixes -* Fixed bug where multiple unique attribute were allowed -* Blocked forms from being submitted unlimited times +- Fixed bug where multiple unique attribute were allowed +- Blocked forms from being submitted unlimited times # Version 0.5.2 (PRE-RELEASE) ## Bug Fixes -* Fixed missing attributes in user account +- Fixed missing attributes in user account # Version 0.5.1 (PRE-RELEASE) ## Bug Fixes -* Delayed SSL init when server startup for traefik to be ready for HTTP challenge -* Enabled easy access to the upgrade tool from the terminal +- Delayed SSL init when server startup for traefik to be ready for HTTP challenge +- Enabled easy access to the upgrade tool from the terminal # Version 0.5.0 (PRE-RELEASE) ## Features -* Upgraded core API PHP version to 7.4 -* New database rule validation options -* Allow non-web platform to skip origin header -* Limited console dashboard to show max 5 alerts at the same time -* Added more webhooks events -* Normailized all webhooks event names -* Added support for SameSite cookie option with fallback cookie for old clients -* Added a new Discord OAuth adapter -* Added a new Twitch OAuth adapter -* Added a new Spotify OAuth adapter -* Added a new Yahoo OAuth adapter -* Added a new Salesforce OAuth adapter -* Added a new Yandex OAuth adapter -* Added a new Paypal OAuth adapter -* Added a new Bitly OAuth adapter -* Upgraded MariaDB image to version 1.0.2 -* Upgraded SMTP image to version 1.0.1 -* File upload route (POST /v1/storage/files) now accept a single file per request -* Added ENV vars to change system email sender name and address -* Usage for requests made by project admin in the console are not counted as API usage -* Added ENV var to change default file upload size limit. New default value is 100MB -* Added option to delete file directly from the dashboard -* Added option to view file preview from the dashboard -* Added option to add custom domains with auto SSL certificate generator +- Upgraded core API PHP version to 7.4 +- New database rule validation options +- Allow non-web platform to skip origin header +- Limited console dashboard to show max 5 alerts at the same time +- Added more webhooks events +- Normailized all webhooks event names +- Added support for SameSite cookie option with fallback cookie for old clients +- Added a new Discord OAuth adapter +- Added a new Twitch OAuth adapter +- Added a new Spotify OAuth adapter +- Added a new Yahoo OAuth adapter +- Added a new Salesforce OAuth adapter +- Added a new Yandex OAuth adapter +- Added a new Paypal OAuth adapter +- Added a new Bitly OAuth adapter +- Upgraded MariaDB image to version 1.0.2 +- Upgraded SMTP image to version 1.0.1 +- File upload route (POST /v1/storage/files) now accept a single file per request +- Added ENV vars to change system email sender name and address +- Usage for requests made by project admin in the console are not counted as API usage +- Added ENV var to change default file upload size limit. New default value is 100MB +- Added option to delete file directly from the dashboard +- Added option to view file preview from the dashboard +- Added option to add custom domains with auto SSL certificate generator ## Bug Fixes -* Fixed bug where user status was saved as a string instead of an integer -* Fixed gravatar icons not showing up correctly on the console -* Fixed code location of project not found error -* Fixed bug where tags element would ignore tab key for parsing new tags -* Fixed OAuth login error saying project UID is missing when its not -* Fixed wrong input validation for user preferences +- Fixed bug where user status was saved as a string instead of an integer +- Fixed gravatar icons not showing up correctly on the console +- Fixed code location of project not found error +- Fixed bug where tags element would ignore tab key for parsing new tags +- Fixed OAuth login error saying project UID is missing when its not +- Fixed wrong input validation for user preferences ## Breaking Changes -* Merged Auth and Account service route to make the API REST compatible +- Merged Auth and Account service route to make the API REST compatible # Version 0.4.0 (PRE-RELEASE) ## Features -* Added 5 new locales for locale service and email templates (is, ml, th, fo, ph, pn) -* 2 stage Docker build -* Limit HTTP origin check only to browser integrations -* Updated new Brexit date to 31-01-2020 -* Added a version number to sign in and signup pages for easier debugging of issues -* Preparation for adding SameSite cookie option support -* Using native Docker volumes for setup for better cross-platform support and easier management of read/write permissions -* Added support for custom SSL certificates without needing to set a proxy -* Added project UID validation check when making an API call. This should help developers to understand our authentication errors better. -* Updated ClamAV docker image to version 1.0.7 -* Updated MariaDB docker image to version 1.0.1 -* Core Docker image size reduced to 127MB +- Added 5 new locales for locale service and email templates (is, ml, th, fo, ph, pn) +- 2 stage Docker build +- Limit HTTP origin check only to browser integrations +- Updated new Brexit date to 31-01-2020 +- Added a version number to sign in and signup pages for easier debugging of issues +- Preparation for adding SameSite cookie option support +- Using native Docker volumes for setup for better cross-platform support and easier management of read/write permissions +- Added support for custom SSL certificates without needing to set a proxy +- Added project UID validation check when making an API call. This should help developers to understand our authentication errors better. +- Updated ClamAV docker image to version 1.0.7 +- Updated MariaDB docker image to version 1.0.1 +- Core Docker image size reduced to 127MB ## Security -* [PHP-FPM security patch fix](https://bugs.php.net/patch-display.php?bug_id=78599&patch=0001-Fix-bug-78599-env_path_info-underflow-can-lead-to-RC.patch&revision=latest) - Upgraded PHP version to 7.3.12 [Major] -* Remove executable permission from avatars files [Minor] -* Updated SDK Generator Twig dependency with security issue: https://www.exploit-db.com/exploits/44102 [Minor] +- [PHP-FPM security patch fix](https://bugs.php.net/patch-display.php?bug_id=78599&patch=0001-Fix-bug-78599-env_path_info-underflow-can-lead-to-RC.patch&revision=latest) - Upgraded PHP version to 7.3.12 [Major] +- Remove executable permission from avatars files [Minor] +- Updated SDK Generator Twig dependency with security issue: https://www.exploit-db.com/exploits/44102 [Minor] ## Bug Fixes -* New loading message when creating a new project -* Fixed broken redirect URL when creating a new project -* Fixed broken modal when a user password is too short -* Fixed issue denying the creation of session cookies on localhosts with port other than 80 or 443 -* Fixed bug that prevented actual file size calculation -* Fixed MariaDB SQL abuse table time field-type -* Fixed error message not showing up in console failed signup -* Fixed cookie session not being appropriately set when accessing the console from IP hostname +- New loading message when creating a new project +- Fixed broken redirect URL when creating a new project +- Fixed broken modal when a user password is too short +- Fixed issue denying the creation of session cookies on localhosts with port other than 80 or 443 +- Fixed bug that prevented actual file size calculation +- Fixed MariaDB SQL abuse table time field-type +- Fixed error message not showing up in console failed signup +- Fixed cookie session not being appropriately set when accessing the console from IP hostname ## Breaking Changes -* OAuth path is now /auth/login/oauth instead of /auth/oauth and /auth/oauth/callback is now /auth/login/oauth/callback, this is for better consistency with new login methods we will introduce in the future -* Changed file attribute sizeCompressed to sizeActual to better reflect server logic +- OAuth path is now /auth/login/oauth instead of /auth/oauth and /auth/oauth/callback is now /auth/login/oauth/callback, this is for better consistency with new login methods we will introduce in the future +- Changed file attribute sizeCompressed to sizeActual to better reflect server logic # Version 0.3.0 (PRE-RELEASE) ## Features -* Added 19 new locales for locale service and email templates (af, ar, bn, cz, hu, hy, jv, ko, lt, ml, no, ru, si, sq, sv, ta, vi, zh-cn, zh-tw) -* New users service routes to allow updates pref and name update -* New OAuth adapters (Amazon, Dropbox, Microsoft, Slack, VK) -* Added support for ES6 require statements in JS SDK -* New Locale API route for fetching a list of continents +- Added 19 new locales for locale service and email templates (af, ar, bn, cz, hu, hy, jv, ko, lt, ml, no, ru, si, sq, sv, ta, vi, zh-cn, zh-tw) +- New users service routes to allow updates pref and name update +- New OAuth adapters (Amazon, Dropbox, Microsoft, Slack, VK) +- Added support for ES6 require statements in JS SDK +- New Locale API route for fetching a list of continents ## Bug Fixes -* Fix for typos in PT-BR translations -* Fix for UI crash when project user was missing a name -* Fix for it locale including the en templates by mistake -* Fix for UI not showing user's prefs properly -* Fixed 401 unexpected error when no permission passed in creation of a new resource +- Fix for typos in PT-BR translations +- Fix for UI crash when project user was missing a name +- Fix for it locale including the en templates by mistake +- Fix for UI not showing user's prefs properly +- Fixed 401 unexpected error when no permission passed in creation of a new resource ## Breaking Changes -* users/deleteUsersSession method name changed to users/deleteUserSession in all SDKs for better consistency +- users/deleteUsersSession method name changed to users/deleteUserSession in all SDKs for better consistency # Version 0.2.0 (PRE-RELEASE) ## Features -* Added option to limit access to the Appwrite console -* Added option to disable abuse check and rate limits -* Added input field with the server API endpoint for easy access -* Added new OAuth providers for Google, Bitbucket, and GitLab -* Added 15 new locales for locale service and email templates (cat, de, es, fi, fr, gr, hi, id, it, nl, pt-br, pt-pt, ro, tr, ua) -* Improved test coverage for the project and synced DEV & CI environments settings +- Added option to limit access to the Appwrite console +- Added option to disable abuse check and rate limits +- Added input field with the server API endpoint for easy access +- Added new OAuth providers for Google, Bitbucket, and GitLab +- Added 15 new locales for locale service and email templates (cat, de, es, fi, fr, gr, hi, id, it, nl, pt-br, pt-pt, ro, tr, ua) +- Improved test coverage for the project and synced DEV & CI environments settings ## Bug Fixes -* Fixed bug not allowing to update OAuth providers settings -* Fixed some broken API examples in docs -* Fixed bug that caused the Appwrite container to change DB directory file permissions. +- Fixed bug not allowing to update OAuth providers settings +- Fixed some broken API examples in docs +- Fixed bug that caused the Appwrite container to change DB directory file permissions. ## Breaking Changes -* Changed auth service 'redirect' param to 'confirm' for better clarity -* Updated all SDKs to sync with API changes +- Changed auth service 'redirect' param to 'confirm' for better clarity +- Updated all SDKs to sync with API changes diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f585217755..83321193d9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -158,7 +158,7 @@ Before running the command, make sure you have proper write permissions to the A To run tests manually, run phpunit from your command line: ```bash -docker exec appwrite /bin/bash -c '/usr/share/nginx/html/vendor/bin/phpunit' +docker exec appwrite test ``` ## Tutorials diff --git a/Dockerfile b/Dockerfile index 039fe3be6d..3cc0c8465a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,6 +53,7 @@ ENV TZ=Asia/Tel_Aviv \ _APP_OPTIONS_ABUSE=enabled \ _APP_OPENSSL_KEY_V1=your-secret-key \ _APP_STORAGE_LIMIT=104857600 \ + _APP_STORAGE_ANTIVIRUS=enabled \ _APP_REDIS_HOST=redis \ _APP_REDIS_PORT=6379 \ _APP_DB_HOST=mariadb \ @@ -111,6 +112,7 @@ COPY ./docker/www.conf /etc/php/$PHP_VERSION/fpm/pool.d/www.conf # Add PHP Source Code COPY ./app /usr/share/nginx/html/app +COPY ./bin /usr/local/bin COPY ./docs /usr/share/nginx/html/docs COPY ./public /usr/share/nginx/html/public COPY ./src /usr/share/nginx/html/src @@ -131,7 +133,6 @@ COPY ./docker/supervisord.conf /etc/supervisord.conf # Set Upload Limit (default to 100MB) RUN echo "upload_max_filesize = ${_APP_STORAGE_LIMIT}" >> /etc/php/$PHP_VERSION/fpm/conf.d/appwrite.ini RUN echo "post_max_size = ${_APP_STORAGE_LIMIT}" >> /etc/php/$PHP_VERSION/fpm/conf.d/appwrite.ini -RUN echo "env[TESTME] = your-secret-key" >> /etc/php/$PHP_VERSION/fpm/conf.d/appwrite.ini RUN echo "opcache.preload_user=www-data" >> /etc/php/$PHP_VERSION/fpm/conf.d/appwrite.ini RUN echo "opcache.preload=/usr/share/nginx/html/app/preload.php" >> /etc/php/$PHP_VERSION/fpm/conf.d/appwrite.ini RUN echo "opcache.preload_user=www-data" >> /etc/php/$PHP_VERSION/cli/conf.d/appwrite.ini @@ -140,13 +141,10 @@ RUN echo "opcache.preload=/usr/share/nginx/html/app/preload.php" >> /etc/php/$PH # Add logs file RUN echo "" >> /var/log/appwrite.log -# Start -COPY ./docker/bin/start /start -RUN chmod 775 /start - -# Upgrade -COPY ./docker/bin/upgrade /upgrade -RUN chmod 775 /upgrade +# Executables +RUN chmod +x /usr/local/bin/start +RUN chmod +x /usr/local/bin/migrate +RUN chmod +x /usr/local/bin/test # Letsencrypt Permissions RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/ @@ -155,4 +153,4 @@ EXPOSE 80 WORKDIR /usr/share/nginx/html -CMD ["/bin/bash", "/start"] +CMD ["/bin/bash", "/usr/local/bin/start"] \ No newline at end of file diff --git a/README.md b/README.md index e80338aca0..40f798c647 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Appwrite Logo

- Simple Backend Server for your [Vue / Angular / React / iOS / Android / Flutter / *ANY OTHER*] Frontend App + A complete backend solution for your [Flutter / Vue / Angular / React / iOS / Android / *ANY OTHER*] client app

@@ -14,14 +14,9 @@ [![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) +Appwrite is an end-to-end backend server for Web, Mobile, Native, or Backend apps packaged as a set of Docker microservices. Appwrite abstract the complexity and repetitiveness required to build a modern backend API from scratch to allow you to build secure apps faster. -Appwrite is a simple self-hosted backend server for web and mobile developers with a shiny dashboard and a very easy-to-use REST API. - -Appwrite API services aim to make developer's life a lot easier by hiding the complexity of common and repetitive software development tasks. - -Using Appwrite, you can easily manage user authentication with multiple sign-in methods, a database for storing and querying user and team data, storage and file management, image manipulation and cropping, schedule cron tasks and many other features to help you get more results in faster times and with a lot less code. - -Appwrite can also integrate really well with your backend. Appwrite can word behind your own proxy facing your internal network, or alongside your own custom backend. You can use Appwrite server SDK to integrate your backend with Appwrite's APIs and webhooks. +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). [https://appwrite.io](https://appwrite.io) @@ -30,10 +25,15 @@ Appwrite can also integrate really well with your backend. Appwrite can word beh Table of Contents: - [Installation](#installation) - - [Changing Port Number](#changing-port-number) + - [Unix](#unix) + - [Windows](#windows) + - [CMD](#cmd) + - [PowerShell](#powershell) - [Getting Started](#getting-started) - [Services](#services) - [SDKs](#sdks) + - [Client](#client) + - [Server](#server) - [Security](#security) - [Follow Us](#follow-us) - [Contributing](#contributing) @@ -45,58 +45,82 @@ Appwrite backend server is designed to run in a container environment. Running y The easiest way to start running your Appwrite server is by running our docker-compose file. Before running the installation command make sure you have [Docker](https://www.docker.com/products/docker-desktop) installed on your machine: +### Unix + ```bash docker run -it --rm \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/install/appwrite:rw \ - -e version=0.5.3 \ + -e version=0.6.1 \ + appwrite/install +``` + +### Windows + +#### CMD + +```cmd +docker run -it --rm ^ + --volume //var/run/docker.sock:/var/run/docker.sock ^ + --volume "%cd%"/appwrite:/install/appwrite:rw ^ + -e version=0.6.1 ^ + appwrite/install +``` + +#### PowerShell + +```powershell +docker run -it --rm , + --volume /var/run/docker.sock:/var/run/docker.sock , + --volume ${pwd}/appwrite:/install/appwrite:rw , + -e version=0.6.1 , appwrite/install ``` Once the Docker installation completes, go to http://localhost to access the Appwrite console from your browser. Please note that on non-linux native hosts, the server might take a few minutes to start after installation completes. -For advanced production and custom installation, check out our Docker [environment variables](docs/tutorials/environment-variables.md) docs. - -### Changing Port Number - -In case your port 80 is already taken, change the port number in the command above. Make sure to set the correct endpoint in your selected SDK, including your new port number. +For advanced production and custom installation, check out our Docker [environment variables](docs/tutorials/environment-variables.md) docs. You can also use our public [docker-compose.yml](https://appwrite.io/docker-compose.yml) file to manually set up and environment. ## Getting Started Getting started with Appwrite is as easy as creating a new project, choosing your platform and integrating its SDK in your code. You can easily get started with your platform of choice by reading one of our Getting Started tutorials. * [Getting Started for Web](https://appwrite.io/docs/getting-started-for-web) +* [Getting Started for Flutter](https://appwrite.io/docs/getting-started-for-flutter) * [Getting Started for Server](https://appwrite.io/docs/getting-started-for-server) * Getting Started for Android (soon...) * Getting Started for iOS (soon...) ### Services -* [**Account**](https://appwrite.io/docs/account) - Manage current user authentication and account. Track and manage the user sessions, devices, sign-in methods, and security logs. -* [**Users**](https://appwrite.io/docs/users) - Manage and list all project users when in admin mode. -* [**Teams**](https://appwrite.io/docs/teams) - Manage and group users in teams. Manage memberships, invites, and user roles within a team. -* [**Database**](https://appwrite.io/docs/database) - Manage database collections and documents. Read, create, update, and delete documents and filter lists of documents collections using an advanced filter with graph-like capabilities. -* [**Storage**](https://appwrite.io/docs/storage) - Manage storage files. Read, create, delete, and preview files. Manipulate the preview of your files to fit your app perfectly. All files are scanned by ClamAV and stored in a secure and encrypted way. -* [**Locale**](https://appwrite.io/docs/locale) - Track your user's location, and manage your app locale-based data. -* [**Avatars**](https://appwrite.io/docs/avatars) - Manage your users' avatars, countries' flags, browser icons, credit card symbols, and generate QR codes. +* [**Account**](https://appwrite.io/docs/client/account) - Manage current user authentication and account. Track and manage the user sessions, devices, sign-in methods, and security logs. +* [**Users**](https://appwrite.io/docs/server/users) - Manage and list all project users when in admin mode. +* [**Teams**](https://appwrite.io/docs/client/teams) - Manage and group users in teams. Manage memberships, invites, and user roles within a team. +* [**Database**](https://appwrite.io/docs/client/database) - Manage database collections and documents. Read, create, update, and delete documents and filter lists of documents collections using an advanced filter with graph-like capabilities. +* [**Storage**](https://appwrite.io/docs/client/storage) - Manage storage files. Read, create, delete, and preview files. Manipulate the preview of your files to fit your app perfectly. All files are scanned by ClamAV and stored in a secure and encrypted way. +* [**Locale**](https://appwrite.io/docs/client/locale) - Track your user's location, and manage your app locale-based data. +* [**Avatars**](https://appwrite.io/docs/client/avatars) - Manage your users' avatars, countries' flags, browser icons, credit card symbols, and generate QR codes. -For the complete API documentation, visit [https://appwrite.io/docs](https://appwrite.io/docs). For more tutorials, news and announcements check out our [blog](https://medium.com/appwrite-io). +For the complete API documentation, visit [https://appwrite.io/docs](https://appwrite.io/docs). For more tutorials, news and announcements check out our [blog](https://medium.com/appwrite-io) and [Discord Server](https://discord.gg/GSeTUeA). ### SDKs -Currently, we support only a few SDK libraries and are constantly working on including new ones. - Below is a list of currently supported platforms and languages. If you wish to help us add support to your platform of choice, you can go over to our [SDK Generator](https://github.com/appwrite/sdk-generator) project and view our [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md). -* ✅ [JS](https://github.com/appwrite/sdk-for-js) (Maintained by the Appwrite Team) +#### Client +* ✅ [Web](https://github.com/appwrite/sdk-for-js) (Maintained by the Appwrite Team) +* ✅ [Flutter](https://github.com/appwrite/sdk-for-flutter) (Maintained by the Appwrite Team) + +#### Server * ✅ [NodeJS](https://github.com/appwrite/sdk-for-node) (Maintained by the Appwrite Team) * ✅ [PHP](https://github.com/appwrite/sdk-for-php) (Maintained by the Appwrite Team) +* ✅ [Ruby](https://github.com/appwrite/sdk-for-ruby) - **Beta** (Maintained by the Appwrite Team) +* ✅ [Python](https://github.com/appwrite/sdk-for-python) - **Beta** (Maintained by the Appwrite Team) * ✅ [Go](https://github.com/appwrite/sdk-for-go) **Work in progress** (Maintained by the Appwrite Team) * ✅ [Dart](https://github.com/appwrite/sdk-for-dart) **Work in progress** (Maintained by the Appwrite Team) -* ✅ [Ruby](https://github.com/appwrite/sdk-for-ruby) - **Work in progress** (Maintained by the Appwrite Team) -* ✅ [Python](https://github.com/appwrite/sdk-for-python) - **Work in progress** (Maintained by the Appwrite Team) -* ✳️ Looking for more SDKs? - Help us by contributing a pull request to our [SDK Generator](https://github.com/appwrite/sdk-generator)! + +Looking for more SDKs? - Help us by contributing a pull request to our [SDK Generator](https://github.com/appwrite/sdk-generator)! ## Security diff --git a/app/app.php b/app/app.php index e22d5dc24b..9fba836c24 100644 --- a/app/app.php +++ b/app/app.php @@ -27,6 +27,7 @@ $services = include __DIR__.'/config/services.php'; // List of services $webhook = new Event('v1-webhooks', 'WebhooksV1'); $audit = new Event('v1-audits', 'AuditsV1'); $usage = new Event('v1-usage', 'UsageV1'); +$deletes = new Event('v1-deletes', 'DeletesV1'); /** * Get All verified client URLs for both console and current projects @@ -68,11 +69,12 @@ $utopia->init(function () use ($utopia, $request, $response, &$user, $project, $ $refDomain = $protocol.'://'.((in_array($origin, $clients)) ? $origin : 'localhost') . (!empty($port) ? ':'.$port : ''); - $selfDomain = new Domain(Config::getParam('domain')); + $selfDomain = new Domain(Config::getParam('hostname')); $endDomain = new Domain($origin); Config::setParam('domainVerification', - ($selfDomain->getRegisterable() === $endDomain->getRegisterable())); + ($selfDomain->getRegisterable() === $endDomain->getRegisterable()) && + $endDomain->getRegisterable() !== ''); /* * Security Headers @@ -86,7 +88,7 @@ $utopia->init(function () use ($utopia, $request, $response, &$user, $project, $ //->addHeader('X-Frame-Options', ($refDomain == 'http://localhost') ? 'SAMEORIGIN' : 'ALLOW-FROM ' . $refDomain) ->addHeader('X-Content-Type-Options', 'nosniff') ->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE') - ->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-SDK-Version') + ->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-SDK-Version, Cache-Control, Expires, Pragma') ->addHeader('Access-Control-Expose-Headers', 'X-Fallback-Cookies') ->addHeader('Access-Control-Allow-Origin', $refDomain) ->addHeader('Access-Control-Allow-Credentials', 'true') @@ -215,10 +217,10 @@ $utopia->init(function () use ($utopia, $request, $response, &$user, $project, $ ; }); -$utopia->shutdown(function () use ($response, $request, $webhook, $audit, $usage, $mode, $project, $utopia) { +$utopia->shutdown(function () use ($response, $request, $webhook, $audit, $usage, $deletes, $mode, $project, $utopia) { /* - * Trigger Events for background jobs + * Trigger events for background workers */ if (!empty($webhook->getParam('event'))) { $webhook->trigger(); @@ -228,6 +230,10 @@ $utopia->shutdown(function () use ($response, $request, $webhook, $audit, $usage $audit->trigger(); } + if (!empty($deletes->getParam('document'))) { + $deletes->trigger(); + } + $route = $utopia->match($request); if($project->getId() @@ -246,7 +252,7 @@ $utopia->options(function () use ($request, $response) { $response ->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE') - ->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-SDK-Version, X-Fallback-Cookies') + ->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-SDK-Version, Cache-Control, Expires, Pragma, X-Fallback-Cookies') ->addHeader('Access-Control-Expose-Headers', 'X-Fallback-Cookies') ->addHeader('Access-Control-Allow-Origin', $origin) ->addHeader('Access-Control-Allow-Credentials', 'true') diff --git a/app/config/collections.php b/app/config/collections.php index 4b23a1edde..3b1d167912 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -41,7 +41,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_PLATFORMS, 'name' => 'Current Host', 'type' => 'web', - 'hostname' => $request->getServer('HTTP_HOST'), + 'hostname' => parse_url('https://'.$request->getServer('HTTP_HOST'), PHP_URL_HOST), ], ], 'legalName' => '', diff --git a/app/config/events.php b/app/config/events.php new file mode 100644 index 0000000000..aeee6849f2 --- /dev/null +++ b/app/config/events.php @@ -0,0 +1,58 @@ + [ + 'description' => 'This event triggers when the account is created.', + ], + 'account.update.email' => [ + 'description' => 'This event triggers when the account email address is updated.', + ], + 'account.update.name' => [ + 'description' => 'This event triggers when the account name is updated.', + ], + 'account.update.password' => [ + 'description' => 'This event triggers when the account password is updated.', + ], + 'account.update.prefs' => [ + 'description' => 'This event triggers when the account preferences are updated.', + ], + 'account.delete' => [ + 'description' => 'This event triggers when the account is deleted.', + ], + 'account.sessions.create' => [ + 'description' => 'This event triggers when the account session is created.', + ], + 'account.sessions.delete' => [ + 'description' => 'This event triggers when the account session is deleted.', + ], + 'database.collections.create' => [ + 'description' => 'This event triggers when a database collection is created.', + ], + 'database.collections.update' => [ + 'description' => 'This event triggers when a database collection is updated.', + ], + 'database.collections.delete' => [ + 'description' => 'This event triggers when a database collection is deleted.', + ], + 'database.documents.create' => [ + 'description' => 'This event triggers when a database document is created.', + ], + 'database.documents.patch' => [ + 'description' => 'This event triggers when a database document is patched.', + ], + 'database.documents.delete' => [ + 'description' => 'This event triggers when a database document is deleted.', + ], + 'storage.files.create' => [ + 'description' => 'This event triggers when a storage file is created.', + ], + 'storage.files.update' => [ + 'description' => 'This event triggers when a storage file is updated.', + ], + 'storage.files.delete' => [ + 'description' => 'This event triggers when a storage file is deleted.', + ], +]; \ No newline at end of file diff --git a/app/config/platforms.php b/app/config/platforms.php index daaeeceeb1..ed1bf24a0c 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -1,60 +1,45 @@ [ - 'key' => APP_PLATFORM_WEB, - 'name' => 'Web', - 'description' => 'Client libraries for integrating with '.APP_NAME.' to build web-based applications and websites. Read the [getting started for web](/docs/getting-started-for-web) tutorial to start building your first web application.', + APP_PLATFORM_CLIENT => [ + 'key' => APP_PLATFORM_CLIENT, + 'name' => 'Client', + 'description' => 'Client libraries for integrating with '.APP_NAME.' to build client-based applications and websites. Read the [getting started for web](/docs/getting-started-for-web) or [getting started for Flutter](/docs/getting-started-for-flutter) tutorials to start building your first application.', 'enabled' => true, 'beta' => false, - 'languages' => [ + 'languages' => [ // TODO change key to 'sdks' [ - 'key' => 'javascript', - 'name' => 'JavaScript', - 'version' => '1.0.29', + 'key' => 'web', + 'name' => 'Web', + 'version' => '1.1.0', 'url' => 'https://github.com/appwrite/sdk-for-js', 'enabled' => true, 'beta' => false, 'family' => APP_PLATFORM_CLIENT, 'prism' => 'javascript', - 'source' => realpath(__DIR__ . '/../sdks/web-javascript'), + 'source' => realpath(__DIR__ . '/../sdks/client-web'), 'gitUrl' => 'git@github.com:appwrite/sdk-for-js.git', 'gitRepoName' => 'sdk-for-js', 'gitUserName' => 'appwrite', ], [ - 'key' => 'typescript', - 'name' => 'TypeScript', - 'url' => '', - 'enabled' => false, + 'key' => 'flutter', + 'name' => 'Flutter', + 'version' => '0.2.2', + 'url' => 'https://github.com/appwrite/sdk-for-flutter', + 'enabled' => true, 'beta' => true, 'family' => APP_PLATFORM_CLIENT, - 'prism' => 'typescript', - 'source' => false, - 'gitUrl' => 'git@github.com:appwrite/sdk-for-typescript.git', - 'gitRepoName' => 'sdk-for-typescript', + 'prism' => 'dart', + 'source' => realpath(__DIR__ . '/../sdks/client-flutter'), + 'gitUrl' => 'git@github.com:appwrite/sdk-for-flutter.git', + 'gitRepoName' => 'sdk-for-flutter', 'gitUserName' => 'appwrite', ], - ], - ], - - APP_PLATFORM_IOS => [ - 'key' => APP_PLATFORM_IOS, - 'name' => 'iOS', - 'description' => 'Client libraries for integrating with '.APP_NAME.' to build iOS applications. Read the [getting started for iOS](/docs/getting-started-for-ios) tutorial to start building your first iOS application.', - 'enabled' => false, - 'beta' => false, - 'languages' => [ [ 'key' => 'swift', 'name' => 'Swift', @@ -81,16 +66,6 @@ return [ 'gitRepoName' => 'sdk-for-objective-c', 'gitUserName' => 'appwrite', ], - ], - ], - - APP_PLATFORM_ANDROID => [ - 'key' => APP_PLATFORM_ANDROID, - 'name' => 'Android', - 'description' => 'Client libraries for integrating with '.APP_NAME.' to build Android applications. Read the [getting started for Android](/docs/getting-started-for-android) tutorial to start building your first Android application.', - 'enabled' => false, - 'beta' => false, - 'languages' => [ [ 'key' => 'kotlin', 'name' => 'Kotlin', @@ -104,62 +79,38 @@ return [ 'gitRepoName' => 'sdk-for-kotlin', 'gitUserName' => 'appwrite', ], - [ - 'key' => 'java', - 'name' => 'Java', - 'url' => '', - 'enabled' => false, - 'beta' => false, - 'family' => APP_PLATFORM_CLIENT, - 'prism' => 'java', - 'source' => false, - 'gitUrl' => 'git@github.com:appwrite/sdk-for-java.git', - 'gitRepoName' => 'sdk-for-java', - 'gitUserName' => 'appwrite', - ], + // [ + // 'key' => 'java', + // 'name' => 'Java', + // 'url' => '', + // 'enabled' => false, + // 'beta' => false, + // 'family' => APP_PLATFORM_CLIENT, + // 'prism' => 'java', + // 'source' => false, + // 'gitUrl' => 'git@github.com:appwrite/sdk-for-java.git', + // 'gitRepoName' => 'sdk-for-java', + // 'gitUserName' => 'appwrite', + // ], ], ], - - APP_PLATFORM_FLUTTER => [ - 'key' => APP_PLATFORM_FLUTTER, - 'name' => 'Flutter', - 'description' => 'Client libraries for integrating with '.APP_NAME.' to build cross-platform Flutter applications. Read the [getting started for Flutter](/docs/getting-started-for-flutter) tutorial to start building your first Flutter application.', - 'enabled' => true, - 'beta' => true, - 'languages' => [ - [ - 'key' => 'dart', - 'name' => 'Dart', - 'version' => '0.1.1', - 'url' => 'https://github.com/appwrite/sdk-for-dart', - 'enabled' => true, - 'beta' => true, - 'family' => APP_PLATFORM_CLIENT, - 'prism' => 'dart', - 'source' => realpath(__DIR__ . '/../sdks/flutter-dart'), - 'gitUrl' => 'git@github.com:appwrite/sdk-for-dart.git', - 'gitRepoName' => 'sdk-for-dart', - 'gitUserName' => 'appwrite', - ], - ], - ], - + APP_PLATFORM_CONSOLE => [ 'key' => APP_PLATFORM_CONSOLE, 'name' => 'Console', 'enabled' => false, 'beta' => false, - 'languages' => [ + 'languages' => [ // TODO change key to 'sdks' [ - 'key' => 'javascript', - 'name' => 'JS', + 'key' => 'web', + 'name' => 'Console', 'version' => '1.0.0', 'url' => 'https://github.com/appwrite/sdk-for-console', 'enabled' => true, 'beta' => false, 'family' => APP_PLATFORM_CONSOLE, 'prism' => 'console', - 'source' => realpath(__DIR__ . '/../sdks/console-javascript'), + 'source' => realpath(__DIR__ . '/../sdks/console-web'), 'gitUrl' => null, 'gitRepoName' => 'sdk-for-console', 'gitUserName' => 'appwrite', @@ -173,11 +124,11 @@ return [ 'description' => 'Libraries for integrating with '.APP_NAME.' to build server side integrations. Read the [getting started for server](/docs/getting-started-for-server) tutorial to start building your first server integration.', 'enabled' => true, 'beta' => false, - 'languages' => [ + 'languages' => [ // TODO change key to 'sdks' [ 'key' => 'nodejs', 'name' => 'Node.js', - 'version' => '1.0.32', + 'version' => '1.1.0', 'url' => 'https://github.com/appwrite/sdk-for-node', 'enabled' => true, 'beta' => false, @@ -188,10 +139,24 @@ return [ 'gitRepoName' => 'sdk-for-node', 'gitUserName' => 'appwrite', ], + [ + 'key' => 'deno', + 'name' => 'Deno', + 'version' => '0.0.1', + 'url' => 'https://github.com/appwrite/sdk-for-deno', + 'enabled' => false, + 'beta' => true, + 'family' => APP_PLATFORM_SERVER, + 'prism' => 'typescript', + 'source' => realpath(__DIR__ . '/../sdks/server-deno'), + 'gitUrl' => 'git@github.com:appwrite/sdk-for-deno.git', + 'gitRepoName' => 'sdk-for-deno', + 'gitUserName' => 'appwrite', + ], [ 'key' => 'php', 'name' => 'PHP', - 'version' => '1.0.17', + 'version' => '1.1.0', 'url' => 'https://github.com/appwrite/sdk-for-php', 'enabled' => true, 'beta' => false, @@ -205,7 +170,7 @@ return [ [ 'key' => 'python', 'name' => 'Python', - 'version' => '0.0.4', + 'version' => '0.0.5', 'url' => 'https://github.com/appwrite/sdk-for-python', 'enabled' => true, 'beta' => true, @@ -219,7 +184,7 @@ return [ [ 'key' => 'ruby', 'name' => 'Ruby', - 'version' => '1.0.9', + 'version' => '1.0.10', 'url' => 'https://github.com/appwrite/sdk-for-ruby', 'enabled' => true, 'beta' => true, @@ -233,9 +198,9 @@ return [ [ 'key' => 'go', 'name' => 'Go', - 'version' => '0.0.6', + 'version' => '0.0.7', 'url' => 'https://github.com/appwrite/sdk-for-go', - 'enabled' => true, + 'enabled' => false, 'beta' => true, 'family' => APP_PLATFORM_SERVER, 'prism' => 'go', @@ -247,9 +212,9 @@ return [ [ 'key' => 'java', 'name' => 'Java', - 'version' => '0.0.1', + 'version' => '0.0.2', 'url' => 'https://github.com/appwrite/sdk-for-java', - 'enabled' => true, + 'enabled' => false, 'beta' => true, 'family' => APP_PLATFORM_SERVER, 'prism' => 'java', @@ -258,7 +223,20 @@ return [ 'gitRepoName' => 'sdk-for-java', 'gitUserName' => 'appwrite', ], + [ + 'key' => 'dart', + 'name' => 'Dart', + 'version' => '0.0.1', + 'url' => 'https://github.com/appwrite/sdk-for-dart', + 'enabled' => false, + 'beta' => true, + 'family' => APP_PLATFORM_SERVER, + 'prism' => 'java', + 'source' => realpath(__DIR__ . '/../sdks/server-dart'), + 'gitUrl' => 'git@github.com:appwrite/sdk-for-dart.git', + 'gitRepoName' => 'sdk-for-dart', + 'gitUserName' => 'appwrite', + ], ], ], - ]; diff --git a/app/config/roles.php b/app/config/roles.php index e690783172..f462305d97 100644 --- a/app/config/roles.php +++ b/app/config/roles.php @@ -58,6 +58,7 @@ return [ 'public', 'home', 'console', + 'documents.read', 'files.read', 'locale.read', 'avatars.read', diff --git a/app/config/scopes.php b/app/config/scopes.php index 53b71dd78f..59ad2a0859 100644 --- a/app/config/scopes.php +++ b/app/config/scopes.php @@ -21,4 +21,5 @@ return [ // List of publicly visible scopes // 'webhooks.write', 'locale.read', 'avatars.read', + 'health.read', ];; \ No newline at end of file diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index b05c244486..a2b7afe0fc 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -30,8 +30,8 @@ use GeoIp2\Database\Reader; include_once __DIR__ . '/../shared/api.php'; -$oauthDefaultSuccess = Config::getParam('protocol').'://'.Config::getParam('domain').'/auth/oauth2/success'; -$oauthDefaultFailure = Config::getParam('protocol').'://'.Config::getParam('domain').'/auth/oauth2/failure'; +$oauthDefaultSuccess = $request->getServer('_APP_HOME').'/auth/oauth2/success'; +$oauthDefaultFailure = $request->getServer('_APP_HOME').'/auth/oauth2/failure'; $oauth2Keys = []; @@ -251,8 +251,8 @@ $utopia->get('/v1/account/sessions/oauth2/:provider') ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') ->param('provider', '', function () { return new WhiteList(array_keys(Config::getParam('providers'))); }, 'OAuth2 Provider. Currently, supported providers are: ' . implode(', ', array_keys(array_filter(Config::getParam('providers'), function($node) {return (!$node['mock']);}))).'.') - ->param('success', $oauthDefaultSuccess, function () use ($clients) { return new Host($clients); }, 'URL to redirect back to your app after a successful login attempt.', true) - ->param('failure', $oauthDefaultFailure, function () use ($clients) { return new Host($clients); }, 'URL to redirect back to your app after a failed login attempt.', true) + ->param('success', $oauthDefaultSuccess, function () use ($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) + ->param('failure', $oauthDefaultFailure, function () use ($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) ->action( function ($provider, $success, $failure) use ($response, $request, $project) { $protocol = Config::getParam('protocol'); @@ -483,6 +483,7 @@ $utopia->get('/v1/account/sessions/oauth2/:provider/redirect') if($state['success'] === $oauthDefaultSuccess) { // Add keys for non-web platforms $state['success'] = URLParser::parse($state['success']); $query = URLParser::parseQuery($state['success']['query']); + $query['project'] = $project->getId(); $query['domain'] = COOKIE_DOMAIN; $query['key'] = Auth::$cookieName; $query['secret'] = Auth::encodeSession($user->getId(), $secret); @@ -1026,7 +1027,7 @@ $utopia->post('/v1/account/recovery') ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') ->param('email', '', function () { return new Email(); }, 'User email.') - ->param('url', '', function () use ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the recovery email.') + ->param('url', '', function () use ($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.') ->action( function ($email, $url) use ($request, $response, $projectDB, $register, $audit, $project) { $profile = $projectDB->getCollection([ // Get user by email address @@ -1187,7 +1188,7 @@ $utopia->post('/v1/account/verification') ->label('sdk.description', '/docs/references/account/create-verification.md') ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') - ->param('url', '', function () use ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the verification email.') // TODO add built-in confirm page + ->param('url', '', function () use ($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.') // TODO add built-in confirm page ->action( function ($url) use ($request, $response, $register, $user, $project, $projectDB, $audit) { $verificationSecret = Auth::tokenGenerator(); diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 258df8c47b..571d0fa971 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -99,6 +99,7 @@ $utopia->get('/v1/avatars/credit-cards/:code') ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'avatars') ->label('sdk.method', 'getCreditCard') + ->label('sdk.methodType', 'location') ->label('sdk.description', '/docs/references/avatars/get-credit-card.md') ->action(function ($code, $width, $height, $quality) use ($avatarCallback) { return $avatarCallback('credit-cards', $code, $width, $height, $quality); }); @@ -113,6 +114,7 @@ $utopia->get('/v1/avatars/browsers/:code') ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'avatars') ->label('sdk.method', 'getBrowser') + ->label('sdk.methodType', 'location') ->label('sdk.description', '/docs/references/avatars/get-browser.md') ->action(function ($code, $width, $height, $quality) use ($avatarCallback) { return $avatarCallback('browsers', $code, $width, $height, $quality); }); @@ -127,6 +129,7 @@ $utopia->get('/v1/avatars/flags/:code') ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'avatars') ->label('sdk.method', 'getFlag') + ->label('sdk.methodType', 'location') ->label('sdk.description', '/docs/references/avatars/get-flag.md') ->action(function ($code, $width, $height, $quality) use ($avatarCallback) { return $avatarCallback('flags', $code, $width, $height, $quality); }); @@ -140,6 +143,7 @@ $utopia->get('/v1/avatars/image') ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'avatars') ->label('sdk.method', 'getImage') + ->label('sdk.methodType', 'location') ->label('sdk.description', '/docs/references/avatars/get-image.md') ->action( function ($url, $width, $height) use ($response) { @@ -206,6 +210,7 @@ $utopia->get('/v1/avatars/favicon') ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'avatars') ->label('sdk.method', 'getFavicon') + ->label('sdk.methodType', 'location') ->label('sdk.description', '/docs/references/avatars/get-favicon.md') ->action( function ($url) use ($response, $request) { @@ -362,6 +367,7 @@ $utopia->get('/v1/avatars/qr') ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'avatars') ->label('sdk.method', 'getQR') + ->label('sdk.methodType', 'location') ->label('sdk.description', '/docs/references/avatars/get-qr.md') ->action( function ($text, $size, $margin, $download) use ($response) { diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 6bf9aab64f..e244a6b46e 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -8,8 +8,8 @@ use Appwrite\Storage\Storage; use Appwrite\ClamAV\Network; $utopia->get('/v1/health') - ->desc('Check API HTTP Health') - ->label('scope', 'public') + ->desc('Get HTTP') + ->label('scope', 'health.read') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'health') ->label('sdk.method', 'get') @@ -21,8 +21,8 @@ $utopia->get('/v1/health') ); $utopia->get('/v1/health/db') - ->desc('Check DB Health') - ->label('scope', 'public') + ->desc('Get DB') + ->label('scope', 'health.read') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'health') ->label('sdk.method', 'getDB') @@ -36,8 +36,8 @@ $utopia->get('/v1/health/db') ); $utopia->get('/v1/health/cache') - ->desc('Check Cache Health') - ->label('scope', 'public') + ->desc('Get Cache') + ->label('scope', 'health.read') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'health') ->label('sdk.method', 'getCache') @@ -51,8 +51,8 @@ $utopia->get('/v1/health/cache') ); $utopia->get('/v1/health/time') - ->desc('Check Time Health') - ->label('scope', 'public') + ->desc('Get Time') + ->label('scope', 'health.read') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'health') ->label('sdk.method', 'getTime') @@ -98,8 +98,8 @@ $utopia->get('/v1/health/time') ); $utopia->get('/v1/health/queue/webhooks') - ->desc('Check number of pending webhook messages') - ->label('scope', 'public') + ->desc('Get Webhooks Queue') + ->label('scope', 'health.read') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'health') ->label('sdk.method', 'getQueueWebhooks') @@ -111,8 +111,8 @@ $utopia->get('/v1/health/queue/webhooks') ); $utopia->get('/v1/health/queue/tasks') - ->desc('Check the number of pending task messages') - ->label('scope', 'public') + ->desc('Get Tasks Queue') + ->label('scope', 'health.read') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'health') ->label('sdk.method', 'getQueueTasks') @@ -124,8 +124,8 @@ $utopia->get('/v1/health/queue/tasks') ); $utopia->get('/v1/health/queue/logs') -->desc('Check the number of pending log messages') - ->label('scope', 'public') +->desc('Get Logs Queue') + ->label('scope', 'health.read') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'health') ->label('sdk.method', 'getQueueLogs') @@ -137,8 +137,8 @@ $utopia->get('/v1/health/queue/logs') ); $utopia->get('/v1/health/queue/usage') - ->desc('Check the number of pending usage messages') - ->label('scope', 'public') + ->desc('Get Usage Queue') + ->label('scope', 'health.read') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'health') ->label('sdk.method', 'getQueueUsage') @@ -150,8 +150,8 @@ $utopia->get('/v1/health/queue/usage') ); $utopia->get('/v1/health/queue/certificates') - ->desc('Check the number of pending certificate messages') - ->label('scope', 'public') + ->desc('Get Certificate Queue') + ->label('scope', 'health.read') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'health') ->label('sdk.method', 'getQueueCertificates') @@ -162,9 +162,22 @@ $utopia->get('/v1/health/queue/certificates') } ); +$utopia->get('/v1/health/queue/functions') + ->desc('Get Functions Queue') + ->label('scope', 'health.read') + ->label('sdk.platform', [APP_PLATFORM_SERVER]) + ->label('sdk.namespace', 'health') + ->label('sdk.method', 'getQueueFunctions') + ->label('sdk.description', '/docs/references/health/get-queue-functions.md') + ->action( + function () use ($response) { + $response->json(['size' => Resque::size('v1-functions')]); + } + ); + $utopia->get('/v1/health/storage/local') - ->desc('Check File System Health') - ->label('scope', 'public') + ->desc('Get Local Storage') + ->label('scope', 'health.read') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'health') ->label('sdk.method', 'getStorageLocal') @@ -197,15 +210,19 @@ $utopia->get('/v1/health/storage/local') } ); -$utopia->get('/v1/health/storage/anti-virus') - ->desc('Check Anti virus Health') - ->label('scope', 'public') +$utopia->get('/v1/health/anti-virus') + ->desc('Get Anti virus') + ->label('scope', 'health.read') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getStorageAntiVirus') + ->label('sdk.method', 'getAntiVirus') ->label('sdk.description', '/docs/references/health/get-storage-anti-virus.md') ->action( - function () use ($response) { + function () use ($request, $response) { + if($request->getServer('_APP_STORAGE_ANTIVIRUS') === 'disabled') { // Check if scans are enabled + throw new Exception('Anitvirus is disabled'); + } + $antiVirus = new Network('clamav', 3310); $response->json([ @@ -216,7 +233,7 @@ $utopia->get('/v1/health/storage/anti-virus') ); $utopia->get('/v1/health/stats') // Currently only used internally - ->desc('System Stats') + ->desc('Get System Stats') ->label('scope', 'god') // ->label('sdk.platform', [APP_PLATFORM_SERVER]) // ->label('sdk.namespace', 'health') diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 64689904e6..54ccd2dcec 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -1,6 +1,6 @@ get('/v1/projects/:projectId/usage') ], 'last30' => [ 'start' => DateTime::createFromFormat('U', strtotime('-30 days')), - 'end' => DateTime::createFromFormat('U', strtotime('today')), + 'end' => DateTime::createFromFormat('U', strtotime('tomorrow')), 'group' => '1d', ], 'last90' => [ @@ -402,7 +402,7 @@ $utopia->delete('/v1/projects/:projectId') ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.') ->param('password', '', function () { return new UID(); }, 'Your user password for confirmation.') ->action( - function ($projectId, $password) use ($response, $consoleDB, $user) { + function ($projectId, $password) use ($response, $consoleDB, $user, $deletes) { if (!Auth::passwordVerify($password, $user->getAttribute('password'))) { // Double check user password throw new Exception('Invalid credentials', 401); } @@ -413,20 +413,22 @@ $utopia->delete('/v1/projects/:projectId') throw new Exception('Project not found', 404); } - // Delete all children (keys, webhooks, tasks [stop tasks?], platforms) + $deletes->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', []); + + foreach ($list as $document) { /* @var $document Document */ + if (!$consoleDB->deleteDocument($projectId)) { + throw new Exception('Failed to remove project document ('.$key.')] from DB', 500); + } + } + } if (!$consoleDB->deleteDocument($projectId)) { throw new Exception('Failed to remove project from DB', 500); } - // Delete all DBs - // $consoleDB->deleteNamespace($project->getId()); - - // Optimize DB? - - // Delete all storage files - // Delete all storage cache - $response->noContent(); } ); @@ -1229,9 +1231,8 @@ $utopia->post('/v1/projects/:projectId/domains') ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') ->param('domain', null, function () { return new DomainValidator(); }, 'Domain name.') ->action( - function ($projectId) use ($request, $response, $consoleDB) { + function ($projectId, $domain) use ($request, $response, $consoleDB) { $project = $consoleDB->getDocument($projectId); - $domain = Config::getParam('domain'); if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { throw new Exception('Project not found', 404); diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 448eb93511..18a8c98c26 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -179,8 +179,6 @@ $utopia->post('/v1/storage/files') throw new Exception('File size not allowed', 400); } - $antiVirus = new Network('clamav', 3310); - /* * Models */ @@ -200,10 +198,14 @@ $utopia->post('/v1/storage/files') $mimeType = $device->getFileMimeType($path); // Get mime-type before compression and encryption - // Check if file size is exceeding allowed limit - if (!$antiVirus->fileScan($path)) { - $device->delete($path); - throw new Exception('Invalid file', 403); + if($request->getServer('_APP_STORAGE_ANTIVIRUS') === 'enabled') { // Check if scans are enabled + $antiVirus = new Network('clamav', 3310); + + // Check if file size is exceeding allowed limit + if (!$antiVirus->fileScan($path)) { + $device->delete($path); + throw new Exception('Invalid file', 403); + } } // Compression @@ -654,53 +656,53 @@ $utopia->delete('/v1/storage/files/:fileId') } ); -$utopia->get('/v1/storage/files/:fileId/scan') - ->desc('Scan Storage') - ->label('scope', 'god') - ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getFileScan') - ->label('sdk.hide', true) - ->param('fileId', '', function () { return new UID(); }, 'File unique ID.') - ->param('storage', 'local', function () { return new WhiteList(['local']);}) - ->action( - function ($fileId, $storage) use ($response, $request, $projectDB) { - $file = $projectDB->getDocument($fileId); +// $utopia->get('/v1/storage/files/:fileId/scan') +// ->desc('Scan Storage') +// ->label('scope', 'god') +// ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) +// ->label('sdk.namespace', 'storage') +// ->label('sdk.method', 'getFileScan') +// ->label('sdk.hide', true) +// ->param('fileId', '', function () { return new UID(); }, 'File unique ID.') +// ->param('storage', 'local', function () { return new WhiteList(['local']);}) +// ->action( +// function ($fileId, $storage) use ($response, $request, $projectDB) { +// $file = $projectDB->getDocument($fileId); - if (empty($file->getId()) || Database::SYSTEM_COLLECTION_FILES != $file->getCollection()) { - throw new Exception('File not found', 404); - } +// if (empty($file->getId()) || Database::SYSTEM_COLLECTION_FILES != $file->getCollection()) { +// throw new Exception('File not found', 404); +// } - $path = $file->getAttribute('path', ''); +// $path = $file->getAttribute('path', ''); - if (!file_exists($path)) { - throw new Exception('File not found in '.$path, 404); - } +// if (!file_exists($path)) { +// throw new Exception('File not found in '.$path, 404); +// } - $compressor = new GZIP(); - $device = Storage::getDevice($storage); +// $compressor = new GZIP(); +// $device = Storage::getDevice($storage); - $source = $device->read($path); +// $source = $device->read($path); - if (!empty($file->getAttribute('fileOpenSSLCipher'))) { // Decrypt - $source = OpenSSL::decrypt( - $source, - $file->getAttribute('fileOpenSSLCipher'), - $request->getServer('_APP_OPENSSL_KEY_V'.$file->getAttribute('fileOpenSSLVersion')), - 0, - hex2bin($file->getAttribute('fileOpenSSLIV')), - hex2bin($file->getAttribute('fileOpenSSLTag')) - ); - } +// if (!empty($file->getAttribute('fileOpenSSLCipher'))) { // Decrypt +// $source = OpenSSL::decrypt( +// $source, +// $file->getAttribute('fileOpenSSLCipher'), +// $request->getServer('_APP_OPENSSL_KEY_V'.$file->getAttribute('fileOpenSSLVersion')), +// 0, +// hex2bin($file->getAttribute('fileOpenSSLIV')), +// hex2bin($file->getAttribute('fileOpenSSLTag')) +// ); +// } - $source = $compressor->decompress($source); +// $source = $compressor->decompress($source); - $antiVirus = new Network('clamav', 3310); +// $antiVirus = new Network('clamav', 3310); - //var_dump($antiVirus->ping()); - //var_dump($antiVirus->version()); - //var_dump($antiVirus->fileScan('/storage/uploads/app-1/5/9/f/e/59fecaed49645.pdf')); +// //var_dump($antiVirus->ping()); +// //var_dump($antiVirus->version()); +// //var_dump($antiVirus->fileScan('/storage/uploads/app-1/5/9/f/e/59fecaed49645.pdf')); - //$response->json($antiVirus->continueScan($device->getRoot())); - } - ); +// //$response->json($antiVirus->continueScan($device->getRoot())); +// } +// ); diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index ccea694833..fad09b695e 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -213,7 +213,7 @@ $utopia->post('/v1/teams/:teamId/memberships') ->param('email', '', function () { return new Email(); }, 'New team member email.') ->param('name', '', function () { return new Text(100); }, 'New team member name.', true) ->param('roles', [], function () { return new ArrayList(new Text(128)); }, '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).') - ->param('url', '', function () use ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the invitation email.') // TODO add our own built-in confirm page + ->param('url', '', function () use ($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.') // TODO add our own built-in confirm page ->action( function ($teamId, $email, $name, $roles, $url) use ($response, $register, $project, $user, $audit, $projectDB) { $name = (empty($name)) ? $email : $name; diff --git a/app/controllers/shared/web.php b/app/controllers/shared/web.php index b4fd17ca56..cb2612c0f9 100644 --- a/app/controllers/shared/web.php +++ b/app/controllers/shared/web.php @@ -31,7 +31,7 @@ $layout ->setParam('env', $utopia->getEnv()) ; -$utopia->shutdown(function () use ($utopia, $response, $request, $layout) { +$utopia->init(function () use ($utopia, $response, $request, $layout) { $time = (60 * 60 * 24 * 45); // 45 days cache $isDev = (\Utopia\App::ENV_TYPE_DEVELOPMENT == Config::getParam('env')); diff --git a/app/controllers/web/console.php b/app/controllers/web/console.php index 70f32693f3..480c4ff9ba 100644 --- a/app/controllers/web/console.php +++ b/app/controllers/web/console.php @@ -133,7 +133,11 @@ $utopia->get('/console/webhooks') ->label('scope', 'console') ->action(function () use ($layout) { $page = new View(__DIR__.'/../../views/console/webhooks/index.phtml'); - + + $page + ->setParam('events', Config::getParam('events', [])) + ; + $layout ->setParam('title', APP_NAME.' - Webhooks') ->setParam('body', $page); @@ -183,7 +187,7 @@ $utopia->get('/console/database/collection') ->label('permission', 'public') ->label('scope', 'console') ->param('id', '', function () { return new UID(); }, 'Collection unique ID.') - ->action(function ($id) use ($layout, $projectDB) { + ->action(function ($id) use ($response, $layout, $projectDB) { Authorization::disable(); $collection = $projectDB->getDocument($id, false); Authorization::reset(); @@ -197,10 +201,18 @@ $utopia->get('/console/database/collection') $page ->setParam('collection', $collection) ; - + $layout ->setParam('title', APP_NAME.' - Database Collection') - ->setParam('body', $page); + ->setParam('body', $page) + ; + + $response + ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') + ->addHeader('Expires', 0) + ->addHeader('Pragma', 'no-cache') + ; + }); $utopia->get('/console/database/document') diff --git a/app/controllers/web/home.php b/app/controllers/web/home.php index 0871e8c252..f3e4fd72c8 100644 --- a/app/controllers/web/home.php +++ b/app/controllers/web/home.php @@ -6,6 +6,8 @@ global $utopia, $response, $request, $layout; use Utopia\View; use Utopia\Config\Config; +use Utopia\Validator\WhiteList; +use Utopia\Validator\Range; $header = new View(__DIR__.'/../../views/home/comps/header.phtml'); $footer = new View(__DIR__.'/../../views/home/comps/footer.phtml'); @@ -155,3 +157,401 @@ $utopia->get('/error/:code') ->setParam('title', 'Error'.' - '.APP_NAME) ->setParam('body', $page); }); + +$utopia->get('/open-api-2.json') + ->label('scope', 'public') + ->label('docs', false) + ->param('platform', APP_PLATFORM_CLIENT, function () {return new WhiteList([APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER, APP_PLATFORM_CONSOLE]);}, 'Choose target platform.', true) + ->param('extensions', 0, function () {return new Range(0, 1);}, 'Show extra data.', true) + ->param('tests', 0, function () {return new Range(0, 1);}, 'Include only test services.', true) + ->action( + function ($platform, $extensions, $tests) use ($response, $request, $utopia, $services) { + function fromCamelCase($input) + { + preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $input, $matches); + $ret = $matches[0]; + foreach ($ret as &$match) { + $match = $match == strtoupper($match) ? strtolower($match) : lcfirst($match); + } + + return implode('_', $ret); + } + + function fromCamelCaseToDash($input) + { + return str_replace([' ', '_'], '-', strtolower(preg_replace('/([a-zA-Z])(?=[A-Z])/', '$1-', $input))); + } + + foreach ($services as $service) { /* @noinspection PhpIncludeInspection */ + if($tests && !isset($service['tests'])) { + continue; + } + + if($tests && !$service['tests']) { + continue; + } + + if (!$tests && !$service['sdk']) { + continue; + } + + /** @noinspection PhpIncludeInspection */ + include_once realpath(__DIR__.'/../../'.$service['controller']); + } + + $security = [ + APP_PLATFORM_CLIENT => ['Project' => []], + APP_PLATFORM_SERVER => ['Project' => [], 'Key' => []], + APP_PLATFORM_CONSOLE => ['Project' => [], 'Key' => []], + ]; + + $platforms = [ + 'client' => APP_PLATFORM_CLIENT, + 'server' => APP_PLATFORM_SERVER, + 'all' => APP_PLATFORM_CONSOLE, + ]; + + $keys = [ + APP_PLATFORM_CLIENT => [ + 'Project' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Project', + 'description' => 'Your project ID', + 'in' => 'header', + ], + 'Locale' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Locale', + 'description' => '', + 'in' => 'header', + ], + ], + APP_PLATFORM_SERVER => [ + 'Project' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Project', + 'description' => 'Your project ID', + 'in' => 'header', + ], + 'Key' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Key', + 'description' => 'Your secret API key', + 'in' => 'header', + ], + 'Locale' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Locale', + 'description' => '', + 'in' => 'header', + ], + ], + APP_PLATFORM_CONSOLE => [ + 'Project' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Project', + 'description' => 'Your project ID', + 'in' => 'header', + ], + 'Key' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Key', + 'description' => 'Your secret API key', + 'in' => 'header', + ], + 'Locale' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Locale', + 'description' => '', + 'in' => 'header', + ], + 'Mode' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Mode', + 'description' => '', + 'in' => 'header', + ], + ], + ]; + + /* + * Specifications (v3.0.0): + * https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md + */ + $output = [ + 'swagger' => '2.0', + 'info' => [ + 'version' => APP_VERSION_STABLE, + 'title' => APP_NAME, + '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' => $request->getServer('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM), + ], + 'license' => [ + 'name' => 'BSD-3-Clause', + 'url' => 'https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE', + ], + ], + 'host' => parse_url($request->getServer('_APP_HOME', Config::getParam('domain')), PHP_URL_HOST), + 'basePath' => '/v1', + 'schemes' => ['https'], + 'consumes' => ['application/json', 'multipart/form-data'], + 'produces' => ['application/json'], + 'securityDefinitions' => $keys[$platform], + 'paths' => [], + 'definitions' => [ + // 'Pet' => [ + // 'required' => ['id', 'name'], + // 'properties' => [ + // 'id' => [ + // 'type' => 'integer', + // 'format' => 'int64', + // ], + // 'name' => [ + // 'type' => 'string', + // ], + // 'tag' => [ + // 'type' => 'string', + // ], + // ], + // ], + // 'Pets' => array( + // 'type' => 'array', + // 'items' => array( + // '$ref' => '#/definitions/Pet', + // ), + // ), + 'Error' => array( + 'required' => array( + 0 => 'code', + 1 => 'message', + ), + 'properties' => array( + 'code' => array( + 'type' => 'integer', + 'format' => 'int32', + ), + 'message' => array( + 'type' => 'string', + ), + ), + ), + ], + 'externalDocs' => [ + 'description' => 'Full API docs, specs and tutorials', + 'url' => Config::getParam('protocol').'://'.Config::getParam('domain').'/docs', + ], + ]; + + if ($extensions) { + if(isset($output['securityDefinitions']['Project'])) { + $output['securityDefinitions']['Project']['extensions'] = ['demo' => '5df5acd0d48c2']; + } + + if(isset($output['securityDefinitions']['Key'])) { + $output['securityDefinitions']['Key']['extensions'] = ['demo' => '919c2d18fb5d4...a2ae413da83346ad2']; + } + + if(isset($output['securityDefinitions']['Locale'])) { + $output['securityDefinitions']['Locale']['extensions'] = ['demo' => 'en']; + } + + if(isset($output['securityDefinitions']['Mode'])) { + $output['securityDefinitions']['Mode']['extensions'] = ['demo' => '']; + } + } + + foreach ($utopia->getRoutes() as $key => $method) { + foreach ($method as $route) { /* @var $route \Utopia\Route */ + if (!$route->getLabel('docs', true)) { + continue; + } + + if (empty($route->getLabel('sdk.namespace', null))) { + continue; + } + + if($platform !== APP_PLATFORM_CONSOLE && !in_array($platforms[$platform], $route->getLabel('sdk.platform', []))) { + continue; + } + + $url = str_replace('/v1', '', $route->getURL()); + $scope = $route->getLabel('scope', ''); + $hide = $route->getLabel('sdk.hide', false); + $consumes = ['application/json']; + + if ($hide) { + continue; + } + + $desc = (!empty($route->getLabel('sdk.description', ''))) ? realpath('../'.$route->getLabel('sdk.description', '')) : null; + + $temp = [ + 'summary' => $route->getDesc(), + 'operationId' => $route->getLabel('sdk.method', uniqid()), + 'consumes' => [], + 'tags' => [$route->getLabel('sdk.namespace', 'default')], + 'description' => ($desc) ? file_get_contents($desc) : '', + + // 'responses' => [ + // 200 => [ + // 'description' => 'An paged array of pets', + // 'schema' => [ + // '$ref' => '#/definitions/Pet', + // ], + // ], + // ], + ]; + + if ($extensions) { + $platformList = $route->getLabel('sdk.platform', []); + + $temp['extensions'] = [ + 'weight' => $route->getOrder(), + 'cookies' => $route->getLabel('sdk.cookies', false), + 'type' => $route->getLabel('sdk.methodType', ''), + 'demo' => 'docs/examples/'.fromCamelCaseToDash($route->getLabel('sdk.namespace', 'default')).'/'.fromCamelCaseToDash($temp['operationId']).'.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), + 'scope' => $route->getLabel('scope', ''), + 'platforms' => $platformList, + ]; + } + + if ((!empty($scope))) { // && 'public' != $scope + $temp['security'][] = $route->getLabel('sdk.security', $security[$platform]); + } + + $requestBody = [ + 'content' => [ + 'application/x-www-form-urlencoded' => [ + 'schema' => [ + 'type' => 'object', + 'properties' => [], + ], + 'required' => [], + ], + ], + ]; + + foreach ($route->getParams() as $name => $param) { + $validator = (is_callable($param['validator'])) ? $param['validator']() : $param['validator']; /* @var $validator \Utopia\Validator */ + + $node = [ + 'name' => $name, + 'description' => $param['description'], + 'required' => !$param['optional'], + ]; + + switch ((!empty($validator)) ? get_class($validator) : '') { + case 'Utopia\Validator\Text': + $node['type'] = 'string'; + $node['x-example'] = '['.strtoupper(fromCamelCase($node['name'])).']'; + break; + case 'Appwrite\Database\Validator\UID': + $node['type'] = 'string'; + $node['x-example'] = '['.strtoupper(fromCamelCase($node['name'])).']'; + break; + case 'Utopia\Validator\Email': + $node['type'] = 'string'; + $node['format'] = 'email'; + $node['x-example'] = 'email@example.com'; + break; + case 'Utopia\Validator\URL': + $node['type'] = 'string'; + $node['format'] = 'url'; + $node['x-example'] = 'https://example.com'; + break; + case 'Utopia\Validator\JSON': + case 'Utopia\Validator\Mock': + case 'Utopia\Validator\Assoc': + $node['type'] = 'object'; + $node['type'] = 'object'; + $node['x-example'] = '{}'; + //$node['format'] = 'json'; + break; + case 'Appwrite\Storage\Validators\File': + $consumes = ['multipart/form-data']; + $node['type'] = 'file'; + break; + case 'Utopia\Validator\ArrayList': + $node['type'] = 'array'; + $node['collectionFormat'] = 'multi'; + $node['items'] = [ + 'type' => 'string', + ]; + break; + case 'Appwrite\Auth\Validator\Password': + $node['type'] = 'string'; + $node['format'] = 'format'; + $node['x-example'] = 'password'; + break; + case 'Utopia\Validator\Range': /* @var $validator \Utopia\Validator\Range */ + $node['type'] = 'integer'; + $node['format'] = 'int32'; + $node['x-example'] = $validator->getMin(); + break; + case 'Utopia\Validator\Numeric': + $node['type'] = 'integer'; + $node['format'] = 'int32'; + break; + case 'Utopia\Validator\Length': + $node['type'] = 'string'; + break; + case 'Utopia\Validator\Host': + $node['type'] = 'string'; + $node['format'] = 'url'; + $node['x-example'] = 'https://example.com'; + break; + case 'Utopia\Validator\WhiteList': /* @var $validator \Utopia\Validator\WhiteList */ + $node['type'] = 'string'; + $node['x-example'] = $validator->getList()[0]; + break; + default: + $node['type'] = 'string'; + break; + } + + if ($param['optional'] && !is_null($param['default'])) { // Param has default value + $node['default'] = $param['default']; + } + + if (false !== strpos($url, ':'.$name)) { // Param is in URL path + $node['in'] = 'path'; + $temp['parameters'][] = $node; + } elseif ($key == 'GET') { // Param is in query + $node['in'] = 'query'; + $temp['parameters'][] = $node; + } else { // Param is in payload + $node['in'] = 'formData'; + $temp['parameters'][] = $node; + $requestBody['content']['application/x-www-form-urlencoded']['schema']['properties'][] = $node; + + if (!$param['optional']) { + $requestBody['content']['application/x-www-form-urlencoded']['required'][] = $name; + } + } + + $url = str_replace(':'.$name, '{'.$name.'}', $url); + } + + $temp['consumes'] = $consumes; + + $output['paths'][$url][strtolower($route->getMethod())] = $temp; + } + } + + /*foreach ($consoleDB->getMocks() as $mock) { + var_dump($mock['name']); + }*/ + + ksort($output['paths']); + + $response + ->json($output); + } + ); \ No newline at end of file diff --git a/app/init.php b/app/init.php index 68f45400c8..98df754775 100644 --- a/app/init.php +++ b/app/init.php @@ -33,7 +33,7 @@ const APP_USERAGENT = APP_NAME.'-Server v%s. Please report abuse at %s'; const APP_MODE_ADMIN = 'admin'; const APP_PAGING_LIMIT = 15; const APP_CACHE_BUSTER = 125; -const APP_VERSION_STABLE = '0.5.3'; +const APP_VERSION_STABLE = '0.6.1'; const APP_STORAGE_UPLOADS = '/storage/uploads'; const APP_STORAGE_CACHE = '/storage/cache'; const APP_STORAGE_CERTIFICATES = '/storage/certificates'; @@ -45,6 +45,7 @@ const APP_SOCIAL_LINKEDIN = 'https://www.linkedin.com/company/appwrite'; const APP_SOCIAL_INSTAGRAM = 'https://www.instagram.com/appwrite.io'; const APP_SOCIAL_GITHUB = 'https://github.com/appwrite'; const APP_SOCIAL_DISCORD = 'https://discord.gg/GSeTUeA'; +const APP_SOCIAL_DEV = 'https://dev.to/appwrite'; $register = new Registry(); $request = new Request(); @@ -53,6 +54,7 @@ $response = new Response(); /* * ENV vars */ +Config::load('events', __DIR__.'/../app/config/events.php'); Config::load('providers', __DIR__.'/../app/config/providers.php'); Config::load('platforms', __DIR__.'/../app/config/platforms.php'); Config::load('locales', __DIR__.'/../app/config/locales.php'); @@ -64,6 +66,7 @@ Config::setParam('domainVerification', false); Config::setParam('version', $request->getServer('_APP_VERSION', 'UNKNOWN')); Config::setParam('protocol', $request->getServer('HTTP_X_FORWARDED_PROTO', $request->getServer('REQUEST_SCHEME', 'https'))); Config::setParam('port', (string) parse_url(Config::getParam('protocol').'://'.$request->getServer('HTTP_HOST', ''), PHP_URL_PORT)); +Config::setParam('hostname', parse_url(Config::getParam('protocol').'://'.$request->getServer('HTTP_HOST', null), PHP_URL_HOST)); $utopia = new App('Asia/Tel_Aviv', Config::getParam('env')); @@ -74,10 +77,11 @@ define('COOKIE_DOMAIN', ( $request->getServer('HTTP_HOST', null) === 'localhost' || $request->getServer('HTTP_HOST', null) === 'localhost:'.Config::getParam('port') || - (filter_var($request->getServer('HTTP_HOST', null), FILTER_VALIDATE_IP) !== false) + (filter_var(Config::getParam('hostname'), FILTER_VALIDATE_IP) !== false) ) ? null - : '.'.parse_url(Config::getParam('protocol').'://'.$request->getServer('HTTP_HOST', ''), PHP_URL_HOST)); + : '.'.Config::getParam('hostname') + ); define('COOKIE_SAMESITE', Response::COOKIE_SAMESITE_NONE); /* @@ -254,7 +258,7 @@ if (APP_MODE_ADMIN === $mode) { $session = Auth::decodeSession( $request->getCookie(Auth::$cookieName, // Get sessions $request->getCookie(Auth::$cookieName.'_legacy', // Get fallback session from old clients (no SameSite support) - $request->getHeader('X-Appwrite-Key', '')))); // Get API Key + $request->getHeader('X-Appwrite-Key', '')))); // Get API Key // Get fallback session from clients who block 3rd-party cookies $response->addHeader('X-Debug-Fallback', 'false'); diff --git a/app/sdks/flutter-dart/CHANGELOG.md b/app/sdks/client-flutter/CHANGELOG.md similarity index 52% rename from app/sdks/flutter-dart/CHANGELOG.md rename to app/sdks/client-flutter/CHANGELOG.md index fe50409674..37f6a30a69 100644 --- a/app/sdks/flutter-dart/CHANGELOG.md +++ b/app/sdks/client-flutter/CHANGELOG.md @@ -1,3 +1,17 @@ +## 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 diff --git a/app/sdks/console-javascript/LICENSE b/app/sdks/client-flutter/LICENSE similarity index 100% rename from app/sdks/console-javascript/LICENSE rename to app/sdks/client-flutter/LICENSE diff --git a/app/sdks/flutter-dart/README.md b/app/sdks/client-flutter/README.md similarity index 78% rename from app/sdks/flutter-dart/README.md rename to app/sdks/client-flutter/README.md index 7c84ddd863..b0c261c115 100644 --- a/app/sdks/flutter-dart/README.md +++ b/app/sdks/client-flutter/README.md @@ -1,13 +1,13 @@ -# Appwrite SDK for Dart +# 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-dart.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.5.3-blue.svg?v=1) +![License](https://img.shields.io/github/license/appwrite/sdk-for-flutter.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.5.3. For older versions, please check previous releases.** +**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 Dart SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. + 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) @@ -20,7 +20,7 @@ Add this to your package's `pubspec.yaml` file: ```yml dependencies: - appwrite: ^0.1.1 + appwrite: ^0.2.2 ``` You can install packages from the command line: diff --git a/app/sdks/client-flutter/docs/examples/account/create-o-auth2session.md b/app/sdks/client-flutter/docs/examples/account/create-o-auth2session.md new file mode 100644 index 0000000000..c617c34d4d --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/account/create-o-auth2session.md @@ -0,0 +1,22 @@ +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.createOAuth2Session( + provider: 'bitbucket', + ); + + 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/create-recovery.md b/app/sdks/client-flutter/docs/examples/account/create-recovery.md new file mode 100644 index 0000000000..50db45b15d --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/account/create-recovery.md @@ -0,0 +1,23 @@ +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.createRecovery( + email: 'email@example.com', + url: 'https://example.com', + ); + + 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/create-session.md b/app/sdks/client-flutter/docs/examples/account/create-session.md new file mode 100644 index 0000000000..ef824b4eca --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/account/create-session.md @@ -0,0 +1,23 @@ +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.createSession( + email: 'email@example.com', + password: 'password', + ); + + 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/create-verification.md b/app/sdks/client-flutter/docs/examples/account/create-verification.md new file mode 100644 index 0000000000..6b9b1ace40 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/account/create-verification.md @@ -0,0 +1,22 @@ +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.createVerification( + url: 'https://example.com', + ); + + 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/create.md b/app/sdks/client-flutter/docs/examples/account/create.md new file mode 100644 index 0000000000..384258ae68 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/account/create.md @@ -0,0 +1,23 @@ +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.create( + email: 'email@example.com', + password: 'password', + ); + + 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/delete-session.md b/app/sdks/client-flutter/docs/examples/account/delete-session.md new file mode 100644 index 0000000000..80a3f505d0 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/account/delete-session.md @@ -0,0 +1,22 @@ +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.deleteSession( + sessionId: '[SESSION_ID]', + ); + + 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/delete-sessions.md b/app/sdks/client-flutter/docs/examples/account/delete-sessions.md new file mode 100644 index 0000000000..5e947fabc2 --- /dev/null +++ b/app/sdks/client-flutter/docs/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/app/sdks/client-flutter/docs/examples/account/delete.md b/app/sdks/client-flutter/docs/examples/account/delete.md new file mode 100644 index 0000000000..2853a1f437 --- /dev/null +++ b/app/sdks/client-flutter/docs/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/app/sdks/client-flutter/docs/examples/account/get-logs.md b/app/sdks/client-flutter/docs/examples/account/get-logs.md new file mode 100644 index 0000000000..8f52f8220b --- /dev/null +++ b/app/sdks/client-flutter/docs/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/app/sdks/client-flutter/docs/examples/account/get-prefs.md b/app/sdks/client-flutter/docs/examples/account/get-prefs.md new file mode 100644 index 0000000000..01d57a5499 --- /dev/null +++ b/app/sdks/client-flutter/docs/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/app/sdks/client-flutter/docs/examples/account/get-sessions.md b/app/sdks/client-flutter/docs/examples/account/get-sessions.md new file mode 100644 index 0000000000..e921bda59b --- /dev/null +++ b/app/sdks/client-flutter/docs/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/app/sdks/client-flutter/docs/examples/account/get.md new file mode 100644 index 0000000000..35241b5607 --- /dev/null +++ b/app/sdks/client-flutter/docs/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/docs/examples/account/update-email.md b/app/sdks/client-flutter/docs/examples/account/update-email.md new file mode 100644 index 0000000000..4a1a002db4 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/account/update-email.md @@ -0,0 +1,23 @@ +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.updateEmail( + email: 'email@example.com', + password: 'password', + ); + + 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/update-name.md b/app/sdks/client-flutter/docs/examples/account/update-name.md new file mode 100644 index 0000000000..fa432bb34a --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/account/update-name.md @@ -0,0 +1,22 @@ +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.updateName( + name: '[NAME]', + ); + + 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/update-password.md b/app/sdks/client-flutter/docs/examples/account/update-password.md new file mode 100644 index 0000000000..9bd8ad9b77 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/account/update-password.md @@ -0,0 +1,23 @@ +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.updatePassword( + password: 'password', + oldPassword: 'password', + ); + + 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/update-prefs.md b/app/sdks/client-flutter/docs/examples/account/update-prefs.md new file mode 100644 index 0000000000..443252f89a --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/account/update-prefs.md @@ -0,0 +1,22 @@ +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.updatePrefs( + prefs: {}, + ); + + 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/update-recovery.md b/app/sdks/client-flutter/docs/examples/account/update-recovery.md new file mode 100644 index 0000000000..5140235d49 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/account/update-recovery.md @@ -0,0 +1,25 @@ +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.updateRecovery( + userId: '[USER_ID]', + secret: '[SECRET]', + password: 'password', + passwordAgain: 'password', + ); + + 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/update-verification.md b/app/sdks/client-flutter/docs/examples/account/update-verification.md new file mode 100644 index 0000000000..b795cde92d --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/account/update-verification.md @@ -0,0 +1,23 @@ +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.updateVerification( + userId: '[USER_ID]', + secret: '[SECRET]', + ); + + 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/avatars/get-browser.md b/app/sdks/client-flutter/docs/examples/avatars/get-browser.md new file mode 100644 index 0000000000..464767c4c0 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/avatars/get-browser.md @@ -0,0 +1,17 @@ +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.getBrowser( + code: 'aa', + ); + + print(result); // Resource URL string +} \ No newline at end of file diff --git a/app/sdks/client-flutter/docs/examples/avatars/get-credit-card.md b/app/sdks/client-flutter/docs/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..482c642402 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/avatars/get-credit-card.md @@ -0,0 +1,17 @@ +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.getCreditCard( + code: 'amex', + ); + + print(result); // Resource URL string +} \ No newline at end of file diff --git a/app/sdks/client-flutter/docs/examples/avatars/get-favicon.md b/app/sdks/client-flutter/docs/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..60397b0af2 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/avatars/get-favicon.md @@ -0,0 +1,17 @@ +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.getFavicon( + url: 'https://example.com', + ); + + print(result); // Resource URL string +} \ No newline at end of file diff --git a/app/sdks/client-flutter/docs/examples/avatars/get-flag.md b/app/sdks/client-flutter/docs/examples/avatars/get-flag.md new file mode 100644 index 0000000000..a9f7a711d9 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/avatars/get-flag.md @@ -0,0 +1,17 @@ +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.getFlag( + code: 'af', + ); + + print(result); // Resource URL string +} \ No newline at end of file diff --git a/app/sdks/client-flutter/docs/examples/avatars/get-image.md b/app/sdks/client-flutter/docs/examples/avatars/get-image.md new file mode 100644 index 0000000000..7cead1cb2f --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/avatars/get-image.md @@ -0,0 +1,17 @@ +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.getImage( + url: 'https://example.com', + ); + + print(result); // Resource URL string +} \ No newline at end of file diff --git a/app/sdks/client-flutter/docs/examples/avatars/get-q-r.md b/app/sdks/client-flutter/docs/examples/avatars/get-q-r.md new file mode 100644 index 0000000000..a5bcfd2c05 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/avatars/get-q-r.md @@ -0,0 +1,17 @@ +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.getQR( + text: '[TEXT]', + ); + + print(result); // Resource URL string +} \ No newline at end of file diff --git a/app/sdks/client-flutter/docs/examples/database/create-document.md b/app/sdks/client-flutter/docs/examples/database/create-document.md new file mode 100644 index 0000000000..b7d540bc2d --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/database/create-document.md @@ -0,0 +1,25 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Database database = Database(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = database.createDocument( + collectionId: '[COLLECTION_ID]', + data: {}, + read: [], + write: [], + ); + + 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/database/delete-document.md b/app/sdks/client-flutter/docs/examples/database/delete-document.md new file mode 100644 index 0000000000..40c1cbdfe2 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/database/delete-document.md @@ -0,0 +1,23 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Database database = Database(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = database.deleteDocument( + collectionId: '[COLLECTION_ID]', + documentId: '[DOCUMENT_ID]', + ); + + 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/database/get-document.md b/app/sdks/client-flutter/docs/examples/database/get-document.md new file mode 100644 index 0000000000..0c98142315 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/database/get-document.md @@ -0,0 +1,23 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Database database = Database(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = database.getDocument( + collectionId: '[COLLECTION_ID]', + documentId: '[DOCUMENT_ID]', + ); + + 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/database/list-documents.md b/app/sdks/client-flutter/docs/examples/database/list-documents.md new file mode 100644 index 0000000000..0685e7f1aa --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/database/list-documents.md @@ -0,0 +1,22 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Database database = Database(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = database.listDocuments( + collectionId: '[COLLECTION_ID]', + ); + + 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/database/update-document.md b/app/sdks/client-flutter/docs/examples/database/update-document.md new file mode 100644 index 0000000000..2f37cd767a --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/database/update-document.md @@ -0,0 +1,26 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Database database = Database(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = database.updateDocument( + collectionId: '[COLLECTION_ID]', + documentId: '[DOCUMENT_ID]', + data: {}, + read: [], + write: [], + ); + + 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-continents.md b/app/sdks/client-flutter/docs/examples/locale/get-continents.md new file mode 100644 index 0000000000..2a6a6413ba --- /dev/null +++ b/app/sdks/client-flutter/docs/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/app/sdks/client-flutter/docs/examples/locale/get-countries-e-u.md b/app/sdks/client-flutter/docs/examples/locale/get-countries-e-u.md new file mode 100644 index 0000000000..1934fc6709 --- /dev/null +++ b/app/sdks/client-flutter/docs/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-phones.md b/app/sdks/client-flutter/docs/examples/locale/get-countries-phones.md new file mode 100644 index 0000000000..f6b1f58749 --- /dev/null +++ b/app/sdks/client-flutter/docs/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/app/sdks/client-flutter/docs/examples/locale/get-countries.md b/app/sdks/client-flutter/docs/examples/locale/get-countries.md new file mode 100644 index 0000000000..104584968f --- /dev/null +++ b/app/sdks/client-flutter/docs/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/app/sdks/client-flutter/docs/examples/locale/get-currencies.md b/app/sdks/client-flutter/docs/examples/locale/get-currencies.md new file mode 100644 index 0000000000..8dc01fc68e --- /dev/null +++ b/app/sdks/client-flutter/docs/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/app/sdks/client-flutter/docs/examples/locale/get.md b/app/sdks/client-flutter/docs/examples/locale/get.md new file mode 100644 index 0000000000..189fceb7d1 --- /dev/null +++ b/app/sdks/client-flutter/docs/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/docs/examples/storage/create-file.md b/app/sdks/client-flutter/docs/examples/storage/create-file.md new file mode 100644 index 0000000000..9f61be12f4 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/storage/create-file.md @@ -0,0 +1,25 @@ +import 'dart:io'; +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Storage storage = Storage(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = storage.createFile( + file: await MultipartFile.fromFile('./path-to-files/image.jpg', 'image.jpg'), + read: [], + write: [], + ); + + 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/storage/delete-file.md b/app/sdks/client-flutter/docs/examples/storage/delete-file.md new file mode 100644 index 0000000000..271ed7b2dd --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/storage/delete-file.md @@ -0,0 +1,22 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Storage storage = Storage(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = storage.deleteFile( + fileId: '[FILE_ID]', + ); + + 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/storage/get-file-download.md b/app/sdks/client-flutter/docs/examples/storage/get-file-download.md new file mode 100644 index 0000000000..be3385a61b --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/storage/get-file-download.md @@ -0,0 +1,17 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Storage storage = Storage(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + String result = storage.getFileDownload( + fileId: '[FILE_ID]', + ); + + print(result); // Resource URL string +} \ No newline at end of file diff --git a/app/sdks/client-flutter/docs/examples/storage/get-file-preview.md b/app/sdks/client-flutter/docs/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..8bd1a47457 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/storage/get-file-preview.md @@ -0,0 +1,17 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Storage storage = Storage(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + String result = storage.getFilePreview( + fileId: '[FILE_ID]', + ); + + print(result); // Resource URL string +} \ No newline at end of file diff --git a/app/sdks/client-flutter/docs/examples/storage/get-file-view.md b/app/sdks/client-flutter/docs/examples/storage/get-file-view.md new file mode 100644 index 0000000000..5803fd409f --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/storage/get-file-view.md @@ -0,0 +1,17 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Storage storage = Storage(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + String result = storage.getFileView( + fileId: '[FILE_ID]', + ); + + print(result); // Resource URL string +} \ No newline at end of file diff --git a/app/sdks/client-flutter/docs/examples/storage/get-file.md b/app/sdks/client-flutter/docs/examples/storage/get-file.md new file mode 100644 index 0000000000..feca667fa9 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/storage/get-file.md @@ -0,0 +1,22 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Storage storage = Storage(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = storage.getFile( + fileId: '[FILE_ID]', + ); + + 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/storage/list-files.md b/app/sdks/client-flutter/docs/examples/storage/list-files.md new file mode 100644 index 0000000000..1963ec694d --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/storage/list-files.md @@ -0,0 +1,21 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Storage storage = Storage(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = storage.listFiles( + ); + + 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/storage/update-file.md b/app/sdks/client-flutter/docs/examples/storage/update-file.md new file mode 100644 index 0000000000..a5ecbfe987 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/storage/update-file.md @@ -0,0 +1,24 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Storage storage = Storage(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = storage.updateFile( + fileId: '[FILE_ID]', + read: [], + write: [], + ); + + 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/teams/create-membership.md b/app/sdks/client-flutter/docs/examples/teams/create-membership.md new file mode 100644 index 0000000000..e5e82de7b4 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/teams/create-membership.md @@ -0,0 +1,25 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Teams teams = Teams(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = teams.createMembership( + teamId: '[TEAM_ID]', + email: 'email@example.com', + roles: [], + url: 'https://example.com', + ); + + 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/teams/create.md b/app/sdks/client-flutter/docs/examples/teams/create.md new file mode 100644 index 0000000000..d11958ae6d --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/teams/create.md @@ -0,0 +1,22 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Teams teams = Teams(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = teams.create( + name: '[NAME]', + ); + + 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/teams/delete-membership.md b/app/sdks/client-flutter/docs/examples/teams/delete-membership.md new file mode 100644 index 0000000000..3f57b840fe --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/teams/delete-membership.md @@ -0,0 +1,23 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Teams teams = Teams(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = teams.deleteMembership( + teamId: '[TEAM_ID]', + inviteId: '[INVITE_ID]', + ); + + 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/teams/delete.md b/app/sdks/client-flutter/docs/examples/teams/delete.md new file mode 100644 index 0000000000..9fb488afec --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/teams/delete.md @@ -0,0 +1,22 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Teams teams = Teams(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = teams.delete( + teamId: '[TEAM_ID]', + ); + + 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/teams/get-memberships.md b/app/sdks/client-flutter/docs/examples/teams/get-memberships.md new file mode 100644 index 0000000000..4edadfa2b4 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/teams/get-memberships.md @@ -0,0 +1,22 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Teams teams = Teams(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = teams.getMemberships( + teamId: '[TEAM_ID]', + ); + + 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/teams/get.md b/app/sdks/client-flutter/docs/examples/teams/get.md new file mode 100644 index 0000000000..083565f7a6 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/teams/get.md @@ -0,0 +1,22 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Teams teams = Teams(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = teams.get( + teamId: '[TEAM_ID]', + ); + + 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/teams/list.md b/app/sdks/client-flutter/docs/examples/teams/list.md new file mode 100644 index 0000000000..665020e928 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/teams/list.md @@ -0,0 +1,21 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Teams teams = Teams(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = teams.list( + ); + + 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/teams/update-membership-status.md b/app/sdks/client-flutter/docs/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..616f64e148 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/teams/update-membership-status.md @@ -0,0 +1,25 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Teams teams = Teams(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = teams.updateMembershipStatus( + teamId: '[TEAM_ID]', + inviteId: '[INVITE_ID]', + userId: '[USER_ID]', + secret: '[SECRET]', + ); + + 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/teams/update.md b/app/sdks/client-flutter/docs/examples/teams/update.md new file mode 100644 index 0000000000..915fb57d38 --- /dev/null +++ b/app/sdks/client-flutter/docs/examples/teams/update.md @@ -0,0 +1,23 @@ +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Teams teams = Teams(client); + + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + + Future result = teams.update( + teamId: '[TEAM_ID]', + name: '[NAME]', + ); + + result + .then((response) { + print(response); + }).catchError((error) { + print(error.response); + }); +} \ No newline at end of file diff --git a/app/sdks/flutter-dart/example/README.md b/app/sdks/client-flutter/example/README.md similarity index 100% rename from app/sdks/flutter-dart/example/README.md rename to app/sdks/client-flutter/example/README.md diff --git a/app/sdks/flutter-dart/lib/appwrite.dart b/app/sdks/client-flutter/lib/appwrite.dart similarity index 100% rename from app/sdks/flutter-dart/lib/appwrite.dart rename to app/sdks/client-flutter/lib/appwrite.dart diff --git a/app/sdks/flutter-dart/lib/client.dart b/app/sdks/client-flutter/lib/client.dart similarity index 83% rename from app/sdks/flutter-dart/lib/client.dart rename to app/sdks/client-flutter/lib/client.dart index 90eb0bd6fe..d9e8eedf19 100644 --- a/app/sdks/flutter-dart/lib/client.dart +++ b/app/sdks/client-flutter/lib/client.dart @@ -15,7 +15,7 @@ class Client { Map headers; Map config; bool selfSigned; - bool init = false; + bool initialized = false; Dio http; PersistCookieJar cookieJar; @@ -30,7 +30,7 @@ class Client { this.headers = { 'content-type': 'application/json', - 'x-sdk-version': 'appwrite:dart:0.1.1', + 'x-sdk-version': 'appwrite:dart:0.2.2', }; this.config = {}; @@ -76,6 +76,22 @@ class Client { return this; } + Future init() async { + if(!initialized) { + final Directory cookieDir = await _getCookiePath(); + + cookieJar = new PersistCookieJar(dir:cookieDir.path); + + this.http.options.baseUrl = this.endPoint; + this.http.options.validateStatus = (status) => status < 400; + this.http.interceptors.add(CookieManager(cookieJar)); + + PackageInfo packageInfo = await PackageInfo.fromPlatform(); + + addHeader('Origin', 'appwrite-' + type + '://' + packageInfo.packageName); + } + } + Future call(HttpMethod method, {String path = '', Map headers = const {}, Map params = const {}}) async { if(selfSigned) { // Allow self signed requests @@ -85,21 +101,7 @@ class Client { }; } - if(!init) { - final Directory cookieDir = await _getCookiePath(); - - cookieJar = new PersistCookieJar(dir:cookieDir.path); - - this.http.options.baseUrl = this.endPoint; - this.http.options.validateStatus = (status) => status < 400; - this.http.interceptors.add(CookieManager(cookieJar)); - - PackageInfo packageInfo = await PackageInfo.fromPlatform(); - - addHeader('Origin', 'appwrite-' + type + '://' + packageInfo.packageName); - - init = true; - } + await this.init(); // Origin is hardcoded for testing Options options = Options( diff --git a/app/sdks/flutter-dart/lib/enums.dart b/app/sdks/client-flutter/lib/enums.dart similarity index 100% rename from app/sdks/flutter-dart/lib/enums.dart rename to app/sdks/client-flutter/lib/enums.dart diff --git a/app/sdks/flutter-dart/lib/service.dart b/app/sdks/client-flutter/lib/service.dart similarity index 100% rename from app/sdks/flutter-dart/lib/service.dart rename to app/sdks/client-flutter/lib/service.dart diff --git a/app/sdks/flutter-dart/lib/services/account.dart b/app/sdks/client-flutter/lib/services/account.dart similarity index 98% rename from app/sdks/flutter-dart/lib/services/account.dart rename to app/sdks/client-flutter/lib/services/account.dart index 92951ce5cf..8cc237d104 100644 --- a/app/sdks/flutter-dart/lib/services/account.dart +++ b/app/sdks/client-flutter/lib/services/account.dart @@ -305,7 +305,7 @@ class Account extends Service { /// 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://localhost:2444/auth/oauth2/success', String failure = 'https://localhost:2444/auth/oauth2/failure'}) { + 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 = { @@ -324,10 +324,11 @@ class Account extends Service { return FlutterWebAuth.authenticate( url: url.toString(), - callbackUrlScheme: "appwrite-callback" - ).then((value) { + callbackUrlScheme: "appwrite-callback-" + client.config['project'] + ).then((value) async { Uri url = Uri.parse(value); List cookies = [new Cookie(url.queryParameters['key'], url.queryParameters['secret'])]; + await client.init(); client.cookieJar.saveFromResponse(Uri.parse(client.endPoint), cookies); }); } diff --git a/app/sdks/flutter-dart/lib/services/avatars.dart b/app/sdks/client-flutter/lib/services/avatars.dart similarity index 55% rename from app/sdks/flutter-dart/lib/services/avatars.dart rename to app/sdks/client-flutter/lib/services/avatars.dart index a85b667018..fc9c403d90 100644 --- a/app/sdks/flutter-dart/lib/services/avatars.dart +++ b/app/sdks/client-flutter/lib/services/avatars.dart @@ -17,20 +17,25 @@ class Avatars extends Service { /// /account/sessions endpoint. Use width, height and quality arguments to /// change the output settings. /// - Future getBrowser({@required String code, int width = 100, int height = 100, int quality = 100}) { + 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'], }; - final Map headers = { - 'content-type': 'application/json', - }; + 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 client.call(HttpMethod.get, path: path, params: params, headers: headers); + return location.toString(); } /// Get Credit Card Icon @@ -40,20 +45,25 @@ class Avatars extends Service { /// card provider you need. Use width, height and quality arguments to change /// the output settings. /// - Future getCreditCard({@required String code, int width = 100, int height = 100, int quality = 100}) { + 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'], }; - final Map headers = { - 'content-type': 'application/json', - }; + 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 client.call(HttpMethod.get, path: path, params: params, headers: headers); + return location.toString(); } /// Get Favicon @@ -61,18 +71,23 @@ class Avatars extends Service { /// Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote /// website URL. /// - Future getFavicon({@required String url}) { + String getFavicon({@required String url}) { final String path = '/avatars/favicon'; final Map params = { 'url': url, + 'project': client.config['project'], }; - final Map headers = { - 'content-type': 'application/json', - }; + 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 client.call(HttpMethod.get, path: path, params: params, headers: headers); + return location.toString(); } /// Get Country Flag @@ -81,20 +96,25 @@ class Avatars extends Service { /// users. The code argument receives the 2 letter country code. Use width, /// height and quality arguments to change the output settings. /// - Future getFlag({@required String code, int width = 100, int height = 100, int quality = 100}) { + 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'], }; - final Map headers = { - 'content-type': 'application/json', - }; + 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 client.call(HttpMethod.get, path: path, params: params, headers: headers); + return location.toString(); } /// Get Image from URL @@ -104,20 +124,25 @@ class Avatars extends Service { /// remote images in your app or in case you want to make sure a 3rd party /// image is properly served using a TLS protocol. /// - Future getImage({@required String url, int width = 400, int height = 400}) { + 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'], }; - final Map headers = { - 'content-type': 'application/json', - }; + 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 client.call(HttpMethod.get, path: path, params: params, headers: headers); + return location.toString(); } /// Get QR Code @@ -125,7 +150,7 @@ class Avatars extends Service { /// 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. /// - Future getQR({@required String text, int size = 400, int margin = 1, int download = 0}) { + String getQR({@required String text, int size = 400, int margin = 1, int download = 0}) { final String path = '/avatars/qr'; final Map params = { @@ -133,12 +158,17 @@ class Avatars extends Service { 'size': size, 'margin': margin, 'download': download, + 'project': client.config['project'], }; - final Map headers = { - 'content-type': 'application/json', - }; + 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 client.call(HttpMethod.get, path: path, params: params, headers: headers); + return location.toString(); } } \ No newline at end of file diff --git a/app/sdks/flutter-dart/lib/services/database.dart b/app/sdks/client-flutter/lib/services/database.dart similarity index 100% rename from app/sdks/flutter-dart/lib/services/database.dart rename to app/sdks/client-flutter/lib/services/database.dart diff --git a/app/sdks/flutter-dart/lib/services/locale.dart b/app/sdks/client-flutter/lib/services/locale.dart similarity index 100% rename from app/sdks/flutter-dart/lib/services/locale.dart rename to app/sdks/client-flutter/lib/services/locale.dart diff --git a/app/sdks/flutter-dart/lib/services/storage.dart b/app/sdks/client-flutter/lib/services/storage.dart similarity index 95% rename from app/sdks/flutter-dart/lib/services/storage.dart rename to app/sdks/client-flutter/lib/services/storage.dart index 47497c7699..696c15ee3a 100644 --- a/app/sdks/flutter-dart/lib/services/storage.dart +++ b/app/sdks/client-flutter/lib/services/storage.dart @@ -125,14 +125,14 @@ class Storage extends Service { }; Uri endpoint = Uri.parse(client.endPoint); - Uri url = new Uri(scheme: endpoint.scheme, + Uri location = new Uri(scheme: endpoint.scheme, host: endpoint.host, port: endpoint.port, path: endpoint.path + path, queryParameters:params, ); - return url.toString(); + return location.toString(); } /// Get File Preview @@ -155,14 +155,14 @@ class Storage extends Service { }; Uri endpoint = Uri.parse(client.endPoint); - Uri url = new Uri(scheme: endpoint.scheme, + Uri location = new Uri(scheme: endpoint.scheme, host: endpoint.host, port: endpoint.port, path: endpoint.path + path, queryParameters:params, ); - return url.toString(); + return location.toString(); } /// Get File for View @@ -179,13 +179,13 @@ class Storage extends Service { }; Uri endpoint = Uri.parse(client.endPoint); - Uri url = new Uri(scheme: endpoint.scheme, + Uri location = new Uri(scheme: endpoint.scheme, host: endpoint.host, port: endpoint.port, path: endpoint.path + path, queryParameters:params, ); - return url.toString(); + return location.toString(); } } \ No newline at end of file diff --git a/app/sdks/flutter-dart/lib/services/teams.dart b/app/sdks/client-flutter/lib/services/teams.dart similarity index 100% rename from app/sdks/flutter-dart/lib/services/teams.dart rename to app/sdks/client-flutter/lib/services/teams.dart diff --git a/app/sdks/flutter-dart/pubspec.yaml b/app/sdks/client-flutter/pubspec.yaml similarity index 91% rename from app/sdks/flutter-dart/pubspec.yaml rename to app/sdks/client-flutter/pubspec.yaml index 33c49e6a9c..2954cdb9e9 100644 --- a/app/sdks/flutter-dart/pubspec.yaml +++ b/app/sdks/client-flutter/pubspec.yaml @@ -1,8 +1,8 @@ name: appwrite -version: 0.1.1 +version: 0.2.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-dart +repository: https://github.com/appwrite/sdk-for-flutter issue_tracker: https://github.com/appwrite/sdk-generator/issues documentation: https://appwrite.io/support environment: @@ -14,7 +14,7 @@ dependencies: dio: ^3.0.0 cookie_jar: ^1.0.0 dio_cookie_manager: ^1.0.0 - flutter_web_auth: ^0.2.0 + flutter_web_auth: ^0.2.4 flutter: sdk: flutter diff --git a/app/sdks/console-javascript/CHANGELOG.md b/app/sdks/client-web/CHANGELOG.md similarity index 100% rename from app/sdks/console-javascript/CHANGELOG.md rename to app/sdks/client-web/CHANGELOG.md diff --git a/app/sdks/flutter-dart/LICENSE b/app/sdks/client-web/LICENSE similarity index 100% rename from app/sdks/flutter-dart/LICENSE rename to app/sdks/client-web/LICENSE diff --git a/app/sdks/web-javascript/README.md b/app/sdks/client-web/README.md similarity index 69% rename from app/sdks/web-javascript/README.md rename to app/sdks/client-web/README.md index 812e31fd29..e59480b4a9 100644 --- a/app/sdks/web-javascript/README.md +++ b/app/sdks/client-web/README.md @@ -1,10 +1,10 @@ -# Appwrite SDK for JavaScript +# 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.5.3-blue.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 JavaScript SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. + 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) @@ -30,24 +30,9 @@ import * as Appwrite from "appwrite"; 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 - + ``` -## Getting Started - -Initialise the Appwrite SDK in your code, and setup your API credentials: - -```js - -// Init your JS SDK -var appwrite = new Appwrite(); - -appwrite - .setEndpoint('http://localhost/v1') // Set only when using self-hosted solution - .setProject('455x34dfkj') // Your Appwrite Project UID -; - -``` ## Contribution diff --git a/app/sdks/web-javascript/docs/examples/account/create-o-auth2session.md b/app/sdks/client-web/docs/examples/account/create-o-auth2session.md similarity index 80% rename from app/sdks/web-javascript/docs/examples/account/create-o-auth2session.md rename to app/sdks/client-web/docs/examples/account/create-o-auth2session.md index 611df2173d..5cc825a273 100644 --- a/app/sdks/web-javascript/docs/examples/account/create-o-auth2session.md +++ b/app/sdks/client-web/docs/examples/account/create-o-auth2session.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/account/create-recovery.md b/app/sdks/client-web/docs/examples/account/create-recovery.md similarity index 81% rename from app/sdks/web-javascript/docs/examples/account/create-recovery.md rename to app/sdks/client-web/docs/examples/account/create-recovery.md index 0647f3e468..72130f4de4 100644 --- a/app/sdks/web-javascript/docs/examples/account/create-recovery.md +++ b/app/sdks/client-web/docs/examples/account/create-recovery.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/account/create-session.md b/app/sdks/client-web/docs/examples/account/create-session.md similarity index 80% rename from app/sdks/web-javascript/docs/examples/account/create-session.md rename to app/sdks/client-web/docs/examples/account/create-session.md index 1a02c4c131..4a7682c13d 100644 --- a/app/sdks/web-javascript/docs/examples/account/create-session.md +++ b/app/sdks/client-web/docs/examples/account/create-session.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/account/create-verification.md b/app/sdks/client-web/docs/examples/account/create-verification.md similarity index 80% rename from app/sdks/web-javascript/docs/examples/account/create-verification.md rename to app/sdks/client-web/docs/examples/account/create-verification.md index 69488635f4..7903384a9f 100644 --- a/app/sdks/web-javascript/docs/examples/account/create-verification.md +++ b/app/sdks/client-web/docs/examples/account/create-verification.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/account/create.md b/app/sdks/client-web/docs/examples/account/create.md similarity index 80% rename from app/sdks/web-javascript/docs/examples/account/create.md rename to app/sdks/client-web/docs/examples/account/create.md index fb6e235aa3..c9ce798b6a 100644 --- a/app/sdks/web-javascript/docs/examples/account/create.md +++ b/app/sdks/client-web/docs/examples/account/create.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/account/delete-session.md b/app/sdks/client-web/docs/examples/account/delete-session.md similarity index 80% rename from app/sdks/web-javascript/docs/examples/account/delete-session.md rename to app/sdks/client-web/docs/examples/account/delete-session.md index 598c9269ec..581e5d132d 100644 --- a/app/sdks/web-javascript/docs/examples/account/delete-session.md +++ b/app/sdks/client-web/docs/examples/account/delete-session.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/account/delete-sessions.md b/app/sdks/client-web/docs/examples/account/delete-sessions.md similarity index 79% rename from app/sdks/web-javascript/docs/examples/account/delete-sessions.md rename to app/sdks/client-web/docs/examples/account/delete-sessions.md index 7c988afa33..d037673eb3 100644 --- a/app/sdks/web-javascript/docs/examples/account/delete-sessions.md +++ b/app/sdks/client-web/docs/examples/account/delete-sessions.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/account/delete.md b/app/sdks/client-web/docs/examples/account/delete.md similarity index 78% rename from app/sdks/web-javascript/docs/examples/account/delete.md rename to app/sdks/client-web/docs/examples/account/delete.md index 2679c444b0..d952d77d7a 100644 --- a/app/sdks/web-javascript/docs/examples/account/delete.md +++ b/app/sdks/client-web/docs/examples/account/delete.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/account/get-logs.md b/app/sdks/client-web/docs/examples/account/get-logs.md similarity index 78% rename from app/sdks/web-javascript/docs/examples/account/get-logs.md rename to app/sdks/client-web/docs/examples/account/get-logs.md index b1234e1929..c53e0446e9 100644 --- a/app/sdks/web-javascript/docs/examples/account/get-logs.md +++ b/app/sdks/client-web/docs/examples/account/get-logs.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/account/get-prefs.md b/app/sdks/client-web/docs/examples/account/get-prefs.md similarity index 78% rename from app/sdks/web-javascript/docs/examples/account/get-prefs.md rename to app/sdks/client-web/docs/examples/account/get-prefs.md index 7e9a1df84f..75835e37fb 100644 --- a/app/sdks/web-javascript/docs/examples/account/get-prefs.md +++ b/app/sdks/client-web/docs/examples/account/get-prefs.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/account/get-sessions.md b/app/sdks/client-web/docs/examples/account/get-sessions.md similarity index 79% rename from app/sdks/web-javascript/docs/examples/account/get-sessions.md rename to app/sdks/client-web/docs/examples/account/get-sessions.md index 96eefa6422..b4434de336 100644 --- a/app/sdks/web-javascript/docs/examples/account/get-sessions.md +++ b/app/sdks/client-web/docs/examples/account/get-sessions.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/account/get.md b/app/sdks/client-web/docs/examples/account/get.md similarity index 78% rename from app/sdks/web-javascript/docs/examples/account/get.md rename to app/sdks/client-web/docs/examples/account/get.md index 0a0c7a2ccc..f0184a8513 100644 --- a/app/sdks/web-javascript/docs/examples/account/get.md +++ b/app/sdks/client-web/docs/examples/account/get.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/account/update-email.md b/app/sdks/client-web/docs/examples/account/update-email.md similarity index 80% rename from app/sdks/web-javascript/docs/examples/account/update-email.md rename to app/sdks/client-web/docs/examples/account/update-email.md index 4beeeb8cf8..f48fed78bc 100644 --- a/app/sdks/web-javascript/docs/examples/account/update-email.md +++ b/app/sdks/client-web/docs/examples/account/update-email.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/account/update-name.md b/app/sdks/client-web/docs/examples/account/update-name.md similarity index 79% rename from app/sdks/web-javascript/docs/examples/account/update-name.md rename to app/sdks/client-web/docs/examples/account/update-name.md index 0464d29405..e03e72c4b2 100644 --- a/app/sdks/web-javascript/docs/examples/account/update-name.md +++ b/app/sdks/client-web/docs/examples/account/update-name.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/account/update-password.md b/app/sdks/client-web/docs/examples/account/update-password.md similarity index 80% rename from app/sdks/web-javascript/docs/examples/account/update-password.md rename to app/sdks/client-web/docs/examples/account/update-password.md index 14180f4b5b..22539f3f64 100644 --- a/app/sdks/web-javascript/docs/examples/account/update-password.md +++ b/app/sdks/client-web/docs/examples/account/update-password.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/account/update-prefs.md b/app/sdks/client-web/docs/examples/account/update-prefs.md similarity index 79% rename from app/sdks/web-javascript/docs/examples/account/update-prefs.md rename to app/sdks/client-web/docs/examples/account/update-prefs.md index 0e7d005134..b2d4ff175e 100644 --- a/app/sdks/web-javascript/docs/examples/account/update-prefs.md +++ b/app/sdks/client-web/docs/examples/account/update-prefs.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/account/update-recovery.md b/app/sdks/client-web/docs/examples/account/update-recovery.md similarity index 81% rename from app/sdks/web-javascript/docs/examples/account/update-recovery.md rename to app/sdks/client-web/docs/examples/account/update-recovery.md index 9c16f06cb5..33cf1b63c9 100644 --- a/app/sdks/web-javascript/docs/examples/account/update-recovery.md +++ b/app/sdks/client-web/docs/examples/account/update-recovery.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/account/update-verification.md b/app/sdks/client-web/docs/examples/account/update-verification.md similarity index 80% rename from app/sdks/web-javascript/docs/examples/account/update-verification.md rename to app/sdks/client-web/docs/examples/account/update-verification.md index f01eeb26db..a80e125e30 100644 --- a/app/sdks/web-javascript/docs/examples/account/update-verification.md +++ b/app/sdks/client-web/docs/examples/account/update-verification.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/client-web/docs/examples/avatars/get-browser.md b/app/sdks/client-web/docs/examples/avatars/get-browser.md new file mode 100644 index 0000000000..86d0df4a23 --- /dev/null +++ b/app/sdks/client-web/docs/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 diff --git a/app/sdks/client-web/docs/examples/avatars/get-credit-card.md b/app/sdks/client-web/docs/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..83a1381adf --- /dev/null +++ b/app/sdks/client-web/docs/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 diff --git a/app/sdks/client-web/docs/examples/avatars/get-favicon.md b/app/sdks/client-web/docs/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..c0ff93307a --- /dev/null +++ b/app/sdks/client-web/docs/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 diff --git a/app/sdks/client-web/docs/examples/avatars/get-flag.md b/app/sdks/client-web/docs/examples/avatars/get-flag.md new file mode 100644 index 0000000000..762aeb348e --- /dev/null +++ b/app/sdks/client-web/docs/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 diff --git a/app/sdks/client-web/docs/examples/avatars/get-image.md b/app/sdks/client-web/docs/examples/avatars/get-image.md new file mode 100644 index 0000000000..58f0eb8077 --- /dev/null +++ b/app/sdks/client-web/docs/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 diff --git a/app/sdks/client-web/docs/examples/avatars/get-q-r.md b/app/sdks/client-web/docs/examples/avatars/get-q-r.md new file mode 100644 index 0000000000..fb17032949 --- /dev/null +++ b/app/sdks/client-web/docs/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 diff --git a/app/sdks/web-javascript/docs/examples/database/create-document.md b/app/sdks/client-web/docs/examples/database/create-document.md similarity index 80% rename from app/sdks/web-javascript/docs/examples/database/create-document.md rename to app/sdks/client-web/docs/examples/database/create-document.md index 200a752a07..e04f73f73e 100644 --- a/app/sdks/web-javascript/docs/examples/database/create-document.md +++ b/app/sdks/client-web/docs/examples/database/create-document.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/database/delete-document.md b/app/sdks/client-web/docs/examples/database/delete-document.md similarity index 81% rename from app/sdks/web-javascript/docs/examples/database/delete-document.md rename to app/sdks/client-web/docs/examples/database/delete-document.md index d40c106ae2..79799b6907 100644 --- a/app/sdks/web-javascript/docs/examples/database/delete-document.md +++ b/app/sdks/client-web/docs/examples/database/delete-document.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/database/get-document.md b/app/sdks/client-web/docs/examples/database/get-document.md similarity index 81% rename from app/sdks/web-javascript/docs/examples/database/get-document.md rename to app/sdks/client-web/docs/examples/database/get-document.md index a554fe21b9..b9605dccc6 100644 --- a/app/sdks/web-javascript/docs/examples/database/get-document.md +++ b/app/sdks/client-web/docs/examples/database/get-document.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/database/list-documents.md b/app/sdks/client-web/docs/examples/database/list-documents.md similarity index 80% rename from app/sdks/web-javascript/docs/examples/database/list-documents.md rename to app/sdks/client-web/docs/examples/database/list-documents.md index aab086d8be..14f8a423a1 100644 --- a/app/sdks/web-javascript/docs/examples/database/list-documents.md +++ b/app/sdks/client-web/docs/examples/database/list-documents.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/database/update-document.md b/app/sdks/client-web/docs/examples/database/update-document.md similarity index 81% rename from app/sdks/web-javascript/docs/examples/database/update-document.md rename to app/sdks/client-web/docs/examples/database/update-document.md index b299576b93..9104b77a71 100644 --- a/app/sdks/web-javascript/docs/examples/database/update-document.md +++ b/app/sdks/client-web/docs/examples/database/update-document.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/locale/get-continents.md b/app/sdks/client-web/docs/examples/locale/get-continents.md similarity index 79% rename from app/sdks/web-javascript/docs/examples/locale/get-continents.md rename to app/sdks/client-web/docs/examples/locale/get-continents.md index 54bfeee869..1dfdf8013b 100644 --- a/app/sdks/web-javascript/docs/examples/locale/get-continents.md +++ b/app/sdks/client-web/docs/examples/locale/get-continents.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/locale/get-countries-e-u.md b/app/sdks/client-web/docs/examples/locale/get-countries-e-u.md similarity index 79% rename from app/sdks/web-javascript/docs/examples/locale/get-countries-e-u.md rename to app/sdks/client-web/docs/examples/locale/get-countries-e-u.md index 19444cbeb2..6b3f210a1e 100644 --- a/app/sdks/web-javascript/docs/examples/locale/get-countries-e-u.md +++ b/app/sdks/client-web/docs/examples/locale/get-countries-e-u.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/locale/get-countries-phones.md b/app/sdks/client-web/docs/examples/locale/get-countries-phones.md similarity index 79% rename from app/sdks/web-javascript/docs/examples/locale/get-countries-phones.md rename to app/sdks/client-web/docs/examples/locale/get-countries-phones.md index b32ddea06e..f35e2152e4 100644 --- a/app/sdks/web-javascript/docs/examples/locale/get-countries-phones.md +++ b/app/sdks/client-web/docs/examples/locale/get-countries-phones.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/locale/get-countries.md b/app/sdks/client-web/docs/examples/locale/get-countries.md similarity index 79% rename from app/sdks/web-javascript/docs/examples/locale/get-countries.md rename to app/sdks/client-web/docs/examples/locale/get-countries.md index 7ea903cf74..53b96375a1 100644 --- a/app/sdks/web-javascript/docs/examples/locale/get-countries.md +++ b/app/sdks/client-web/docs/examples/locale/get-countries.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/locale/get-currencies.md b/app/sdks/client-web/docs/examples/locale/get-currencies.md similarity index 79% rename from app/sdks/web-javascript/docs/examples/locale/get-currencies.md rename to app/sdks/client-web/docs/examples/locale/get-currencies.md index 56b5ba8a7d..57db66401f 100644 --- a/app/sdks/web-javascript/docs/examples/locale/get-currencies.md +++ b/app/sdks/client-web/docs/examples/locale/get-currencies.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/locale/get.md b/app/sdks/client-web/docs/examples/locale/get.md similarity index 78% rename from app/sdks/web-javascript/docs/examples/locale/get.md rename to app/sdks/client-web/docs/examples/locale/get.md index 1358ced165..469a046dbc 100644 --- a/app/sdks/web-javascript/docs/examples/locale/get.md +++ b/app/sdks/client-web/docs/examples/locale/get.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/storage/create-file.md b/app/sdks/client-web/docs/examples/storage/create-file.md similarity index 81% rename from app/sdks/web-javascript/docs/examples/storage/create-file.md rename to app/sdks/client-web/docs/examples/storage/create-file.md index 0cfd25a3f0..b23c47027a 100644 --- a/app/sdks/web-javascript/docs/examples/storage/create-file.md +++ b/app/sdks/client-web/docs/examples/storage/create-file.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/storage/delete-file.md b/app/sdks/client-web/docs/examples/storage/delete-file.md similarity index 79% rename from app/sdks/web-javascript/docs/examples/storage/delete-file.md rename to app/sdks/client-web/docs/examples/storage/delete-file.md index 54c3c217c7..c38ab4ba9c 100644 --- a/app/sdks/web-javascript/docs/examples/storage/delete-file.md +++ b/app/sdks/client-web/docs/examples/storage/delete-file.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/storage/get-file-download.md b/app/sdks/client-web/docs/examples/storage/get-file-download.md similarity index 72% rename from app/sdks/web-javascript/docs/examples/storage/get-file-download.md rename to app/sdks/client-web/docs/examples/storage/get-file-download.md index 817388b206..ae3a643529 100644 --- a/app/sdks/web-javascript/docs/examples/storage/get-file-download.md +++ b/app/sdks/client-web/docs/examples/storage/get-file-download.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/storage/get-file-preview.md b/app/sdks/client-web/docs/examples/storage/get-file-preview.md similarity index 72% rename from app/sdks/web-javascript/docs/examples/storage/get-file-preview.md rename to app/sdks/client-web/docs/examples/storage/get-file-preview.md index 81fd86c4fc..30461e4d9a 100644 --- a/app/sdks/web-javascript/docs/examples/storage/get-file-preview.md +++ b/app/sdks/client-web/docs/examples/storage/get-file-preview.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/storage/get-file-view.md b/app/sdks/client-web/docs/examples/storage/get-file-view.md similarity index 71% rename from app/sdks/web-javascript/docs/examples/storage/get-file-view.md rename to app/sdks/client-web/docs/examples/storage/get-file-view.md index c9bd9c3c69..341dd502de 100644 --- a/app/sdks/web-javascript/docs/examples/storage/get-file-view.md +++ b/app/sdks/client-web/docs/examples/storage/get-file-view.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/storage/get-file.md b/app/sdks/client-web/docs/examples/storage/get-file.md similarity index 79% rename from app/sdks/web-javascript/docs/examples/storage/get-file.md rename to app/sdks/client-web/docs/examples/storage/get-file.md index abe4f6993f..a1f94c08a6 100644 --- a/app/sdks/web-javascript/docs/examples/storage/get-file.md +++ b/app/sdks/client-web/docs/examples/storage/get-file.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/storage/list-files.md b/app/sdks/client-web/docs/examples/storage/list-files.md similarity index 78% rename from app/sdks/web-javascript/docs/examples/storage/list-files.md rename to app/sdks/client-web/docs/examples/storage/list-files.md index 75e4b1c480..c489a0b46d 100644 --- a/app/sdks/web-javascript/docs/examples/storage/list-files.md +++ b/app/sdks/client-web/docs/examples/storage/list-files.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/storage/update-file.md b/app/sdks/client-web/docs/examples/storage/update-file.md similarity index 80% rename from app/sdks/web-javascript/docs/examples/storage/update-file.md rename to app/sdks/client-web/docs/examples/storage/update-file.md index 32a5afd8aa..2a2f579b3b 100644 --- a/app/sdks/web-javascript/docs/examples/storage/update-file.md +++ b/app/sdks/client-web/docs/examples/storage/update-file.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/teams/create-membership.md b/app/sdks/client-web/docs/examples/teams/create-membership.md similarity index 82% rename from app/sdks/web-javascript/docs/examples/teams/create-membership.md rename to app/sdks/client-web/docs/examples/teams/create-membership.md index b2baa405a1..78b2d7fa77 100644 --- a/app/sdks/web-javascript/docs/examples/teams/create-membership.md +++ b/app/sdks/client-web/docs/examples/teams/create-membership.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/teams/create.md b/app/sdks/client-web/docs/examples/teams/create.md similarity index 79% rename from app/sdks/web-javascript/docs/examples/teams/create.md rename to app/sdks/client-web/docs/examples/teams/create.md index 2e7cf60c38..43205ba888 100644 --- a/app/sdks/web-javascript/docs/examples/teams/create.md +++ b/app/sdks/client-web/docs/examples/teams/create.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/teams/delete-membership.md b/app/sdks/client-web/docs/examples/teams/delete-membership.md similarity index 80% rename from app/sdks/web-javascript/docs/examples/teams/delete-membership.md rename to app/sdks/client-web/docs/examples/teams/delete-membership.md index a17ad4f009..1b85ef08da 100644 --- a/app/sdks/web-javascript/docs/examples/teams/delete-membership.md +++ b/app/sdks/client-web/docs/examples/teams/delete-membership.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/teams/delete.md b/app/sdks/client-web/docs/examples/teams/delete.md similarity index 79% rename from app/sdks/web-javascript/docs/examples/teams/delete.md rename to app/sdks/client-web/docs/examples/teams/delete.md index 85415016c7..4665ad5773 100644 --- a/app/sdks/web-javascript/docs/examples/teams/delete.md +++ b/app/sdks/client-web/docs/examples/teams/delete.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/teams/get-memberships.md b/app/sdks/client-web/docs/examples/teams/get-memberships.md similarity index 79% rename from app/sdks/web-javascript/docs/examples/teams/get-memberships.md rename to app/sdks/client-web/docs/examples/teams/get-memberships.md index 1ab6bf3ffe..6235ce33f4 100644 --- a/app/sdks/web-javascript/docs/examples/teams/get-memberships.md +++ b/app/sdks/client-web/docs/examples/teams/get-memberships.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/teams/get.md b/app/sdks/client-web/docs/examples/teams/get.md similarity index 79% rename from app/sdks/web-javascript/docs/examples/teams/get.md rename to app/sdks/client-web/docs/examples/teams/get.md index 3e0c4d7fac..f4b0f040b1 100644 --- a/app/sdks/web-javascript/docs/examples/teams/get.md +++ b/app/sdks/client-web/docs/examples/teams/get.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/teams/list.md b/app/sdks/client-web/docs/examples/teams/list.md similarity index 78% rename from app/sdks/web-javascript/docs/examples/teams/list.md rename to app/sdks/client-web/docs/examples/teams/list.md index d74fa47e8c..c4229e2400 100644 --- a/app/sdks/web-javascript/docs/examples/teams/list.md +++ b/app/sdks/client-web/docs/examples/teams/list.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/teams/update-membership-status.md b/app/sdks/client-web/docs/examples/teams/update-membership-status.md similarity index 82% rename from app/sdks/web-javascript/docs/examples/teams/update-membership-status.md rename to app/sdks/client-web/docs/examples/teams/update-membership-status.md index 25f858ebf8..e8b3de0a0b 100644 --- a/app/sdks/web-javascript/docs/examples/teams/update-membership-status.md +++ b/app/sdks/client-web/docs/examples/teams/update-membership-status.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/docs/examples/teams/update.md b/app/sdks/client-web/docs/examples/teams/update.md similarity index 79% rename from app/sdks/web-javascript/docs/examples/teams/update.md rename to app/sdks/client-web/docs/examples/teams/update.md index dedfb63557..bbab80937d 100644 --- a/app/sdks/web-javascript/docs/examples/teams/update.md +++ b/app/sdks/client-web/docs/examples/teams/update.md @@ -1,6 +1,7 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; diff --git a/app/sdks/web-javascript/package.json b/app/sdks/client-web/package.json similarity index 95% rename from app/sdks/web-javascript/package.json rename to app/sdks/client-web/package.json index c28785e89f..26dd06fb94 100644 --- a/app/sdks/web-javascript/package.json +++ b/app/sdks/client-web/package.json @@ -2,7 +2,7 @@ "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.29", + "version": "1.1.0", "license": "BSD-3-Clause", "main": "src/sdk.js", "types": "types/index.d.ts", diff --git a/app/sdks/web-javascript/src/sdk.js b/app/sdks/client-web/src/sdk.js similarity index 97% rename from app/sdks/web-javascript/src/sdk.js rename to app/sdks/client-web/src/sdk.js index 4e8f1b0197..0d7a7deaab 100644 --- a/app/sdks/web-javascript/src/sdk.js +++ b/app/sdks/client-web/src/sdk.js @@ -103,7 +103,7 @@ globalParams.push({key: key, value: value}); }; - addGlobalHeader('x-sdk-version', 'appwrite:javascript:1.0.29'); + addGlobalHeader('x-sdk-version', 'appwrite:javascript:1.1.0'); addGlobalHeader('content-type', ''); /** @@ -712,7 +712,7 @@ * @throws {Error} * @return {Promise} */ - createOAuth2Session: function(provider, success = 'https://localhost:2444/auth/oauth2/success', failure = 'https://localhost:2444/auth/oauth2/failure') { + createOAuth2Session: function(provider, success = 'https://appwrite.io/auth/oauth2/success', failure = 'https://appwrite.io/auth/oauth2/failure') { if(provider === undefined) { throw new Error('Missing required parameter: "provider"'); } @@ -858,7 +858,7 @@ * @param {number} height * @param {number} quality * @throws {Error} - * @return {Promise} + * @return {string} */ getBrowser: function(code, width = 100, height = 100, quality = 100) { if(code === undefined) { @@ -881,10 +881,11 @@ payload['quality'] = quality; } - return http - .get(path, { - 'content-type': 'application/json', - }, payload); + payload['project'] = config.project; + + let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&'); + + return config.endpoint + path + ((query) ? '?' + query : ''); }, /** @@ -900,7 +901,7 @@ * @param {number} height * @param {number} quality * @throws {Error} - * @return {Promise} + * @return {string} */ getCreditCard: function(code, width = 100, height = 100, quality = 100) { if(code === undefined) { @@ -923,10 +924,11 @@ payload['quality'] = quality; } - return http - .get(path, { - 'content-type': 'application/json', - }, payload); + payload['project'] = config.project; + + let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&'); + + return config.endpoint + path + ((query) ? '?' + query : ''); }, /** @@ -937,7 +939,7 @@ * * @param {string} url * @throws {Error} - * @return {Promise} + * @return {string} */ getFavicon: function(url) { if(url === undefined) { @@ -952,10 +954,11 @@ payload['url'] = url; } - return http - .get(path, { - 'content-type': 'application/json', - }, payload); + payload['project'] = config.project; + + let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&'); + + return config.endpoint + path + ((query) ? '?' + query : ''); }, /** @@ -970,7 +973,7 @@ * @param {number} height * @param {number} quality * @throws {Error} - * @return {Promise} + * @return {string} */ getFlag: function(code, width = 100, height = 100, quality = 100) { if(code === undefined) { @@ -993,10 +996,11 @@ payload['quality'] = quality; } - return http - .get(path, { - 'content-type': 'application/json', - }, payload); + payload['project'] = config.project; + + let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&'); + + return config.endpoint + path + ((query) ? '?' + query : ''); }, /** @@ -1011,7 +1015,7 @@ * @param {number} width * @param {number} height * @throws {Error} - * @return {Promise} + * @return {string} */ getImage: function(url, width = 400, height = 400) { if(url === undefined) { @@ -1034,10 +1038,11 @@ payload['height'] = height; } - return http - .get(path, { - 'content-type': 'application/json', - }, payload); + payload['project'] = config.project; + + let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&'); + + return config.endpoint + path + ((query) ? '?' + query : ''); }, /** @@ -1051,7 +1056,7 @@ * @param {number} margin * @param {number} download * @throws {Error} - * @return {Promise} + * @return {string} */ getQR: function(text, size = 400, margin = 1, download = 0) { if(text === undefined) { @@ -1078,10 +1083,11 @@ payload['download'] = download; } - return http - .get(path, { - 'content-type': 'application/json', - }, payload); + payload['project'] = config.project; + + let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&'); + + return config.endpoint + path + ((query) ? '?' + query : ''); } }; diff --git a/app/sdks/web-javascript/src/sdk.min.js b/app/sdks/client-web/src/sdk.min.js similarity index 90% rename from app/sdks/web-javascript/src/sdk.min.js rename to app/sdks/client-web/src/sdk.min.js index b2af28282a..113a3402b8 100644 --- a/app/sdks/web-javascript/src/sdk.min.js +++ b/app/sdks/client-web/src/sdk.min.js @@ -1,5 +1,5 @@ (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;indexkey+'='+encodeURIComponent(payload[key])).join('&');window.location=config.endpoint+path+((query)?'?'+query:'')},deleteSession:function(sessionId){if(sessionId===undefined){throw new Error('Missing required parameter: "sessionId"')} @@ -59,26 +59,26 @@ return http.put(path,{'content-type':'application/json',},payload)}};let avatars 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} -return http.get(path,{'content-type':'application/json',},payload)},getCreditCard:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')} +payload.project=config.project;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},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} -return http.get(path,{'content-type':'application/json',},payload)},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"')} +payload.project=config.project;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"')} let path='/avatars/favicon';let payload={};if(url){payload.url=url} -return http.get(path,{'content-type':'application/json',},payload)},getFlag:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')} +payload.project=config.project;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},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} -return http.get(path,{'content-type':'application/json',},payload)},getImage:function(url,width=400,height=400){if(url===undefined){throw new Error('Missing required parameter: "url"')} +payload.project=config.project;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},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} -return http.get(path,{'content-type':'application/json',},payload)},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"')} +payload.project=config.project;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},getQR:function(text,size=400,margin=1,download=0){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} -return http.get(path,{'content-type':'application/json',},payload)}};let database={listDocuments:function(collectionId,filters=[],offset=0,limit=50,orderField='$id',orderType='ASC',orderCast='string',search='',first=0,last=0){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')} +payload.project=config.project;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')}};let database={listDocuments:function(collectionId,filters=[],offset=0,limit=50,orderField='$id',orderType='ASC',orderCast='string',search='',first=0,last=0){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(offset){payload.offset=offset} if(limit){payload.limit=limit} diff --git a/app/sdks/console-javascript/tsconfig.json b/app/sdks/client-web/tsconfig.json similarity index 100% rename from app/sdks/console-javascript/tsconfig.json rename to app/sdks/client-web/tsconfig.json diff --git a/app/sdks/web-javascript/types/index.d.ts b/app/sdks/client-web/types/index.d.ts similarity index 98% rename from app/sdks/web-javascript/types/index.d.ts rename to app/sdks/client-web/types/index.d.ts index 638f15d2dd..f2bc108bc4 100644 --- a/app/sdks/web-javascript/types/index.d.ts +++ b/app/sdks/client-web/types/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for appwrite 1.0.29 +// Type definitions for appwrite 1.1.0 // Project: Appwrite @@ -321,9 +321,9 @@ declare namespace Appwrite { * @param {number} height * @param {number} quality * @throws {Error} - * @return {Promise} + * @return {string} */ - getBrowser(code: string, width: number, height: number, quality: number): Promise; + getBrowser(code: string, width: number, height: number, quality: number): string; /** * Get Credit Card Icon @@ -338,9 +338,9 @@ declare namespace Appwrite { * @param {number} height * @param {number} quality * @throws {Error} - * @return {Promise} + * @return {string} */ - getCreditCard(code: string, width: number, height: number, quality: number): Promise; + getCreditCard(code: string, width: number, height: number, quality: number): string; /** * Get Favicon @@ -350,9 +350,9 @@ declare namespace Appwrite { * * @param {string} url * @throws {Error} - * @return {Promise} + * @return {string} */ - getFavicon(url: string): Promise; + getFavicon(url: string): string; /** * Get Country Flag @@ -366,9 +366,9 @@ declare namespace Appwrite { * @param {number} height * @param {number} quality * @throws {Error} - * @return {Promise} + * @return {string} */ - getFlag(code: string, width: number, height: number, quality: number): Promise; + getFlag(code: string, width: number, height: number, quality: number): string; /** * Get Image from URL @@ -382,9 +382,9 @@ declare namespace Appwrite { * @param {number} width * @param {number} height * @throws {Error} - * @return {Promise} + * @return {string} */ - getImage(url: string, width: number, height: number): Promise; + getImage(url: string, width: number, height: number): string; /** * Get QR Code @@ -397,9 +397,9 @@ declare namespace Appwrite { * @param {number} margin * @param {number} download * @throws {Error} - * @return {Promise} + * @return {string} */ - getQR(text: string, size: number, margin: number, download: number): Promise; + getQR(text: string, size: number, margin: number, download: number): string; } diff --git a/app/sdks/console-javascript/docs/examples/avatars/get-browser.md b/app/sdks/console-javascript/docs/examples/avatars/get-browser.md deleted file mode 100644 index fd5959f1bb..0000000000 --- a/app/sdks/console-javascript/docs/examples/avatars/get-browser.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = sdk.avatars.getBrowser('aa'); - -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-javascript/docs/examples/avatars/get-credit-card.md b/app/sdks/console-javascript/docs/examples/avatars/get-credit-card.md deleted file mode 100644 index 45c87c783a..0000000000 --- a/app/sdks/console-javascript/docs/examples/avatars/get-credit-card.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = sdk.avatars.getCreditCard('amex'); - -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-javascript/docs/examples/avatars/get-favicon.md b/app/sdks/console-javascript/docs/examples/avatars/get-favicon.md deleted file mode 100644 index 2b8d94c4c6..0000000000 --- a/app/sdks/console-javascript/docs/examples/avatars/get-favicon.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = sdk.avatars.getFavicon('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-javascript/docs/examples/avatars/get-flag.md b/app/sdks/console-javascript/docs/examples/avatars/get-flag.md deleted file mode 100644 index a2723be671..0000000000 --- a/app/sdks/console-javascript/docs/examples/avatars/get-flag.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = sdk.avatars.getFlag('af'); - -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-javascript/docs/examples/avatars/get-image.md b/app/sdks/console-javascript/docs/examples/avatars/get-image.md deleted file mode 100644 index c9d6b6cf79..0000000000 --- a/app/sdks/console-javascript/docs/examples/avatars/get-image.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = sdk.avatars.getImage('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-javascript/docs/examples/avatars/get-q-r.md b/app/sdks/console-javascript/docs/examples/avatars/get-q-r.md deleted file mode 100644 index 39938a47bf..0000000000 --- a/app/sdks/console-javascript/docs/examples/avatars/get-q-r.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = sdk.avatars.getQR('[TEXT]'); - -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-javascript/docs/examples/health/get-storage-anti-virus.md b/app/sdks/console-javascript/docs/examples/health/get-storage-anti-virus.md deleted file mode 100644 index 06cc087c43..0000000000 --- a/app/sdks/console-javascript/docs/examples/health/get-storage-anti-virus.md +++ /dev/null @@ -1,14 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = sdk.health.getStorageAntiVirus(); - -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/web-javascript/CHANGELOG.md b/app/sdks/console-web/CHANGELOG.md similarity index 100% rename from app/sdks/web-javascript/CHANGELOG.md rename to app/sdks/console-web/CHANGELOG.md diff --git a/app/sdks/web-javascript/LICENSE b/app/sdks/console-web/LICENSE similarity index 100% rename from app/sdks/web-javascript/LICENSE rename to app/sdks/console-web/LICENSE diff --git a/app/sdks/console-javascript/README.md b/app/sdks/console-web/README.md similarity index 73% rename from app/sdks/console-javascript/README.md rename to app/sdks/console-web/README.md index 3911d7c430..8d44e2769b 100644 --- a/app/sdks/console-javascript/README.md +++ b/app/sdks/console-web/README.md @@ -1,10 +1,10 @@ -# Appwrite SDK for JavaScript +# 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.5.3-blue.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 JS SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. + 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) @@ -33,21 +33,6 @@ To install with a CDN (content delivery network) add the following scripts to th ``` -## Getting Started - -Initialise the Appwrite SDK in your code, and setup your API credentials: - -```js - -// Init your JS SDK -var appwrite = new Appwrite(); - -appwrite - .setEndpoint('http://localhost/v1') // Set only when using self-hosted solution - .setProject('455x34dfkj') // Your Appwrite Project UID -; - -``` ## Contribution diff --git a/app/sdks/console-javascript/docs/examples/account/create-o-auth2session.md b/app/sdks/console-web/docs/examples/account/create-o-auth2session.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/account/create-o-auth2session.md rename to app/sdks/console-web/docs/examples/account/create-o-auth2session.md index b66e4360c6..bea25a368f 100644 --- a/app/sdks/console-javascript/docs/examples/account/create-o-auth2session.md +++ b/app/sdks/console-web/docs/examples/account/create-o-auth2session.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/account/create-recovery.md b/app/sdks/console-web/docs/examples/account/create-recovery.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/account/create-recovery.md rename to app/sdks/console-web/docs/examples/account/create-recovery.md index 7b636943e3..d69269b351 100644 --- a/app/sdks/console-javascript/docs/examples/account/create-recovery.md +++ b/app/sdks/console-web/docs/examples/account/create-recovery.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/account/create-session.md b/app/sdks/console-web/docs/examples/account/create-session.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/account/create-session.md rename to app/sdks/console-web/docs/examples/account/create-session.md index 1f930eddc5..0734a84aaa 100644 --- a/app/sdks/console-javascript/docs/examples/account/create-session.md +++ b/app/sdks/console-web/docs/examples/account/create-session.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/account/create-verification.md b/app/sdks/console-web/docs/examples/account/create-verification.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/account/create-verification.md rename to app/sdks/console-web/docs/examples/account/create-verification.md index d9088638df..1211b5c642 100644 --- a/app/sdks/console-javascript/docs/examples/account/create-verification.md +++ b/app/sdks/console-web/docs/examples/account/create-verification.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/account/create.md b/app/sdks/console-web/docs/examples/account/create.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/account/create.md rename to app/sdks/console-web/docs/examples/account/create.md index ef9b9b7f95..e61b1fbac4 100644 --- a/app/sdks/console-javascript/docs/examples/account/create.md +++ b/app/sdks/console-web/docs/examples/account/create.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/account/delete-session.md b/app/sdks/console-web/docs/examples/account/delete-session.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/account/delete-session.md rename to app/sdks/console-web/docs/examples/account/delete-session.md index 7d813a356c..84505281f0 100644 --- a/app/sdks/console-javascript/docs/examples/account/delete-session.md +++ b/app/sdks/console-web/docs/examples/account/delete-session.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/account/delete-sessions.md b/app/sdks/console-web/docs/examples/account/delete-sessions.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/account/delete-sessions.md rename to app/sdks/console-web/docs/examples/account/delete-sessions.md index fef0113dc7..61bec86399 100644 --- a/app/sdks/console-javascript/docs/examples/account/delete-sessions.md +++ b/app/sdks/console-web/docs/examples/account/delete-sessions.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/account/delete.md b/app/sdks/console-web/docs/examples/account/delete.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/account/delete.md rename to app/sdks/console-web/docs/examples/account/delete.md index cc953421a5..dbb8dbf250 100644 --- a/app/sdks/console-javascript/docs/examples/account/delete.md +++ b/app/sdks/console-web/docs/examples/account/delete.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/account/get-logs.md b/app/sdks/console-web/docs/examples/account/get-logs.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/account/get-logs.md rename to app/sdks/console-web/docs/examples/account/get-logs.md index 9186ca2ab3..12e6656c96 100644 --- a/app/sdks/console-javascript/docs/examples/account/get-logs.md +++ b/app/sdks/console-web/docs/examples/account/get-logs.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/account/get-prefs.md b/app/sdks/console-web/docs/examples/account/get-prefs.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/account/get-prefs.md rename to app/sdks/console-web/docs/examples/account/get-prefs.md index c80508e3ee..e328baba32 100644 --- a/app/sdks/console-javascript/docs/examples/account/get-prefs.md +++ b/app/sdks/console-web/docs/examples/account/get-prefs.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/account/get-sessions.md b/app/sdks/console-web/docs/examples/account/get-sessions.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/account/get-sessions.md rename to app/sdks/console-web/docs/examples/account/get-sessions.md index 1595e7a7ee..cb281dd4db 100644 --- a/app/sdks/console-javascript/docs/examples/account/get-sessions.md +++ b/app/sdks/console-web/docs/examples/account/get-sessions.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/account/get.md b/app/sdks/console-web/docs/examples/account/get.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/account/get.md rename to app/sdks/console-web/docs/examples/account/get.md index 8e88b195ae..82c96fb9db 100644 --- a/app/sdks/console-javascript/docs/examples/account/get.md +++ b/app/sdks/console-web/docs/examples/account/get.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/account/update-email.md b/app/sdks/console-web/docs/examples/account/update-email.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/account/update-email.md rename to app/sdks/console-web/docs/examples/account/update-email.md index c53eb579aa..c2caaf060e 100644 --- a/app/sdks/console-javascript/docs/examples/account/update-email.md +++ b/app/sdks/console-web/docs/examples/account/update-email.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/account/update-name.md b/app/sdks/console-web/docs/examples/account/update-name.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/account/update-name.md rename to app/sdks/console-web/docs/examples/account/update-name.md index f9a3fdeffd..047eba688b 100644 --- a/app/sdks/console-javascript/docs/examples/account/update-name.md +++ b/app/sdks/console-web/docs/examples/account/update-name.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/account/update-password.md b/app/sdks/console-web/docs/examples/account/update-password.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/account/update-password.md rename to app/sdks/console-web/docs/examples/account/update-password.md index a0058d972a..d305031fa0 100644 --- a/app/sdks/console-javascript/docs/examples/account/update-password.md +++ b/app/sdks/console-web/docs/examples/account/update-password.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/account/update-prefs.md b/app/sdks/console-web/docs/examples/account/update-prefs.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/account/update-prefs.md rename to app/sdks/console-web/docs/examples/account/update-prefs.md index fa55eea179..8c4e402ae1 100644 --- a/app/sdks/console-javascript/docs/examples/account/update-prefs.md +++ b/app/sdks/console-web/docs/examples/account/update-prefs.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/account/update-recovery.md b/app/sdks/console-web/docs/examples/account/update-recovery.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/account/update-recovery.md rename to app/sdks/console-web/docs/examples/account/update-recovery.md index 883df2f9b2..235a4db481 100644 --- a/app/sdks/console-javascript/docs/examples/account/update-recovery.md +++ b/app/sdks/console-web/docs/examples/account/update-recovery.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/account/update-verification.md b/app/sdks/console-web/docs/examples/account/update-verification.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/account/update-verification.md rename to app/sdks/console-web/docs/examples/account/update-verification.md index d04203a3cb..ef2c384853 100644 --- a/app/sdks/console-javascript/docs/examples/account/update-verification.md +++ b/app/sdks/console-web/docs/examples/account/update-verification.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-web/docs/examples/avatars/get-browser.md b/app/sdks/console-web/docs/examples/avatars/get-browser.md new file mode 100644 index 0000000000..cd89107b91 --- /dev/null +++ b/app/sdks/console-web/docs/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 diff --git a/app/sdks/console-web/docs/examples/avatars/get-credit-card.md b/app/sdks/console-web/docs/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..4906a4127c --- /dev/null +++ b/app/sdks/console-web/docs/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 diff --git a/app/sdks/console-web/docs/examples/avatars/get-favicon.md b/app/sdks/console-web/docs/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..ec53212364 --- /dev/null +++ b/app/sdks/console-web/docs/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 diff --git a/app/sdks/console-web/docs/examples/avatars/get-flag.md b/app/sdks/console-web/docs/examples/avatars/get-flag.md new file mode 100644 index 0000000000..87122bddb3 --- /dev/null +++ b/app/sdks/console-web/docs/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 diff --git a/app/sdks/console-web/docs/examples/avatars/get-image.md b/app/sdks/console-web/docs/examples/avatars/get-image.md new file mode 100644 index 0000000000..d6789db732 --- /dev/null +++ b/app/sdks/console-web/docs/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 diff --git a/app/sdks/console-web/docs/examples/avatars/get-q-r.md b/app/sdks/console-web/docs/examples/avatars/get-q-r.md new file mode 100644 index 0000000000..93d3438746 --- /dev/null +++ b/app/sdks/console-web/docs/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 diff --git a/app/sdks/console-javascript/docs/examples/database/create-collection.md b/app/sdks/console-web/docs/examples/database/create-collection.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/database/create-collection.md rename to app/sdks/console-web/docs/examples/database/create-collection.md index 13bd67171c..a7a4b90197 100644 --- a/app/sdks/console-javascript/docs/examples/database/create-collection.md +++ b/app/sdks/console-web/docs/examples/database/create-collection.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/database/create-document.md b/app/sdks/console-web/docs/examples/database/create-document.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/database/create-document.md rename to app/sdks/console-web/docs/examples/database/create-document.md index 41908a3820..64809c6156 100644 --- a/app/sdks/console-javascript/docs/examples/database/create-document.md +++ b/app/sdks/console-web/docs/examples/database/create-document.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/database/delete-collection.md b/app/sdks/console-web/docs/examples/database/delete-collection.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/database/delete-collection.md rename to app/sdks/console-web/docs/examples/database/delete-collection.md index 4a7753685b..bfb0706bf5 100644 --- a/app/sdks/console-javascript/docs/examples/database/delete-collection.md +++ b/app/sdks/console-web/docs/examples/database/delete-collection.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/database/delete-document.md b/app/sdks/console-web/docs/examples/database/delete-document.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/database/delete-document.md rename to app/sdks/console-web/docs/examples/database/delete-document.md index 246454a0d4..356a71a437 100644 --- a/app/sdks/console-javascript/docs/examples/database/delete-document.md +++ b/app/sdks/console-web/docs/examples/database/delete-document.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/database/get-collection-logs.md b/app/sdks/console-web/docs/examples/database/get-collection-logs.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/database/get-collection-logs.md rename to app/sdks/console-web/docs/examples/database/get-collection-logs.md index 09a05445ed..8934910901 100644 --- a/app/sdks/console-javascript/docs/examples/database/get-collection-logs.md +++ b/app/sdks/console-web/docs/examples/database/get-collection-logs.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/database/get-collection.md b/app/sdks/console-web/docs/examples/database/get-collection.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/database/get-collection.md rename to app/sdks/console-web/docs/examples/database/get-collection.md index c58d3bf21e..d74d4b3225 100644 --- a/app/sdks/console-javascript/docs/examples/database/get-collection.md +++ b/app/sdks/console-web/docs/examples/database/get-collection.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/database/get-document.md b/app/sdks/console-web/docs/examples/database/get-document.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/database/get-document.md rename to app/sdks/console-web/docs/examples/database/get-document.md index 7674814399..51638880c5 100644 --- a/app/sdks/console-javascript/docs/examples/database/get-document.md +++ b/app/sdks/console-web/docs/examples/database/get-document.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/database/list-collections.md b/app/sdks/console-web/docs/examples/database/list-collections.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/database/list-collections.md rename to app/sdks/console-web/docs/examples/database/list-collections.md index 73a45b621a..8a18249748 100644 --- a/app/sdks/console-javascript/docs/examples/database/list-collections.md +++ b/app/sdks/console-web/docs/examples/database/list-collections.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/database/list-documents.md b/app/sdks/console-web/docs/examples/database/list-documents.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/database/list-documents.md rename to app/sdks/console-web/docs/examples/database/list-documents.md index 10100f59d5..1d895a566a 100644 --- a/app/sdks/console-javascript/docs/examples/database/list-documents.md +++ b/app/sdks/console-web/docs/examples/database/list-documents.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/database/update-collection.md b/app/sdks/console-web/docs/examples/database/update-collection.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/database/update-collection.md rename to app/sdks/console-web/docs/examples/database/update-collection.md index c3d663bb1e..f00a6c6f8c 100644 --- a/app/sdks/console-javascript/docs/examples/database/update-collection.md +++ b/app/sdks/console-web/docs/examples/database/update-collection.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/database/update-document.md b/app/sdks/console-web/docs/examples/database/update-document.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/database/update-document.md rename to app/sdks/console-web/docs/examples/database/update-document.md index d4570fe32b..52c172ab6a 100644 --- a/app/sdks/console-javascript/docs/examples/database/update-document.md +++ b/app/sdks/console-web/docs/examples/database/update-document.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-web/docs/examples/health/get-anti-virus.md b/app/sdks/console-web/docs/examples/health/get-anti-virus.md new file mode 100644 index 0000000000..95b671992b --- /dev/null +++ b/app/sdks/console-web/docs/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/app/sdks/console-javascript/docs/examples/health/get-cache.md b/app/sdks/console-web/docs/examples/health/get-cache.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/health/get-cache.md rename to app/sdks/console-web/docs/examples/health/get-cache.md index 046c5ea191..5c41d81868 100644 --- a/app/sdks/console-javascript/docs/examples/health/get-cache.md +++ b/app/sdks/console-web/docs/examples/health/get-cache.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/health/get-d-b.md b/app/sdks/console-web/docs/examples/health/get-d-b.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/health/get-d-b.md rename to app/sdks/console-web/docs/examples/health/get-d-b.md index 5ce56a6c4e..407f87e2a1 100644 --- a/app/sdks/console-javascript/docs/examples/health/get-d-b.md +++ b/app/sdks/console-web/docs/examples/health/get-d-b.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/health/get-queue-certificates.md b/app/sdks/console-web/docs/examples/health/get-queue-certificates.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/health/get-queue-certificates.md rename to app/sdks/console-web/docs/examples/health/get-queue-certificates.md index 0ab304c378..a115c869ba 100644 --- a/app/sdks/console-javascript/docs/examples/health/get-queue-certificates.md +++ b/app/sdks/console-web/docs/examples/health/get-queue-certificates.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-web/docs/examples/health/get-queue-functions.md b/app/sdks/console-web/docs/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..3c0dc33acf --- /dev/null +++ b/app/sdks/console-web/docs/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/app/sdks/console-javascript/docs/examples/health/get-queue-logs.md b/app/sdks/console-web/docs/examples/health/get-queue-logs.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/health/get-queue-logs.md rename to app/sdks/console-web/docs/examples/health/get-queue-logs.md index 35078edc21..b3d41b49c6 100644 --- a/app/sdks/console-javascript/docs/examples/health/get-queue-logs.md +++ b/app/sdks/console-web/docs/examples/health/get-queue-logs.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/health/get-queue-tasks.md b/app/sdks/console-web/docs/examples/health/get-queue-tasks.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/health/get-queue-tasks.md rename to app/sdks/console-web/docs/examples/health/get-queue-tasks.md index 90ae978371..4f34f670a6 100644 --- a/app/sdks/console-javascript/docs/examples/health/get-queue-tasks.md +++ b/app/sdks/console-web/docs/examples/health/get-queue-tasks.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/health/get-queue-usage.md b/app/sdks/console-web/docs/examples/health/get-queue-usage.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/health/get-queue-usage.md rename to app/sdks/console-web/docs/examples/health/get-queue-usage.md index 1c04d04fe9..3d234be2de 100644 --- a/app/sdks/console-javascript/docs/examples/health/get-queue-usage.md +++ b/app/sdks/console-web/docs/examples/health/get-queue-usage.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/health/get-queue-webhooks.md b/app/sdks/console-web/docs/examples/health/get-queue-webhooks.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/health/get-queue-webhooks.md rename to app/sdks/console-web/docs/examples/health/get-queue-webhooks.md index 18970f2157..c5825dcf6c 100644 --- a/app/sdks/console-javascript/docs/examples/health/get-queue-webhooks.md +++ b/app/sdks/console-web/docs/examples/health/get-queue-webhooks.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/health/get-storage-local.md b/app/sdks/console-web/docs/examples/health/get-storage-local.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/health/get-storage-local.md rename to app/sdks/console-web/docs/examples/health/get-storage-local.md index f034f47f9a..7287745704 100644 --- a/app/sdks/console-javascript/docs/examples/health/get-storage-local.md +++ b/app/sdks/console-web/docs/examples/health/get-storage-local.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/health/get-time.md b/app/sdks/console-web/docs/examples/health/get-time.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/health/get-time.md rename to app/sdks/console-web/docs/examples/health/get-time.md index d579c981a3..b6087b73d5 100644 --- a/app/sdks/console-javascript/docs/examples/health/get-time.md +++ b/app/sdks/console-web/docs/examples/health/get-time.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/health/get.md b/app/sdks/console-web/docs/examples/health/get.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/health/get.md rename to app/sdks/console-web/docs/examples/health/get.md index 0f7b186341..1e7d6fe4e8 100644 --- a/app/sdks/console-javascript/docs/examples/health/get.md +++ b/app/sdks/console-web/docs/examples/health/get.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/locale/get-continents.md b/app/sdks/console-web/docs/examples/locale/get-continents.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/locale/get-continents.md rename to app/sdks/console-web/docs/examples/locale/get-continents.md index f21e10337d..93144335ea 100644 --- a/app/sdks/console-javascript/docs/examples/locale/get-continents.md +++ b/app/sdks/console-web/docs/examples/locale/get-continents.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/locale/get-countries-e-u.md b/app/sdks/console-web/docs/examples/locale/get-countries-e-u.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/locale/get-countries-e-u.md rename to app/sdks/console-web/docs/examples/locale/get-countries-e-u.md index 7ade8b1808..fffc8696e8 100644 --- a/app/sdks/console-javascript/docs/examples/locale/get-countries-e-u.md +++ b/app/sdks/console-web/docs/examples/locale/get-countries-e-u.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/locale/get-countries-phones.md b/app/sdks/console-web/docs/examples/locale/get-countries-phones.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/locale/get-countries-phones.md rename to app/sdks/console-web/docs/examples/locale/get-countries-phones.md index bc0fb2a6f5..751f4f6cc4 100644 --- a/app/sdks/console-javascript/docs/examples/locale/get-countries-phones.md +++ b/app/sdks/console-web/docs/examples/locale/get-countries-phones.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/locale/get-countries.md b/app/sdks/console-web/docs/examples/locale/get-countries.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/locale/get-countries.md rename to app/sdks/console-web/docs/examples/locale/get-countries.md index 21dd02a789..30b1dd95c7 100644 --- a/app/sdks/console-javascript/docs/examples/locale/get-countries.md +++ b/app/sdks/console-web/docs/examples/locale/get-countries.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/locale/get-currencies.md b/app/sdks/console-web/docs/examples/locale/get-currencies.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/locale/get-currencies.md rename to app/sdks/console-web/docs/examples/locale/get-currencies.md index 617398e2f3..4c92714062 100644 --- a/app/sdks/console-javascript/docs/examples/locale/get-currencies.md +++ b/app/sdks/console-web/docs/examples/locale/get-currencies.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/locale/get.md b/app/sdks/console-web/docs/examples/locale/get.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/locale/get.md rename to app/sdks/console-web/docs/examples/locale/get.md index ad06454b69..1fba9877b5 100644 --- a/app/sdks/console-javascript/docs/examples/locale/get.md +++ b/app/sdks/console-web/docs/examples/locale/get.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/create-domain.md b/app/sdks/console-web/docs/examples/projects/create-domain.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/projects/create-domain.md rename to app/sdks/console-web/docs/examples/projects/create-domain.md index 3362de91c3..756b869a85 100644 --- a/app/sdks/console-javascript/docs/examples/projects/create-domain.md +++ b/app/sdks/console-web/docs/examples/projects/create-domain.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/create-key.md b/app/sdks/console-web/docs/examples/projects/create-key.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/projects/create-key.md rename to app/sdks/console-web/docs/examples/projects/create-key.md index 1632d24862..9556f5b7f7 100644 --- a/app/sdks/console-javascript/docs/examples/projects/create-key.md +++ b/app/sdks/console-web/docs/examples/projects/create-key.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/create-platform.md b/app/sdks/console-web/docs/examples/projects/create-platform.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/projects/create-platform.md rename to app/sdks/console-web/docs/examples/projects/create-platform.md index 474640705a..f4476fe599 100644 --- a/app/sdks/console-javascript/docs/examples/projects/create-platform.md +++ b/app/sdks/console-web/docs/examples/projects/create-platform.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/create-task.md b/app/sdks/console-web/docs/examples/projects/create-task.md similarity index 85% rename from app/sdks/console-javascript/docs/examples/projects/create-task.md rename to app/sdks/console-web/docs/examples/projects/create-task.md index ccec45a35a..5698d000e8 100644 --- a/app/sdks/console-javascript/docs/examples/projects/create-task.md +++ b/app/sdks/console-web/docs/examples/projects/create-task.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/create-webhook.md b/app/sdks/console-web/docs/examples/projects/create-webhook.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/projects/create-webhook.md rename to app/sdks/console-web/docs/examples/projects/create-webhook.md index 4bb7400949..728786f9fb 100644 --- a/app/sdks/console-javascript/docs/examples/projects/create-webhook.md +++ b/app/sdks/console-web/docs/examples/projects/create-webhook.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/create.md b/app/sdks/console-web/docs/examples/projects/create.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/projects/create.md rename to app/sdks/console-web/docs/examples/projects/create.md index c5cfac1bc4..8041ed154e 100644 --- a/app/sdks/console-javascript/docs/examples/projects/create.md +++ b/app/sdks/console-web/docs/examples/projects/create.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/delete-domain.md b/app/sdks/console-web/docs/examples/projects/delete-domain.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/projects/delete-domain.md rename to app/sdks/console-web/docs/examples/projects/delete-domain.md index 04d4c18343..1b3df9363b 100644 --- a/app/sdks/console-javascript/docs/examples/projects/delete-domain.md +++ b/app/sdks/console-web/docs/examples/projects/delete-domain.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/delete-key.md b/app/sdks/console-web/docs/examples/projects/delete-key.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/projects/delete-key.md rename to app/sdks/console-web/docs/examples/projects/delete-key.md index f71b115718..dc855bcc30 100644 --- a/app/sdks/console-javascript/docs/examples/projects/delete-key.md +++ b/app/sdks/console-web/docs/examples/projects/delete-key.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/delete-platform.md b/app/sdks/console-web/docs/examples/projects/delete-platform.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/projects/delete-platform.md rename to app/sdks/console-web/docs/examples/projects/delete-platform.md index 2f29f97b5a..2a180c47e4 100644 --- a/app/sdks/console-javascript/docs/examples/projects/delete-platform.md +++ b/app/sdks/console-web/docs/examples/projects/delete-platform.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/delete-task.md b/app/sdks/console-web/docs/examples/projects/delete-task.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/projects/delete-task.md rename to app/sdks/console-web/docs/examples/projects/delete-task.md index 5c82493859..b7f9ad3e47 100644 --- a/app/sdks/console-javascript/docs/examples/projects/delete-task.md +++ b/app/sdks/console-web/docs/examples/projects/delete-task.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/delete-webhook.md b/app/sdks/console-web/docs/examples/projects/delete-webhook.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/projects/delete-webhook.md rename to app/sdks/console-web/docs/examples/projects/delete-webhook.md index 776df8864a..c5e0588ad1 100644 --- a/app/sdks/console-javascript/docs/examples/projects/delete-webhook.md +++ b/app/sdks/console-web/docs/examples/projects/delete-webhook.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/delete.md b/app/sdks/console-web/docs/examples/projects/delete.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/projects/delete.md rename to app/sdks/console-web/docs/examples/projects/delete.md index ae4ff5ccb1..20b67370f0 100644 --- a/app/sdks/console-javascript/docs/examples/projects/delete.md +++ b/app/sdks/console-web/docs/examples/projects/delete.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/get-domain.md b/app/sdks/console-web/docs/examples/projects/get-domain.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/projects/get-domain.md rename to app/sdks/console-web/docs/examples/projects/get-domain.md index 4b3d9c52ed..1622546719 100644 --- a/app/sdks/console-javascript/docs/examples/projects/get-domain.md +++ b/app/sdks/console-web/docs/examples/projects/get-domain.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/get-key.md b/app/sdks/console-web/docs/examples/projects/get-key.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/projects/get-key.md rename to app/sdks/console-web/docs/examples/projects/get-key.md index 8cecb69760..8bb458c335 100644 --- a/app/sdks/console-javascript/docs/examples/projects/get-key.md +++ b/app/sdks/console-web/docs/examples/projects/get-key.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/get-platform.md b/app/sdks/console-web/docs/examples/projects/get-platform.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/projects/get-platform.md rename to app/sdks/console-web/docs/examples/projects/get-platform.md index 2968e093ef..bfeb49393b 100644 --- a/app/sdks/console-javascript/docs/examples/projects/get-platform.md +++ b/app/sdks/console-web/docs/examples/projects/get-platform.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/get-task.md b/app/sdks/console-web/docs/examples/projects/get-task.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/projects/get-task.md rename to app/sdks/console-web/docs/examples/projects/get-task.md index 4cdd44ec6c..c405299d74 100644 --- a/app/sdks/console-javascript/docs/examples/projects/get-task.md +++ b/app/sdks/console-web/docs/examples/projects/get-task.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/get-usage.md b/app/sdks/console-web/docs/examples/projects/get-usage.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/projects/get-usage.md rename to app/sdks/console-web/docs/examples/projects/get-usage.md index 3503d3ee1a..e024a2966c 100644 --- a/app/sdks/console-javascript/docs/examples/projects/get-usage.md +++ b/app/sdks/console-web/docs/examples/projects/get-usage.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/get-webhook.md b/app/sdks/console-web/docs/examples/projects/get-webhook.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/projects/get-webhook.md rename to app/sdks/console-web/docs/examples/projects/get-webhook.md index 0d92c8a507..2629d4424d 100644 --- a/app/sdks/console-javascript/docs/examples/projects/get-webhook.md +++ b/app/sdks/console-web/docs/examples/projects/get-webhook.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/get.md b/app/sdks/console-web/docs/examples/projects/get.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/projects/get.md rename to app/sdks/console-web/docs/examples/projects/get.md index 98b4ef15ad..bcfb35186b 100644 --- a/app/sdks/console-javascript/docs/examples/projects/get.md +++ b/app/sdks/console-web/docs/examples/projects/get.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/list-domains.md b/app/sdks/console-web/docs/examples/projects/list-domains.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/projects/list-domains.md rename to app/sdks/console-web/docs/examples/projects/list-domains.md index 48dcaaf31e..5ddfec49b5 100644 --- a/app/sdks/console-javascript/docs/examples/projects/list-domains.md +++ b/app/sdks/console-web/docs/examples/projects/list-domains.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/list-keys.md b/app/sdks/console-web/docs/examples/projects/list-keys.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/projects/list-keys.md rename to app/sdks/console-web/docs/examples/projects/list-keys.md index 122ff5d676..497ddf9bac 100644 --- a/app/sdks/console-javascript/docs/examples/projects/list-keys.md +++ b/app/sdks/console-web/docs/examples/projects/list-keys.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/list-platforms.md b/app/sdks/console-web/docs/examples/projects/list-platforms.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/projects/list-platforms.md rename to app/sdks/console-web/docs/examples/projects/list-platforms.md index 3dba8f1be4..4fd2d311f3 100644 --- a/app/sdks/console-javascript/docs/examples/projects/list-platforms.md +++ b/app/sdks/console-web/docs/examples/projects/list-platforms.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/list-tasks.md b/app/sdks/console-web/docs/examples/projects/list-tasks.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/projects/list-tasks.md rename to app/sdks/console-web/docs/examples/projects/list-tasks.md index dfbd51039d..d42efc2b80 100644 --- a/app/sdks/console-javascript/docs/examples/projects/list-tasks.md +++ b/app/sdks/console-web/docs/examples/projects/list-tasks.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/list-webhooks.md b/app/sdks/console-web/docs/examples/projects/list-webhooks.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/projects/list-webhooks.md rename to app/sdks/console-web/docs/examples/projects/list-webhooks.md index 32660f6447..6c45849399 100644 --- a/app/sdks/console-javascript/docs/examples/projects/list-webhooks.md +++ b/app/sdks/console-web/docs/examples/projects/list-webhooks.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/list.md b/app/sdks/console-web/docs/examples/projects/list.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/projects/list.md rename to app/sdks/console-web/docs/examples/projects/list.md index 32a2e112cc..428fc4545f 100644 --- a/app/sdks/console-javascript/docs/examples/projects/list.md +++ b/app/sdks/console-web/docs/examples/projects/list.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/update-domain-verification.md b/app/sdks/console-web/docs/examples/projects/update-domain-verification.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/projects/update-domain-verification.md rename to app/sdks/console-web/docs/examples/projects/update-domain-verification.md index 7a60d9443a..ea53295bcf 100644 --- a/app/sdks/console-javascript/docs/examples/projects/update-domain-verification.md +++ b/app/sdks/console-web/docs/examples/projects/update-domain-verification.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/update-key.md b/app/sdks/console-web/docs/examples/projects/update-key.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/projects/update-key.md rename to app/sdks/console-web/docs/examples/projects/update-key.md index 196e6ceac0..f19b593c9f 100644 --- a/app/sdks/console-javascript/docs/examples/projects/update-key.md +++ b/app/sdks/console-web/docs/examples/projects/update-key.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/update-o-auth2.md b/app/sdks/console-web/docs/examples/projects/update-o-auth2.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/projects/update-o-auth2.md rename to app/sdks/console-web/docs/examples/projects/update-o-auth2.md index 5c202778f5..4a82548a6a 100644 --- a/app/sdks/console-javascript/docs/examples/projects/update-o-auth2.md +++ b/app/sdks/console-web/docs/examples/projects/update-o-auth2.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/update-platform.md b/app/sdks/console-web/docs/examples/projects/update-platform.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/projects/update-platform.md rename to app/sdks/console-web/docs/examples/projects/update-platform.md index 606872f9ce..0e22080ed0 100644 --- a/app/sdks/console-javascript/docs/examples/projects/update-platform.md +++ b/app/sdks/console-web/docs/examples/projects/update-platform.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/update-task.md b/app/sdks/console-web/docs/examples/projects/update-task.md similarity index 85% rename from app/sdks/console-javascript/docs/examples/projects/update-task.md rename to app/sdks/console-web/docs/examples/projects/update-task.md index 8b23e7a0dc..dc95cfda9f 100644 --- a/app/sdks/console-javascript/docs/examples/projects/update-task.md +++ b/app/sdks/console-web/docs/examples/projects/update-task.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/update-webhook.md b/app/sdks/console-web/docs/examples/projects/update-webhook.md similarity index 85% rename from app/sdks/console-javascript/docs/examples/projects/update-webhook.md rename to app/sdks/console-web/docs/examples/projects/update-webhook.md index 6b1cc8cbed..b1ead71e92 100644 --- a/app/sdks/console-javascript/docs/examples/projects/update-webhook.md +++ b/app/sdks/console-web/docs/examples/projects/update-webhook.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/projects/update.md b/app/sdks/console-web/docs/examples/projects/update.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/projects/update.md rename to app/sdks/console-web/docs/examples/projects/update.md index 34cda4b9e2..9d06850534 100644 --- a/app/sdks/console-javascript/docs/examples/projects/update.md +++ b/app/sdks/console-web/docs/examples/projects/update.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/storage/create-file.md b/app/sdks/console-web/docs/examples/storage/create-file.md similarity index 84% rename from app/sdks/console-javascript/docs/examples/storage/create-file.md rename to app/sdks/console-web/docs/examples/storage/create-file.md index 0aa8829fe8..673777e380 100644 --- a/app/sdks/console-javascript/docs/examples/storage/create-file.md +++ b/app/sdks/console-web/docs/examples/storage/create-file.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/storage/delete-file.md b/app/sdks/console-web/docs/examples/storage/delete-file.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/storage/delete-file.md rename to app/sdks/console-web/docs/examples/storage/delete-file.md index e37c8937b0..7278b682ae 100644 --- a/app/sdks/console-javascript/docs/examples/storage/delete-file.md +++ b/app/sdks/console-web/docs/examples/storage/delete-file.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/storage/get-file-download.md b/app/sdks/console-web/docs/examples/storage/get-file-download.md similarity index 78% rename from app/sdks/console-javascript/docs/examples/storage/get-file-download.md rename to app/sdks/console-web/docs/examples/storage/get-file-download.md index 0d0ff8fc3e..5be3f81694 100644 --- a/app/sdks/console-javascript/docs/examples/storage/get-file-download.md +++ b/app/sdks/console-web/docs/examples/storage/get-file-download.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/storage/get-file-preview.md b/app/sdks/console-web/docs/examples/storage/get-file-preview.md similarity index 78% rename from app/sdks/console-javascript/docs/examples/storage/get-file-preview.md rename to app/sdks/console-web/docs/examples/storage/get-file-preview.md index 712b38917a..737ead95c3 100644 --- a/app/sdks/console-javascript/docs/examples/storage/get-file-preview.md +++ b/app/sdks/console-web/docs/examples/storage/get-file-preview.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/storage/get-file-view.md b/app/sdks/console-web/docs/examples/storage/get-file-view.md similarity index 78% rename from app/sdks/console-javascript/docs/examples/storage/get-file-view.md rename to app/sdks/console-web/docs/examples/storage/get-file-view.md index 08368f8b19..c9f73b7d28 100644 --- a/app/sdks/console-javascript/docs/examples/storage/get-file-view.md +++ b/app/sdks/console-web/docs/examples/storage/get-file-view.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/storage/get-file.md b/app/sdks/console-web/docs/examples/storage/get-file.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/storage/get-file.md rename to app/sdks/console-web/docs/examples/storage/get-file.md index f9707981b7..9691be3056 100644 --- a/app/sdks/console-javascript/docs/examples/storage/get-file.md +++ b/app/sdks/console-web/docs/examples/storage/get-file.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/storage/list-files.md b/app/sdks/console-web/docs/examples/storage/list-files.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/storage/list-files.md rename to app/sdks/console-web/docs/examples/storage/list-files.md index 3a40057b7c..5c2560d06d 100644 --- a/app/sdks/console-javascript/docs/examples/storage/list-files.md +++ b/app/sdks/console-web/docs/examples/storage/list-files.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/storage/update-file.md b/app/sdks/console-web/docs/examples/storage/update-file.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/storage/update-file.md rename to app/sdks/console-web/docs/examples/storage/update-file.md index 630ec6c9fc..c053d60470 100644 --- a/app/sdks/console-javascript/docs/examples/storage/update-file.md +++ b/app/sdks/console-web/docs/examples/storage/update-file.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/teams/create-membership.md b/app/sdks/console-web/docs/examples/teams/create-membership.md similarity index 85% rename from app/sdks/console-javascript/docs/examples/teams/create-membership.md rename to app/sdks/console-web/docs/examples/teams/create-membership.md index 7d60897edf..534577ead3 100644 --- a/app/sdks/console-javascript/docs/examples/teams/create-membership.md +++ b/app/sdks/console-web/docs/examples/teams/create-membership.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/teams/create.md b/app/sdks/console-web/docs/examples/teams/create.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/teams/create.md rename to app/sdks/console-web/docs/examples/teams/create.md index 573557179a..6f7232b9c5 100644 --- a/app/sdks/console-javascript/docs/examples/teams/create.md +++ b/app/sdks/console-web/docs/examples/teams/create.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/teams/delete-membership.md b/app/sdks/console-web/docs/examples/teams/delete-membership.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/teams/delete-membership.md rename to app/sdks/console-web/docs/examples/teams/delete-membership.md index 01dc2dfc95..fa1efe401b 100644 --- a/app/sdks/console-javascript/docs/examples/teams/delete-membership.md +++ b/app/sdks/console-web/docs/examples/teams/delete-membership.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/teams/delete.md b/app/sdks/console-web/docs/examples/teams/delete.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/teams/delete.md rename to app/sdks/console-web/docs/examples/teams/delete.md index d8eb25bf87..cacad26c02 100644 --- a/app/sdks/console-javascript/docs/examples/teams/delete.md +++ b/app/sdks/console-web/docs/examples/teams/delete.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/teams/get-memberships.md b/app/sdks/console-web/docs/examples/teams/get-memberships.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/teams/get-memberships.md rename to app/sdks/console-web/docs/examples/teams/get-memberships.md index 1b51d214df..e1b959d1eb 100644 --- a/app/sdks/console-javascript/docs/examples/teams/get-memberships.md +++ b/app/sdks/console-web/docs/examples/teams/get-memberships.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/teams/get.md b/app/sdks/console-web/docs/examples/teams/get.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/teams/get.md rename to app/sdks/console-web/docs/examples/teams/get.md index 2c14d01ebd..a8496ad76d 100644 --- a/app/sdks/console-javascript/docs/examples/teams/get.md +++ b/app/sdks/console-web/docs/examples/teams/get.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/teams/list.md b/app/sdks/console-web/docs/examples/teams/list.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/teams/list.md rename to app/sdks/console-web/docs/examples/teams/list.md index a266273f3d..b94d6c32ff 100644 --- a/app/sdks/console-javascript/docs/examples/teams/list.md +++ b/app/sdks/console-web/docs/examples/teams/list.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/teams/update-membership-status.md b/app/sdks/console-web/docs/examples/teams/update-membership-status.md similarity index 85% rename from app/sdks/console-javascript/docs/examples/teams/update-membership-status.md rename to app/sdks/console-web/docs/examples/teams/update-membership-status.md index 3942b0a788..4931f02689 100644 --- a/app/sdks/console-javascript/docs/examples/teams/update-membership-status.md +++ b/app/sdks/console-web/docs/examples/teams/update-membership-status.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/teams/update.md b/app/sdks/console-web/docs/examples/teams/update.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/teams/update.md rename to app/sdks/console-web/docs/examples/teams/update.md index 00b718e431..5b73121518 100644 --- a/app/sdks/console-javascript/docs/examples/teams/update.md +++ b/app/sdks/console-web/docs/examples/teams/update.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/users/create.md b/app/sdks/console-web/docs/examples/users/create.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/users/create.md rename to app/sdks/console-web/docs/examples/users/create.md index c4d5acb17d..9adc060ff5 100644 --- a/app/sdks/console-javascript/docs/examples/users/create.md +++ b/app/sdks/console-web/docs/examples/users/create.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/users/delete-session.md b/app/sdks/console-web/docs/examples/users/delete-session.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/users/delete-session.md rename to app/sdks/console-web/docs/examples/users/delete-session.md index dac3ed7c39..96a9b5c94f 100644 --- a/app/sdks/console-javascript/docs/examples/users/delete-session.md +++ b/app/sdks/console-web/docs/examples/users/delete-session.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/users/delete-sessions.md b/app/sdks/console-web/docs/examples/users/delete-sessions.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/users/delete-sessions.md rename to app/sdks/console-web/docs/examples/users/delete-sessions.md index 6386b536d5..56092ab5fc 100644 --- a/app/sdks/console-javascript/docs/examples/users/delete-sessions.md +++ b/app/sdks/console-web/docs/examples/users/delete-sessions.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/users/get-logs.md b/app/sdks/console-web/docs/examples/users/get-logs.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/users/get-logs.md rename to app/sdks/console-web/docs/examples/users/get-logs.md index cdaf3e8b76..c349383ec1 100644 --- a/app/sdks/console-javascript/docs/examples/users/get-logs.md +++ b/app/sdks/console-web/docs/examples/users/get-logs.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/users/get-prefs.md b/app/sdks/console-web/docs/examples/users/get-prefs.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/users/get-prefs.md rename to app/sdks/console-web/docs/examples/users/get-prefs.md index a861db2607..7d8a3cd33f 100644 --- a/app/sdks/console-javascript/docs/examples/users/get-prefs.md +++ b/app/sdks/console-web/docs/examples/users/get-prefs.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/users/get-sessions.md b/app/sdks/console-web/docs/examples/users/get-sessions.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/users/get-sessions.md rename to app/sdks/console-web/docs/examples/users/get-sessions.md index 4281e3c27e..1b7535855e 100644 --- a/app/sdks/console-javascript/docs/examples/users/get-sessions.md +++ b/app/sdks/console-web/docs/examples/users/get-sessions.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/users/get.md b/app/sdks/console-web/docs/examples/users/get.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/users/get.md rename to app/sdks/console-web/docs/examples/users/get.md index cccbd13855..751798de39 100644 --- a/app/sdks/console-javascript/docs/examples/users/get.md +++ b/app/sdks/console-web/docs/examples/users/get.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/users/list.md b/app/sdks/console-web/docs/examples/users/list.md similarity index 82% rename from app/sdks/console-javascript/docs/examples/users/list.md rename to app/sdks/console-web/docs/examples/users/list.md index 34888458cd..bbc4895412 100644 --- a/app/sdks/console-javascript/docs/examples/users/list.md +++ b/app/sdks/console-web/docs/examples/users/list.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/users/update-prefs.md b/app/sdks/console-web/docs/examples/users/update-prefs.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/users/update-prefs.md rename to app/sdks/console-web/docs/examples/users/update-prefs.md index ed254f0608..877aa309a1 100644 --- a/app/sdks/console-javascript/docs/examples/users/update-prefs.md +++ b/app/sdks/console-web/docs/examples/users/update-prefs.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/docs/examples/users/update-status.md b/app/sdks/console-web/docs/examples/users/update-status.md similarity index 83% rename from app/sdks/console-javascript/docs/examples/users/update-status.md rename to app/sdks/console-web/docs/examples/users/update-status.md index c82fd1faa7..6c432ff4c6 100644 --- a/app/sdks/console-javascript/docs/examples/users/update-status.md +++ b/app/sdks/console-web/docs/examples/users/update-status.md @@ -1,6 +1,7 @@ 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 ; diff --git a/app/sdks/console-javascript/package.json b/app/sdks/console-web/package.json similarity index 100% rename from app/sdks/console-javascript/package.json rename to app/sdks/console-web/package.json diff --git a/app/sdks/console-javascript/src/sdk.js b/app/sdks/console-web/src/sdk.js similarity index 97% rename from app/sdks/console-javascript/src/sdk.js rename to app/sdks/console-web/src/sdk.js index 1379f8ced7..86e219cde5 100644 --- a/app/sdks/console-javascript/src/sdk.js +++ b/app/sdks/console-web/src/sdk.js @@ -748,7 +748,7 @@ * @throws {Error} * @return {Promise} */ - createOAuth2Session: function(provider, success = 'https://localhost:2444/auth/oauth2/success', failure = 'https://localhost:2444/auth/oauth2/failure') { + createOAuth2Session: function(provider, success = 'https://appwrite.io/auth/oauth2/success', failure = 'https://appwrite.io/auth/oauth2/failure') { if(provider === undefined) { throw new Error('Missing required parameter: "provider"'); } @@ -896,7 +896,7 @@ * @param {number} height * @param {number} quality * @throws {Error} - * @return {Promise} + * @return {string} */ getBrowser: function(code, width = 100, height = 100, quality = 100) { if(code === undefined) { @@ -919,10 +919,13 @@ payload['quality'] = quality; } - return http - .get(path, { - 'content-type': 'application/json', - }, payload); + payload['project'] = config.project; + + payload['key'] = config.key; + + let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&'); + + return config.endpoint + path + ((query) ? '?' + query : ''); }, /** @@ -938,7 +941,7 @@ * @param {number} height * @param {number} quality * @throws {Error} - * @return {Promise} + * @return {string} */ getCreditCard: function(code, width = 100, height = 100, quality = 100) { if(code === undefined) { @@ -961,10 +964,13 @@ payload['quality'] = quality; } - return http - .get(path, { - 'content-type': 'application/json', - }, payload); + payload['project'] = config.project; + + payload['key'] = config.key; + + let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&'); + + return config.endpoint + path + ((query) ? '?' + query : ''); }, /** @@ -975,7 +981,7 @@ * * @param {string} url * @throws {Error} - * @return {Promise} + * @return {string} */ getFavicon: function(url) { if(url === undefined) { @@ -990,10 +996,13 @@ payload['url'] = url; } - return http - .get(path, { - 'content-type': 'application/json', - }, payload); + payload['project'] = config.project; + + payload['key'] = config.key; + + let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&'); + + return config.endpoint + path + ((query) ? '?' + query : ''); }, /** @@ -1008,7 +1017,7 @@ * @param {number} height * @param {number} quality * @throws {Error} - * @return {Promise} + * @return {string} */ getFlag: function(code, width = 100, height = 100, quality = 100) { if(code === undefined) { @@ -1031,10 +1040,13 @@ payload['quality'] = quality; } - return http - .get(path, { - 'content-type': 'application/json', - }, payload); + payload['project'] = config.project; + + payload['key'] = config.key; + + let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&'); + + return config.endpoint + path + ((query) ? '?' + query : ''); }, /** @@ -1049,7 +1061,7 @@ * @param {number} width * @param {number} height * @throws {Error} - * @return {Promise} + * @return {string} */ getImage: function(url, width = 400, height = 400) { if(url === undefined) { @@ -1072,10 +1084,13 @@ payload['height'] = height; } - return http - .get(path, { - 'content-type': 'application/json', - }, payload); + payload['project'] = config.project; + + payload['key'] = config.key; + + let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&'); + + return config.endpoint + path + ((query) ? '?' + query : ''); }, /** @@ -1089,7 +1104,7 @@ * @param {number} margin * @param {number} download * @throws {Error} - * @return {Promise} + * @return {string} */ getQR: function(text, size = 400, margin = 1, download = 0) { if(text === undefined) { @@ -1116,10 +1131,13 @@ payload['download'] = download; } - return http - .get(path, { - 'content-type': 'application/json', - }, payload); + payload['project'] = config.project; + + payload['key'] = config.key; + + let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&'); + + return config.endpoint + path + ((query) ? '?' + query : ''); } }; @@ -1609,7 +1627,7 @@ let health = { /** - * Check API HTTP Health + * Get HTTP * * Check the Appwrite HTTP server is up and responsive. * @@ -1628,7 +1646,26 @@ }, /** - * Check Cache Health + * 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. @@ -1648,7 +1685,7 @@ }, /** - * Check DB Health + * Get DB * * Check the Appwrite database server is up and connection is successful. * @@ -1667,7 +1704,7 @@ }, /** - * Check the number of pending certificate messages + * Get Certificate Queue * * Get the number of certificates that are waiting to be issued against * [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue @@ -1688,7 +1725,25 @@ }, /** - * Check the number of pending log messages + * 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. @@ -1708,7 +1763,7 @@ }, /** - * Check the number of pending task messages + * Get Tasks Queue * * Get the number of tasks that are waiting to be processed in the Appwrite * internal queue server. @@ -1728,7 +1783,7 @@ }, /** - * Check the number of pending usage messages + * Get Usage Queue * * Get the number of usage stats that are waiting to be processed in the * Appwrite internal queue server. @@ -1748,7 +1803,7 @@ }, /** - * Check number of pending webhook messages + * Get Webhooks Queue * * Get the number of webhooks that are waiting to be processed in the Appwrite * internal queue server. @@ -1768,26 +1823,7 @@ }, /** - * Check Anti virus Health - * - * Check the Appwrite Anti Virus server is up and connection is successful. - * - * @throws {Error} - * @return {Promise} - */ - getStorageAntiVirus: function() { - let path = '/health/storage/anti-virus'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Check File System Health + * Get Local Storage * * Check the Appwrite local storage device is up and connection is successful. * @@ -1806,7 +1842,7 @@ }, /** - * Check Time Health + * 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 diff --git a/app/sdks/console-javascript/src/sdk.min.js b/app/sdks/console-web/src/sdk.min.js similarity index 90% rename from app/sdks/console-javascript/src/sdk.min.js rename to app/sdks/console-web/src/sdk.min.js index 0023277bf9..b43f612ff4 100644 --- a/app/sdks/console-javascript/src/sdk.min.js +++ b/app/sdks/console-web/src/sdk.min.js @@ -45,7 +45,7 @@ return http.put(path,{'content-type':'application/json',},payload)},getSessions: 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://localhost:2444/auth/oauth2/success',failure='https://localhost:2444/auth/oauth2/failure'){if(provider===undefined){throw new Error('Missing required parameter: "provider"')} +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'){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} payload.project=config.project;payload.key=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');window.location=config.endpoint+path+((query)?'?'+query:'')},deleteSession:function(sessionId){if(sessionId===undefined){throw new Error('Missing required parameter: "sessionId"')} @@ -59,26 +59,26 @@ return http.put(path,{'content-type':'application/json',},payload)}};let avatars 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} -return http.get(path,{'content-type':'application/json',},payload)},getCreditCard:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')} +payload.project=config.project;payload.key=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},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} -return http.get(path,{'content-type':'application/json',},payload)},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"')} +payload.project=config.project;payload.key=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"')} let path='/avatars/favicon';let payload={};if(url){payload.url=url} -return http.get(path,{'content-type':'application/json',},payload)},getFlag:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"')} +payload.project=config.project;payload.key=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},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} -return http.get(path,{'content-type':'application/json',},payload)},getImage:function(url,width=400,height=400){if(url===undefined){throw new Error('Missing required parameter: "url"')} +payload.project=config.project;payload.key=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},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} -return http.get(path,{'content-type':'application/json',},payload)},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"')} +payload.project=config.project;payload.key=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')},getQR:function(text,size=400,margin=1,download=0){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} -return http.get(path,{'content-type':'application/json',},payload)}};let database={listCollections:function(search='',limit=25,offset=0,orderType='ASC'){let path='/database/collections';let payload={};if(search){payload.search=search} +payload.project=config.project;payload.key=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'')}};let database={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} @@ -133,7 +133,7 @@ if(write){payload.write=write} return http.patch(path,{'content-type':'application/json',},payload)},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)},getCollectionLogs:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"')} -let path='/database/collections/{collectionId}/logs'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};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)},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)},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)},getStorageAntiVirus:function(){let path='/health/storage/anti-virus';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)}};let projects={list:function(){let path='/projects';let payload={};return http.get(path,{'content-type':'application/json',},payload)},create:function(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(name===undefined){throw new Error('Missing required parameter: "name"')} +let path='/database/collections/{collectionId}/logs'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};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)}};let projects={list:function(){let path='/projects';let payload={};return http.get(path,{'content-type':'application/json',},payload)},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} diff --git a/app/sdks/web-javascript/tsconfig.json b/app/sdks/console-web/tsconfig.json similarity index 100% rename from app/sdks/web-javascript/tsconfig.json rename to app/sdks/console-web/tsconfig.json diff --git a/app/sdks/console-javascript/types/index.d.ts b/app/sdks/console-web/types/index.d.ts similarity index 98% rename from app/sdks/console-javascript/types/index.d.ts rename to app/sdks/console-web/types/index.d.ts index 5416bcd5a9..08f42c7cf4 100644 --- a/app/sdks/console-javascript/types/index.d.ts +++ b/app/sdks/console-web/types/index.d.ts @@ -342,9 +342,9 @@ declare namespace Appwrite { * @param {number} height * @param {number} quality * @throws {Error} - * @return {Promise} + * @return {string} */ - getBrowser(code: string, width: number, height: number, quality: number): Promise; + getBrowser(code: string, width: number, height: number, quality: number): string; /** * Get Credit Card Icon @@ -359,9 +359,9 @@ declare namespace Appwrite { * @param {number} height * @param {number} quality * @throws {Error} - * @return {Promise} + * @return {string} */ - getCreditCard(code: string, width: number, height: number, quality: number): Promise; + getCreditCard(code: string, width: number, height: number, quality: number): string; /** * Get Favicon @@ -371,9 +371,9 @@ declare namespace Appwrite { * * @param {string} url * @throws {Error} - * @return {Promise} + * @return {string} */ - getFavicon(url: string): Promise; + getFavicon(url: string): string; /** * Get Country Flag @@ -387,9 +387,9 @@ declare namespace Appwrite { * @param {number} height * @param {number} quality * @throws {Error} - * @return {Promise} + * @return {string} */ - getFlag(code: string, width: number, height: number, quality: number): Promise; + getFlag(code: string, width: number, height: number, quality: number): string; /** * Get Image from URL @@ -403,9 +403,9 @@ declare namespace Appwrite { * @param {number} width * @param {number} height * @throws {Error} - * @return {Promise} + * @return {string} */ - getImage(url: string, width: number, height: number): Promise; + getImage(url: string, width: number, height: number): string; /** * Get QR Code @@ -418,9 +418,9 @@ declare namespace Appwrite { * @param {number} margin * @param {number} download * @throws {Error} - * @return {Promise} + * @return {string} */ - getQR(text: string, size: number, margin: number, download: number): Promise; + getQR(text: string, size: number, margin: number, download: number): string; } @@ -592,7 +592,7 @@ declare namespace Appwrite { export interface Health { /** - * Check API HTTP Health + * Get HTTP * * Check the Appwrite HTTP server is up and responsive. * @@ -602,7 +602,17 @@ declare namespace Appwrite { get(): Promise; /** - * Check Cache Health + * 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. @@ -613,7 +623,7 @@ declare namespace Appwrite { getCache(): Promise; /** - * Check DB Health + * Get DB * * Check the Appwrite database server is up and connection is successful. * @@ -623,7 +633,7 @@ declare namespace Appwrite { getDB(): Promise; /** - * Check the number of pending certificate messages + * Get Certificate Queue * * Get the number of certificates that are waiting to be issued against * [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue @@ -635,7 +645,16 @@ declare namespace Appwrite { getQueueCertificates(): Promise; /** - * Check the number of pending log messages + * 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. @@ -646,7 +665,7 @@ declare namespace Appwrite { getQueueLogs(): Promise; /** - * Check the number of pending task messages + * Get Tasks Queue * * Get the number of tasks that are waiting to be processed in the Appwrite * internal queue server. @@ -657,7 +676,7 @@ declare namespace Appwrite { getQueueTasks(): Promise; /** - * Check the number of pending usage messages + * Get Usage Queue * * Get the number of usage stats that are waiting to be processed in the * Appwrite internal queue server. @@ -668,7 +687,7 @@ declare namespace Appwrite { getQueueUsage(): Promise; /** - * Check number of pending webhook messages + * Get Webhooks Queue * * Get the number of webhooks that are waiting to be processed in the Appwrite * internal queue server. @@ -679,17 +698,7 @@ declare namespace Appwrite { getQueueWebhooks(): Promise; /** - * Check Anti virus Health - * - * Check the Appwrite Anti Virus server is up and connection is successful. - * - * @throws {Error} - * @return {Promise} - */ - getStorageAntiVirus(): Promise; - - /** - * Check File System Health + * Get Local Storage * * Check the Appwrite local storage device is up and connection is successful. * @@ -699,7 +708,7 @@ declare namespace Appwrite { getStorageLocal(): Promise; /** - * Check Time Health + * 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 diff --git a/app/sdks/flutter-dart/.dart_tool/package_config.json b/app/sdks/flutter-dart/.dart_tool/package_config.json deleted file mode 100644 index 79f1f8fa5a..0000000000 --- a/app/sdks/flutter-dart/.dart_tool/package_config.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "configVersion": 2, - "packages": [ - { - "name": "charcode", - "rootUri": "file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/charcode-1.1.3", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "collection", - "rootUri": "file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/collection-1.14.12", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "cookie_jar", - "rootUri": "file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/cookie_jar-1.0.1", - "packageUri": "lib/", - "languageVersion": "1.20" - }, - { - "name": "dio", - "rootUri": "file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/dio-3.0.9", - "packageUri": "lib/", - "languageVersion": "2.4" - }, - { - "name": "dio_cookie_manager", - "rootUri": "file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/dio_cookie_manager-1.0.0", - "packageUri": "lib/", - "languageVersion": "2.4" - }, - { - "name": "http_parser", - "rootUri": "file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/http_parser-3.1.4", - "packageUri": "lib/", - "languageVersion": "2.3" - }, - { - "name": "meta", - "rootUri": "file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/meta-1.1.8", - "packageUri": "lib/", - "languageVersion": "1.12" - }, - { - "name": "path", - "rootUri": "file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/path-1.6.4", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "source_span", - "rootUri": "file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/source_span-1.7.0", - "packageUri": "lib/", - "languageVersion": "2.6" - }, - { - "name": "string_scanner", - "rootUri": "file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.0.5", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "term_glyph", - "rootUri": "file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.1.0", - "packageUri": "lib/", - "languageVersion": "1.8" - }, - { - "name": "typed_data", - "rootUri": "file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/typed_data-1.1.6", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "appwrite", - "rootUri": "../", - "packageUri": "lib/", - "languageVersion": "2.6" - } - ], - "generated": "2020-04-10T18:56:11.631386Z", - "generator": "pub", - "generatorVersion": "2.7.2" -} diff --git a/app/sdks/flutter-dart/.flutter-plugins b/app/sdks/flutter-dart/.flutter-plugins deleted file mode 100644 index 08a8bd037a..0000000000 --- a/app/sdks/flutter-dart/.flutter-plugins +++ /dev/null @@ -1,5 +0,0 @@ -# This is a generated file; do not edit or check into version control. -flutter_web_auth=/Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/flutter_web_auth-0.1.3/ -package_info=/Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.0+16/ -path_provider=/Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.5/ -path_provider_macos=/Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4/ diff --git a/app/sdks/flutter-dart/.flutter-plugins-dependencies b/app/sdks/flutter-dart/.flutter-plugins-dependencies deleted file mode 100644 index d581b58f71..0000000000 --- a/app/sdks/flutter-dart/.flutter-plugins-dependencies +++ /dev/null @@ -1 +0,0 @@ -{"_info":"// This is a generated file; do not edit or check into version control.","dependencyGraph":[{"name":"flutter_web_auth","dependencies":[]},{"name":"package_info","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos"]},{"name":"path_provider_macos","dependencies":[]}]} \ No newline at end of file diff --git a/app/sdks/flutter-dart/.packages b/app/sdks/flutter-dart/.packages deleted file mode 100644 index 7b07f11699..0000000000 --- a/app/sdks/flutter-dart/.packages +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by pub on 2020-04-10 21:56:11.618646. -charcode:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/charcode-1.1.3/lib/ -collection:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/collection-1.14.12/lib/ -cookie_jar:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/cookie_jar-1.0.1/lib/ -dio:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/dio-3.0.9/lib/ -dio_cookie_manager:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/dio_cookie_manager-1.0.0/lib/ -http_parser:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/http_parser-3.1.4/lib/ -meta:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/meta-1.1.8/lib/ -path:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/path-1.6.4/lib/ -source_span:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/source_span-1.7.0/lib/ -string_scanner:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.0.5/lib/ -term_glyph:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.1.0/lib/ -typed_data:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/typed_data-1.1.6/lib/ -appwrite:lib/ diff --git a/app/sdks/flutter-dart/docs/examples/account/create-o-auth2session.md b/app/sdks/flutter-dart/docs/examples/account/create-o-auth2session.md deleted file mode 100644 index 2745fc48bd..0000000000 --- a/app/sdks/flutter-dart/docs/examples/account/create-o-auth2session.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Account account = Account(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = account.createOAuth2Session( - provider: 'bitbucket', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/account/create-recovery.md b/app/sdks/flutter-dart/docs/examples/account/create-recovery.md deleted file mode 100644 index f381743e10..0000000000 --- a/app/sdks/flutter-dart/docs/examples/account/create-recovery.md +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Account account = Account(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = account.createRecovery( - email: 'email@example.com', - url: 'https://example.com', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/account/create-session.md b/app/sdks/flutter-dart/docs/examples/account/create-session.md deleted file mode 100644 index 65584ae62a..0000000000 --- a/app/sdks/flutter-dart/docs/examples/account/create-session.md +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Account account = Account(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = account.createSession( - email: 'email@example.com', - password: 'password', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/account/create-verification.md b/app/sdks/flutter-dart/docs/examples/account/create-verification.md deleted file mode 100644 index 735c53f4dd..0000000000 --- a/app/sdks/flutter-dart/docs/examples/account/create-verification.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Account account = Account(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = account.createVerification( - url: 'https://example.com', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/account/create.md b/app/sdks/flutter-dart/docs/examples/account/create.md deleted file mode 100644 index 596c8e8fcf..0000000000 --- a/app/sdks/flutter-dart/docs/examples/account/create.md +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Account account = Account(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = account.create( - email: 'email@example.com', - password: 'password', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/account/delete-session.md b/app/sdks/flutter-dart/docs/examples/account/delete-session.md deleted file mode 100644 index a1c4fe58c0..0000000000 --- a/app/sdks/flutter-dart/docs/examples/account/delete-session.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Account account = Account(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = account.deleteSession( - sessionId: '[SESSION_ID]', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/account/delete-sessions.md b/app/sdks/flutter-dart/docs/examples/account/delete-sessions.md deleted file mode 100644 index e0e0f9d6ea..0000000000 --- a/app/sdks/flutter-dart/docs/examples/account/delete-sessions.md +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Account account = Account(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = account.deleteSessions(); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/account/delete.md b/app/sdks/flutter-dart/docs/examples/account/delete.md deleted file mode 100644 index 6566687b96..0000000000 --- a/app/sdks/flutter-dart/docs/examples/account/delete.md +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Account account = Account(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = account.delete(); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/account/get-logs.md b/app/sdks/flutter-dart/docs/examples/account/get-logs.md deleted file mode 100644 index 00d0d95eee..0000000000 --- a/app/sdks/flutter-dart/docs/examples/account/get-logs.md +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Account account = Account(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = account.getLogs(); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/account/get-prefs.md b/app/sdks/flutter-dart/docs/examples/account/get-prefs.md deleted file mode 100644 index ac9af996e8..0000000000 --- a/app/sdks/flutter-dart/docs/examples/account/get-prefs.md +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Account account = Account(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = account.getPrefs(); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/account/get-sessions.md b/app/sdks/flutter-dart/docs/examples/account/get-sessions.md deleted file mode 100644 index 136b349bbc..0000000000 --- a/app/sdks/flutter-dart/docs/examples/account/get-sessions.md +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Account account = Account(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = account.getSessions(); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/account/get.md b/app/sdks/flutter-dart/docs/examples/account/get.md deleted file mode 100644 index 7a3fab6ae3..0000000000 --- a/app/sdks/flutter-dart/docs/examples/account/get.md +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Account account = Account(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = account.get(); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/account/update-email.md b/app/sdks/flutter-dart/docs/examples/account/update-email.md deleted file mode 100644 index 0e3783719b..0000000000 --- a/app/sdks/flutter-dart/docs/examples/account/update-email.md +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Account account = Account(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = account.updateEmail( - email: 'email@example.com', - password: 'password', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/account/update-name.md b/app/sdks/flutter-dart/docs/examples/account/update-name.md deleted file mode 100644 index f36e747d80..0000000000 --- a/app/sdks/flutter-dart/docs/examples/account/update-name.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Account account = Account(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = account.updateName( - name: '[NAME]', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/account/update-password.md b/app/sdks/flutter-dart/docs/examples/account/update-password.md deleted file mode 100644 index dbc873634f..0000000000 --- a/app/sdks/flutter-dart/docs/examples/account/update-password.md +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Account account = Account(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = account.updatePassword( - password: 'password', - oldPassword: 'password', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/account/update-prefs.md b/app/sdks/flutter-dart/docs/examples/account/update-prefs.md deleted file mode 100644 index 6a687b63f4..0000000000 --- a/app/sdks/flutter-dart/docs/examples/account/update-prefs.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Account account = Account(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = account.updatePrefs( - prefs: {}, -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/account/update-recovery.md b/app/sdks/flutter-dart/docs/examples/account/update-recovery.md deleted file mode 100644 index 07c892deb6..0000000000 --- a/app/sdks/flutter-dart/docs/examples/account/update-recovery.md +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Account account = Account(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = account.updateRecovery( - userId: '[USER_ID]', - secret: '[SECRET]', - password: 'password', - passwordAgain: 'password', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/account/update-verification.md b/app/sdks/flutter-dart/docs/examples/account/update-verification.md deleted file mode 100644 index 7b080556b2..0000000000 --- a/app/sdks/flutter-dart/docs/examples/account/update-verification.md +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Account account = Account(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = account.updateVerification( - userId: '[USER_ID]', - secret: '[SECRET]', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/avatars/get-browser.md b/app/sdks/flutter-dart/docs/examples/avatars/get-browser.md deleted file mode 100644 index 4e057dd753..0000000000 --- a/app/sdks/flutter-dart/docs/examples/avatars/get-browser.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Avatars avatars = Avatars(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = avatars.getBrowser( - code: 'aa', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/avatars/get-credit-card.md b/app/sdks/flutter-dart/docs/examples/avatars/get-credit-card.md deleted file mode 100644 index caa57c877b..0000000000 --- a/app/sdks/flutter-dart/docs/examples/avatars/get-credit-card.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Avatars avatars = Avatars(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = avatars.getCreditCard( - code: 'amex', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/avatars/get-favicon.md b/app/sdks/flutter-dart/docs/examples/avatars/get-favicon.md deleted file mode 100644 index 488bf3b351..0000000000 --- a/app/sdks/flutter-dart/docs/examples/avatars/get-favicon.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Avatars avatars = Avatars(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = avatars.getFavicon( - url: 'https://example.com', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/avatars/get-flag.md b/app/sdks/flutter-dart/docs/examples/avatars/get-flag.md deleted file mode 100644 index f401bae569..0000000000 --- a/app/sdks/flutter-dart/docs/examples/avatars/get-flag.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Avatars avatars = Avatars(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = avatars.getFlag( - code: 'af', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/avatars/get-image.md b/app/sdks/flutter-dart/docs/examples/avatars/get-image.md deleted file mode 100644 index d9bee4b20f..0000000000 --- a/app/sdks/flutter-dart/docs/examples/avatars/get-image.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Avatars avatars = Avatars(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = avatars.getImage( - url: 'https://example.com', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/avatars/get-q-r.md b/app/sdks/flutter-dart/docs/examples/avatars/get-q-r.md deleted file mode 100644 index 9be7533e0b..0000000000 --- a/app/sdks/flutter-dart/docs/examples/avatars/get-q-r.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Avatars avatars = Avatars(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = avatars.getQR( - text: '[TEXT]', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/database/create-document.md b/app/sdks/flutter-dart/docs/examples/database/create-document.md deleted file mode 100644 index 9eea7b677c..0000000000 --- a/app/sdks/flutter-dart/docs/examples/database/create-document.md +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Database database = Database(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = database.createDocument( - collectionId: '[COLLECTION_ID]', - data: {}, - read: [], - write: [], -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/database/delete-document.md b/app/sdks/flutter-dart/docs/examples/database/delete-document.md deleted file mode 100644 index 5e41ff0a41..0000000000 --- a/app/sdks/flutter-dart/docs/examples/database/delete-document.md +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Database database = Database(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = database.deleteDocument( - collectionId: '[COLLECTION_ID]', - documentId: '[DOCUMENT_ID]', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/database/get-document.md b/app/sdks/flutter-dart/docs/examples/database/get-document.md deleted file mode 100644 index e410508fb1..0000000000 --- a/app/sdks/flutter-dart/docs/examples/database/get-document.md +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Database database = Database(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = database.getDocument( - collectionId: '[COLLECTION_ID]', - documentId: '[DOCUMENT_ID]', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/database/list-documents.md b/app/sdks/flutter-dart/docs/examples/database/list-documents.md deleted file mode 100644 index b4270d909b..0000000000 --- a/app/sdks/flutter-dart/docs/examples/database/list-documents.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Database database = Database(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = database.listDocuments( - collectionId: '[COLLECTION_ID]', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/database/update-document.md b/app/sdks/flutter-dart/docs/examples/database/update-document.md deleted file mode 100644 index e9c584e066..0000000000 --- a/app/sdks/flutter-dart/docs/examples/database/update-document.md +++ /dev/null @@ -1,24 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Database database = Database(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = database.updateDocument( - collectionId: '[COLLECTION_ID]', - documentId: '[DOCUMENT_ID]', - data: {}, - read: [], - write: [], -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/locale/get-continents.md b/app/sdks/flutter-dart/docs/examples/locale/get-continents.md deleted file mode 100644 index 743635f053..0000000000 --- a/app/sdks/flutter-dart/docs/examples/locale/get-continents.md +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Locale locale = Locale(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = locale.getContinents(); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/locale/get-countries-e-u.md b/app/sdks/flutter-dart/docs/examples/locale/get-countries-e-u.md deleted file mode 100644 index c46b95ec07..0000000000 --- a/app/sdks/flutter-dart/docs/examples/locale/get-countries-e-u.md +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Locale locale = Locale(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = locale.getCountriesEU(); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/locale/get-countries-phones.md b/app/sdks/flutter-dart/docs/examples/locale/get-countries-phones.md deleted file mode 100644 index a406f184f9..0000000000 --- a/app/sdks/flutter-dart/docs/examples/locale/get-countries-phones.md +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Locale locale = Locale(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = locale.getCountriesPhones(); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/locale/get-countries.md b/app/sdks/flutter-dart/docs/examples/locale/get-countries.md deleted file mode 100644 index c83c02b60c..0000000000 --- a/app/sdks/flutter-dart/docs/examples/locale/get-countries.md +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Locale locale = Locale(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = locale.getCountries(); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/locale/get-currencies.md b/app/sdks/flutter-dart/docs/examples/locale/get-currencies.md deleted file mode 100644 index b34f4c7162..0000000000 --- a/app/sdks/flutter-dart/docs/examples/locale/get-currencies.md +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Locale locale = Locale(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = locale.getCurrencies(); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/locale/get.md b/app/sdks/flutter-dart/docs/examples/locale/get.md deleted file mode 100644 index fed81b836e..0000000000 --- a/app/sdks/flutter-dart/docs/examples/locale/get.md +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Locale locale = Locale(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = locale.get(); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/storage/create-file.md b/app/sdks/flutter-dart/docs/examples/storage/create-file.md deleted file mode 100644 index b7ee0857ae..0000000000 --- a/app/sdks/flutter-dart/docs/examples/storage/create-file.md +++ /dev/null @@ -1,23 +0,0 @@ -import 'dart:io'; -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Storage storage = Storage(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = storage.createFile( - file: await MultipartFile.fromFile('./path-to-files/image.jpg', 'image.jpg'), - read: [], - write: [], -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/storage/delete-file.md b/app/sdks/flutter-dart/docs/examples/storage/delete-file.md deleted file mode 100644 index 9a2ed98b96..0000000000 --- a/app/sdks/flutter-dart/docs/examples/storage/delete-file.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Storage storage = Storage(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = storage.deleteFile( - fileId: '[FILE_ID]', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/storage/get-file-download.md b/app/sdks/flutter-dart/docs/examples/storage/get-file-download.md deleted file mode 100644 index e00cdc9022..0000000000 --- a/app/sdks/flutter-dart/docs/examples/storage/get-file-download.md +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Storage storage = Storage(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -String result = storage.getFileDownload( - fileId: '[FILE_ID]', -); - -print(result); // Resource URL string diff --git a/app/sdks/flutter-dart/docs/examples/storage/get-file-preview.md b/app/sdks/flutter-dart/docs/examples/storage/get-file-preview.md deleted file mode 100644 index 5297ab8342..0000000000 --- a/app/sdks/flutter-dart/docs/examples/storage/get-file-preview.md +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Storage storage = Storage(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -String result = storage.getFilePreview( - fileId: '[FILE_ID]', -); - -print(result); // Resource URL string diff --git a/app/sdks/flutter-dart/docs/examples/storage/get-file-view.md b/app/sdks/flutter-dart/docs/examples/storage/get-file-view.md deleted file mode 100644 index 13b1de4822..0000000000 --- a/app/sdks/flutter-dart/docs/examples/storage/get-file-view.md +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Storage storage = Storage(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -String result = storage.getFileView( - fileId: '[FILE_ID]', -); - -print(result); // Resource URL string diff --git a/app/sdks/flutter-dart/docs/examples/storage/get-file.md b/app/sdks/flutter-dart/docs/examples/storage/get-file.md deleted file mode 100644 index bdeaf55130..0000000000 --- a/app/sdks/flutter-dart/docs/examples/storage/get-file.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Storage storage = Storage(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = storage.getFile( - fileId: '[FILE_ID]', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/storage/list-files.md b/app/sdks/flutter-dart/docs/examples/storage/list-files.md deleted file mode 100644 index 9ef25d8a01..0000000000 --- a/app/sdks/flutter-dart/docs/examples/storage/list-files.md +++ /dev/null @@ -1,19 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Storage storage = Storage(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = storage.listFiles( -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/storage/update-file.md b/app/sdks/flutter-dart/docs/examples/storage/update-file.md deleted file mode 100644 index 44955c224f..0000000000 --- a/app/sdks/flutter-dart/docs/examples/storage/update-file.md +++ /dev/null @@ -1,22 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Storage storage = Storage(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = storage.updateFile( - fileId: '[FILE_ID]', - read: [], - write: [], -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/teams/create-membership.md b/app/sdks/flutter-dart/docs/examples/teams/create-membership.md deleted file mode 100644 index b06200f66d..0000000000 --- a/app/sdks/flutter-dart/docs/examples/teams/create-membership.md +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Teams teams = Teams(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = teams.createMembership( - teamId: '[TEAM_ID]', - email: 'email@example.com', - roles: [], - url: 'https://example.com', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/teams/create.md b/app/sdks/flutter-dart/docs/examples/teams/create.md deleted file mode 100644 index 71bb6219a2..0000000000 --- a/app/sdks/flutter-dart/docs/examples/teams/create.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Teams teams = Teams(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = teams.create( - name: '[NAME]', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/teams/delete-membership.md b/app/sdks/flutter-dart/docs/examples/teams/delete-membership.md deleted file mode 100644 index 4baddf5f9d..0000000000 --- a/app/sdks/flutter-dart/docs/examples/teams/delete-membership.md +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Teams teams = Teams(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = teams.deleteMembership( - teamId: '[TEAM_ID]', - inviteId: '[INVITE_ID]', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/teams/delete.md b/app/sdks/flutter-dart/docs/examples/teams/delete.md deleted file mode 100644 index c88521f2a2..0000000000 --- a/app/sdks/flutter-dart/docs/examples/teams/delete.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Teams teams = Teams(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = teams.delete( - teamId: '[TEAM_ID]', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/teams/get-memberships.md b/app/sdks/flutter-dart/docs/examples/teams/get-memberships.md deleted file mode 100644 index 27e0971de7..0000000000 --- a/app/sdks/flutter-dart/docs/examples/teams/get-memberships.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Teams teams = Teams(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = teams.getMemberships( - teamId: '[TEAM_ID]', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/teams/get.md b/app/sdks/flutter-dart/docs/examples/teams/get.md deleted file mode 100644 index ef9c01002c..0000000000 --- a/app/sdks/flutter-dart/docs/examples/teams/get.md +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Teams teams = Teams(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = teams.get( - teamId: '[TEAM_ID]', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/teams/list.md b/app/sdks/flutter-dart/docs/examples/teams/list.md deleted file mode 100644 index a9e4313b83..0000000000 --- a/app/sdks/flutter-dart/docs/examples/teams/list.md +++ /dev/null @@ -1,19 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Teams teams = Teams(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = teams.list( -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/teams/update-membership-status.md b/app/sdks/flutter-dart/docs/examples/teams/update-membership-status.md deleted file mode 100644 index a33ecd4c18..0000000000 --- a/app/sdks/flutter-dart/docs/examples/teams/update-membership-status.md +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Teams teams = Teams(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = teams.updateMembershipStatus( - teamId: '[TEAM_ID]', - inviteId: '[INVITE_ID]', - userId: '[USER_ID]', - secret: '[SECRET]', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/docs/examples/teams/update.md b/app/sdks/flutter-dart/docs/examples/teams/update.md deleted file mode 100644 index b1cc7e2391..0000000000 --- a/app/sdks/flutter-dart/docs/examples/teams/update.md +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:appwrite/appwrite.dart'; - -// Init SDK -Client client = Client(); -Teams teams = Teams(client); - -client - .setProject('5df5acd0d48c2') // Your project ID -; - -Future result = teams.update( - teamId: '[TEAM_ID]', - name: '[NAME]', -); - -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file diff --git a/app/sdks/flutter-dart/pubspec.lock b/app/sdks/flutter-dart/pubspec.lock deleted file mode 100644 index a1648b1374..0000000000 --- a/app/sdks/flutter-dart/pubspec.lock +++ /dev/null @@ -1,89 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.3" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.14.12" - cookie_jar: - dependency: "direct main" - description: - name: cookie_jar - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - dio: - dependency: "direct main" - description: - name: dio - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.9" - dio_cookie_manager: - dependency: "direct main" - description: - name: dio_cookie_manager - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.4" - meta: - dependency: "direct main" - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.8" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.4" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.5" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.6" -sdks: - dart: ">=2.6.0 <3.0.0" diff --git a/app/sdks/server-deno/CHANGELOG.md b/app/sdks/server-deno/CHANGELOG.md new file mode 100644 index 0000000000..fa4d35e687 --- /dev/null +++ b/app/sdks/server-deno/CHANGELOG.md @@ -0,0 +1 @@ +# Change Log \ No newline at end of file diff --git a/app/sdks/server-deno/LICENSE b/app/sdks/server-deno/LICENSE new file mode 100644 index 0000000000..fc7c051a91 --- /dev/null +++ b/app/sdks/server-deno/LICENSE @@ -0,0 +1,12 @@ +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 new file mode 100644 index 0000000000..1a53fc663b --- /dev/null +++ b/app/sdks/server-deno/README.md @@ -0,0 +1,28 @@ +# 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.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 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/docs/examples/avatars/get-browser.md b/app/sdks/server-deno/docs/examples/avatars/get-browser.md new file mode 100644 index 0000000000..38b693da58 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/avatars/get-browser.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/avatars/get-credit-card.md b/app/sdks/server-deno/docs/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..e3af5aad73 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/avatars/get-credit-card.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/avatars/get-favicon.md b/app/sdks/server-deno/docs/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..c3305a22b8 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/avatars/get-favicon.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/avatars/get-flag.md b/app/sdks/server-deno/docs/examples/avatars/get-flag.md new file mode 100644 index 0000000000..c16c433bf3 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/avatars/get-flag.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/avatars/get-image.md b/app/sdks/server-deno/docs/examples/avatars/get-image.md new file mode 100644 index 0000000000..5555b673be --- /dev/null +++ b/app/sdks/server-deno/docs/examples/avatars/get-image.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/avatars/get-q-r.md b/app/sdks/server-deno/docs/examples/avatars/get-q-r.md new file mode 100644 index 0000000000..30d66f88a3 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/avatars/get-q-r.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/database/create-collection.md b/app/sdks/server-deno/docs/examples/database/create-collection.md new file mode 100644 index 0000000000..e33d1f92ba --- /dev/null +++ b/app/sdks/server-deno/docs/examples/database/create-collection.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/database/create-document.md b/app/sdks/server-deno/docs/examples/database/create-document.md new file mode 100644 index 0000000000..6d6d66dd75 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/database/create-document.md @@ -0,0 +1,19 @@ +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/delete-collection.md b/app/sdks/server-deno/docs/examples/database/delete-collection.md new file mode 100644 index 0000000000..e3ab2022ad --- /dev/null +++ b/app/sdks/server-deno/docs/examples/database/delete-collection.md @@ -0,0 +1,19 @@ +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.deleteCollection('[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/delete-document.md b/app/sdks/server-deno/docs/examples/database/delete-document.md new file mode 100644 index 0000000000..7b1626885d --- /dev/null +++ b/app/sdks/server-deno/docs/examples/database/delete-document.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/database/get-collection-logs.md b/app/sdks/server-deno/docs/examples/database/get-collection-logs.md new file mode 100644 index 0000000000..7c68ffb2d2 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/database/get-collection-logs.md @@ -0,0 +1,19 @@ +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.getCollectionLogs('[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.md b/app/sdks/server-deno/docs/examples/database/get-collection.md new file mode 100644 index 0000000000..5023c2349e --- /dev/null +++ b/app/sdks/server-deno/docs/examples/database/get-collection.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/database/get-document.md b/app/sdks/server-deno/docs/examples/database/get-document.md new file mode 100644 index 0000000000..0b3b4c2e34 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/database/get-document.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/database/list-collections.md b/app/sdks/server-deno/docs/examples/database/list-collections.md new file mode 100644 index 0000000000..7ac270809f --- /dev/null +++ b/app/sdks/server-deno/docs/examples/database/list-collections.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/database/list-documents.md b/app/sdks/server-deno/docs/examples/database/list-documents.md new file mode 100644 index 0000000000..6e49475cad --- /dev/null +++ b/app/sdks/server-deno/docs/examples/database/list-documents.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/database/update-collection.md b/app/sdks/server-deno/docs/examples/database/update-collection.md new file mode 100644 index 0000000000..ac009964f6 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/database/update-collection.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/database/update-document.md b/app/sdks/server-deno/docs/examples/database/update-document.md new file mode 100644 index 0000000000..51a92ac562 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/database/update-document.md @@ -0,0 +1,19 @@ +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-deno/docs/examples/health/get-anti-virus.md b/app/sdks/server-deno/docs/examples/health/get-anti-virus.md new file mode 100644 index 0000000000..6bf045456f --- /dev/null +++ b/app/sdks/server-deno/docs/examples/health/get-anti-virus.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/health/get-cache.md b/app/sdks/server-deno/docs/examples/health/get-cache.md new file mode 100644 index 0000000000..c8b2ac6731 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/health/get-cache.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/health/get-d-b.md b/app/sdks/server-deno/docs/examples/health/get-d-b.md new file mode 100644 index 0000000000..0e43374f85 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/health/get-d-b.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/health/get-queue-certificates.md b/app/sdks/server-deno/docs/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..906f9069ef --- /dev/null +++ b/app/sdks/server-deno/docs/examples/health/get-queue-certificates.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/health/get-queue-functions.md b/app/sdks/server-deno/docs/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..30ffc7f134 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/health/get-queue-functions.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/health/get-queue-logs.md b/app/sdks/server-deno/docs/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..a139915c51 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/health/get-queue-logs.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/health/get-queue-tasks.md b/app/sdks/server-deno/docs/examples/health/get-queue-tasks.md new file mode 100644 index 0000000000..9868b4fb50 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/health/get-queue-tasks.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/health/get-queue-usage.md b/app/sdks/server-deno/docs/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..07b9a08664 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/health/get-queue-usage.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/health/get-queue-webhooks.md b/app/sdks/server-deno/docs/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..fcf250d359 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/health/get-queue-webhooks.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/health/get-storage-local.md b/app/sdks/server-deno/docs/examples/health/get-storage-local.md new file mode 100644 index 0000000000..b92b720c2f --- /dev/null +++ b/app/sdks/server-deno/docs/examples/health/get-storage-local.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/health/get-time.md b/app/sdks/server-deno/docs/examples/health/get-time.md new file mode 100644 index 0000000000..88e1036670 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/health/get-time.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/health/get.md b/app/sdks/server-deno/docs/examples/health/get.md new file mode 100644 index 0000000000..abc1af3e50 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/health/get.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/locale/get-continents.md b/app/sdks/server-deno/docs/examples/locale/get-continents.md new file mode 100644 index 0000000000..2633029d58 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/locale/get-continents.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/locale/get-countries-e-u.md b/app/sdks/server-deno/docs/examples/locale/get-countries-e-u.md new file mode 100644 index 0000000000..6d6f15959f --- /dev/null +++ b/app/sdks/server-deno/docs/examples/locale/get-countries-e-u.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/locale/get-countries-phones.md b/app/sdks/server-deno/docs/examples/locale/get-countries-phones.md new file mode 100644 index 0000000000..e1085e34b2 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/locale/get-countries-phones.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/locale/get-countries.md b/app/sdks/server-deno/docs/examples/locale/get-countries.md new file mode 100644 index 0000000000..626d339405 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/locale/get-countries.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/locale/get-currencies.md b/app/sdks/server-deno/docs/examples/locale/get-currencies.md new file mode 100644 index 0000000000..2bcdb0da64 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/locale/get-currencies.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/locale/get.md b/app/sdks/server-deno/docs/examples/locale/get.md new file mode 100644 index 0000000000..5189633d34 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/locale/get.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/storage/create-file.md b/app/sdks/server-deno/docs/examples/storage/create-file.md new file mode 100644 index 0000000000..5452f892ee --- /dev/null +++ b/app/sdks/server-deno/docs/examples/storage/create-file.md @@ -0,0 +1,19 @@ +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(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/app/sdks/server-deno/docs/examples/storage/delete-file.md b/app/sdks/server-deno/docs/examples/storage/delete-file.md new file mode 100644 index 0000000000..63a4a7a163 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/storage/delete-file.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/storage/get-file-download.md b/app/sdks/server-deno/docs/examples/storage/get-file-download.md new file mode 100644 index 0000000000..e46a6276c5 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/storage/get-file-download.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/storage/get-file-preview.md b/app/sdks/server-deno/docs/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..d55e4e2c78 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/storage/get-file-preview.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/storage/get-file-view.md b/app/sdks/server-deno/docs/examples/storage/get-file-view.md new file mode 100644 index 0000000000..9f13a1b2cb --- /dev/null +++ b/app/sdks/server-deno/docs/examples/storage/get-file-view.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/storage/get-file.md b/app/sdks/server-deno/docs/examples/storage/get-file.md new file mode 100644 index 0000000000..56d16adbc1 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/storage/get-file.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/storage/list-files.md b/app/sdks/server-deno/docs/examples/storage/list-files.md new file mode 100644 index 0000000000..56279b6a47 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/storage/list-files.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/storage/update-file.md b/app/sdks/server-deno/docs/examples/storage/update-file.md new file mode 100644 index 0000000000..c2493a27d6 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/storage/update-file.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/teams/create-membership.md b/app/sdks/server-deno/docs/examples/teams/create-membership.md new file mode 100644 index 0000000000..19ed6d1e84 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/teams/create-membership.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/teams/create.md b/app/sdks/server-deno/docs/examples/teams/create.md new file mode 100644 index 0000000000..548ddc6722 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/teams/create.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/teams/delete-membership.md b/app/sdks/server-deno/docs/examples/teams/delete-membership.md new file mode 100644 index 0000000000..98e05f4655 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/teams/delete-membership.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/teams/delete.md b/app/sdks/server-deno/docs/examples/teams/delete.md new file mode 100644 index 0000000000..54d0e7c0b6 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/teams/delete.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/teams/get-memberships.md b/app/sdks/server-deno/docs/examples/teams/get-memberships.md new file mode 100644 index 0000000000..b3e0c6990d --- /dev/null +++ b/app/sdks/server-deno/docs/examples/teams/get-memberships.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/teams/get.md b/app/sdks/server-deno/docs/examples/teams/get.md new file mode 100644 index 0000000000..36a74c20eb --- /dev/null +++ b/app/sdks/server-deno/docs/examples/teams/get.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/teams/list.md b/app/sdks/server-deno/docs/examples/teams/list.md new file mode 100644 index 0000000000..0fabc7bd1a --- /dev/null +++ b/app/sdks/server-deno/docs/examples/teams/list.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/teams/update.md b/app/sdks/server-deno/docs/examples/teams/update.md new file mode 100644 index 0000000000..f28143d989 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/teams/update.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/users/create.md b/app/sdks/server-deno/docs/examples/users/create.md new file mode 100644 index 0000000000..0a7c27aef2 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/users/create.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/users/delete-session.md b/app/sdks/server-deno/docs/examples/users/delete-session.md new file mode 100644 index 0000000000..fce31a8329 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/users/delete-session.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/users/delete-sessions.md b/app/sdks/server-deno/docs/examples/users/delete-sessions.md new file mode 100644 index 0000000000..ad29540583 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/users/delete-sessions.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/users/get-logs.md b/app/sdks/server-deno/docs/examples/users/get-logs.md new file mode 100644 index 0000000000..e7243cdd57 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/users/get-logs.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/users/get-prefs.md b/app/sdks/server-deno/docs/examples/users/get-prefs.md new file mode 100644 index 0000000000..9cce769aa9 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/users/get-prefs.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/users/get-sessions.md b/app/sdks/server-deno/docs/examples/users/get-sessions.md new file mode 100644 index 0000000000..0aded27e16 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/users/get-sessions.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/users/get.md b/app/sdks/server-deno/docs/examples/users/get.md new file mode 100644 index 0000000000..fe08ece8d9 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/users/get.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/users/list.md b/app/sdks/server-deno/docs/examples/users/list.md new file mode 100644 index 0000000000..9a290eb0b7 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/users/list.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/users/update-prefs.md b/app/sdks/server-deno/docs/examples/users/update-prefs.md new file mode 100644 index 0000000000..db180ed7ae --- /dev/null +++ b/app/sdks/server-deno/docs/examples/users/update-prefs.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/docs/examples/users/update-status.md b/app/sdks/server-deno/docs/examples/users/update-status.md new file mode 100644 index 0000000000..dfd3d44202 --- /dev/null +++ b/app/sdks/server-deno/docs/examples/users/update-status.md @@ -0,0 +1,19 @@ +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/app/sdks/server-deno/mod.ts b/app/sdks/server-deno/mod.ts new file mode 100644 index 0000000000..3e51466fe6 --- /dev/null +++ b/app/sdks/server-deno/mod.ts @@ -0,0 +1,19 @@ +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 new file mode 100644 index 0000000000..4c7b8dd3d0 --- /dev/null +++ b/app/sdks/server-deno/src/client.ts @@ -0,0 +1,138 @@ +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.1', + }; + + /** + * 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 new file mode 100644 index 0000000000..ceedf1a0c3 --- /dev/null +++ b/app/sdks/server-deno/src/service.ts @@ -0,0 +1,13 @@ +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 new file mode 100644 index 0000000000..f70e950bed --- /dev/null +++ b/app/sdks/server-deno/src/services/avatars.ts @@ -0,0 +1,163 @@ +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 new file mode 100644 index 0000000000..30e601b2e5 --- /dev/null +++ b/app/sdks/server-deno/src/services/database.ts @@ -0,0 +1,282 @@ +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. + * + * @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 new file mode 100644 index 0000000000..df5c18a2cb --- /dev/null +++ b/app/sdks/server-deno/src/services/health.ts @@ -0,0 +1,232 @@ +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 new file mode 100644 index 0000000000..0c42ac61d2 --- /dev/null +++ b/app/sdks/server-deno/src/services/locale.ts @@ -0,0 +1,124 @@ +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 new file mode 100644 index 0000000000..b644d3a61d --- /dev/null +++ b/app/sdks/server-deno/src/services/storage.ts @@ -0,0 +1,198 @@ +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 new file mode 100644 index 0000000000..f4a936b537 --- /dev/null +++ b/app/sdks/server-deno/src/services/teams.ts @@ -0,0 +1,201 @@ +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/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 new file mode 100644 index 0000000000..ac48507f08 --- /dev/null +++ b/app/sdks/server-deno/src/services/users.ts @@ -0,0 +1,214 @@ +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/README.md b/app/sdks/server-go/README.md index 6769ae8da2..3b46d51f79 100644 --- a/app/sdks/server-go/README.md +++ b/app/sdks/server-go/README.md @@ -1,9 +1,9 @@ # 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.5.3-blue.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.5.3. For older versions, please check previous releases.** +**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. 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 new file mode 100644 index 0000000000..a6f363dde1 --- /dev/null +++ b/app/sdks/server-go/docs/examples/health/get-anti-virus.md @@ -0,0 +1,25 @@ +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-queue-functions.md b/app/sdks/server-go/docs/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..5df453068b --- /dev/null +++ b/app/sdks/server-go/docs/examples/health/get-queue-functions.md @@ -0,0 +1,25 @@ +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/health.go b/app/sdks/server-go/health.go index eb4832cebf..d3b6b3a926 100644 --- a/app/sdks/server-go/health.go +++ b/app/sdks/server-go/health.go @@ -26,6 +26,17 @@ func (srv *Health) Get() (map[string]interface{}, error) { 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) { @@ -60,6 +71,16 @@ func (srv *Health) GetQueueCertificates() (map[string]interface{}, error) { 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) { @@ -104,17 +125,6 @@ func (srv *Health) GetQueueWebhooks() (map[string]interface{}, error) { return srv.client.Call("GET", path, nil, params) } -// GetStorageAntiVirus check the Appwrite Anti Virus server is up and -// connection is successful. -func (srv *Health) GetStorageAntiVirus() (map[string]interface{}, error) { - path := "/health/storage/anti-virus" - - 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) { diff --git a/app/sdks/server-java/README.md b/app/sdks/server-java/README.md index 85d13be4e6..05e7d85945 100644 --- a/app/sdks/server-java/README.md +++ b/app/sdks/server-java/README.md @@ -1,9 +1,9 @@ # 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.5.3-blue.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.5.3. For older versions, please check previous releases.** +**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. diff --git a/app/sdks/server-java/src/main/java/services/Health.java b/app/sdks/server-java/src/main/java/services/Health.java index 2d9ff9d360..08e23433d1 100644 --- a/app/sdks/server-java/src/main/java/services/Health.java +++ b/app/sdks/server-java/src/main/java/services/Health.java @@ -18,7 +18,7 @@ public class Health extends Service { super(client); } - /// Check API HTTP Health + /// Get HTTP /* * Check the Appwrite HTTP server is up and responsive. */ @@ -37,7 +37,26 @@ public class Health extends Service { return client.call("GET", path, headers, params); } - /// Check Cache Health + /// 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. @@ -57,7 +76,7 @@ public class Health extends Service { return client.call("GET", path, headers, params); } - /// Check DB Health + /// Get DB /* * Check the Appwrite database server is up and connection is successful. */ @@ -76,7 +95,7 @@ public class Health extends Service { return client.call("GET", path, headers, params); } - /// Check the number of pending certificate messages + /// Get Certificate Queue /* * Get the number of certificates that are waiting to be issued against * [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue @@ -97,7 +116,23 @@ public class Health extends Service { return client.call("GET", path, headers, params); } - /// Check the number of pending log messages + /// 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. @@ -117,7 +152,7 @@ public class Health extends Service { return client.call("GET", path, headers, params); } - /// Check the number of pending task messages + /// Get Tasks Queue /* * Get the number of tasks that are waiting to be processed in the Appwrite * internal queue server. @@ -137,7 +172,7 @@ public class Health extends Service { return client.call("GET", path, headers, params); } - /// Check the number of pending usage messages + /// Get Usage Queue /* * Get the number of usage stats that are waiting to be processed in the * Appwrite internal queue server. @@ -157,7 +192,7 @@ public class Health extends Service { return client.call("GET", path, headers, params); } - /// Check number of pending webhook messages + /// Get Webhooks Queue /* * Get the number of webhooks that are waiting to be processed in the Appwrite * internal queue server. @@ -177,26 +212,7 @@ public class Health extends Service { return client.call("GET", path, headers, params); } - /// Check Anti virus Health - /* - * Check the Appwrite Anti Virus server is up and connection is successful. - */ - public Call getStorageAntiVirus() { - final String path = "/health/storage/anti-virus"; - - final Map params = Map.ofEntries( - ); - - - - final Map headers = Map.ofEntries( - entry("content-type", "application/json") - ); - - return client.call("GET", path, headers, params); - } - - /// Check File System Health + /// Get Local Storage /* * Check the Appwrite local storage device is up and connection is successful. */ @@ -215,7 +231,7 @@ public class Health extends Service { return client.call("GET", path, headers, params); } - /// Check Time Health + /// 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 diff --git a/app/sdks/server-nodejs/README.md b/app/sdks/server-nodejs/README.md index b51df55ce9..abf67fea4e 100644 --- a/app/sdks/server-nodejs/README.md +++ b/app/sdks/server-nodejs/README.md @@ -1,7 +1,7 @@ -# Appwrite SDK for NodeJS +# 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.5.3-blue.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. diff --git a/app/sdks/server-nodejs/docs/examples/avatars/get-browser.md b/app/sdks/server-nodejs/docs/examples/avatars/get-browser.md index 662526f015..2a670ce08b 100644 --- a/app/sdks/server-nodejs/docs/examples/avatars/get-browser.md +++ b/app/sdks/server-nodejs/docs/examples/avatars/get-browser.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/avatars/get-credit-card.md b/app/sdks/server-nodejs/docs/examples/avatars/get-credit-card.md index 98165f3d3e..afd38f5a97 100644 --- a/app/sdks/server-nodejs/docs/examples/avatars/get-credit-card.md +++ b/app/sdks/server-nodejs/docs/examples/avatars/get-credit-card.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/avatars/get-favicon.md b/app/sdks/server-nodejs/docs/examples/avatars/get-favicon.md index 2b0c9c60f7..bb347371d4 100644 --- a/app/sdks/server-nodejs/docs/examples/avatars/get-favicon.md +++ b/app/sdks/server-nodejs/docs/examples/avatars/get-favicon.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/avatars/get-flag.md b/app/sdks/server-nodejs/docs/examples/avatars/get-flag.md index 79d6869b4c..db677bc4f8 100644 --- a/app/sdks/server-nodejs/docs/examples/avatars/get-flag.md +++ b/app/sdks/server-nodejs/docs/examples/avatars/get-flag.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/avatars/get-image.md b/app/sdks/server-nodejs/docs/examples/avatars/get-image.md index 6652964694..efa871ea63 100644 --- a/app/sdks/server-nodejs/docs/examples/avatars/get-image.md +++ b/app/sdks/server-nodejs/docs/examples/avatars/get-image.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/avatars/get-q-r.md b/app/sdks/server-nodejs/docs/examples/avatars/get-q-r.md index d827ee2179..e79b3235af 100644 --- a/app/sdks/server-nodejs/docs/examples/avatars/get-q-r.md +++ b/app/sdks/server-nodejs/docs/examples/avatars/get-q-r.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/database/create-collection.md b/app/sdks/server-nodejs/docs/examples/database/create-collection.md index 3e0f8b4270..c0207f30f0 100644 --- a/app/sdks/server-nodejs/docs/examples/database/create-collection.md +++ b/app/sdks/server-nodejs/docs/examples/database/create-collection.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/database/create-document.md b/app/sdks/server-nodejs/docs/examples/database/create-document.md index 9375820357..8676dfb84d 100644 --- a/app/sdks/server-nodejs/docs/examples/database/create-document.md +++ b/app/sdks/server-nodejs/docs/examples/database/create-document.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/database/delete-collection.md b/app/sdks/server-nodejs/docs/examples/database/delete-collection.md index f8c0bf99f8..503da98a73 100644 --- a/app/sdks/server-nodejs/docs/examples/database/delete-collection.md +++ b/app/sdks/server-nodejs/docs/examples/database/delete-collection.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/database/delete-document.md b/app/sdks/server-nodejs/docs/examples/database/delete-document.md index d0faf7a519..f14c985e83 100644 --- a/app/sdks/server-nodejs/docs/examples/database/delete-document.md +++ b/app/sdks/server-nodejs/docs/examples/database/delete-document.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/database/get-collection-logs.md b/app/sdks/server-nodejs/docs/examples/database/get-collection-logs.md index 580ca8fc3a..5bc911624b 100644 --- a/app/sdks/server-nodejs/docs/examples/database/get-collection-logs.md +++ b/app/sdks/server-nodejs/docs/examples/database/get-collection-logs.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/database/get-collection.md b/app/sdks/server-nodejs/docs/examples/database/get-collection.md index e789936066..a14ce0d49a 100644 --- a/app/sdks/server-nodejs/docs/examples/database/get-collection.md +++ b/app/sdks/server-nodejs/docs/examples/database/get-collection.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/database/get-document.md b/app/sdks/server-nodejs/docs/examples/database/get-document.md index 1f19c6d4e4..55cce32b9b 100644 --- a/app/sdks/server-nodejs/docs/examples/database/get-document.md +++ b/app/sdks/server-nodejs/docs/examples/database/get-document.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/database/list-collections.md b/app/sdks/server-nodejs/docs/examples/database/list-collections.md index 787201b8c8..bacfdb062c 100644 --- a/app/sdks/server-nodejs/docs/examples/database/list-collections.md +++ b/app/sdks/server-nodejs/docs/examples/database/list-collections.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/database/list-documents.md b/app/sdks/server-nodejs/docs/examples/database/list-documents.md index a5f68f9adf..ad02d05e2a 100644 --- a/app/sdks/server-nodejs/docs/examples/database/list-documents.md +++ b/app/sdks/server-nodejs/docs/examples/database/list-documents.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/database/update-collection.md b/app/sdks/server-nodejs/docs/examples/database/update-collection.md index 03c5276066..eb9326565a 100644 --- a/app/sdks/server-nodejs/docs/examples/database/update-collection.md +++ b/app/sdks/server-nodejs/docs/examples/database/update-collection.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/database/update-document.md b/app/sdks/server-nodejs/docs/examples/database/update-document.md index aa595eb5d4..131722cd26 100644 --- a/app/sdks/server-nodejs/docs/examples/database/update-document.md +++ b/app/sdks/server-nodejs/docs/examples/database/update-document.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/health/get-anti-virus.md b/app/sdks/server-nodejs/docs/examples/health/get-anti-virus.md new file mode 100644 index 0000000000..c08e612bcf --- /dev/null +++ b/app/sdks/server-nodejs/docs/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/app/sdks/server-nodejs/docs/examples/health/get-cache.md b/app/sdks/server-nodejs/docs/examples/health/get-cache.md index 6b49af6ffd..d19cc8abd5 100644 --- a/app/sdks/server-nodejs/docs/examples/health/get-cache.md +++ b/app/sdks/server-nodejs/docs/examples/health/get-cache.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/health/get-d-b.md b/app/sdks/server-nodejs/docs/examples/health/get-d-b.md index 273ad1ad74..08505367d4 100644 --- a/app/sdks/server-nodejs/docs/examples/health/get-d-b.md +++ b/app/sdks/server-nodejs/docs/examples/health/get-d-b.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/health/get-queue-certificates.md b/app/sdks/server-nodejs/docs/examples/health/get-queue-certificates.md index 23494f189b..2eb69e0126 100644 --- a/app/sdks/server-nodejs/docs/examples/health/get-queue-certificates.md +++ b/app/sdks/server-nodejs/docs/examples/health/get-queue-certificates.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/health/get-queue-functions.md b/app/sdks/server-nodejs/docs/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..9470e11646 --- /dev/null +++ b/app/sdks/server-nodejs/docs/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/app/sdks/server-nodejs/docs/examples/health/get-queue-logs.md b/app/sdks/server-nodejs/docs/examples/health/get-queue-logs.md index b4423c5c96..10f1cb24e3 100644 --- a/app/sdks/server-nodejs/docs/examples/health/get-queue-logs.md +++ b/app/sdks/server-nodejs/docs/examples/health/get-queue-logs.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/health/get-queue-tasks.md b/app/sdks/server-nodejs/docs/examples/health/get-queue-tasks.md index f581d8c1ed..c159f4e6ee 100644 --- a/app/sdks/server-nodejs/docs/examples/health/get-queue-tasks.md +++ b/app/sdks/server-nodejs/docs/examples/health/get-queue-tasks.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/health/get-queue-usage.md b/app/sdks/server-nodejs/docs/examples/health/get-queue-usage.md index e8774856ce..6286c741ee 100644 --- a/app/sdks/server-nodejs/docs/examples/health/get-queue-usage.md +++ b/app/sdks/server-nodejs/docs/examples/health/get-queue-usage.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/health/get-queue-webhooks.md b/app/sdks/server-nodejs/docs/examples/health/get-queue-webhooks.md index 24333e8ec4..3a788eb895 100644 --- a/app/sdks/server-nodejs/docs/examples/health/get-queue-webhooks.md +++ b/app/sdks/server-nodejs/docs/examples/health/get-queue-webhooks.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/health/get-storage-local.md b/app/sdks/server-nodejs/docs/examples/health/get-storage-local.md index 2323be7d9d..84b8fb47a6 100644 --- a/app/sdks/server-nodejs/docs/examples/health/get-storage-local.md +++ b/app/sdks/server-nodejs/docs/examples/health/get-storage-local.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/health/get-time.md b/app/sdks/server-nodejs/docs/examples/health/get-time.md index c3d2a369d4..563bf2fb52 100644 --- a/app/sdks/server-nodejs/docs/examples/health/get-time.md +++ b/app/sdks/server-nodejs/docs/examples/health/get-time.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/health/get.md b/app/sdks/server-nodejs/docs/examples/health/get.md index 8b504497ef..20c3d40801 100644 --- a/app/sdks/server-nodejs/docs/examples/health/get.md +++ b/app/sdks/server-nodejs/docs/examples/health/get.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/locale/get-continents.md b/app/sdks/server-nodejs/docs/examples/locale/get-continents.md index 437672de14..323237b4ab 100644 --- a/app/sdks/server-nodejs/docs/examples/locale/get-continents.md +++ b/app/sdks/server-nodejs/docs/examples/locale/get-continents.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/locale/get-countries-e-u.md b/app/sdks/server-nodejs/docs/examples/locale/get-countries-e-u.md index 023f079bee..fc9170dba4 100644 --- a/app/sdks/server-nodejs/docs/examples/locale/get-countries-e-u.md +++ b/app/sdks/server-nodejs/docs/examples/locale/get-countries-e-u.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/locale/get-countries-phones.md b/app/sdks/server-nodejs/docs/examples/locale/get-countries-phones.md index 9ecf5289dc..42be901677 100644 --- a/app/sdks/server-nodejs/docs/examples/locale/get-countries-phones.md +++ b/app/sdks/server-nodejs/docs/examples/locale/get-countries-phones.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/locale/get-countries.md b/app/sdks/server-nodejs/docs/examples/locale/get-countries.md index 54acdfd12f..437c9bb502 100644 --- a/app/sdks/server-nodejs/docs/examples/locale/get-countries.md +++ b/app/sdks/server-nodejs/docs/examples/locale/get-countries.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/locale/get-currencies.md b/app/sdks/server-nodejs/docs/examples/locale/get-currencies.md index b947708adb..1b7d605760 100644 --- a/app/sdks/server-nodejs/docs/examples/locale/get-currencies.md +++ b/app/sdks/server-nodejs/docs/examples/locale/get-currencies.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/locale/get.md b/app/sdks/server-nodejs/docs/examples/locale/get.md index 293612f9d4..2f2eb95d90 100644 --- a/app/sdks/server-nodejs/docs/examples/locale/get.md +++ b/app/sdks/server-nodejs/docs/examples/locale/get.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/storage/create-file.md b/app/sdks/server-nodejs/docs/examples/storage/create-file.md index 9a24cac516..1eda9fd868 100644 --- a/app/sdks/server-nodejs/docs/examples/storage/create-file.md +++ b/app/sdks/server-nodejs/docs/examples/storage/create-file.md @@ -7,6 +7,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/storage/delete-file.md b/app/sdks/server-nodejs/docs/examples/storage/delete-file.md index 7c7e22f335..9ce0ff7f2e 100644 --- a/app/sdks/server-nodejs/docs/examples/storage/delete-file.md +++ b/app/sdks/server-nodejs/docs/examples/storage/delete-file.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/storage/get-file-download.md b/app/sdks/server-nodejs/docs/examples/storage/get-file-download.md index 63a8da4e3f..1683ed87e0 100644 --- a/app/sdks/server-nodejs/docs/examples/storage/get-file-download.md +++ b/app/sdks/server-nodejs/docs/examples/storage/get-file-download.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/storage/get-file-preview.md b/app/sdks/server-nodejs/docs/examples/storage/get-file-preview.md index c4339db0c2..771dcd35f0 100644 --- a/app/sdks/server-nodejs/docs/examples/storage/get-file-preview.md +++ b/app/sdks/server-nodejs/docs/examples/storage/get-file-preview.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/storage/get-file-view.md b/app/sdks/server-nodejs/docs/examples/storage/get-file-view.md index 3fa784e548..83029ecdee 100644 --- a/app/sdks/server-nodejs/docs/examples/storage/get-file-view.md +++ b/app/sdks/server-nodejs/docs/examples/storage/get-file-view.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/storage/get-file.md b/app/sdks/server-nodejs/docs/examples/storage/get-file.md index 91cce65d90..2a76fdf189 100644 --- a/app/sdks/server-nodejs/docs/examples/storage/get-file.md +++ b/app/sdks/server-nodejs/docs/examples/storage/get-file.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/storage/list-files.md b/app/sdks/server-nodejs/docs/examples/storage/list-files.md index 349433700c..e11fd95300 100644 --- a/app/sdks/server-nodejs/docs/examples/storage/list-files.md +++ b/app/sdks/server-nodejs/docs/examples/storage/list-files.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/storage/update-file.md b/app/sdks/server-nodejs/docs/examples/storage/update-file.md index a424a8e576..4726169146 100644 --- a/app/sdks/server-nodejs/docs/examples/storage/update-file.md +++ b/app/sdks/server-nodejs/docs/examples/storage/update-file.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/teams/create-membership.md b/app/sdks/server-nodejs/docs/examples/teams/create-membership.md index 03d569beee..cd17042e58 100644 --- a/app/sdks/server-nodejs/docs/examples/teams/create-membership.md +++ b/app/sdks/server-nodejs/docs/examples/teams/create-membership.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/teams/create.md b/app/sdks/server-nodejs/docs/examples/teams/create.md index 2a581f6bf4..c0d0611a49 100644 --- a/app/sdks/server-nodejs/docs/examples/teams/create.md +++ b/app/sdks/server-nodejs/docs/examples/teams/create.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/teams/delete-membership.md b/app/sdks/server-nodejs/docs/examples/teams/delete-membership.md index d6c1807e19..f9a76f3ec0 100644 --- a/app/sdks/server-nodejs/docs/examples/teams/delete-membership.md +++ b/app/sdks/server-nodejs/docs/examples/teams/delete-membership.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/teams/delete.md b/app/sdks/server-nodejs/docs/examples/teams/delete.md index 9801610fc4..e833fdfb9b 100644 --- a/app/sdks/server-nodejs/docs/examples/teams/delete.md +++ b/app/sdks/server-nodejs/docs/examples/teams/delete.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/teams/get-memberships.md b/app/sdks/server-nodejs/docs/examples/teams/get-memberships.md index 9e3690ffdd..75cdf38e5c 100644 --- a/app/sdks/server-nodejs/docs/examples/teams/get-memberships.md +++ b/app/sdks/server-nodejs/docs/examples/teams/get-memberships.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/teams/get.md b/app/sdks/server-nodejs/docs/examples/teams/get.md index 5d14c3163d..a51322df27 100644 --- a/app/sdks/server-nodejs/docs/examples/teams/get.md +++ b/app/sdks/server-nodejs/docs/examples/teams/get.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/teams/list.md b/app/sdks/server-nodejs/docs/examples/teams/list.md index 237925fee2..259bbd22b2 100644 --- a/app/sdks/server-nodejs/docs/examples/teams/list.md +++ b/app/sdks/server-nodejs/docs/examples/teams/list.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/teams/update.md b/app/sdks/server-nodejs/docs/examples/teams/update.md index 6f5bd1b51b..2118e8a90f 100644 --- a/app/sdks/server-nodejs/docs/examples/teams/update.md +++ b/app/sdks/server-nodejs/docs/examples/teams/update.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/users/create.md b/app/sdks/server-nodejs/docs/examples/users/create.md index 692e221008..83704cbd9d 100644 --- a/app/sdks/server-nodejs/docs/examples/users/create.md +++ b/app/sdks/server-nodejs/docs/examples/users/create.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/users/delete-session.md b/app/sdks/server-nodejs/docs/examples/users/delete-session.md index 9715f20bd1..22308d4fa6 100644 --- a/app/sdks/server-nodejs/docs/examples/users/delete-session.md +++ b/app/sdks/server-nodejs/docs/examples/users/delete-session.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/users/delete-sessions.md b/app/sdks/server-nodejs/docs/examples/users/delete-sessions.md index 3c25045433..75f8f96bda 100644 --- a/app/sdks/server-nodejs/docs/examples/users/delete-sessions.md +++ b/app/sdks/server-nodejs/docs/examples/users/delete-sessions.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/users/get-logs.md b/app/sdks/server-nodejs/docs/examples/users/get-logs.md index 70ba499a97..1287b5ef5f 100644 --- a/app/sdks/server-nodejs/docs/examples/users/get-logs.md +++ b/app/sdks/server-nodejs/docs/examples/users/get-logs.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/users/get-prefs.md b/app/sdks/server-nodejs/docs/examples/users/get-prefs.md index 4824700394..088e6b0811 100644 --- a/app/sdks/server-nodejs/docs/examples/users/get-prefs.md +++ b/app/sdks/server-nodejs/docs/examples/users/get-prefs.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/users/get-sessions.md b/app/sdks/server-nodejs/docs/examples/users/get-sessions.md index cf14125b43..f5ad029ebe 100644 --- a/app/sdks/server-nodejs/docs/examples/users/get-sessions.md +++ b/app/sdks/server-nodejs/docs/examples/users/get-sessions.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/users/get.md b/app/sdks/server-nodejs/docs/examples/users/get.md index 1f69cfcf9e..5b91577284 100644 --- a/app/sdks/server-nodejs/docs/examples/users/get.md +++ b/app/sdks/server-nodejs/docs/examples/users/get.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/users/list.md b/app/sdks/server-nodejs/docs/examples/users/list.md index 0d8c4e8b94..0bc83b06bf 100644 --- a/app/sdks/server-nodejs/docs/examples/users/list.md +++ b/app/sdks/server-nodejs/docs/examples/users/list.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/users/update-prefs.md b/app/sdks/server-nodejs/docs/examples/users/update-prefs.md index f06a5c0a0e..7d1011d6be 100644 --- a/app/sdks/server-nodejs/docs/examples/users/update-prefs.md +++ b/app/sdks/server-nodejs/docs/examples/users/update-prefs.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/docs/examples/users/update-status.md b/app/sdks/server-nodejs/docs/examples/users/update-status.md index 0849c0805a..86f54381da 100644 --- a/app/sdks/server-nodejs/docs/examples/users/update-status.md +++ b/app/sdks/server-nodejs/docs/examples/users/update-status.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-nodejs/lib/client.js b/app/sdks/server-nodejs/lib/client.js index 024c4f1c5b..add1956056 100644 --- a/app/sdks/server-nodejs/lib/client.js +++ b/app/sdks/server-nodejs/lib/client.js @@ -7,7 +7,7 @@ class Client { this.endpoint = 'https://appwrite.io/v1'; this.headers = { 'content-type': '', - 'x-sdk-version': 'appwrite:nodejs:1.0.32', + 'x-sdk-version': 'appwrite:nodejs:1.1.0', }; this.selfSigned = false; } diff --git a/app/sdks/server-nodejs/lib/services/health.js b/app/sdks/server-nodejs/lib/services/health.js index a77e07eb64..a0aed052ce 100644 --- a/app/sdks/server-nodejs/lib/services/health.js +++ b/app/sdks/server-nodejs/lib/services/health.js @@ -3,7 +3,7 @@ const Service = require('../service.js'); class Health extends Service { /** - * Check API HTTP Health + * Get HTTP * * Check the Appwrite HTTP server is up and responsive. * @@ -21,7 +21,25 @@ class Health extends Service { } /** - * Check Cache Health + * 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. @@ -40,7 +58,7 @@ class Health extends Service { } /** - * Check DB Health + * Get DB * * Check the Appwrite database server is up and connection is successful. * @@ -58,7 +76,7 @@ class Health extends Service { } /** - * Check the number of pending certificate messages + * Get Certificate Queue * * Get the number of certificates that are waiting to be issued against * [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue @@ -78,7 +96,23 @@ class Health extends Service { } /** - * Check the number of pending log messages + * 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. @@ -97,7 +131,7 @@ class Health extends Service { } /** - * Check the number of pending task messages + * Get Tasks Queue * * Get the number of tasks that are waiting to be processed in the Appwrite * internal queue server. @@ -116,7 +150,7 @@ class Health extends Service { } /** - * Check the number of pending usage messages + * Get Usage Queue * * Get the number of usage stats that are waiting to be processed in the * Appwrite internal queue server. @@ -135,7 +169,7 @@ class Health extends Service { } /** - * Check number of pending webhook messages + * Get Webhooks Queue * * Get the number of webhooks that are waiting to be processed in the Appwrite * internal queue server. @@ -154,25 +188,7 @@ class Health extends Service { } /** - * Check Anti virus Health - * - * Check the Appwrite Anti Virus server is up and connection is successful. - * - * @throws Exception - * @return {} - */ - async getStorageAntiVirus() { - let path = '/health/storage/anti-virus'; - - return await this.client.call('get', path, { - 'content-type': 'application/json', - }, - { - }); - } - - /** - * Check File System Health + * Get Local Storage * * Check the Appwrite local storage device is up and connection is successful. * @@ -190,7 +206,7 @@ class Health extends Service { } /** - * Check Time Health + * 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 diff --git a/app/sdks/server-nodejs/package.json b/app/sdks/server-nodejs/package.json index f55aed2719..377ea48db2 100644 --- a/app/sdks/server-nodejs/package.json +++ b/app/sdks/server-nodejs/package.json @@ -2,7 +2,7 @@ "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.0.32", + "version": "1.1.0", "license": "BSD-3-Clause", "main": "index.js", "repository": { diff --git a/app/sdks/server-php/README.md b/app/sdks/server-php/README.md index 140173b028..0d64f84fca 100644 --- a/app/sdks/server-php/README.md +++ b/app/sdks/server-php/README.md @@ -1,7 +1,7 @@ -# Appwrite SDK for PHP +# 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.5.3-blue.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. diff --git a/app/sdks/server-php/composer.json b/app/sdks/server-php/composer.json index fc13cb3bed..64d2e1746f 100644 --- a/app/sdks/server-php/composer.json +++ b/app/sdks/server-php/composer.json @@ -7,7 +7,7 @@ "license": "BSD-3-Clause", "support": { "url": "https://appwrite.io/support", - "email": "team@appwrite.io" + "email": "team@localhost.test" }, "autoload": { "psr-4": { diff --git a/app/sdks/server-php/docs/examples/avatars/get-browser.md b/app/sdks/server-php/docs/examples/avatars/get-browser.md index e1d578d09f..795d79157e 100644 --- a/app/sdks/server-php/docs/examples/avatars/get-browser.md +++ b/app/sdks/server-php/docs/examples/avatars/get-browser.md @@ -6,6 +6,7 @@ use Appwrite\Services\Avatars; $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/avatars/get-credit-card.md b/app/sdks/server-php/docs/examples/avatars/get-credit-card.md index 24f2e75bfc..33879d0179 100644 --- a/app/sdks/server-php/docs/examples/avatars/get-credit-card.md +++ b/app/sdks/server-php/docs/examples/avatars/get-credit-card.md @@ -6,6 +6,7 @@ use Appwrite\Services\Avatars; $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/avatars/get-favicon.md b/app/sdks/server-php/docs/examples/avatars/get-favicon.md index b0c33ccb3e..dee19dbf04 100644 --- a/app/sdks/server-php/docs/examples/avatars/get-favicon.md +++ b/app/sdks/server-php/docs/examples/avatars/get-favicon.md @@ -6,6 +6,7 @@ use Appwrite\Services\Avatars; $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/avatars/get-flag.md b/app/sdks/server-php/docs/examples/avatars/get-flag.md index 83eebce6d8..d70d7e43ec 100644 --- a/app/sdks/server-php/docs/examples/avatars/get-flag.md +++ b/app/sdks/server-php/docs/examples/avatars/get-flag.md @@ -6,6 +6,7 @@ use Appwrite\Services\Avatars; $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/avatars/get-image.md b/app/sdks/server-php/docs/examples/avatars/get-image.md index a452e07ee7..a46b9fbe37 100644 --- a/app/sdks/server-php/docs/examples/avatars/get-image.md +++ b/app/sdks/server-php/docs/examples/avatars/get-image.md @@ -6,6 +6,7 @@ use Appwrite\Services\Avatars; $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/avatars/get-q-r.md b/app/sdks/server-php/docs/examples/avatars/get-q-r.md index bc457a7e21..95b5a6d7b3 100644 --- a/app/sdks/server-php/docs/examples/avatars/get-q-r.md +++ b/app/sdks/server-php/docs/examples/avatars/get-q-r.md @@ -6,6 +6,7 @@ use Appwrite\Services\Avatars; $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/database/create-collection.md b/app/sdks/server-php/docs/examples/database/create-collection.md index b5f3ed4955..276d5049fe 100644 --- a/app/sdks/server-php/docs/examples/database/create-collection.md +++ b/app/sdks/server-php/docs/examples/database/create-collection.md @@ -6,6 +6,7 @@ use Appwrite\Services\Database; $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/database/create-document.md b/app/sdks/server-php/docs/examples/database/create-document.md index 318b66a2f1..6c32cdf950 100644 --- a/app/sdks/server-php/docs/examples/database/create-document.md +++ b/app/sdks/server-php/docs/examples/database/create-document.md @@ -6,6 +6,7 @@ use Appwrite\Services\Database; $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/database/delete-collection.md b/app/sdks/server-php/docs/examples/database/delete-collection.md index d35e7ef7e4..4018420188 100644 --- a/app/sdks/server-php/docs/examples/database/delete-collection.md +++ b/app/sdks/server-php/docs/examples/database/delete-collection.md @@ -6,6 +6,7 @@ use Appwrite\Services\Database; $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/database/delete-document.md b/app/sdks/server-php/docs/examples/database/delete-document.md index d69bc27dc1..3ed45d6ee1 100644 --- a/app/sdks/server-php/docs/examples/database/delete-document.md +++ b/app/sdks/server-php/docs/examples/database/delete-document.md @@ -6,6 +6,7 @@ use Appwrite\Services\Database; $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/database/get-collection-logs.md b/app/sdks/server-php/docs/examples/database/get-collection-logs.md index bcb8374ce2..22c547eb39 100644 --- a/app/sdks/server-php/docs/examples/database/get-collection-logs.md +++ b/app/sdks/server-php/docs/examples/database/get-collection-logs.md @@ -6,6 +6,7 @@ use Appwrite\Services\Database; $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/database/get-collection.md b/app/sdks/server-php/docs/examples/database/get-collection.md index 3f274b10ae..a088b24bb6 100644 --- a/app/sdks/server-php/docs/examples/database/get-collection.md +++ b/app/sdks/server-php/docs/examples/database/get-collection.md @@ -6,6 +6,7 @@ use Appwrite\Services\Database; $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/database/get-document.md b/app/sdks/server-php/docs/examples/database/get-document.md index 06ad41708b..d506bd8414 100644 --- a/app/sdks/server-php/docs/examples/database/get-document.md +++ b/app/sdks/server-php/docs/examples/database/get-document.md @@ -6,6 +6,7 @@ use Appwrite\Services\Database; $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/database/list-collections.md b/app/sdks/server-php/docs/examples/database/list-collections.md index f3fcc58540..4f4aa1b775 100644 --- a/app/sdks/server-php/docs/examples/database/list-collections.md +++ b/app/sdks/server-php/docs/examples/database/list-collections.md @@ -6,6 +6,7 @@ use Appwrite\Services\Database; $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/database/list-documents.md b/app/sdks/server-php/docs/examples/database/list-documents.md index 8c6e1b3f94..359da4ce33 100644 --- a/app/sdks/server-php/docs/examples/database/list-documents.md +++ b/app/sdks/server-php/docs/examples/database/list-documents.md @@ -6,6 +6,7 @@ use Appwrite\Services\Database; $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/database/update-collection.md b/app/sdks/server-php/docs/examples/database/update-collection.md index 3384d0056d..70d596066a 100644 --- a/app/sdks/server-php/docs/examples/database/update-collection.md +++ b/app/sdks/server-php/docs/examples/database/update-collection.md @@ -6,6 +6,7 @@ use Appwrite\Services\Database; $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/database/update-document.md b/app/sdks/server-php/docs/examples/database/update-document.md index c5768a07cb..4389034640 100644 --- a/app/sdks/server-php/docs/examples/database/update-document.md +++ b/app/sdks/server-php/docs/examples/database/update-document.md @@ -6,6 +6,7 @@ use Appwrite\Services\Database; $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/health/get-anti-virus.md b/app/sdks/server-php/docs/examples/health/get-anti-virus.md new file mode 100644 index 0000000000..89a5fb2a7a --- /dev/null +++ b/app/sdks/server-php/docs/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/app/sdks/server-php/docs/examples/health/get-cache.md b/app/sdks/server-php/docs/examples/health/get-cache.md index 4599dea724..e654c26f51 100644 --- a/app/sdks/server-php/docs/examples/health/get-cache.md +++ b/app/sdks/server-php/docs/examples/health/get-cache.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-php/docs/examples/health/get-d-b.md b/app/sdks/server-php/docs/examples/health/get-d-b.md index 2626ebe356..2d37991a3d 100644 --- a/app/sdks/server-php/docs/examples/health/get-d-b.md +++ b/app/sdks/server-php/docs/examples/health/get-d-b.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-php/docs/examples/health/get-queue-certificates.md b/app/sdks/server-php/docs/examples/health/get-queue-certificates.md index e6805e0ed7..57f2c5793e 100644 --- a/app/sdks/server-php/docs/examples/health/get-queue-certificates.md +++ b/app/sdks/server-php/docs/examples/health/get-queue-certificates.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-php/docs/examples/health/get-queue-functions.md b/app/sdks/server-php/docs/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..8ff6510e1c --- /dev/null +++ b/app/sdks/server-php/docs/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/app/sdks/server-php/docs/examples/health/get-queue-logs.md b/app/sdks/server-php/docs/examples/health/get-queue-logs.md index 70d4b7ee18..fa723d7391 100644 --- a/app/sdks/server-php/docs/examples/health/get-queue-logs.md +++ b/app/sdks/server-php/docs/examples/health/get-queue-logs.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-php/docs/examples/health/get-queue-tasks.md b/app/sdks/server-php/docs/examples/health/get-queue-tasks.md index a63faabfc1..b8f1794a1a 100644 --- a/app/sdks/server-php/docs/examples/health/get-queue-tasks.md +++ b/app/sdks/server-php/docs/examples/health/get-queue-tasks.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-php/docs/examples/health/get-queue-usage.md b/app/sdks/server-php/docs/examples/health/get-queue-usage.md index a48385aea5..371d02f5b4 100644 --- a/app/sdks/server-php/docs/examples/health/get-queue-usage.md +++ b/app/sdks/server-php/docs/examples/health/get-queue-usage.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-php/docs/examples/health/get-queue-webhooks.md b/app/sdks/server-php/docs/examples/health/get-queue-webhooks.md index e8433ee986..af48a72d06 100644 --- a/app/sdks/server-php/docs/examples/health/get-queue-webhooks.md +++ b/app/sdks/server-php/docs/examples/health/get-queue-webhooks.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-php/docs/examples/health/get-storage-local.md b/app/sdks/server-php/docs/examples/health/get-storage-local.md index b5c751bfbc..eba15a1652 100644 --- a/app/sdks/server-php/docs/examples/health/get-storage-local.md +++ b/app/sdks/server-php/docs/examples/health/get-storage-local.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-php/docs/examples/health/get-time.md b/app/sdks/server-php/docs/examples/health/get-time.md index 04acfa3be5..849f499460 100644 --- a/app/sdks/server-php/docs/examples/health/get-time.md +++ b/app/sdks/server-php/docs/examples/health/get-time.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-php/docs/examples/health/get.md b/app/sdks/server-php/docs/examples/health/get.md index 76c8e0b46a..9f1ec8970c 100644 --- a/app/sdks/server-php/docs/examples/health/get.md +++ b/app/sdks/server-php/docs/examples/health/get.md @@ -6,6 +6,7 @@ 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 ; diff --git a/app/sdks/server-php/docs/examples/locale/get-continents.md b/app/sdks/server-php/docs/examples/locale/get-continents.md index c642fa1414..bb099d31f5 100644 --- a/app/sdks/server-php/docs/examples/locale/get-continents.md +++ b/app/sdks/server-php/docs/examples/locale/get-continents.md @@ -6,6 +6,7 @@ use Appwrite\Services\Locale; $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/locale/get-countries-e-u.md b/app/sdks/server-php/docs/examples/locale/get-countries-e-u.md index 47bcaa417a..87287a5cea 100644 --- a/app/sdks/server-php/docs/examples/locale/get-countries-e-u.md +++ b/app/sdks/server-php/docs/examples/locale/get-countries-e-u.md @@ -6,6 +6,7 @@ use Appwrite\Services\Locale; $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/locale/get-countries-phones.md b/app/sdks/server-php/docs/examples/locale/get-countries-phones.md index 4e0bcfba94..71a39303da 100644 --- a/app/sdks/server-php/docs/examples/locale/get-countries-phones.md +++ b/app/sdks/server-php/docs/examples/locale/get-countries-phones.md @@ -6,6 +6,7 @@ use Appwrite\Services\Locale; $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/locale/get-countries.md b/app/sdks/server-php/docs/examples/locale/get-countries.md index 08557f8808..1c8f863a76 100644 --- a/app/sdks/server-php/docs/examples/locale/get-countries.md +++ b/app/sdks/server-php/docs/examples/locale/get-countries.md @@ -6,6 +6,7 @@ use Appwrite\Services\Locale; $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/locale/get-currencies.md b/app/sdks/server-php/docs/examples/locale/get-currencies.md index efbeb932de..b799bf6b80 100644 --- a/app/sdks/server-php/docs/examples/locale/get-currencies.md +++ b/app/sdks/server-php/docs/examples/locale/get-currencies.md @@ -6,6 +6,7 @@ use Appwrite\Services\Locale; $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/locale/get.md b/app/sdks/server-php/docs/examples/locale/get.md index 023d3227b0..8e11f17689 100644 --- a/app/sdks/server-php/docs/examples/locale/get.md +++ b/app/sdks/server-php/docs/examples/locale/get.md @@ -6,6 +6,7 @@ use Appwrite\Services\Locale; $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/storage/create-file.md b/app/sdks/server-php/docs/examples/storage/create-file.md index da6fa4d755..ba533dd2e7 100644 --- a/app/sdks/server-php/docs/examples/storage/create-file.md +++ b/app/sdks/server-php/docs/examples/storage/create-file.md @@ -6,6 +6,7 @@ use Appwrite\Services\Storage; $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/storage/delete-file.md b/app/sdks/server-php/docs/examples/storage/delete-file.md index 84707c25cd..23d4013d22 100644 --- a/app/sdks/server-php/docs/examples/storage/delete-file.md +++ b/app/sdks/server-php/docs/examples/storage/delete-file.md @@ -6,6 +6,7 @@ use Appwrite\Services\Storage; $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/storage/get-file-download.md b/app/sdks/server-php/docs/examples/storage/get-file-download.md index 680c5637b4..3064481141 100644 --- a/app/sdks/server-php/docs/examples/storage/get-file-download.md +++ b/app/sdks/server-php/docs/examples/storage/get-file-download.md @@ -6,6 +6,7 @@ use Appwrite\Services\Storage; $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/storage/get-file-preview.md b/app/sdks/server-php/docs/examples/storage/get-file-preview.md index 913628839c..00cb63696b 100644 --- a/app/sdks/server-php/docs/examples/storage/get-file-preview.md +++ b/app/sdks/server-php/docs/examples/storage/get-file-preview.md @@ -6,6 +6,7 @@ use Appwrite\Services\Storage; $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/storage/get-file-view.md b/app/sdks/server-php/docs/examples/storage/get-file-view.md index 88a71a1523..07b7ab32ba 100644 --- a/app/sdks/server-php/docs/examples/storage/get-file-view.md +++ b/app/sdks/server-php/docs/examples/storage/get-file-view.md @@ -6,6 +6,7 @@ use Appwrite\Services\Storage; $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/storage/get-file.md b/app/sdks/server-php/docs/examples/storage/get-file.md index 4b4554ece1..c8b6495f18 100644 --- a/app/sdks/server-php/docs/examples/storage/get-file.md +++ b/app/sdks/server-php/docs/examples/storage/get-file.md @@ -6,6 +6,7 @@ use Appwrite\Services\Storage; $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/storage/list-files.md b/app/sdks/server-php/docs/examples/storage/list-files.md index 497bada42e..787c38e320 100644 --- a/app/sdks/server-php/docs/examples/storage/list-files.md +++ b/app/sdks/server-php/docs/examples/storage/list-files.md @@ -6,6 +6,7 @@ use Appwrite\Services\Storage; $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/storage/update-file.md b/app/sdks/server-php/docs/examples/storage/update-file.md index f7f3503f4c..7515217b97 100644 --- a/app/sdks/server-php/docs/examples/storage/update-file.md +++ b/app/sdks/server-php/docs/examples/storage/update-file.md @@ -6,6 +6,7 @@ use Appwrite\Services\Storage; $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/teams/create-membership.md b/app/sdks/server-php/docs/examples/teams/create-membership.md index 8864d1f418..9c88b1bba5 100644 --- a/app/sdks/server-php/docs/examples/teams/create-membership.md +++ b/app/sdks/server-php/docs/examples/teams/create-membership.md @@ -6,6 +6,7 @@ use Appwrite\Services\Teams; $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/teams/create.md b/app/sdks/server-php/docs/examples/teams/create.md index 45646098cb..7b0946bc83 100644 --- a/app/sdks/server-php/docs/examples/teams/create.md +++ b/app/sdks/server-php/docs/examples/teams/create.md @@ -6,6 +6,7 @@ use Appwrite\Services\Teams; $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/teams/delete-membership.md b/app/sdks/server-php/docs/examples/teams/delete-membership.md index 0bf19be778..ca9d3d57c0 100644 --- a/app/sdks/server-php/docs/examples/teams/delete-membership.md +++ b/app/sdks/server-php/docs/examples/teams/delete-membership.md @@ -6,6 +6,7 @@ use Appwrite\Services\Teams; $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/teams/delete.md b/app/sdks/server-php/docs/examples/teams/delete.md index 4d1bcee7b8..394a1940fc 100644 --- a/app/sdks/server-php/docs/examples/teams/delete.md +++ b/app/sdks/server-php/docs/examples/teams/delete.md @@ -6,6 +6,7 @@ use Appwrite\Services\Teams; $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/teams/get-memberships.md b/app/sdks/server-php/docs/examples/teams/get-memberships.md index bd71709838..56f6d59063 100644 --- a/app/sdks/server-php/docs/examples/teams/get-memberships.md +++ b/app/sdks/server-php/docs/examples/teams/get-memberships.md @@ -6,6 +6,7 @@ use Appwrite\Services\Teams; $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/teams/get.md b/app/sdks/server-php/docs/examples/teams/get.md index d9b3ba11dd..6f0b705707 100644 --- a/app/sdks/server-php/docs/examples/teams/get.md +++ b/app/sdks/server-php/docs/examples/teams/get.md @@ -6,6 +6,7 @@ use Appwrite\Services\Teams; $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/teams/list.md b/app/sdks/server-php/docs/examples/teams/list.md index a127a3d1eb..d17bb7689b 100644 --- a/app/sdks/server-php/docs/examples/teams/list.md +++ b/app/sdks/server-php/docs/examples/teams/list.md @@ -6,6 +6,7 @@ use Appwrite\Services\Teams; $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/teams/update.md b/app/sdks/server-php/docs/examples/teams/update.md index 6318ca5bad..945001dc36 100644 --- a/app/sdks/server-php/docs/examples/teams/update.md +++ b/app/sdks/server-php/docs/examples/teams/update.md @@ -6,6 +6,7 @@ use Appwrite\Services\Teams; $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/users/create.md b/app/sdks/server-php/docs/examples/users/create.md index bc52ac6836..53497b4277 100644 --- a/app/sdks/server-php/docs/examples/users/create.md +++ b/app/sdks/server-php/docs/examples/users/create.md @@ -6,6 +6,7 @@ use Appwrite\Services\Users; $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/users/delete-session.md b/app/sdks/server-php/docs/examples/users/delete-session.md index 02acfeddd2..ead6de7549 100644 --- a/app/sdks/server-php/docs/examples/users/delete-session.md +++ b/app/sdks/server-php/docs/examples/users/delete-session.md @@ -6,6 +6,7 @@ use Appwrite\Services\Users; $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/users/delete-sessions.md b/app/sdks/server-php/docs/examples/users/delete-sessions.md index 461c4e1df5..968d788ea7 100644 --- a/app/sdks/server-php/docs/examples/users/delete-sessions.md +++ b/app/sdks/server-php/docs/examples/users/delete-sessions.md @@ -6,6 +6,7 @@ use Appwrite\Services\Users; $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/users/get-logs.md b/app/sdks/server-php/docs/examples/users/get-logs.md index 9164405788..5602536920 100644 --- a/app/sdks/server-php/docs/examples/users/get-logs.md +++ b/app/sdks/server-php/docs/examples/users/get-logs.md @@ -6,6 +6,7 @@ use Appwrite\Services\Users; $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/users/get-prefs.md b/app/sdks/server-php/docs/examples/users/get-prefs.md index 0874dbc508..1c9978a0fb 100644 --- a/app/sdks/server-php/docs/examples/users/get-prefs.md +++ b/app/sdks/server-php/docs/examples/users/get-prefs.md @@ -6,6 +6,7 @@ use Appwrite\Services\Users; $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/users/get-sessions.md b/app/sdks/server-php/docs/examples/users/get-sessions.md index 06a6a026ac..fef9f1db74 100644 --- a/app/sdks/server-php/docs/examples/users/get-sessions.md +++ b/app/sdks/server-php/docs/examples/users/get-sessions.md @@ -6,6 +6,7 @@ use Appwrite\Services\Users; $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/users/get.md b/app/sdks/server-php/docs/examples/users/get.md index 4f4d3c937d..16c29f9a5a 100644 --- a/app/sdks/server-php/docs/examples/users/get.md +++ b/app/sdks/server-php/docs/examples/users/get.md @@ -6,6 +6,7 @@ use Appwrite\Services\Users; $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/users/list.md b/app/sdks/server-php/docs/examples/users/list.md index ea5983f101..efce771ea1 100644 --- a/app/sdks/server-php/docs/examples/users/list.md +++ b/app/sdks/server-php/docs/examples/users/list.md @@ -6,6 +6,7 @@ use Appwrite\Services\Users; $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/users/update-prefs.md b/app/sdks/server-php/docs/examples/users/update-prefs.md index e21a056151..9e9141f8a7 100644 --- a/app/sdks/server-php/docs/examples/users/update-prefs.md +++ b/app/sdks/server-php/docs/examples/users/update-prefs.md @@ -6,6 +6,7 @@ use Appwrite\Services\Users; $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/users/update-status.md b/app/sdks/server-php/docs/examples/users/update-status.md index cee1486385..87f9bceb46 100644 --- a/app/sdks/server-php/docs/examples/users/update-status.md +++ b/app/sdks/server-php/docs/examples/users/update-status.md @@ -6,6 +6,7 @@ use Appwrite\Services\Users; $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/health.md b/app/sdks/server-php/docs/health.md index 0161105d15..38b814b633 100644 --- a/app/sdks/server-php/docs/health.md +++ b/app/sdks/server-php/docs/health.md @@ -1,6 +1,6 @@ # Health Service -## Check API HTTP Health +## Get HTTP ```http request GET https://appwrite.io/v1/health @@ -8,7 +8,15 @@ GET https://appwrite.io/v1/health ** Check the Appwrite HTTP server is up and responsive. ** -## Check Cache Health +## 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 @@ -16,7 +24,7 @@ GET https://appwrite.io/v1/health/cache ** Check the Appwrite in-memory cache server is up and connection is successful. ** -## Check DB Health +## Get DB ```http request GET https://appwrite.io/v1/health/db @@ -24,7 +32,7 @@ GET https://appwrite.io/v1/health/db ** Check the Appwrite database server is up and connection is successful. ** -## Check the number of pending certificate messages +## Get Certificate Queue ```http request GET https://appwrite.io/v1/health/queue/certificates @@ -32,7 +40,13 @@ 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. ** -## Check the number of pending log messages +## 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 @@ -40,7 +54,7 @@ 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. ** -## Check the number of pending task messages +## Get Tasks Queue ```http request GET https://appwrite.io/v1/health/queue/tasks @@ -48,7 +62,7 @@ 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. ** -## Check the number of pending usage messages +## Get Usage Queue ```http request GET https://appwrite.io/v1/health/queue/usage @@ -56,7 +70,7 @@ 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. ** -## Check number of pending webhook messages +## Get Webhooks Queue ```http request GET https://appwrite.io/v1/health/queue/webhooks @@ -64,15 +78,7 @@ 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. ** -## Check Anti virus Health - -```http request -GET https://appwrite.io/v1/health/storage/anti-virus -``` - -** Check the Appwrite Anti Virus server is up and connection is successful. ** - -## Check File System Health +## Get Local Storage ```http request GET https://appwrite.io/v1/health/storage/local @@ -80,7 +86,7 @@ GET https://appwrite.io/v1/health/storage/local ** Check the Appwrite local storage device is up and connection is successful. ** -## Check Time Health +## Get Time ```http request GET https://appwrite.io/v1/health/time diff --git a/app/sdks/server-php/src/Appwrite/Client.php b/app/sdks/server-php/src/Appwrite/Client.php index 21ca0bda1b..f44d0c9233 100644 --- a/app/sdks/server-php/src/Appwrite/Client.php +++ b/app/sdks/server-php/src/Appwrite/Client.php @@ -37,7 +37,7 @@ class Client */ protected $headers = [ 'content-type' => '', - 'x-sdk-version' => 'appwrite:php:1.0.17', + 'x-sdk-version' => 'appwrite:php:1.1.0', ]; /** diff --git a/app/sdks/server-php/src/Appwrite/Services/Health.php b/app/sdks/server-php/src/Appwrite/Services/Health.php index a8423aa188..d39f1f406d 100644 --- a/app/sdks/server-php/src/Appwrite/Services/Health.php +++ b/app/sdks/server-php/src/Appwrite/Services/Health.php @@ -9,7 +9,7 @@ use Appwrite\Service; class Health extends Service { /** - * Check API HTTP Health + * Get HTTP * * Check the Appwrite HTTP server is up and responsive. * @@ -28,7 +28,26 @@ class Health extends Service } /** - * Check Cache Health + * 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. @@ -48,7 +67,7 @@ class Health extends Service } /** - * Check DB Health + * Get DB * * Check the Appwrite database server is up and connection is successful. * @@ -67,7 +86,7 @@ class Health extends Service } /** - * Check the number of pending certificate messages + * Get Certificate Queue * * Get the number of certificates that are waiting to be issued against * [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue @@ -88,7 +107,24 @@ class Health extends Service } /** - * Check the number of pending log messages + * 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. @@ -108,7 +144,7 @@ class Health extends Service } /** - * Check the number of pending task messages + * Get Tasks Queue * * Get the number of tasks that are waiting to be processed in the Appwrite * internal queue server. @@ -128,7 +164,7 @@ class Health extends Service } /** - * Check the number of pending usage messages + * Get Usage Queue * * Get the number of usage stats that are waiting to be processed in the * Appwrite internal queue server. @@ -148,7 +184,7 @@ class Health extends Service } /** - * Check number of pending webhook messages + * Get Webhooks Queue * * Get the number of webhooks that are waiting to be processed in the Appwrite * internal queue server. @@ -168,26 +204,7 @@ class Health extends Service } /** - * Check Anti virus Health - * - * Check the Appwrite Anti Virus server is up and connection is successful. - * - * @throws Exception - * @return array - */ - public function getStorageAntiVirus():array - { - $path = str_replace([], [], '/health/storage/anti-virus'); - $params = []; - - - return $this->client->call(Client::METHOD_GET, $path, [ - 'content-type' => 'application/json', - ], $params); - } - - /** - * Check File System Health + * Get Local Storage * * Check the Appwrite local storage device is up and connection is successful. * @@ -206,7 +223,7 @@ class Health extends Service } /** - * Check Time Health + * 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 diff --git a/app/sdks/server-python/README.md b/app/sdks/server-python/README.md index 11e9a9a7cd..1d5c72a9c4 100644 --- a/app/sdks/server-python/README.md +++ b/app/sdks/server-python/README.md @@ -1,9 +1,9 @@ -# Appwrite SDK for Python +# 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.5.3-blue.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.5.3. For older versions, please check previous releases.** +**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 Python SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. diff --git a/app/sdks/server-python/appwrite/client.py b/app/sdks/server-python/appwrite/client.py index d0e74de33d..a9d0bf8a1b 100644 --- a/app/sdks/server-python/appwrite/client.py +++ b/app/sdks/server-python/appwrite/client.py @@ -7,7 +7,7 @@ class Client: self._endpoint = 'https://appwrite.io/v1' self._global_headers = { 'content-type': '', - 'x-sdk-version': 'appwrite:python:0.0.4', + 'x-sdk-version': 'appwrite:python:0.0.5', } def set_self_signed(self, status=True): diff --git a/app/sdks/server-python/appwrite/services/health.py b/app/sdks/server-python/appwrite/services/health.py index aa2a3fe37e..5e08ebe6e8 100644 --- a/app/sdks/server-python/appwrite/services/health.py +++ b/app/sdks/server-python/appwrite/services/health.py @@ -7,7 +7,7 @@ class Health(Service): super(Health, self).__init__(client) def get(self): - """Check API HTTP Health""" + """Get HTTP""" params = {} path = '/health' @@ -16,8 +16,18 @@ class Health(Service): '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): - """Check Cache Health""" + """Get Cache""" params = {} path = '/health/cache' @@ -27,7 +37,7 @@ class Health(Service): }, params) def get_d_b(self): - """Check DB Health""" + """Get DB""" params = {} path = '/health/db' @@ -37,7 +47,7 @@ class Health(Service): }, params) def get_queue_certificates(self): - """Check the number of pending certificate messages""" + """Get Certificate Queue""" params = {} path = '/health/queue/certificates' @@ -46,8 +56,18 @@ class Health(Service): '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): - """Check the number of pending log messages""" + """Get Logs Queue""" params = {} path = '/health/queue/logs' @@ -57,7 +77,7 @@ class Health(Service): }, params) def get_queue_tasks(self): - """Check the number of pending task messages""" + """Get Tasks Queue""" params = {} path = '/health/queue/tasks' @@ -67,7 +87,7 @@ class Health(Service): }, params) def get_queue_usage(self): - """Check the number of pending usage messages""" + """Get Usage Queue""" params = {} path = '/health/queue/usage' @@ -77,7 +97,7 @@ class Health(Service): }, params) def get_queue_webhooks(self): - """Check number of pending webhook messages""" + """Get Webhooks Queue""" params = {} path = '/health/queue/webhooks' @@ -86,18 +106,8 @@ class Health(Service): 'content-type': 'application/json', }, params) - def get_storage_anti_virus(self): - """Check Anti virus Health""" - - params = {} - path = '/health/storage/anti-virus' - - return self.client.call('get', path, { - 'content-type': 'application/json', - }, params) - def get_storage_local(self): - """Check File System Health""" + """Get Local Storage""" params = {} path = '/health/storage/local' @@ -107,7 +117,7 @@ class Health(Service): }, params) def get_time(self): - """Check Time Health""" + """Get Time""" params = {} path = '/health/time' diff --git a/app/sdks/server-python/docs/examples/avatars/get-browser.md b/app/sdks/server-python/docs/examples/avatars/get-browser.md index 34cd9d9502..ec783ca34d 100644 --- a/app/sdks/server-python/docs/examples/avatars/get-browser.md +++ b/app/sdks/server-python/docs/examples/avatars/get-browser.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/avatars/get-credit-card.md b/app/sdks/server-python/docs/examples/avatars/get-credit-card.md index a4e05600c3..ce2d3f8135 100644 --- a/app/sdks/server-python/docs/examples/avatars/get-credit-card.md +++ b/app/sdks/server-python/docs/examples/avatars/get-credit-card.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/avatars/get-favicon.md b/app/sdks/server-python/docs/examples/avatars/get-favicon.md index 0d9d1f2cc1..8de722c202 100644 --- a/app/sdks/server-python/docs/examples/avatars/get-favicon.md +++ b/app/sdks/server-python/docs/examples/avatars/get-favicon.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/avatars/get-flag.md b/app/sdks/server-python/docs/examples/avatars/get-flag.md index f1ebc9b0fa..0bf5657d2e 100644 --- a/app/sdks/server-python/docs/examples/avatars/get-flag.md +++ b/app/sdks/server-python/docs/examples/avatars/get-flag.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/avatars/get-image.md b/app/sdks/server-python/docs/examples/avatars/get-image.md index 43c59994e0..3164a956c1 100644 --- a/app/sdks/server-python/docs/examples/avatars/get-image.md +++ b/app/sdks/server-python/docs/examples/avatars/get-image.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/avatars/get-q-r.md b/app/sdks/server-python/docs/examples/avatars/get-q-r.md index 0fb4d95e3a..b0c6508a8a 100644 --- a/app/sdks/server-python/docs/examples/avatars/get-q-r.md +++ b/app/sdks/server-python/docs/examples/avatars/get-q-r.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/database/create-collection.md b/app/sdks/server-python/docs/examples/database/create-collection.md index 5fd4823de5..357757880c 100644 --- a/app/sdks/server-python/docs/examples/database/create-collection.md +++ b/app/sdks/server-python/docs/examples/database/create-collection.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/database/create-document.md b/app/sdks/server-python/docs/examples/database/create-document.md index ff146a7d17..f8bcdef562 100644 --- a/app/sdks/server-python/docs/examples/database/create-document.md +++ b/app/sdks/server-python/docs/examples/database/create-document.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/database/delete-collection.md b/app/sdks/server-python/docs/examples/database/delete-collection.md index 433d45d3d6..c3a7af45f5 100644 --- a/app/sdks/server-python/docs/examples/database/delete-collection.md +++ b/app/sdks/server-python/docs/examples/database/delete-collection.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/database/delete-document.md b/app/sdks/server-python/docs/examples/database/delete-document.md index 81d9d2aab9..1adacaff4e 100644 --- a/app/sdks/server-python/docs/examples/database/delete-document.md +++ b/app/sdks/server-python/docs/examples/database/delete-document.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/database/get-collection-logs.md b/app/sdks/server-python/docs/examples/database/get-collection-logs.md index 7776a1e31d..4abaa17f24 100644 --- a/app/sdks/server-python/docs/examples/database/get-collection-logs.md +++ b/app/sdks/server-python/docs/examples/database/get-collection-logs.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/database/get-collection.md b/app/sdks/server-python/docs/examples/database/get-collection.md index 7e00030f1a..34269a7d4a 100644 --- a/app/sdks/server-python/docs/examples/database/get-collection.md +++ b/app/sdks/server-python/docs/examples/database/get-collection.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/database/get-document.md b/app/sdks/server-python/docs/examples/database/get-document.md index ec7f36957b..13d313c15f 100644 --- a/app/sdks/server-python/docs/examples/database/get-document.md +++ b/app/sdks/server-python/docs/examples/database/get-document.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/database/list-collections.md b/app/sdks/server-python/docs/examples/database/list-collections.md index 1615e075e5..840ae586fe 100644 --- a/app/sdks/server-python/docs/examples/database/list-collections.md +++ b/app/sdks/server-python/docs/examples/database/list-collections.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/database/list-documents.md b/app/sdks/server-python/docs/examples/database/list-documents.md index 9a30f08ff7..6969eef581 100644 --- a/app/sdks/server-python/docs/examples/database/list-documents.md +++ b/app/sdks/server-python/docs/examples/database/list-documents.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/database/update-collection.md b/app/sdks/server-python/docs/examples/database/update-collection.md index 4a67d1fb6c..ef1a65a67d 100644 --- a/app/sdks/server-python/docs/examples/database/update-collection.md +++ b/app/sdks/server-python/docs/examples/database/update-collection.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/database/update-document.md b/app/sdks/server-python/docs/examples/database/update-document.md index 1e27a77b9f..a3c9fe0b0b 100644 --- a/app/sdks/server-python/docs/examples/database/update-document.md +++ b/app/sdks/server-python/docs/examples/database/update-document.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/health/get-anti-virus.md b/app/sdks/server-python/docs/examples/health/get-anti-virus.md new file mode 100644 index 0000000000..0c90f20750 --- /dev/null +++ b/app/sdks/server-python/docs/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/app/sdks/server-python/docs/examples/health/get-cache.md b/app/sdks/server-python/docs/examples/health/get-cache.md index 308bdee556..e06416fdf0 100644 --- a/app/sdks/server-python/docs/examples/health/get-cache.md +++ b/app/sdks/server-python/docs/examples/health/get-cache.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/health/get-d-b.md b/app/sdks/server-python/docs/examples/health/get-d-b.md index 6c4fe2e4f9..34d9446080 100644 --- a/app/sdks/server-python/docs/examples/health/get-d-b.md +++ b/app/sdks/server-python/docs/examples/health/get-d-b.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/health/get-queue-certificates.md b/app/sdks/server-python/docs/examples/health/get-queue-certificates.md index 6b0361e13b..74f61975fc 100644 --- a/app/sdks/server-python/docs/examples/health/get-queue-certificates.md +++ b/app/sdks/server-python/docs/examples/health/get-queue-certificates.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/health/get-queue-functions.md b/app/sdks/server-python/docs/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..6704514eb7 --- /dev/null +++ b/app/sdks/server-python/docs/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/app/sdks/server-python/docs/examples/health/get-queue-logs.md b/app/sdks/server-python/docs/examples/health/get-queue-logs.md index 5b3e387ab7..79d169f51f 100644 --- a/app/sdks/server-python/docs/examples/health/get-queue-logs.md +++ b/app/sdks/server-python/docs/examples/health/get-queue-logs.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/health/get-queue-tasks.md b/app/sdks/server-python/docs/examples/health/get-queue-tasks.md index b33bc081d0..aba8cca053 100644 --- a/app/sdks/server-python/docs/examples/health/get-queue-tasks.md +++ b/app/sdks/server-python/docs/examples/health/get-queue-tasks.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/health/get-queue-usage.md b/app/sdks/server-python/docs/examples/health/get-queue-usage.md index 774f2a892a..cb3cc5ae6f 100644 --- a/app/sdks/server-python/docs/examples/health/get-queue-usage.md +++ b/app/sdks/server-python/docs/examples/health/get-queue-usage.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/health/get-queue-webhooks.md b/app/sdks/server-python/docs/examples/health/get-queue-webhooks.md index 7cef20570f..a4c9d96d66 100644 --- a/app/sdks/server-python/docs/examples/health/get-queue-webhooks.md +++ b/app/sdks/server-python/docs/examples/health/get-queue-webhooks.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/health/get-storage-local.md b/app/sdks/server-python/docs/examples/health/get-storage-local.md index 7b1a30f615..a97ed125ad 100644 --- a/app/sdks/server-python/docs/examples/health/get-storage-local.md +++ b/app/sdks/server-python/docs/examples/health/get-storage-local.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/health/get-time.md b/app/sdks/server-python/docs/examples/health/get-time.md index 42390722c3..ecc66250cc 100644 --- a/app/sdks/server-python/docs/examples/health/get-time.md +++ b/app/sdks/server-python/docs/examples/health/get-time.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/health/get.md b/app/sdks/server-python/docs/examples/health/get.md index 831b34768f..77352aafab 100644 --- a/app/sdks/server-python/docs/examples/health/get.md +++ b/app/sdks/server-python/docs/examples/health/get.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/locale/get-continents.md b/app/sdks/server-python/docs/examples/locale/get-continents.md index 6b84bd7bb6..bf4c255434 100644 --- a/app/sdks/server-python/docs/examples/locale/get-continents.md +++ b/app/sdks/server-python/docs/examples/locale/get-continents.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/locale/get-countries-e-u.md b/app/sdks/server-python/docs/examples/locale/get-countries-e-u.md index 100a0d56a4..78d69ff2dc 100644 --- a/app/sdks/server-python/docs/examples/locale/get-countries-e-u.md +++ b/app/sdks/server-python/docs/examples/locale/get-countries-e-u.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/locale/get-countries-phones.md b/app/sdks/server-python/docs/examples/locale/get-countries-phones.md index dbac81e356..fb349b1442 100644 --- a/app/sdks/server-python/docs/examples/locale/get-countries-phones.md +++ b/app/sdks/server-python/docs/examples/locale/get-countries-phones.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/locale/get-countries.md b/app/sdks/server-python/docs/examples/locale/get-countries.md index ee994e73c9..ceb731073d 100644 --- a/app/sdks/server-python/docs/examples/locale/get-countries.md +++ b/app/sdks/server-python/docs/examples/locale/get-countries.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/locale/get-currencies.md b/app/sdks/server-python/docs/examples/locale/get-currencies.md index 7a4e50fe56..dacb886e20 100644 --- a/app/sdks/server-python/docs/examples/locale/get-currencies.md +++ b/app/sdks/server-python/docs/examples/locale/get-currencies.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/locale/get.md b/app/sdks/server-python/docs/examples/locale/get.md index f86fa446e7..43cd2107de 100644 --- a/app/sdks/server-python/docs/examples/locale/get.md +++ b/app/sdks/server-python/docs/examples/locale/get.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/storage/create-file.md b/app/sdks/server-python/docs/examples/storage/create-file.md index 7ef7cba970..045ef3adc3 100644 --- a/app/sdks/server-python/docs/examples/storage/create-file.md +++ b/app/sdks/server-python/docs/examples/storage/create-file.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/storage/delete-file.md b/app/sdks/server-python/docs/examples/storage/delete-file.md index 1fda179766..155e5a41d4 100644 --- a/app/sdks/server-python/docs/examples/storage/delete-file.md +++ b/app/sdks/server-python/docs/examples/storage/delete-file.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/storage/get-file-download.md b/app/sdks/server-python/docs/examples/storage/get-file-download.md index 02ea23459c..975a0f302d 100644 --- a/app/sdks/server-python/docs/examples/storage/get-file-download.md +++ b/app/sdks/server-python/docs/examples/storage/get-file-download.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/storage/get-file-preview.md b/app/sdks/server-python/docs/examples/storage/get-file-preview.md index f1778b3b81..ad9abe444f 100644 --- a/app/sdks/server-python/docs/examples/storage/get-file-preview.md +++ b/app/sdks/server-python/docs/examples/storage/get-file-preview.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/storage/get-file-view.md b/app/sdks/server-python/docs/examples/storage/get-file-view.md index 52d69787a2..892b93ca97 100644 --- a/app/sdks/server-python/docs/examples/storage/get-file-view.md +++ b/app/sdks/server-python/docs/examples/storage/get-file-view.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/storage/get-file.md b/app/sdks/server-python/docs/examples/storage/get-file.md index 61b48ce7c5..cded2ba12f 100644 --- a/app/sdks/server-python/docs/examples/storage/get-file.md +++ b/app/sdks/server-python/docs/examples/storage/get-file.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/storage/list-files.md b/app/sdks/server-python/docs/examples/storage/list-files.md index 2de28ac6ff..d54bb75d79 100644 --- a/app/sdks/server-python/docs/examples/storage/list-files.md +++ b/app/sdks/server-python/docs/examples/storage/list-files.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/storage/update-file.md b/app/sdks/server-python/docs/examples/storage/update-file.md index ec6890240f..d1085e7df8 100644 --- a/app/sdks/server-python/docs/examples/storage/update-file.md +++ b/app/sdks/server-python/docs/examples/storage/update-file.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/teams/create-membership.md b/app/sdks/server-python/docs/examples/teams/create-membership.md index fa32e5fc32..5b68051829 100644 --- a/app/sdks/server-python/docs/examples/teams/create-membership.md +++ b/app/sdks/server-python/docs/examples/teams/create-membership.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/teams/create.md b/app/sdks/server-python/docs/examples/teams/create.md index 3511082e01..d4d1ba63c8 100644 --- a/app/sdks/server-python/docs/examples/teams/create.md +++ b/app/sdks/server-python/docs/examples/teams/create.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/teams/delete-membership.md b/app/sdks/server-python/docs/examples/teams/delete-membership.md index e8e103b783..e08e44fdcc 100644 --- a/app/sdks/server-python/docs/examples/teams/delete-membership.md +++ b/app/sdks/server-python/docs/examples/teams/delete-membership.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/teams/delete.md b/app/sdks/server-python/docs/examples/teams/delete.md index 9ec3d76e8a..87d953ff5f 100644 --- a/app/sdks/server-python/docs/examples/teams/delete.md +++ b/app/sdks/server-python/docs/examples/teams/delete.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/teams/get-memberships.md b/app/sdks/server-python/docs/examples/teams/get-memberships.md index aed5537ac1..01879bb280 100644 --- a/app/sdks/server-python/docs/examples/teams/get-memberships.md +++ b/app/sdks/server-python/docs/examples/teams/get-memberships.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/teams/get.md b/app/sdks/server-python/docs/examples/teams/get.md index 694bb9b996..c1f90c8fe1 100644 --- a/app/sdks/server-python/docs/examples/teams/get.md +++ b/app/sdks/server-python/docs/examples/teams/get.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/teams/list.md b/app/sdks/server-python/docs/examples/teams/list.md index 08aea8927d..a3d831ff4f 100644 --- a/app/sdks/server-python/docs/examples/teams/list.md +++ b/app/sdks/server-python/docs/examples/teams/list.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/teams/update.md b/app/sdks/server-python/docs/examples/teams/update.md index ceed295c52..63f6acdc9b 100644 --- a/app/sdks/server-python/docs/examples/teams/update.md +++ b/app/sdks/server-python/docs/examples/teams/update.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/users/create.md b/app/sdks/server-python/docs/examples/users/create.md index 84973214d5..4c63f3771d 100644 --- a/app/sdks/server-python/docs/examples/users/create.md +++ b/app/sdks/server-python/docs/examples/users/create.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/users/delete-session.md b/app/sdks/server-python/docs/examples/users/delete-session.md index 6d006d6734..ca2fa99b56 100644 --- a/app/sdks/server-python/docs/examples/users/delete-session.md +++ b/app/sdks/server-python/docs/examples/users/delete-session.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/users/delete-sessions.md b/app/sdks/server-python/docs/examples/users/delete-sessions.md index b27fbb4f4f..fe4b2be3a8 100644 --- a/app/sdks/server-python/docs/examples/users/delete-sessions.md +++ b/app/sdks/server-python/docs/examples/users/delete-sessions.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/users/get-logs.md b/app/sdks/server-python/docs/examples/users/get-logs.md index 8ccea842df..22816871d2 100644 --- a/app/sdks/server-python/docs/examples/users/get-logs.md +++ b/app/sdks/server-python/docs/examples/users/get-logs.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/users/get-prefs.md b/app/sdks/server-python/docs/examples/users/get-prefs.md index ce566bd732..846c7c13f5 100644 --- a/app/sdks/server-python/docs/examples/users/get-prefs.md +++ b/app/sdks/server-python/docs/examples/users/get-prefs.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/users/get-sessions.md b/app/sdks/server-python/docs/examples/users/get-sessions.md index 58e7e4b507..0e29608697 100644 --- a/app/sdks/server-python/docs/examples/users/get-sessions.md +++ b/app/sdks/server-python/docs/examples/users/get-sessions.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/users/get.md b/app/sdks/server-python/docs/examples/users/get.md index 67d8c8d690..bc23f2238c 100644 --- a/app/sdks/server-python/docs/examples/users/get.md +++ b/app/sdks/server-python/docs/examples/users/get.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/users/list.md b/app/sdks/server-python/docs/examples/users/list.md index ed8e7651ae..b7492fa9bf 100644 --- a/app/sdks/server-python/docs/examples/users/list.md +++ b/app/sdks/server-python/docs/examples/users/list.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/users/update-prefs.md b/app/sdks/server-python/docs/examples/users/update-prefs.md index cc11f989ce..c78546f484 100644 --- a/app/sdks/server-python/docs/examples/users/update-prefs.md +++ b/app/sdks/server-python/docs/examples/users/update-prefs.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/docs/examples/users/update-status.md b/app/sdks/server-python/docs/examples/users/update-status.md index 268715af54..f40c83b61e 100644 --- a/app/sdks/server-python/docs/examples/users/update-status.md +++ b/app/sdks/server-python/docs/examples/users/update-status.md @@ -4,6 +4,7 @@ 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 ) diff --git a/app/sdks/server-python/setup.py b/app/sdks/server-python/setup.py index 6446e4cb4e..4903197191 100644 --- a/app/sdks/server-python/setup.py +++ b/app/sdks/server-python/setup.py @@ -3,15 +3,15 @@ import setuptools setuptools.setup( name = 'appwrite', packages = ['appwrite', 'appwrite/services'], - version = '0.0.4', + version = '0.0.5', 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@appwrite.io', + author_email = 'team@localhost.test', maintainer = 'Appwrite Team', - maintainer_email = 'team@appwrite.io', + maintainer_email = 'team@localhost.test', url = 'https://appwrite.io/support', - download_url='https://github.com/appwrite/sdk-for-python/archive/0.0.4.tar.gz', + download_url='https://github.com/appwrite/sdk-for-python/archive/0.0.5.tar.gz', # keywords = ['SOME', 'MEANINGFULL', 'KEYWORDS'], install_requires=[ 'requests', diff --git a/app/sdks/server-ruby/README.md b/app/sdks/server-ruby/README.md index 6b71d0ccee..cbc2cf781c 100644 --- a/app/sdks/server-ruby/README.md +++ b/app/sdks/server-ruby/README.md @@ -1,9 +1,9 @@ -# Appwrite SDK for Ruby +# 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.5.3-blue.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.5.3. For older versions, please check previous releases.** +**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. diff --git a/app/sdks/server-ruby/appwrite.gemspec b/app/sdks/server-ruby/appwrite.gemspec index 99fa047a96..66c69d18df 100644 --- a/app/sdks/server-ruby/appwrite.gemspec +++ b/app/sdks/server-ruby/appwrite.gemspec @@ -1,13 +1,13 @@ Gem::Specification.new do |s| s.name = 'appwrite' - s.version = '1.0.9' + s.version = '1.0.10' 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@appwrite.io' + 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/docs/examples/avatars/get-browser.md b/app/sdks/server-ruby/docs/examples/avatars/get-browser.md new file mode 100644 index 0000000000..95f8acd0d8 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/avatars/get-credit-card.md b/app/sdks/server-ruby/docs/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..30c7853dfa --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/avatars/get-favicon.md b/app/sdks/server-ruby/docs/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..4a564d63f3 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/avatars/get-flag.md b/app/sdks/server-ruby/docs/examples/avatars/get-flag.md new file mode 100644 index 0000000000..5bd18a837a --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/avatars/get-image.md b/app/sdks/server-ruby/docs/examples/avatars/get-image.md new file mode 100644 index 0000000000..8a6043afb6 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/avatars/get-q-r.md b/app/sdks/server-ruby/docs/examples/avatars/get-q-r.md new file mode 100644 index 0000000000..d291c7411e --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/database/create-collection.md b/app/sdks/server-ruby/docs/examples/database/create-collection.md new file mode 100644 index 0000000000..281efc99b1 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/database/create-document.md b/app/sdks/server-ruby/docs/examples/database/create-document.md new file mode 100644 index 0000000000..c90850e278 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/delete-collection.md b/app/sdks/server-ruby/docs/examples/database/delete-collection.md new file mode 100644 index 0000000000..8d37aa9901 --- /dev/null +++ b/app/sdks/server-ruby/docs/examples/database/delete-collection.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .setproject('5df5acd0d48c2') # Your project ID + .setkey('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.delete_collection(collection_id: '[COLLECTION_ID]'); + +puts response \ No newline at end of file diff --git a/app/sdks/server-ruby/docs/examples/database/delete-document.md b/app/sdks/server-ruby/docs/examples/database/delete-document.md new file mode 100644 index 0000000000..7baec53db9 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/database/get-collection-logs.md b/app/sdks/server-ruby/docs/examples/database/get-collection-logs.md new file mode 100644 index 0000000000..7a970fad0c --- /dev/null +++ b/app/sdks/server-ruby/docs/examples/database/get-collection-logs.md @@ -0,0 +1,15 @@ +require 'appwrite' + +client = Appwrite::Client.new() + +client + .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint + .setproject('5df5acd0d48c2') # Your project ID + .setkey('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.get_collection_logs(collection_id: '[COLLECTION_ID]'); + +puts response \ No newline at end of file diff --git a/app/sdks/server-ruby/docs/examples/database/get-collection.md b/app/sdks/server-ruby/docs/examples/database/get-collection.md new file mode 100644 index 0000000000..73c2e63852 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/database/get-document.md b/app/sdks/server-ruby/docs/examples/database/get-document.md new file mode 100644 index 0000000000..9d204b35c5 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/database/list-collections.md b/app/sdks/server-ruby/docs/examples/database/list-collections.md new file mode 100644 index 0000000000..12e4f47b8d --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/database/list-documents.md b/app/sdks/server-ruby/docs/examples/database/list-documents.md new file mode 100644 index 0000000000..8c417470c8 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/database/update-collection.md b/app/sdks/server-ruby/docs/examples/database/update-collection.md new file mode 100644 index 0000000000..74326a5e66 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/database/update-document.md b/app/sdks/server-ruby/docs/examples/database/update-document.md new file mode 100644 index 0000000000..01c70a48ad --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/health/get-anti-virus.md b/app/sdks/server-ruby/docs/examples/health/get-anti-virus.md new file mode 100644 index 0000000000..0d3e91df0c --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/health/get-cache.md b/app/sdks/server-ruby/docs/examples/health/get-cache.md new file mode 100644 index 0000000000..c09575805d --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/health/get-d-b.md b/app/sdks/server-ruby/docs/examples/health/get-d-b.md new file mode 100644 index 0000000000..f57769c3ad --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/health/get-queue-certificates.md b/app/sdks/server-ruby/docs/examples/health/get-queue-certificates.md new file mode 100644 index 0000000000..d5917ba9c5 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/health/get-queue-functions.md b/app/sdks/server-ruby/docs/examples/health/get-queue-functions.md new file mode 100644 index 0000000000..a24825a28d --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/health/get-queue-logs.md b/app/sdks/server-ruby/docs/examples/health/get-queue-logs.md new file mode 100644 index 0000000000..165553e0be --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/health/get-queue-tasks.md b/app/sdks/server-ruby/docs/examples/health/get-queue-tasks.md new file mode 100644 index 0000000000..a2c869a15a --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/health/get-queue-usage.md b/app/sdks/server-ruby/docs/examples/health/get-queue-usage.md new file mode 100644 index 0000000000..50ebbc0524 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/health/get-queue-webhooks.md b/app/sdks/server-ruby/docs/examples/health/get-queue-webhooks.md new file mode 100644 index 0000000000..19d0427ddb --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/health/get-storage-local.md b/app/sdks/server-ruby/docs/examples/health/get-storage-local.md new file mode 100644 index 0000000000..899d610d02 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/health/get-time.md b/app/sdks/server-ruby/docs/examples/health/get-time.md new file mode 100644 index 0000000000..244c5d5f03 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/health/get.md b/app/sdks/server-ruby/docs/examples/health/get.md new file mode 100644 index 0000000000..3014c571e4 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/locale/get-continents.md b/app/sdks/server-ruby/docs/examples/locale/get-continents.md new file mode 100644 index 0000000000..2548d110a8 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/locale/get-countries-e-u.md b/app/sdks/server-ruby/docs/examples/locale/get-countries-e-u.md new file mode 100644 index 0000000000..c809b8ead3 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/locale/get-countries-phones.md b/app/sdks/server-ruby/docs/examples/locale/get-countries-phones.md new file mode 100644 index 0000000000..2830af2de8 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/locale/get-countries.md b/app/sdks/server-ruby/docs/examples/locale/get-countries.md new file mode 100644 index 0000000000..82deb00f78 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/locale/get-currencies.md b/app/sdks/server-ruby/docs/examples/locale/get-currencies.md new file mode 100644 index 0000000000..de5270ac25 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/locale/get.md b/app/sdks/server-ruby/docs/examples/locale/get.md new file mode 100644 index 0000000000..b41e8eede0 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/storage/create-file.md b/app/sdks/server-ruby/docs/examples/storage/create-file.md new file mode 100644 index 0000000000..5192d9a512 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/storage/delete-file.md b/app/sdks/server-ruby/docs/examples/storage/delete-file.md new file mode 100644 index 0000000000..b334ffa485 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/storage/get-file-download.md b/app/sdks/server-ruby/docs/examples/storage/get-file-download.md new file mode 100644 index 0000000000..ec5a16ca51 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/storage/get-file-preview.md b/app/sdks/server-ruby/docs/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..c361984126 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/storage/get-file-view.md b/app/sdks/server-ruby/docs/examples/storage/get-file-view.md new file mode 100644 index 0000000000..ba2e850f0f --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/storage/get-file.md b/app/sdks/server-ruby/docs/examples/storage/get-file.md new file mode 100644 index 0000000000..394bb8c3ae --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/storage/list-files.md b/app/sdks/server-ruby/docs/examples/storage/list-files.md new file mode 100644 index 0000000000..86111f2186 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/storage/update-file.md b/app/sdks/server-ruby/docs/examples/storage/update-file.md new file mode 100644 index 0000000000..05a1fe5e6c --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/teams/create-membership.md b/app/sdks/server-ruby/docs/examples/teams/create-membership.md new file mode 100644 index 0000000000..c6f1a2d254 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/teams/create.md b/app/sdks/server-ruby/docs/examples/teams/create.md new file mode 100644 index 0000000000..1f83e92ed9 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/teams/delete-membership.md b/app/sdks/server-ruby/docs/examples/teams/delete-membership.md new file mode 100644 index 0000000000..1f8df2b91b --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/teams/delete.md b/app/sdks/server-ruby/docs/examples/teams/delete.md new file mode 100644 index 0000000000..593893dfe6 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/teams/get-memberships.md b/app/sdks/server-ruby/docs/examples/teams/get-memberships.md new file mode 100644 index 0000000000..3a217a0001 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/teams/get.md b/app/sdks/server-ruby/docs/examples/teams/get.md new file mode 100644 index 0000000000..408e5844bf --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/teams/list.md b/app/sdks/server-ruby/docs/examples/teams/list.md new file mode 100644 index 0000000000..4f275e9ffc --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/teams/update.md b/app/sdks/server-ruby/docs/examples/teams/update.md new file mode 100644 index 0000000000..f696cff943 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/users/create.md b/app/sdks/server-ruby/docs/examples/users/create.md new file mode 100644 index 0000000000..7477cd8883 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/users/delete-session.md b/app/sdks/server-ruby/docs/examples/users/delete-session.md new file mode 100644 index 0000000000..bb5fe3020b --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/users/delete-sessions.md b/app/sdks/server-ruby/docs/examples/users/delete-sessions.md new file mode 100644 index 0000000000..c2e641eed1 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/users/get-logs.md b/app/sdks/server-ruby/docs/examples/users/get-logs.md new file mode 100644 index 0000000000..87c8316b44 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/users/get-prefs.md b/app/sdks/server-ruby/docs/examples/users/get-prefs.md new file mode 100644 index 0000000000..2e0e076ee2 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/users/get-sessions.md b/app/sdks/server-ruby/docs/examples/users/get-sessions.md new file mode 100644 index 0000000000..3bf468a976 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/users/get.md b/app/sdks/server-ruby/docs/examples/users/get.md new file mode 100644 index 0000000000..e5dca85e99 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/users/list.md b/app/sdks/server-ruby/docs/examples/users/list.md new file mode 100644 index 0000000000..5243c36e77 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/users/update-prefs.md b/app/sdks/server-ruby/docs/examples/users/update-prefs.md new file mode 100644 index 0000000000..4993d2eb6f --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/docs/examples/users/update-status.md b/app/sdks/server-ruby/docs/examples/users/update-status.md new file mode 100644 index 0000000000..533ad38848 --- /dev/null +++ b/app/sdks/server-ruby/docs/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 + .setproject('5df5acd0d48c2') # Your project ID + .setkey('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/app/sdks/server-ruby/lib/appwrite/client.rb b/app/sdks/server-ruby/lib/appwrite/client.rb index 5e413cf6ae..0620069f74 100644 --- a/app/sdks/server-ruby/lib/appwrite/client.rb +++ b/app/sdks/server-ruby/lib/appwrite/client.rb @@ -20,7 +20,7 @@ module Appwrite @headers = { 'content-type' => '', 'user-agent' => RUBY_PLATFORM + ':ruby-' + RUBY_VERSION, - 'x-sdk-version' => 'appwrite:ruby:1.0.9' + 'x-sdk-version' => 'appwrite:ruby:1.0.10' } @endpoint = 'https://appwrite.io/v1'; end diff --git a/app/sdks/server-ruby/lib/appwrite/services/health.rb b/app/sdks/server-ruby/lib/appwrite/services/health.rb index f48069ff25..d2c6bc7b60 100644 --- a/app/sdks/server-ruby/lib/appwrite/services/health.rb +++ b/app/sdks/server-ruby/lib/appwrite/services/health.rb @@ -12,6 +12,17 @@ module Appwrite }, 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' @@ -45,6 +56,17 @@ module Appwrite }, 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' @@ -89,17 +111,6 @@ module Appwrite }, params); end - def get_storage_anti_virus() - path = '/health/storage/anti-virus' - - params = { - } - - return @client.call('get', path, { - 'content-type' => 'application/json', - }, params); - end - def get_storage_local() path = '/health/storage/local' diff --git a/app/sdks/web-javascript/docs/examples/avatars/get-browser.md b/app/sdks/web-javascript/docs/examples/avatars/get-browser.md deleted file mode 100644 index 0e76e4050c..0000000000 --- a/app/sdks/web-javascript/docs/examples/avatars/get-browser.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.avatars.getBrowser('aa'); - -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/web-javascript/docs/examples/avatars/get-credit-card.md b/app/sdks/web-javascript/docs/examples/avatars/get-credit-card.md deleted file mode 100644 index 584f24d8a0..0000000000 --- a/app/sdks/web-javascript/docs/examples/avatars/get-credit-card.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.avatars.getCreditCard('amex'); - -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/web-javascript/docs/examples/avatars/get-favicon.md b/app/sdks/web-javascript/docs/examples/avatars/get-favicon.md deleted file mode 100644 index 292a4f4403..0000000000 --- a/app/sdks/web-javascript/docs/examples/avatars/get-favicon.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.avatars.getFavicon('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/web-javascript/docs/examples/avatars/get-flag.md b/app/sdks/web-javascript/docs/examples/avatars/get-flag.md deleted file mode 100644 index fc5e6ff644..0000000000 --- a/app/sdks/web-javascript/docs/examples/avatars/get-flag.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.avatars.getFlag('af'); - -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/web-javascript/docs/examples/avatars/get-image.md b/app/sdks/web-javascript/docs/examples/avatars/get-image.md deleted file mode 100644 index 7f5468d4a9..0000000000 --- a/app/sdks/web-javascript/docs/examples/avatars/get-image.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.avatars.getImage('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/web-javascript/docs/examples/avatars/get-q-r.md b/app/sdks/web-javascript/docs/examples/avatars/get-q-r.md deleted file mode 100644 index 33ae75a2d4..0000000000 --- a/app/sdks/web-javascript/docs/examples/avatars/get-q-r.md +++ /dev/null @@ -1,13 +0,0 @@ -let sdk = new Appwrite(); - -sdk - .setProject('5df5acd0d48c2') // Your project ID -; - -let promise = sdk.avatars.getQR('[TEXT]'); - -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file diff --git a/app/tasks/upgrade.php b/app/tasks/migrate.php similarity index 93% rename from app/tasks/upgrade.php rename to app/tasks/migrate.php index c2a8723f99..e05d1bc0ff 100644 --- a/app/tasks/upgrade.php +++ b/app/tasks/migrate.php @@ -21,7 +21,7 @@ $callbacks = [ }, '0.5.0' => function($project) use ($db, $projectDB, $requset) { - Console::info('Upgrading project: '.$project->getId()); + Console::log('Migrating project: '.$project->getId()); // Update all documents $uid -> $id @@ -40,7 +40,7 @@ $callbacks = [ $sum = count($all); - Console::success('Fetched '.$sum.' (offset: '.$offset.' / limit: '.$limit.') documents from a total of '.$projectDB->getSum()); + Console::log('Migrating: '.$offset.' / '.$projectDB->getSum()); foreach($all as $document) { $document = fixDocument($document); @@ -51,7 +51,6 @@ $callbacks = [ try { $new = $projectDB->overwriteDocument($document->getArrayCopy()); - Console::success('Updated document succefully'); } catch (\Throwable $th) { Console::error('Failed to update document: '.$th->getMessage()); continue; @@ -153,7 +152,7 @@ function fixDocument(Document $document) { ->removeAttribute('$uid') ; - Console::log('Switched from $uid to $id: '.$document->getCollection().'/'.$document->getId()); + //Console::log('Switched from $uid to $id: '.$document->getCollection().'/'.$document->getId()); foreach($document as &$attr) { if($attr instanceof Document) { @@ -175,7 +174,7 @@ function fixDocument(Document $document) { $cli ->task('run') ->action(function () use ($console, $projectDB, $consoleDB, $callbacks) { - Console::success('Starting Upgrade'); + Console::success('Starting Data Migration'); Authorization::disable(); @@ -211,8 +210,10 @@ $cli $sum = count($projects); $offset = $offset + $limit; - Console::success('Fetched '.$sum.' projects...'); + Console::log('Fetched '.$sum.' projects...'); } + + Console::success('Data Migration Completed'); }); $cli->run(); diff --git a/app/tasks/sdks.php b/app/tasks/sdks.php index 588efe1d0c..2843443924 100644 --- a/app/tasks/sdks.php +++ b/app/tasks/sdks.php @@ -15,9 +15,9 @@ use Appwrite\SDK\Language\Node; use Appwrite\SDK\Language\Python; use Appwrite\SDK\Language\Ruby; use Appwrite\SDK\Language\Dart; +use Appwrite\SDK\Language\Deno; use Appwrite\SDK\Language\Go; use Appwrite\SDK\Language\Java; -use Appwrite\SDK\Language\Typescript; $cli = new CLI(); @@ -42,11 +42,16 @@ $cli } $platforms = Config::getParam('platforms'); + $selected = strtolower(Console::confirm('Choose SDK ("*" for all):')); $message = Console::confirm('Please enter your commit message:'); $production = (Console::confirm('Type "Appwrite" to deploy for production') == 'Appwrite'); foreach($platforms as $key => $platform) { foreach($platform['languages'] as $language) { + if($selected !== $language['key'] && $selected !== '*') { + continue; + } + if(!$language['enabled']) { Console::warning($language['name'].' for '.$platform['name'] . ' is disabled'); continue; @@ -56,7 +61,7 @@ $cli //$spec = getSSLPage('http://localhost/v1/open-api-2.json?extensions=1&platform='.$language['family']); $spec = getSSLPage('https://appwrite.io/v1/open-api-2.json?extensions=1&platform='.$language['family']); - $spec = getSSLPage('https://localhost:2444/v1/open-api-2.json?extensions=1&platform='.$language['family']); + $spec = getSSLPage('https://localhost/v1/open-api-2.json?extensions=1&platform='.$language['family']); $result = realpath(__DIR__.'/..').'/sdks/'.$key.'-'.$language['key']; $target = realpath(__DIR__.'/..').'/sdks/git/'.$language['key'].'/'; @@ -82,25 +87,18 @@ Redistribution and use in source and binary forms, with or without modification, 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.'; switch ($language['key']) { - case 'php': - $config = new PHP(); - $config - ->setComposerVendor('appwrite') - ->setComposerPackage('appwrite') - ; - break; - case 'javascript': + case 'web': $config = new JS(); $config ->setNPMPackage('appwrite') ->setBowerPackage('appwrite') ; break; - case 'typescript': - $config = new Typescript(); + case 'php': + $config = new PHP(); $config - ->setNPMPackage('appwrite') - ->setBowerPackage('appwrite') + ->setComposerVendor('appwrite') + ->setComposerPackage('appwrite') ; break; case 'nodejs': @@ -110,6 +108,9 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ->setBowerPackage('appwrite') ; break; + case 'deno': + $config = new Deno(); + break; case 'python': $config = new Python(); $config @@ -123,6 +124,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ->setGemPackage('appwrite') ; break; + case 'flutter': case 'dart': $config = new Dart(); break; @@ -142,6 +144,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND $sdk = new SDK($config, new Swagger2($spec)); $sdk + ->setName($language['name']) ->setDescription("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 {$language['name']} 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)") diff --git a/app/views/console/database/collection.phtml b/app/views/console/database/collection.phtml index afd1b7326c..5b5c4ccd80 100644 --- a/app/views/console/database/collection.phtml +++ b/app/views/console/database/collection.phtml @@ -75,7 +75,7 @@ $rules = $collection->getAttribute('rules', []); data-name="project-documents">
-

No Documnets Found

+

No Documents Found

Create your first document to get started

@@ -264,10 +264,10 @@ $rules = $collection->getAttribute('rules', []); - + @@ -415,10 +415,10 @@ $rules = $collection->getAttribute('rules', []); - + diff --git a/app/views/console/database/document.phtml b/app/views/console/database/document.phtml index b631ad85a3..cd3d4cbb03 100644 --- a/app/views/console/database/document.phtml +++ b/app/views/console/database/document.phtml @@ -308,9 +308,9 @@ $collections = []; -
  • + \ No newline at end of file diff --git a/app/views/console/home/index.phtml b/app/views/console/home/index.phtml index 22d519d26a..3d9eb0e25e 100644 --- a/app/views/console/home/index.phtml +++ b/app/views/console/home/index.phtml @@ -132,10 +132,10 @@ $graph = $this->getParam('graph', false); -   + -

    Get Started

    +

    @@ -203,7 +203,7 @@ $graph = $this->getParam('graph', false); - +
    @@ -241,7 +241,7 @@ $graph = $this->getParam('graph', false); - +
    diff --git a/app/views/console/settings/index.phtml b/app/views/console/settings/index.phtml index 3874dba15f..e6def1b2ee 100644 --- a/app/views/console/settings/index.phtml +++ b/app/views/console/settings/index.phtml @@ -27,39 +27,36 @@ $customDomainsTarget = $this->getParam('customDomainsTarget', false);
  • Overview

    -
    +
    +
    +
    + - - -
    -
    -
    + - -
    - + + +
    +
    - -
    - -
    +
    - - -
    - -
    - - -
    - -
    -
    + +
    -
    +

    Danger Zone

    + +
    +

    This is the area where you can delete your project.

    + +

    By deleting your project you will lose all your project metadata, resources and stats.

    + +

    PLEASE NOTE: Project deletion is irreversible.

    + +
    + + + + +
    +
    -
    - + +
    + +
    + +
    + + +
    + +
    + + +
    +