diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..e69de29bb2 diff --git a/CHANGES.md b/CHANGES.md index 7063f6db38..f37bd7bf5d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,52 @@ +# Version 0.7.0 (NOT-RELEASED) + +## Features + +- New route in Locale API to fetch a list of languages +- Added option to force HTTPS connection to the Appwrite server (_APP_OPTIONS_FORCE_HTTPS) +- Added Google Fonts to Appwrite for offline availability +- Added a new route in the Avatars API to get user initials avatar +- Added option to delete team from the console +- Added option to view team members from the console +- Added option to join a user to any team from the console +- Added support for Brotli compression + +## Bug Fixes + +- Fixed output of /v1/health/queue/certificates returning wrong data +- Fixed bug where team members count was wrong in some cases +- Fixed network calculation for uploaded files +- Fixed a UI bug preventing float values in numeric fields +- Fixed scroll positioning when moving rules order up & down +- Fixed missing validation for database documents key length (32 chars) + +## Security + +- Access to Health API now requires authentication with an API Key with access to `health.read` scope allowed + +# Version 0.6.2 (PRE-RELEASE) + +## Features + +- New OAuth adapter for sign-in with Apple + +## 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 a non-standard port as hostname +- Fixed bug where requests number on the dashboard was hidden when the number got too long +- Permission fields are not required for file creation or update + +## Security + +- [low severity] Patch for email library (https://github.com/advisories/GHSA-f7hx-fqxw-rvvj) + # Version 0.6.1 (PRE-RELEASE) ## Bug Fixes diff --git a/Dockerfile b/Dockerfile index 421fda73ad..e4ffd73eb9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,28 +11,25 @@ ENV TZ=Asia/Tel_Aviv \ RUN \ apt-get update && \ - apt-get install -y --no-install-recommends --no-install-suggests ca-certificates software-properties-common curl git openssl && \ + apt-get install -y --no-install-recommends --no-install-suggests ca-certificates software-properties-common wget git openssl && \ LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php && \ apt-get update && \ apt-get install -y --no-install-recommends --no-install-suggests make php$PHP_VERSION php$PHP_VERSION-dev zip unzip php$PHP_VERSION-zip && \ # Redis Extension - curl -L -o phpredis-$PHP_REDIS_VERSION.tar https://github.com/phpredis/phpredis/tarball/$PHP_REDIS_VERSION && \ - mkdir phpredis-$PHP_REDIS_VERSION && tar xf phpredis-$PHP_REDIS_VERSION.tar -C phpredis-$PHP_REDIS_VERSION --strip-components 1 && \ + wget -q https://github.com/phpredis/phpredis/archive/$PHP_REDIS_VERSION.tar.gz && \ + tar -xf $PHP_REDIS_VERSION.tar.gz && \ cd phpredis-$PHP_REDIS_VERSION && \ phpize$PHP_VERSION && \ ./configure && \ make && \ - # # XHprof Extension - # git clone "https://github.com/tideways/php-xhprof-extension.git" && \ - # cd php-xhprof-extension && \ - # phpize$PHP_VERSION && \ - # ./configure && \ - # make && \ - # make install && \ - # ls -ll && \ - # ls -ll modules && \ # Composer - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer + wget https://getcomposer.org/composer.phar && \ + chmod +x ./composer.phar && \ + mv ./composer.phar /usr/bin/composer && \ + #Brotli + cd / && \ + git clone https://github.com/eustas/ngx_brotli.git && \ + cd ngx_brotli && git submodule update --init && cd .. WORKDIR /usr/local/src/ @@ -60,8 +57,10 @@ ENV TZ=Asia/Tel_Aviv \ _APP_HOME=https://appwrite.io \ _APP_EDITION=community \ _APP_OPTIONS_ABUSE=enabled \ + _APP_OPTIONS_FORCE_HTTPS=disabled \ _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 \ @@ -82,35 +81,59 @@ ENV TZ=Asia/Tel_Aviv \ #ENV _APP_SMTP_PASSWORD '' COPY --from=builder /phpredis-5.2.1/modules/redis.so /usr/lib/php/20190902/ -#COPY --from=builder /phpredis-5.2.1/php-xhprof-extension/modules/tideways_xhprof.so /usr/lib/php/20190902/ +COPY --from=builder /phpredis-5.2.1/modules/redis.so /usr/lib/php/20190902/ +COPY --from=builder /ngx_brotli /ngx_brotli RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN \ apt-get update && \ - apt-get install -y --no-install-recommends --no-install-suggests curl ca-certificates software-properties-common openssl gnupg docker.io && \ + apt-get install -y --no-install-recommends --no-install-suggests wget ca-certificates software-properties-common build-essential libpcre3-dev zlib1g-dev libssl-dev openssl gnupg htop supervisor docker.io && \ LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php && \ add-apt-repository universe && \ add-apt-repository ppa:certbot/certbot && \ apt-get update && \ - apt-get install -y --no-install-recommends --no-install-suggests htop supervisor php$PHP_VERSION php$PHP_VERSION-fpm \ + apt-get install -y --no-install-recommends --no-install-suggests php$PHP_VERSION php$PHP_VERSION-fpm \ php$PHP_VERSION-mysqlnd php$PHP_VERSION-curl php$PHP_VERSION-imagick php$PHP_VERSION-mbstring php$PHP_VERSION-dom webp certbot && \ # Nginx - echo "deb http://nginx.org/packages/mainline/ubuntu/ bionic nginx" >> /etc/apt/sources.list.d/nginx.list && \ - curl -o nginx_signing.key http://nginx.org/keys/nginx_signing.key && \ - apt-key add nginx_signing.key && \ - apt-get update && \ - apt-get install -y --no-install-recommends --no-install-suggests nginx && \ + wget http://nginx.org/download/nginx-1.19.0.tar.gz && \ + tar -xzvf nginx-1.19.0.tar.gz && rm nginx-1.19.0.tar.gz && \ + cd nginx-1.19.0 && \ + ./configure --prefix=/usr/share/nginx \ + --sbin-path=/usr/sbin/nginx \ + --modules-path=/usr/lib/nginx/modules \ + --conf-path=/etc/nginx/nginx.conf \ + --error-log-path=/var/log/nginx/error.log \ + --http-log-path=/var/log/nginx/access.log \ + --pid-path=/run/nginx.pid \ + --lock-path=/var/lock/nginx.lock \ + --user=www-data \ + --group=www-data \ + --build=Ubuntu \ + --with-http_gzip_static_module \ + --with-http_ssl_module \ + --with-http_v2_module \ + --add-module=/ngx_brotli && \ + make && \ + make install && \ + rm -rf ../nginx-1.19.0 && \ # Redis Extension echo extension=redis.so >> /etc/php/$PHP_VERSION/fpm/conf.d/redis.ini && \ echo extension=redis.so >> /etc/php/$PHP_VERSION/cli/conf.d/redis.ini && \ - # XHProf Extension - #echo extension=tideways_xhprof.so >> /etc/php/$PHP_VERSION/fpm/conf.d/xhprof.ini && \ - #echo extension=tideways_xhprof.so >> /etc/php/$PHP_VERSION/cli/conf.d/xhprof.ini && \ + # XHprof Extension + # git clone "https://github.com/tideways/php-xhprof-extension.git" && \ + # cd php-xhprof-extension && \ + # phpize$PHP_VERSION && \ + # ./configure && \ + # make && \ + # make install && \ + # ls -ll && \ + # ls -ll modules && \ # Cleanup cd ../ && \ - apt-get purge -y --auto-remove software-properties-common gnupg curl && \ + apt-get purge -y --auto-remove wget software-properties-common build-essential libpcre3-dev zlib1g-dev libssl-dev gnupg && \ apt-get clean && \ + rm -rf /ngx_brotli && \ rm -rf /var/lib/apt/lists/* # Set Upload Limit (default to 100MB) @@ -162,4 +185,4 @@ EXPOSE 80 WORKDIR /usr/share/nginx/html -CMD ["/bin/bash", "/usr/local/bin/start"] +CMD ["/bin/bash", "/usr/local/bin/start"] \ No newline at end of file diff --git a/README.md b/README.md index c7cc4f9ecf..bc78047f0f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Appwrite Logo

- Simple Backend Server for your [Flutter / Vue / Angular / React / iOS / Android / *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 work 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 work 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.6.1 \ + -e version=0.6.2 \ + 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.2 ^ + 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.2 , 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 527cb77f14..edd0a79921 100644 --- a/app/app.php +++ b/app/app.php @@ -16,7 +16,7 @@ use Appwrite\Database\Database; use Appwrite\Database\Document; use Appwrite\Database\Validator\Authorization; use Appwrite\Event\Event; -use Appwrite\Network\Validators\Origin; +use Appwrite\Network\Validator\Origin; /* * Configuration files @@ -28,6 +28,7 @@ $webhook = new Event('v1-webhooks', 'WebhooksV1'); $audit = new Event('v1-audits', 'AuditsV1'); $usage = new Event('v1-usage', 'UsageV1'); $functions = new Event('v1-functions', 'FunctionsV1'); +$deletes = new Event('v1-deletes', 'DeletesV1'); /** * Get All verified client URLs for both console and current projects @@ -69,11 +70,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 @@ -81,13 +83,21 @@ $utopia->init(function () use ($utopia, $request, $response, &$user, $project, $ * As recommended at: * @see https://www.owasp.org/index.php/List_of_useful_HTTP_headers */ + if ($request->getServer('_APP_OPTIONS_FORCE_HTTPS', 'disabled') === 'enabled') { // Force HTTPS + if(Config::getParam('protocol') !== 'https') { + return $response->redirect('https://' . Config::getParam('domain').$request->getServer('REQUEST_URI')); + } + + $response->addHeader('Strict-Transport-Security', 'max-age='.(60 * 60 * 24 * 126)); // 126 days + } + $response ->addHeader('Server', 'Appwrite') ->addHeader('X-XSS-Protection', '1; mode=block; report=/v1/xss?url='.urlencode($request->getServer('REQUEST_URI'))) //->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') @@ -103,6 +113,7 @@ $utopia->init(function () use ($utopia, $request, $response, &$user, $project, $ if(!$originValidator->isValid($origin) && in_array($request->getMethod(), [Request::METHOD_POST, Request::METHOD_PUT, Request::METHOD_PATCH, Request::METHOD_DELETE]) + && $route->getLabel('origin', false) !== '*' && empty($request->getHeader('X-Appwrite-Key', ''))) { throw new Exception($originValidator->getDescription(), 403); } @@ -216,10 +227,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(); @@ -229,14 +240,18 @@ $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() && $mode !== APP_MODE_ADMIN && !empty($route->getLabel('sdk.namespace', null))) { // Don't calculate console usage and admin mode $usage - ->setParam('request', $request->getSize()) + ->setParam('request', $request->getSize() + $usage->getParam('storage')) ->setParam('response', $response->getSize()) ->trigger() ; @@ -248,7 +263,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/events.php b/app/config/events.php index a5d6a899dc..aeee6849f2 100644 --- a/app/config/events.php +++ b/app/config/events.php @@ -5,54 +5,54 @@ */ return [ 'account.create' => [ - 'description' => 'Triggers any time a new user register an account.', + 'description' => 'This event triggers when the account is created.', ], 'account.update.email' => [ - 'description' => 'Triggers any time a a user updates his or her acoount email address.', + 'description' => 'This event triggers when the account email address is updated.', ], 'account.update.name' => [ - 'description' => 'Triggers any time a a user updates his or her acoount name.', + 'description' => 'This event triggers when the account name is updated.', ], 'account.update.password' => [ - 'description' => 'Triggers any time a a user updates his or her acoount password.', + 'description' => 'This event triggers when the account password is updated.', ], 'account.update.prefs' => [ - 'description' => 'Triggers any time a a user updates his or her acoount preferences.', + 'description' => 'This event triggers when the account preferences are updated.', ], 'account.delete' => [ - 'description' => 'Triggers any time a new user is deleting its account.', + 'description' => 'This event triggers when the account is deleted.', ], 'account.sessions.create' => [ - 'description' => 'Triggers any time a user session is being created.', + 'description' => 'This event triggers when the account session is created.', ], 'account.sessions.delete' => [ - 'description' => 'Triggers any time a user session is being deleted.', + 'description' => 'This event triggers when the account session is deleted.', ], 'database.collections.create' => [ - 'description' => 'Triggers any time a new database collection is being created.', + 'description' => 'This event triggers when a database collection is created.', ], 'database.collections.update' => [ - 'description' => 'Triggers any time a new database collection is being updated.', + 'description' => 'This event triggers when a database collection is updated.', ], 'database.collections.delete' => [ - 'description' => 'Triggers any time a database collection is being deleted.', + 'description' => 'This event triggers when a database collection is deleted.', ], 'database.documents.create' => [ - 'description' => 'Triggers any time a new database document is being created.', + 'description' => 'This event triggers when a database document is created.', ], 'database.documents.patch' => [ - 'description' => 'Triggers any time a new database document is being updated.', + 'description' => 'This event triggers when a database document is patched.', ], 'database.documents.delete' => [ - 'description' => 'Triggers any time a database document is being deleted.', + 'description' => 'This event triggers when a database document is deleted.', ], 'storage.files.create' => [ - 'description' => 'Triggers any time a storage file has been created.', + 'description' => 'This event triggers when a storage file is created.', ], 'storage.files.update' => [ - 'description' => 'Triggers any time a storage file has been updated.', + 'description' => 'This event triggers when a storage file is updated.', ], 'storage.files.delete' => [ - 'description' => 'Triggers any time a file has been deleted.', + 'description' => 'This event triggers when a storage file is deleted.', ], ]; \ No newline at end of file diff --git a/app/config/languages.php b/app/config/languages.php new file mode 100644 index 0000000000..5f0434b4d0 --- /dev/null +++ b/app/config/languages.php @@ -0,0 +1,936 @@ + "aa", + "name" => "Afar", + "nativeName" => "Afar" + ], + [ + "code" => "ab", + "name" => "Abkhazian", + "nativeName" => "Аҧсуа" + ], + [ + "code" => "af", + "name" => "Afrikaans", + "nativeName" => "Afrikaans" + ], + [ + "code" => "ak", + "name" => "Akan", + "nativeName" => "Akana" + ], + [ + "code" => "am", + "name" => "Amharic", + "nativeName" => "አማርኛ" + ], + [ + "code" => "an", + "name" => "Aragonese", + "nativeName" => "Aragonés" + ], + [ + "code" => "ar", + "name" => "Arabic", + "nativeName" => "العربية" + ], + [ + "code" => "as", + "name" => "Assamese", + "nativeName" => "অসমীয়া" + ], + [ + "code" => "av", + "name" => "Avar", + "nativeName" => "Авар" + ], + [ + "code" => "ay", + "name" => "Aymara", + "nativeName" => "Aymar" + ], + [ + "code" => "az", + "name" => "Azerbaijani", + "nativeName" => "Azərbaycanca / آذربايجان" + ], + [ + "code" => "ba", + "name" => "Bashkir", + "nativeName" => "Башҡорт" + ], + [ + "code" => "be", + "name" => "Belarusian", + "nativeName" => "Беларуская" + ], + [ + "code" => "bg", + "name" => "Bulgarian", + "nativeName" => "Български" + ], + [ + "code" => "bh", + "name" => "Bihari", + "nativeName" => "भोजपुरी" + ], + [ + "code" => "bi", + "name" => "Bislama", + "nativeName" => "Bislama" + ], + [ + "code" => "bm", + "name" => "Bambara", + "nativeName" => "Bamanankan" + ], + [ + "code" => "bn", + "name" => "Bengali", + "nativeName" => "বাংলা" + ], + [ + "code" => "bo", + "name" => "Tibetan", + "nativeName" => "བོད་ཡིག / Bod skad" + ], + [ + "code" => "br", + "name" => "Breton", + "nativeName" => "Brezhoneg" + ], + [ + "code" => "bs", + "name" => "Bosnian", + "nativeName" => "Bosanski" + ], + [ + "code" => "ca", + "name" => "Catalan", + "nativeName" => "Català" + ], + [ + "code" => "ce", + "name" => "Chechen", + "nativeName" => "Нохчийн" + ], + [ + "code" => "ch", + "name" => "Chamorro", + "nativeName" => "Chamoru" + ], + [ + "code" => "co", + "name" => "Corsican", + "nativeName" => "Corsu" + ], + [ + "code" => "cr", + "name" => "Cree", + "nativeName" => "Nehiyaw" + ], + [ + "code" => "cs", + "name" => "Czech", + "nativeName" => "Česky" + ], + [ + "code" => "cu", + "name" => "Old Church Slavonic / Old Bulgarian", + "nativeName" => "словѣньскъ / slověnĭskŭ" + ], + [ + "code" => "cv", + "name" => "Chuvash", + "nativeName" => "Чăваш" + ], + [ + "code" => "cy", + "name" => "Welsh", + "nativeName" => "Cymraeg" + ], + [ + "code" => "da", + "name" => "Danish", + "nativeName" => "Dansk" + ], + [ + "code" => "de", + "name" => "German", + "nativeName" => "Deutsch" + ], + [ + "code" => "dv", + "name" => "Divehi", + "nativeName" => "ދިވެހިބަސް" + ], + [ + "code" => "dz", + "name" => "Dzongkha", + "nativeName" => "ཇོང་ཁ" + ], + [ + "code" => "ee", + "name" => "Ewe", + "nativeName" => "Ɛʋɛ" + ], + [ + "code" => "el", + "name" => "Greek", + "nativeName" => "Ελληνικά" + ], + [ + "code" => "en", + "name" => "English", + "nativeName" => "English" + ], + [ + "code" => "eo", + "name" => "Esperanto", + "nativeName" => "Esperanto" + ], + [ + "code" => "es", + "name" => "Spanish", + "nativeName" => "Español" + ], + [ + "code" => "et", + "name" => "Estonian", + "nativeName" => "Eesti" + ], + [ + "code" => "eu", + "name" => "Basque", + "nativeName" => "Euskara" + ], + [ + "code" => "fa", + "name" => "Persian", + "nativeName" => "فارسی" + ], + [ + "code" => "ff", + "name" => "Peul", + "nativeName" => "Fulfulde" + ], + [ + "code" => "fi", + "name" => "Finnish", + "nativeName" => "Suomi" + ], + [ + "code" => "fj", + "name" => "Fijian", + "nativeName" => "Na Vosa Vakaviti" + ], + [ + "code" => "fo", + "name" => "Faroese", + "nativeName" => "Føroyskt" + ], + [ + "code" => "fr", + "name" => "French", + "nativeName" => "Français" + ], + [ + "code" => "fy", + "name" => "West Frisian", + "nativeName" => "Frysk" + ], + [ + "code" => "ga", + "name" => "Irish", + "nativeName" => "Gaeilge" + ], + [ + "code" => "gd", + "name" => "Scottish Gaelic", + "nativeName" => "Gàidhlig" + ], + [ + "code" => "gl", + "name" => "Galician", + "nativeName" => "Galego" + ], + [ + "code" => "gn", + "name" => "Guarani", + "nativeName" => "Avañe'ẽ" + ], + [ + "code" => "gu", + "name" => "Gujarati", + "nativeName" => "ગુજરાતી" + ], + [ + "code" => "gv", + "name" => "Manx", + "nativeName" => "Gaelg" + ], + [ + "code" => "ha", + "name" => "Hausa", + "nativeName" => "هَوُسَ" + ], + [ + "code" => "he", + "name" => "Hebrew", + "nativeName" => "עברית" + ], + [ + "code" => "hi", + "name" => "Hindi", + "nativeName" => "हिन्दी" + ], + [ + "code" => "ho", + "name" => "Hiri Motu", + "nativeName" => "Hiri Motu" + ], + [ + "code" => "hr", + "name" => "Croatian", + "nativeName" => "Hrvatski" + ], + [ + "code" => "ht", + "name" => "Haitian", + "nativeName" => "Krèyol ayisyen" + ], + [ + "code" => "hu", + "name" => "Hungarian", + "nativeName" => "Magyar" + ], + [ + "code" => "hy", + "name" => "Armenian", + "nativeName" => "Հայերեն" + ], + [ + "code" => "hz", + "name" => "Herero", + "nativeName" => "Otsiherero" + ], + [ + "code" => "ia", + "name" => "Interlingua", + "nativeName" => "Interlingua" + ], + [ + "code" => "id", + "name" => "Indonesian", + "nativeName" => "Bahasa Indonesia" + ], + [ + "code" => "ie", + "name" => "Interlingue", + "nativeName" => "Interlingue" + ], + [ + "code" => "ig", + "name" => "Igbo", + "nativeName" => "Igbo" + ], + [ + "code" => "ii", + "name" => "Sichuan Yi", + "nativeName" => "ꆇꉙ / 四川彝语" + ], + [ + "code" => "ik", + "name" => "Inupiak", + "nativeName" => "Iñupiak" + ], + [ + "code" => "io", + "name" => "Ido", + "nativeName" => "Ido" + ], + [ + "code" => "is", + "name" => "Icelandic", + "nativeName" => "Íslenska" + ], + [ + "code" => "it", + "name" => "Italian", + "nativeName" => "Italiano" + ], + [ + "code" => "iu", + "name" => "Inuktitut", + "nativeName" => "ᐃᓄᒃᑎᑐᑦ" + ], + [ + "code" => "ja", + "name" => "Japanese", + "nativeName" => "日本語" + ], + [ + "code" => "jv", + "name" => "Javanese", + "nativeName" => "Basa Jawa" + ], + [ + "code" => "ka", + "name" => "Georgian", + "nativeName" => "ქართული" + ], + [ + "code" => "kg", + "name" => "Kongo", + "nativeName" => "KiKongo" + ], + [ + "code" => "ki", + "name" => "Kikuyu", + "nativeName" => "Gĩkũyũ" + ], + [ + "code" => "kj", + "name" => "Kuanyama", + "nativeName" => "Kuanyama" + ], + [ + "code" => "kk", + "name" => "Kazakh", + "nativeName" => "Қазақша" + ], + [ + "code" => "kl", + "name" => "Greenlandic", + "nativeName" => "Kalaallisut" + ], + [ + "code" => "km", + "name" => "Cambodian", + "nativeName" => "ភាសាខ្មែរ" + ], + [ + "code" => "kn", + "name" => "Kannada", + "nativeName" => "ಕನ್ನಡ" + ], + [ + "code" => "ko", + "name" => "Korean", + "nativeName" => "한국어" + ], + [ + "code" => "kr", + "name" => "Kanuri", + "nativeName" => "Kanuri" + ], + [ + "code" => "ks", + "name" => "Kashmiri", + "nativeName" => "कश्मीरी / كشميري" + ], + [ + "code" => "ku", + "name" => "Kurdish", + "nativeName" => "Kurdî / كوردی" + ], + [ + "code" => "kv", + "name" => "Komi", + "nativeName" => "Коми" + ], + [ + "code" => "kw", + "name" => "Cornish", + "nativeName" => "Kernewek" + ], + [ + "code" => "ky", + "name" => "Kirghiz", + "nativeName" => "Kırgızca / Кыргызча" + ], + [ + "code" => "la", + "name" => "Latin", + "nativeName" => "Latina" + ], + [ + "code" => "lb", + "name" => "Luxembourgish", + "nativeName" => "Lëtzebuergesch" + ], + [ + "code" => "lg", + "name" => "Ganda", + "nativeName" => "Luganda" + ], + [ + "code" => "li", + "name" => "Limburgian", + "nativeName" => "Limburgs" + ], + [ + "code" => "ln", + "name" => "Lingala", + "nativeName" => "Lingála" + ], + [ + "code" => "lo", + "name" => "Laotian", + "nativeName" => "ລາວ / Pha xa lao" + ], + [ + "code" => "lt", + "name" => "Lithuanian", + "nativeName" => "Lietuvių" + ], + [ + "code" => "lu", + "name" => "Luba-Katanga", + "nativeName" => "Tshiluba" + ], + [ + "code" => "lv", + "name" => "Latvian", + "nativeName" => "Latviešu" + ], + [ + "code" => "mg", + "name" => "Malagasy", + "nativeName" => "Malagasy" + ], + [ + "code" => "mh", + "name" => "Marshallese", + "nativeName" => "Kajin Majel / Ebon" + ], + [ + "code" => "mi", + "name" => "Maori", + "nativeName" => "Māori" + ], + [ + "code" => "mk", + "name" => "Macedonian", + "nativeName" => "Македонски" + ], + [ + "code" => "ml", + "name" => "Malayalam", + "nativeName" => "മലയാളം" + ], + [ + "code" => "mn", + "name" => "Mongolian", + "nativeName" => "Монгол" + ], + [ + "code" => "mo", + "name" => "Moldovan", + "nativeName" => "Moldovenească" + ], + [ + "code" => "mr", + "name" => "Marathi", + "nativeName" => "मराठी" + ], + [ + "code" => "ms", + "name" => "Malay", + "nativeName" => "Bahasa Melayu" + ], + [ + "code" => "mt", + "name" => "Maltese", + "nativeName" => "bil-Malti" + ], + [ + "code" => "my", + "name" => "Burmese", + "nativeName" => "မြန်မာစာ" + ], + [ + "code" => "na", + "name" => "Nauruan", + "nativeName" => "Dorerin Naoero" + ], + [ + "code" => "nb", + "name" => "Norwegian Bokmål", + "nativeName" => "Norsk bokmål" + ], + [ + "code" => "nd", + "name" => "North Ndebele", + "nativeName" => "Sindebele" + ], + [ + "code" => "ne", + "name" => "Nepali", + "nativeName" => "नेपाली" + ], + [ + "code" => "ng", + "name" => "Ndonga", + "nativeName" => "Oshiwambo" + ], + [ + "code" => "nl", + "name" => "Dutch", + "nativeName" => "Nederlands" + ], + [ + "code" => "nn", + "name" => "Norwegian Nynorsk", + "nativeName" => "Norsk nynorsk" + ], + [ + "code" => "no", + "name" => "Norwegian", + "nativeName" => "Norsk" + ], + [ + "code" => "nr", + "name" => "South Ndebele", + "nativeName" => "isiNdebele" + ], + [ + "code" => "nv", + "name" => "Navajo", + "nativeName" => "Diné bizaad" + ], + [ + "code" => "ny", + "name" => "Chichewa", + "nativeName" => "Chi-Chewa" + ], + [ + "code" => "oc", + "name" => "Occitan", + "nativeName" => "Occitan" + ], + [ + "code" => "oj", + "name" => "Ojibwa", + "nativeName" => "ᐊᓂᔑᓈᐯᒧᐎᓐ / Anishinaabemowin" + ], + [ + "code" => "om", + "name" => "Oromo", + "nativeName" => "Oromoo" + ], + [ + "code" => "or", + "name" => "Oriya", + "nativeName" => "ଓଡ଼ିଆ" + ], + [ + "code" => "os", + "name" => "Ossetian / Ossetic", + "nativeName" => "Иронау" + ], + [ + "code" => "pa", + "name" => "Panjabi / Punjabi", + "nativeName" => "ਪੰਜਾਬੀ / पंजाबी / پنجابي" + ], + [ + "code" => "pi", + "name" => "Pali", + "nativeName" => "Pāli / पाऴि" + ], + [ + "code" => "pl", + "name" => "Polish", + "nativeName" => "Polski" + ], + [ + "code" => "ps", + "name" => "Pashto", + "nativeName" => "پښتو" + ], + [ + "code" => "pt", + "name" => "Portuguese", + "nativeName" => "Português" + ], + [ + "code" => "qu", + "name" => "Quechua", + "nativeName" => "Runa Simi" + ], + [ + "code" => "rm", + "name" => "Raeto Romance", + "nativeName" => "Rumantsch" + ], + [ + "code" => "rn", + "name" => "Kirundi", + "nativeName" => "Kirundi" + ], + [ + "code" => "ro", + "name" => "Romanian", + "nativeName" => "Română" + ], + [ + "code" => "ru", + "name" => "Russian", + "nativeName" => "Русский" + ], + [ + "code" => "rw", + "name" => "Rwandi", + "nativeName" => "Kinyarwandi" + ], + [ + "code" => "sa", + "name" => "Sanskrit", + "nativeName" => "संस्कृतम्" + ], + [ + "code" => "sc", + "name" => "Sardinian", + "nativeName" => "Sardu" + ], + [ + "code" => "sd", + "name" => "Sindhi", + "nativeName" => "सिनधि" + ], + [ + "code" => "se", + "name" => "Northern Sami", + "nativeName" => "Sámegiella" + ], + [ + "code" => "sg", + "name" => "Sango", + "nativeName" => "Sängö" + ], + [ + "code" => "sh", + "name" => "Serbo-Croatian", + "nativeName" => "Srpskohrvatski / Српскохрватски" + ], + [ + "code" => "si", + "name" => "Sinhalese", + "nativeName" => "සිංහල" + ], + [ + "code" => "sk", + "name" => "Slovak", + "nativeName" => "Slovenčina" + ], + [ + "code" => "sl", + "name" => "Slovenian", + "nativeName" => "Slovenščina" + ], + [ + "code" => "sm", + "name" => "Samoan", + "nativeName" => "Gagana Samoa" + ], + [ + "code" => "sn", + "name" => "Shona", + "nativeName" => "chiShona" + ], + [ + "code" => "so", + "name" => "Somalia", + "nativeName" => "Soomaaliga" + ], + [ + "code" => "sq", + "name" => "Albanian", + "nativeName" => "Shqip" + ], + [ + "code" => "sr", + "name" => "Serbian", + "nativeName" => "Српски" + ], + [ + "code" => "ss", + "name" => "Swati", + "nativeName" => "SiSwati" + ], + [ + "code" => "st", + "name" => "Southern Sotho", + "nativeName" => "Sesotho" + ], + [ + "code" => "su", + "name" => "Sundanese", + "nativeName" => "Basa Sunda" + ], + [ + "code" => "sv", + "name" => "Swedish", + "nativeName" => "Svenska" + ], + [ + "code" => "sw", + "name" => "Swahili", + "nativeName" => "Kiswahili" + ], + [ + "code" => "ta", + "name" => "Tamil", + "nativeName" => "தமிழ்" + ], + [ + "code" => "te", + "name" => "Telugu", + "nativeName" => "తెలుగు" + ], + [ + "code" => "tg", + "name" => "Tajik", + "nativeName" => "Тоҷикӣ" + ], + [ + "code" => "th", + "name" => "Thai", + "nativeName" => "ไทย / Phasa Thai" + ], + [ + "code" => "ti", + "name" => "Tigrinya", + "nativeName" => "ትግርኛ" + ], + [ + "code" => "tk", + "name" => "Turkmen", + "nativeName" => "Туркмен / تركمن" + ], + [ + "code" => "tl", + "name" => "Tagalog / Filipino", + "nativeName" => "Tagalog" + ], + [ + "code" => "tn", + "name" => "Tswana", + "nativeName" => "Setswana" + ], + [ + "code" => "to", + "name" => "Tonga", + "nativeName" => "Lea Faka-Tonga" + ], + [ + "code" => "tr", + "name" => "Turkish", + "nativeName" => "Türkçe" + ], + [ + "code" => "ts", + "name" => "Tsonga", + "nativeName" => "Xitsonga" + ], + [ + "code" => "tt", + "name" => "Tatar", + "nativeName" => "Tatarça" + ], + [ + "code" => "tw", + "name" => "Twi", + "nativeName" => "Twi" + ], + [ + "code" => "ty", + "name" => "Tahitian", + "nativeName" => "Reo Mā`ohi" + ], + [ + "code" => "ug", + "name" => "Uyghur", + "nativeName" => "Uyƣurqə / ئۇيغۇرچە" + ], + [ + "code" => "uk", + "name" => "Ukrainian", + "nativeName" => "Українська" + ], + [ + "code" => "ur", + "name" => "Urdu", + "nativeName" => "اردو" + ], + [ + "code" => "uz", + "name" => "Uzbek", + "nativeName" => "Ўзбек" + ], + [ + "code" => "ve", + "name" => "Venda", + "nativeName" => "Tshivenḓa" + ], + [ + "code" => "vi", + "name" => "Vietnamese", + "nativeName" => "Tiếng Việt" + ], + [ + "code" => "vo", + "name" => "Volapük", + "nativeName" => "Volapük" + ], + [ + "code" => "wa", + "name" => "Walloon", + "nativeName" => "Walon" + ], + [ + "code" => "wo", + "name" => "Wolof", + "nativeName" => "Wollof" + ], + [ + "code" => "xh", + "name" => "Xhosa", + "nativeName" => "isiXhosa" + ], + [ + "code" => "yi", + "name" => "Yiddish", + "nativeName" => "ייִדיש" + ], + [ + "code" => "yo", + "name" => "Yoruba", + "nativeName" => "Yorùbá" + ], + [ + "code" => "za", + "name" => "Zhuang", + "nativeName" => "Cuengh / Tôô / 壮语" + ], + [ + "code" => "zh", + "name" => "Chinese", + "nativeName" => "中文" + ], + [ + "code" => "zu", + "name" => "Zulu", + "nativeName" => "isiZulu" + ] +]; diff --git a/app/config/platforms.php b/app/config/platforms.php index 54d00fcbbe..f05dcde39b 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -29,7 +29,7 @@ return [ [ 'key' => 'flutter', 'name' => 'Flutter', - 'version' => '0.2.1', + 'version' => '0.2.2', 'url' => 'https://github.com/appwrite/sdk-for-flutter', 'enabled' => true, 'beta' => true, @@ -139,6 +139,20 @@ 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', @@ -170,7 +184,7 @@ return [ [ 'key' => 'ruby', 'name' => 'Ruby', - 'version' => '1.0.10', + 'version' => '1.0.11', 'url' => 'https://github.com/appwrite/sdk-for-ruby', 'enabled' => true, 'beta' => true, diff --git a/app/config/providers.php b/app/config/providers.php index 703bbef264..b1b086a865 100644 --- a/app/config/providers.php +++ b/app/config/providers.php @@ -1,149 +1,187 @@ [ + 'developers' => 'https://developer.amazon.com/apps-and-games/services-and-apis', + 'icon' => 'icon-amazon', + 'enabled' => true, + 'form' => false, + 'beta' => false, + 'mock' => false, + ], + 'apple' => [ + 'developers' => 'https://developer.apple.com/', + 'icon' => 'icon-apple', + 'enabled' => true, + 'form' => 'apple.phtml', // Perperation for adding ability to customized OAuth UI forms, currently handled hardcoded. + 'beta' => true, + 'mock' => false, + ], 'bitbucket' => [ 'developers' => 'https://developer.atlassian.com/bitbucket', 'icon' => 'icon-bitbucket', 'enabled' => true, + 'form' => false, + 'beta' => false, 'mock' => false, ], - 'facebook' => [ - 'developers' => 'https://developers.facebook.com/', - 'icon' => 'icon-facebook', + 'bitly' => [ + 'developers' => 'https://dev.bitly.com/v4_documentation.html', + 'icon' => 'icon-bitly', 'enabled' => true, - 'mock' => false, + 'form' => false, + 'beta' => false, + 'mock' => false ], - 'github' => [ - 'developers' => 'https://developer.github.com/', - 'icon' => 'icon-github-circled', - 'enabled' => true, - 'mock' => false, - ], - 'gitlab' => [ - 'developers' => 'https://docs.gitlab.com/ee/api/', - 'icon' => 'icon-gitlab', - 'enabled' => true, - 'mock' => false, - ], - 'google' => [ - 'developers' => 'https://developers.google.com/', - 'icon' => 'icon-google', - 'enabled' => true, - 'mock' => false, - ], - // 'instagram' => [ - // 'developers' => 'https://www.instagram.com/developer/', - // 'icon' => 'icon-instagram', - // 'enabled' => false, - // 'mock' => false, - // ], - 'microsoft' => [ - 'developers' => 'https://developer.microsoft.com/en-us/', - 'icon' => 'icon-windows', - 'enabled' => true, - 'mock' => false, - ], - // 'twitter' => [ - // 'developers' => 'https://developer.twitter.com/', - // 'icon' => 'icon-twitter', - // 'enabled' => false, - // 'mock' => false, - // ], - 'linkedin' => [ - 'developers' => 'https://developer.linkedin.com/', - 'icon' => 'icon-linkedin', - 'enabled' => true, - 'mock' => false, - ], - 'slack' => [ - 'developers' => 'https://api.slack.com/', - 'icon' => 'icon-slack', + 'discord' => [ + 'developers' => 'https://discordapp.com/developers/docs/topics/oauth2', + 'icon' => 'icon-discord', 'enabled' => true, + 'form' => false, + 'beta' => false, 'mock' => false, ], 'dropbox' => [ 'developers' => 'https://www.dropbox.com/developers/documentation', 'icon' => 'icon-dropbox', 'enabled' => true, + 'form' => false, + 'beta' => false, 'mock' => false, ], + 'facebook' => [ + 'developers' => 'https://developers.facebook.com/', + 'icon' => 'icon-facebook', + 'enabled' => true, + 'form' => false, + 'beta' => false, + 'mock' => false, + ], + 'github' => [ + 'developers' => 'https://developer.github.com/', + 'icon' => 'icon-github-circled', + 'enabled' => true, + 'form' => false, + 'beta' => false, + 'mock' => false, + ], + 'gitlab' => [ + 'developers' => 'https://docs.gitlab.com/ee/api/', + 'icon' => 'icon-gitlab', + 'enabled' => true, + 'form' => false, + 'beta' => false, + 'mock' => false, + ], + 'google' => [ + 'developers' => 'https://developers.google.com/', + 'icon' => 'icon-google', + 'enabled' => true, + 'form' => false, + 'beta' => false, + 'mock' => false, + ], + 'linkedin' => [ + 'developers' => 'https://developer.linkedin.com/', + 'icon' => 'icon-linkedin', + 'enabled' => true, + 'form' => false, + 'beta' => false, + 'mock' => false, + ], + 'microsoft' => [ + 'developers' => 'https://developer.microsoft.com/en-us/', + 'icon' => 'icon-windows', + 'enabled' => true, + 'form' => false, + 'beta' => false, + 'mock' => false, + ], + 'paypal' => [ + 'developers' => 'https://developer.paypal.com/docs/api/overview/', + 'icon' => 'icon-paypal', + 'enabled' => true, + 'form' => false, + 'beta' => false, + 'mock' => false + ], 'salesforce' => [ 'developers' => 'https://developer.salesforce.com/docs/', 'icon' => 'icon-salesforce', 'enabled' => true, + 'form' => false, + 'beta' => false, 'mock' => false, ], - // 'apple' => [ - // 'developers' => 'https://developer.apple.com/', - // 'icon' => 'icon-apple', - // 'enabled' => false, - // 'mock' => false, - // ], - 'amazon' => [ - 'developers' => 'https://developer.amazon.com/apps-and-games/services-and-apis', - 'icon' => 'icon-amazon', - 'enabled' => true, - 'mock' => false, - ], - 'vk' => [ - 'developers' => 'https://vk.com/dev', - 'icon' => 'icon-vk', - 'enabled' => true, - 'mock' => false, - ], - 'discord' => [ - 'developers' => 'https://discordapp.com/developers/docs/topics/oauth2', - 'icon' => 'icon-discord', - 'enabled' => true, - 'mock' => false, - ], - 'twitch' => [ - 'developers' => 'https://dev.twitch.tv/docs/authentication', - 'icon' => 'icon-twitch', + 'slack' => [ + 'developers' => 'https://api.slack.com/', + 'icon' => 'icon-slack', 'enabled' => true, + 'form' => false, + 'beta' => false, 'mock' => false, ], 'spotify' => [ 'developers' => 'https://developer.spotify.com/documentation/general/guides/authorization-guide/', 'icon' => 'icon-spotify', 'enabled' => true, + 'form' => false, + 'beta' => false, + 'mock' => false, + ], + 'twitch' => [ + 'developers' => 'https://dev.twitch.tv/docs/authentication', + 'icon' => 'icon-twitch', + 'enabled' => true, + 'form' => false, + 'beta' => false, + 'mock' => false, + ], + 'vk' => [ + 'developers' => 'https://vk.com/dev', + 'icon' => 'icon-vk', + 'enabled' => true, + 'form' => false, + 'beta' => false, 'mock' => false, ], 'yahoo' => [ 'developers' => 'https://developer.yahoo.com/oauth2/guide/flows_authcode/', 'icon' => 'icon-yahoo', 'enabled' => true, + 'form' => false, + 'beta' => false, 'mock' => false, ], 'yandex' => [ 'developers' => 'https://tech.yandex.com/oauth/', 'icon' => 'icon-yandex', 'enabled' => true, + 'form' => false, + 'beta' => false, 'mock' => false, ], - 'twitter' => [ - 'developers' => 'https://developer.twitter.com/', - 'icon' => 'icon-twitter', - 'enabled' => false, - 'mock' => false - ], - 'paypal' => [ - 'developers' => 'https://developer.paypal.com/docs/api/overview/', - 'icon' => 'icon-paypal', - 'enabled' => true, - 'mock' => false - ], - 'bitly' => [ - 'developers' => 'https://dev.bitly.com/v4_documentation.html', - 'icon' => 'icon-bitly', - 'enabled' => true, - 'mock' => false - ], + // 'instagram' => [ + // 'developers' => 'https://www.instagram.com/developer/', + // 'icon' => 'icon-instagram', + // 'enabled' => false, + // 'beta' => false, + // 'mock' => false, + // ], + // 'twitter' => [ + // 'developers' => 'https://developer.twitter.com/', + // 'icon' => 'icon-twitter', + // 'enabled' => false, + // 'beta' => false, + // 'mock' => false, + // ], // Keep Last 'mock' => [ 'developers' => 'https://appwrite.io', 'icon' => 'icon-appwrite', 'enabled' => true, + 'form' => false, + 'beta' => false, 'mock' => true, ] ]; diff --git a/app/config/roles.php b/app/config/roles.php index 28c9cc6e06..9bd12bdf22 100644 --- a/app/config/roles.php +++ b/app/config/roles.php @@ -24,7 +24,6 @@ $logged = [ 'projects.write', 'locale.read', 'avatars.read', - 'health.read', ]; $admins = [ @@ -60,10 +59,10 @@ return [ 'public', 'home', 'console', + 'documents.read', 'files.read', 'locale.read', 'avatars.read', - 'health.read', ], ], ROLE_MEMBER => [ diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index ce19865264..282a5d9a22 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -57,7 +57,7 @@ $utopia->post('/v1/account') ->label('sdk.description', '/docs/references/account/create.md') ->label('abuse-limit', 10) ->param('email', '', function () { return new Email(); }, 'User email.') - ->param('password', '', function () { return new Password(); }, 'User password.') + ->param('password', '', function () { return new Password(); }, 'User password. Must be between 6 to 32 chars.') ->param('name', '', function () { return new Text(100); }, 'User name.', true) ->action( function ($email, $password, $name) use ($register, $request, $response, $audit, $projectDB, $project, $webhook, $oauth2Keys) { @@ -158,7 +158,7 @@ $utopia->post('/v1/account/sessions') ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') ->param('email', '', function () { return new Email(); }, 'User email.') - ->param('password', '', function () { return new Password(); }, 'User password.') + ->param('password', '', function () { return new Password(); }, 'User password. Must be between 6 to 32 chars.') ->action( function ($email, $password) use ($response, $request, $projectDB, $audit, $webhook) { $protocol = Config::getParam('protocol'); @@ -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'); @@ -308,6 +308,29 @@ $utopia->get('/v1/account/sessions/oauth2/callback/:provider/:projectId') } ); +$utopia->post('/v1/account/sessions/oauth2/callback/:provider/:projectId') + ->desc('OAuth2 Callback') + ->label('error', __DIR__.'/../../views/general/error.phtml') + ->label('scope', 'public') + ->label('origin', '*') + ->label('docs', false) + ->param('projectId', '', function () { return new Text(1024); }, 'Project unique ID.') + ->param('provider', '', function () { return new WhiteList(array_keys(Config::getParam('providers'))); }, 'OAuth2 provider.') + ->param('code', '', function () { return new Text(1024); }, 'OAuth2 code.') + ->param('state', '', function () { return new Text(2048); }, 'Login state params.', true) + ->action( + function ($projectId, $provider, $code, $state) use ($response) { + $domain = Config::getParam('domain'); + $protocol = Config::getParam('protocol'); + + $response + ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') + ->addHeader('Pragma', 'no-cache') + ->redirect($protocol.'://'.$domain.'/v1/account/sessions/oauth2/'.$provider.'/redirect?' + .http_build_query(['project' => $projectId, 'code' => $code, 'state' => $state])); + } + ); + $utopia->get('/v1/account/sessions/oauth2/:provider/redirect') ->desc('OAuth2 Redirect') ->label('error', __DIR__.'/../../views/general/error.phtml') @@ -361,6 +384,7 @@ $utopia->get('/v1/account/sessions/oauth2/:provider/redirect') if (!empty($state['failure']) && !$validateURL->isValid($state['failure'])) { throw new Exception('Invalid redirect URL for failure login', 400); } + $state['failure'] = null; $accessToken = $oauth2->getAccessToken($code); @@ -721,8 +745,8 @@ $utopia->patch('/v1/account/password') ->label('sdk.namespace', 'account') ->label('sdk.method', 'updatePassword') ->label('sdk.description', '/docs/references/account/update-password.md') - ->param('password', '', function () { return new Password(); }, 'New user password.') - ->param('oldPassword', '', function () { return new Password(); }, 'Old user password.') + ->param('password', '', function () { return new Password(); }, 'New user password. Must be between 6 to 32 chars.') + ->param('oldPassword', '', function () { return new Password(); }, 'Old user password. Must be between 6 to 32 chars.') ->action( function ($password, $oldPassword) use ($response, $user, $projectDB, $audit, $oauth2Keys) { if (!Auth::passwordVerify($oldPassword, $user->getAttribute('password'))) { // Double check user password @@ -764,7 +788,7 @@ $utopia->patch('/v1/account/email') ->label('sdk.method', 'updateEmail') ->label('sdk.description', '/docs/references/account/update-email.md') ->param('email', '', function () { return new Email(); }, 'User email.') - ->param('password', '', function () { return new Password(); }, 'User password.') + ->param('password', '', function () { return new Password(); }, 'User password. Must be between 6 to 32 chars.') ->action( function ($email, $password) use ($response, $user, $projectDB, $audit, $oauth2Keys) { if (!Auth::passwordVerify($password, $user->getAttribute('password'))) { // Double check user password @@ -1027,7 +1051,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 @@ -1120,8 +1144,8 @@ $utopia->put('/v1/account/recovery') ->label('abuse-key', 'url:{url},userId:{param-userId}') ->param('userId', '', function () { return new UID(); }, 'User account UID address.') ->param('secret', '', function () { return new Text(256); }, 'Valid reset token.') - ->param('password', '', function () { return new Password(); }, 'New password.') - ->param('passwordAgain', '', function () {return new Password(); }, 'New password again.') + ->param('password', '', function () { return new Password(); }, 'New password. Must be between 6 to 32 chars.') + ->param('passwordAgain', '', function () {return new Password(); }, 'New password again. Must be between 6 to 32 chars.') ->action( function ($userId, $secret, $password, $passwordAgain) use ($response, $projectDB, $audit) { if ($password !== $passwordAgain) { @@ -1188,7 +1212,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 0e62ba9c6e..b1c8d352b3 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -16,6 +16,7 @@ use BaconQrCode\Renderer\Image\ImagickImageBackEnd; use BaconQrCode\Renderer\RendererStyle\RendererStyle; use BaconQrCode\Writer; use Utopia\Config\Config; +use Utopia\Validator\HexColor; include_once __DIR__ . '/../shared/api.php'; @@ -114,6 +115,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); }); @@ -384,7 +386,83 @@ $utopia->get('/v1/avatars/qr') $response ->addHeader('Expires', date('D, d M Y H:i:s', time() + (60 * 60 * 24 * 45)).' GMT') // 45 days cache ->setContentType('image/png') - ->send('', $writer->writeString($text)) + ->send($writer->writeString($text)) + ; + } + ); + +$utopia->get('/v1/avatars/initials') + ->desc('Get User Initials') + ->param('name', '', function () { return new Text(512); }, 'Full Name. When empty, current user name or email will be used.', true) + ->param('width', 500, function () { return new Range(0, 2000); }, 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) + ->param('height', 500, function () { return new Range(0, 2000); }, 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) + ->param('color', '', function () { return new HexColor(); }, 'Changes text color. By default a random color will be picked and stay will persistent to the given name.', true) + ->param('background', '', function () { return new HexColor(); }, 'Changes background color. By default a random color will be picked and stay will persistent to the given name.', true) + ->label('scope', 'avatars.read') + ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) + ->label('sdk.namespace', 'avatars') + ->label('sdk.method', 'getInitials') + ->label('sdk.methodType', 'location') + ->label('sdk.description', '/docs/references/avatars/get-initials.md') + ->action( + function ($name, $width, $height, $color, $background) use ($response, $user) { + $themes = [ + ['color' => '#27005e', 'background' => '#e1d2f6'], // VIOLET + ['color' => '#5e2700', 'background' => '#f3d9c6'], // ORANGE + ['color' => '#006128', 'background' => '#c9f3c6'], // GREEN + ['color' => '#580061', 'background' => '#f2d1f5'], // FUSCHIA + ['color' => '#00365d', 'background' => '#c6e1f3'], // BLUE + ['color' => '#00075c', 'background' => '#d2d5f6'], // INDIGO + ['color' => '#610038', 'background' => '#f5d1e6'], // PINK + ['color' => '#386100', 'background' => '#dcf1bd'], // LIME + ['color' => '#615800', 'background' => '#f1ecba'], // YELLOW + ['color' => '#610008', 'background' => '#f6d2d5'] // RED + ]; + + $rand = rand(0, count($themes)-1); + + $name = (!empty($name)) ? $name : $user->getAttribute('name', $user->getAttribute('email', '')); + $words = explode(' ', strtoupper($name)); + $initials = null; + $code = 0; + + foreach ($words as $key => $w) { + $initials .= (isset($w[0])) ? $w[0] : ''; + $code += (isset($w[0])) ? ord($w[0]) : 0; + + if($key == 1) { + break; + } + } + + $length = count($words); + $rand = substr($code,-1); + $background = (!empty($background)) ? '#'.$background : $themes[$rand]['background']; + $color = (!empty($color)) ? '#'.$color : $themes[$rand]['color']; + + $image = new \Imagick(); + $draw = new \ImagickDraw(); + $fontSize = min($width, $height) / 2; + + $draw->setFont(__DIR__."/../../../public/fonts/poppins-v9-latin-500.ttf"); + $image->setFont(__DIR__."/../../../public/fonts/poppins-v9-latin-500.ttf"); + + $draw->setFillColor(new \ImagickPixel($color)); + $draw->setFontSize($fontSize); + + $draw->setTextAlignment(\Imagick::ALIGN_CENTER); + $draw->annotation($width / 1.97, ($height / 2) + ($fontSize / 3), $initials); + + $image->newImage($width, $height, $background); + $image->setImageFormat("png"); + $image->drawImage($draw); + + //$image->setImageCompressionQuality(9 - round(($quality / 100) * 9)); + + $response + ->addHeader('Expires', date('D, d M Y H:i:s', time() + (60 * 60 * 24 * 45)).' GMT') // 45 days cache + ->setContentType('image/png') + ->send($image->getImageBlob()) ; } ); \ No newline at end of file diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 9e9ea09635..db95fe5db1 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -3,7 +3,7 @@ global $utopia, $request, $response, $register, $project; use Utopia\Exception; -use Appwrite\Storage\Devices\Local; +use Appwrite\Storage\Device\Local; use Appwrite\Storage\Storage; use Appwrite\ClamAV\Network; @@ -158,7 +158,7 @@ $utopia->get('/v1/health/queue/certificates') ->label('sdk.description', '/docs/references/health/get-queue-certificates.md') ->action( function () use ($response) { - $response->json(['size' => Resque::size('v1-usage')]); + $response->json(['size' => Resque::size('v1-certificates')]); } ); @@ -218,7 +218,11 @@ $utopia->get('/v1/health/anti-virus') ->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([ diff --git a/app/controllers/api/locale.php b/app/controllers/api/locale.php index 8f4f2e3272..64978ac355 100644 --- a/app/controllers/api/locale.php +++ b/app/controllers/api/locale.php @@ -165,3 +165,19 @@ $utopia->get('/v1/locale/currencies') $response->json($currencies); } ); + + +$utopia->get('/v1/locale/languages') + ->desc('List Languages') + ->label('scope', 'locale.read') + ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) + ->label('sdk.namespace', 'locale') + ->label('sdk.method', 'getLanguages') + ->label('sdk.description', '/docs/references/locale/get-languages.md') + ->action( + function () use ($response) { + $languages = include __DIR__.'/../../config/languages.php'; + + $response->json($languages); + } + ); \ No newline at end of file diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 9c57fd1b5a..766b2f48fb 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -1,6 +1,6 @@ patch('/v1/projects/:projectId/oauth2') ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.') ->param('provider', '', function () { return new WhiteList(array_keys(Config::getParam('providers'))); }, 'Provider Name', false) ->param('appId', '', function () { return new Text(256); }, 'Provider app ID.', true) - ->param('secret', '', function () { return new text(256); }, 'Provider secret key.', true) + ->param('secret', '', function () { return new text(512); }, 'Provider secret key.', true) ->action( function ($projectId, $provider, $appId, $secret) use ($request, $response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -400,9 +400,9 @@ $utopia->delete('/v1/projects/:projectId') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'delete') ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.') - ->param('password', '', function () { return new UID(); }, 'Your user password for confirmation.') + ->param('password', '', function () { return new UID(); }, 'Your user password for confirmation. Must be between 6 to 32 chars.') ->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,26 @@ $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($project->getAttribute('teamId', null))) { + throw new Exception('Failed to remove project team 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 +1235,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..ebcb85f32d 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -15,10 +15,10 @@ use Appwrite\ClamAV\Network; use Appwrite\Database\Database; use Appwrite\Database\Validator\UID; use Appwrite\Storage\Storage; -use Appwrite\Storage\Devices\Local; -use Appwrite\Storage\Validators\File; -use Appwrite\Storage\Validators\FileSize; -use Appwrite\Storage\Validators\Upload; +use Appwrite\Storage\Device\Local; +use Appwrite\Storage\Validator\File; +use Appwrite\Storage\Validator\FileSize; +use Appwrite\Storage\Validator\Upload; use Appwrite\Storage\Compression\Algorithms\GZIP; use Appwrite\Resize\Resize; use Appwrite\OpenSSL\OpenSSL; @@ -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..ded2445faa 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -213,9 +213,9 @@ $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) { + function ($teamId, $email, $name, $roles, $url) use ($response, $register, $project, $user, $audit, $projectDB, $mode) { $name = (empty($name)) ? $email : $name; $team = $projectDB->getDocument($teamId); @@ -285,7 +285,7 @@ $utopia->post('/v1/teams/:teamId/memberships') } } - if (!$isOwner) { + if (!$isOwner && (APP_MODE_ADMIN !== $mode)) { throw new Exception('User is not allowed to send invitations for this team', 401); } @@ -302,11 +302,18 @@ $utopia->post('/v1/teams/:teamId/memberships') 'roles' => $roles, 'invited' => time(), 'joined' => 0, - 'confirm' => false, + 'confirm' => (APP_MODE_ADMIN === $mode), 'secret' => Auth::hash($secret), ]); - $membership = $projectDB->createDocument($membership->getArrayCopy()); + if(APP_MODE_ADMIN === $mode) { // Allow admin to create membership + Authorization::disable(); + $membership = $projectDB->createDocument($membership->getArrayCopy()); + Authorization::reset(); + } + else { + $membership = $projectDB->createDocument($membership->getArrayCopy()); + } if (false === $membership) { throw new Exception('Failed saving membership to DB', 500); @@ -334,7 +341,9 @@ $utopia->post('/v1/teams/:teamId/memberships') $mail->AltBody = strip_tags($body->render()); try { - $mail->send(); + if(APP_MODE_ADMIN !== $mode) { // No need in comfirmation when in admin mode + $mail->send(); + } } catch (\Exception $error) { throw new Exception('Error sending mail: ' . $error->getMessage(), 500); } @@ -371,8 +380,12 @@ $utopia->get('/v1/teams/:teamId/memberships') ->label('sdk.method', 'getMemberships') ->label('sdk.description', '/docs/references/teams/get-team-members.md') ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') + ->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true) + ->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) + ->param('offset', 0, function () { return new Range(0, 2000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true) + ->param('orderType', 'ASC', function () { return new WhiteList(['ASC', 'DESC']); }, 'Order result by ASC or DESC order.', true) ->action( - function ($teamId) use ($response, $projectDB) { + function ($teamId, $search, $limit, $offset, $orderType) use ($response, $projectDB) { $team = $projectDB->getDocument($teamId); if (empty($team->getId()) || Database::SYSTEM_COLLECTION_TEAMS != $team->getCollection()) { @@ -380,8 +393,12 @@ $utopia->get('/v1/teams/:teamId/memberships') } $memberships = $projectDB->getCollection([ - 'limit' => 50, - 'offset' => 0, + 'limit' => $limit, + 'offset' => $offset, + 'orderField' => 'joined', + 'orderType' => $orderType, + 'orderCast' => 'int', + 'search' => $search, 'filters' => [ '$collection='.Database::SYSTEM_COLLECTION_MEMBERSHIPS, 'teamId='.$teamId, @@ -408,15 +425,8 @@ $utopia->get('/v1/teams/:teamId/memberships') ])); } - usort($users, function ($a, $b) { - if ($a['joined'] === 0 || $b['joined'] === 0) { - return $b['joined'] - $a['joined']; - } + $response->json(['sum' => $projectDB->getSum(), 'memberships' => $users]); - return $a['joined'] - $b['joined']; - }); - - $response->json($users); } ); @@ -583,9 +593,11 @@ $utopia->delete('/v1/teams/:teamId/memberships/:inviteId') throw new Exception('Failed to remove membership from DB', 500); } - $team = $projectDB->updateDocument(array_merge($team->getArrayCopy(), [ - 'sum' => $team->getAttribute('sum', 0) - 1, - ])); + if ($membership->getAttribute('confirm')) { // Count only confirmed members + $team = $projectDB->updateDocument(array_merge($team->getArrayCopy(), [ + 'sum' => $team->getAttribute('sum', 0) - 1, + ])); + } if (false === $team) { throw new Exception('Failed saving team to DB', 500); diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 17d78de7cb..3eee6f5b02 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -31,7 +31,7 @@ $utopia->post('/v1/users') ->label('sdk.method', 'create') ->label('sdk.description', '/docs/references/users/create-user.md') ->param('email', '', function () { return new Email(); }, 'User email.') - ->param('password', '', function () { return new Password(); }, 'User password.') + ->param('password', '', function () { return new Password(); }, 'User password. Must be between 6 to 32 chars.') ->param('name', '', function () { return new Text(100); }, 'User name.', true) ->action( function ($email, $password, $name) use ($response, $projectDB) { diff --git a/app/controllers/mock.php b/app/controllers/mock.php index 0a75d85d73..1600fa857e 100644 --- a/app/controllers/mock.php +++ b/app/controllers/mock.php @@ -7,7 +7,7 @@ use Utopia\Validator\Text; use Utopia\Validator\ArrayList; use Utopia\Response; use Utopia\Validator\Host; -use Appwrite\Storage\Validators\File; +use Appwrite\Storage\Validator\File; $result = []; diff --git a/app/controllers/shared/web.php b/app/controllers/shared/web.php index 9f148817a2..42afb283e6 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 c7ec613553..e8d8599ba9 100644 --- a/app/controllers/web/console.php +++ b/app/controllers/web/console.php @@ -137,7 +137,7 @@ $utopia->get('/console/webhooks') $page ->setParam('events', Config::getParam('events', [])) ; - + $layout ->setParam('title', APP_NAME.' - Webhooks') ->setParam('body', $page); @@ -187,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(); @@ -201,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') @@ -281,6 +289,18 @@ $utopia->get('/console/users/user') ->setParam('body', $page); }); +$utopia->get('/console/users/teams/team') + ->desc('Platform console project team') + ->label('permission', 'public') + ->label('scope', 'console') + ->action(function () use ($layout) { + $page = new View(__DIR__.'/../../views/console/users/team.phtml'); + + $layout + ->setParam('title', APP_NAME.' - Team') + ->setParam('body', $page); + }); + $utopia->get('/console/functions') ->desc('Platform console project functions') ->label('permission', 'public') diff --git a/app/controllers/web/home.php b/app/controllers/web/home.php index f3e4fd72c8..093faf3eb7 100644 --- a/app/controllers/web/home.php +++ b/app/controllers/web/home.php @@ -417,6 +417,7 @@ $utopia->get('/open-api-2.json') '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), + 'rate-key' => $route->getLabel('abuse-key', 'url:{url},ip:{ip}'), 'scope' => $route->getLabel('scope', ''), 'platforms' => $platformList, ]; @@ -474,7 +475,7 @@ $utopia->get('/open-api-2.json') $node['x-example'] = '{}'; //$node['format'] = 'json'; break; - case 'Appwrite\Storage\Validators\File': + case 'Appwrite\Storage\Validator\File': $consumes = ['multipart/form-data']; $node['type'] = 'file'; break; diff --git a/app/init.php b/app/init.php index b597aff173..62ea435166 100644 --- a/app/init.php +++ b/app/init.php @@ -34,7 +34,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.6.1'; +const APP_VERSION_STABLE = '0.6.2'; const APP_STORAGE_UPLOADS = '/storage/uploads'; const APP_STORAGE_CACHE = '/storage/cache'; const APP_STORAGE_CERTIFICATES = '/storage/certificates'; @@ -68,6 +68,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')); @@ -78,10 +79,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); /* @@ -295,7 +297,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/client-flutter/CHANGELOG.md b/app/sdks/client-flutter/CHANGELOG.md index 0bb441e953..37f6a30a69 100644 --- a/app/sdks/client-flutter/CHANGELOG.md +++ b/app/sdks/client-flutter/CHANGELOG.md @@ -1,3 +1,8 @@ +## 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 diff --git a/app/sdks/client-flutter/README.md b/app/sdks/client-flutter/README.md index 8c17a5b4a4..b0c261c115 100644 --- a/app/sdks/client-flutter/README.md +++ b/app/sdks/client-flutter/README.md @@ -2,9 +2,9 @@ [![pub package](https://img.shields.io/pub/v/appwrite.svg)](https://pub.dartlang.org/packages/appwrite) ![License](https://img.shields.io/github/license/appwrite/sdk-for-flutter.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.6.0-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.6.0. 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 Flutter SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. @@ -20,7 +20,7 @@ Add this to your package's `pubspec.yaml` file: ```yml dependencies: - appwrite: ^0.2.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 index 2745fc48bd..c617c34d4d 100644 --- a/app/sdks/client-flutter/docs/examples/account/create-o-auth2session.md +++ b/app/sdks/client-flutter/docs/examples/account/create-o-auth2session.md @@ -1,20 +1,22 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Account account = Account(client); +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = account.createOAuth2Session( + Future result = account.createOAuth2Session( provider: 'bitbucket', -); + ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index f381743e10..50db45b15d 100644 --- a/app/sdks/client-flutter/docs/examples/account/create-recovery.md +++ b/app/sdks/client-flutter/docs/examples/account/create-recovery.md @@ -1,21 +1,23 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Account account = Account(client); +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = account.createRecovery( + 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 + 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 index 65584ae62a..ef824b4eca 100644 --- a/app/sdks/client-flutter/docs/examples/account/create-session.md +++ b/app/sdks/client-flutter/docs/examples/account/create-session.md @@ -1,21 +1,23 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Account account = Account(client); +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = account.createSession( + 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 + 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 index 735c53f4dd..6b9b1ace40 100644 --- a/app/sdks/client-flutter/docs/examples/account/create-verification.md +++ b/app/sdks/client-flutter/docs/examples/account/create-verification.md @@ -1,20 +1,22 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Account account = Account(client); +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = account.createVerification( + Future result = account.createVerification( url: 'https://example.com', -); + ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index 596c8e8fcf..384258ae68 100644 --- a/app/sdks/client-flutter/docs/examples/account/create.md +++ b/app/sdks/client-flutter/docs/examples/account/create.md @@ -1,21 +1,23 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Account account = Account(client); +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = account.create( + 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 + 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 index a1c4fe58c0..80a3f505d0 100644 --- a/app/sdks/client-flutter/docs/examples/account/delete-session.md +++ b/app/sdks/client-flutter/docs/examples/account/delete-session.md @@ -1,20 +1,22 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Account account = Account(client); +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = account.deleteSession( + Future result = account.deleteSession( sessionId: '[SESSION_ID]', -); + ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index e0e0f9d6ea..5e947fabc2 100644 --- a/app/sdks/client-flutter/docs/examples/account/delete-sessions.md +++ b/app/sdks/client-flutter/docs/examples/account/delete-sessions.md @@ -1,18 +1,20 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Account account = Account(client); +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = account.deleteSessions(); + Future result = account.deleteSessions( ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index 6566687b96..2853a1f437 100644 --- a/app/sdks/client-flutter/docs/examples/account/delete.md +++ b/app/sdks/client-flutter/docs/examples/account/delete.md @@ -1,18 +1,20 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Account account = Account(client); +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = account.delete(); + Future result = account.delete( ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index 00d0d95eee..8f52f8220b 100644 --- a/app/sdks/client-flutter/docs/examples/account/get-logs.md +++ b/app/sdks/client-flutter/docs/examples/account/get-logs.md @@ -1,18 +1,20 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Account account = Account(client); +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = account.getLogs(); + Future result = account.getLogs( ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index ac9af996e8..01d57a5499 100644 --- a/app/sdks/client-flutter/docs/examples/account/get-prefs.md +++ b/app/sdks/client-flutter/docs/examples/account/get-prefs.md @@ -1,18 +1,20 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Account account = Account(client); +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = account.getPrefs(); + Future result = account.getPrefs( ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index 136b349bbc..e921bda59b 100644 --- a/app/sdks/client-flutter/docs/examples/account/get-sessions.md +++ b/app/sdks/client-flutter/docs/examples/account/get-sessions.md @@ -1,18 +1,20 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Account account = Account(client); +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = account.getSessions(); + Future result = account.getSessions( ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index 7a3fab6ae3..35241b5607 100644 --- a/app/sdks/client-flutter/docs/examples/account/get.md +++ b/app/sdks/client-flutter/docs/examples/account/get.md @@ -1,18 +1,20 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Account account = Account(client); +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = account.get(); + Future result = account.get( ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index 0e3783719b..4a1a002db4 100644 --- a/app/sdks/client-flutter/docs/examples/account/update-email.md +++ b/app/sdks/client-flutter/docs/examples/account/update-email.md @@ -1,21 +1,23 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Account account = Account(client); +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = account.updateEmail( + 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 + 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 index f36e747d80..fa432bb34a 100644 --- a/app/sdks/client-flutter/docs/examples/account/update-name.md +++ b/app/sdks/client-flutter/docs/examples/account/update-name.md @@ -1,20 +1,22 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Account account = Account(client); +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = account.updateName( + Future result = account.updateName( name: '[NAME]', -); + ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index dbc873634f..9bd8ad9b77 100644 --- a/app/sdks/client-flutter/docs/examples/account/update-password.md +++ b/app/sdks/client-flutter/docs/examples/account/update-password.md @@ -1,21 +1,23 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Account account = Account(client); +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = account.updatePassword( + Future result = account.updatePassword( password: 'password', oldPassword: 'password', -); + ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index 6a687b63f4..443252f89a 100644 --- a/app/sdks/client-flutter/docs/examples/account/update-prefs.md +++ b/app/sdks/client-flutter/docs/examples/account/update-prefs.md @@ -1,20 +1,22 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Account account = Account(client); +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = account.updatePrefs( + Future result = account.updatePrefs( prefs: {}, -); + ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index 07c892deb6..5140235d49 100644 --- a/app/sdks/client-flutter/docs/examples/account/update-recovery.md +++ b/app/sdks/client-flutter/docs/examples/account/update-recovery.md @@ -1,23 +1,25 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Account account = Account(client); +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = account.updateRecovery( + 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 + 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 index 7b080556b2..b795cde92d 100644 --- a/app/sdks/client-flutter/docs/examples/account/update-verification.md +++ b/app/sdks/client-flutter/docs/examples/account/update-verification.md @@ -1,21 +1,23 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Account account = Account(client); +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = account.updateVerification( + Future result = account.updateVerification( userId: '[USER_ID]', secret: '[SECRET]', -); + ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index 4e057dd753..464767c4c0 100644 --- a/app/sdks/client-flutter/docs/examples/avatars/get-browser.md +++ b/app/sdks/client-flutter/docs/examples/avatars/get-browser.md @@ -1,20 +1,17 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Avatars avatars = Avatars(client); +void main() { // Init SDK + Client client = Client(); + Avatars avatars = Avatars(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = avatars.getBrowser( + String result = avatars.getBrowser( code: 'aa', -); + ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index 76d8613c57..482c642402 100644 --- a/app/sdks/client-flutter/docs/examples/avatars/get-credit-card.md +++ b/app/sdks/client-flutter/docs/examples/avatars/get-credit-card.md @@ -1,15 +1,17 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Avatars avatars = Avatars(client); +void main() { // Init SDK + Client client = Client(); + Avatars avatars = Avatars(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -String result = avatars.getCreditCard( + String result = avatars.getCreditCard( code: 'amex', -); + ); -print(result); // Resource URL string + 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 index 00ea1e9c68..60397b0af2 100644 --- a/app/sdks/client-flutter/docs/examples/avatars/get-favicon.md +++ b/app/sdks/client-flutter/docs/examples/avatars/get-favicon.md @@ -1,15 +1,17 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Avatars avatars = Avatars(client); +void main() { // Init SDK + Client client = Client(); + Avatars avatars = Avatars(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -String result = avatars.getFavicon( + String result = avatars.getFavicon( url: 'https://example.com', -); + ); -print(result); // Resource URL string + 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 index 83d0ed3fb8..a9f7a711d9 100644 --- a/app/sdks/client-flutter/docs/examples/avatars/get-flag.md +++ b/app/sdks/client-flutter/docs/examples/avatars/get-flag.md @@ -1,15 +1,17 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Avatars avatars = Avatars(client); +void main() { // Init SDK + Client client = Client(); + Avatars avatars = Avatars(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -String result = avatars.getFlag( + String result = avatars.getFlag( code: 'af', -); + ); -print(result); // Resource URL string + 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 index 1b0542df8b..7cead1cb2f 100644 --- a/app/sdks/client-flutter/docs/examples/avatars/get-image.md +++ b/app/sdks/client-flutter/docs/examples/avatars/get-image.md @@ -1,15 +1,17 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Avatars avatars = Avatars(client); +void main() { // Init SDK + Client client = Client(); + Avatars avatars = Avatars(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -String result = avatars.getImage( + String result = avatars.getImage( url: 'https://example.com', -); + ); -print(result); // Resource URL string + 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 index 825bf00de5..a5bcfd2c05 100644 --- a/app/sdks/client-flutter/docs/examples/avatars/get-q-r.md +++ b/app/sdks/client-flutter/docs/examples/avatars/get-q-r.md @@ -1,15 +1,17 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Avatars avatars = Avatars(client); +void main() { // Init SDK + Client client = Client(); + Avatars avatars = Avatars(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -String result = avatars.getQR( + String result = avatars.getQR( text: '[TEXT]', -); + ); -print(result); // Resource URL string + 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 index 9eea7b677c..b7d540bc2d 100644 --- a/app/sdks/client-flutter/docs/examples/database/create-document.md +++ b/app/sdks/client-flutter/docs/examples/database/create-document.md @@ -1,23 +1,25 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Database database = Database(client); +void main() { // Init SDK + Client client = Client(); + Database database = Database(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = database.createDocument( + 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 + 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 index 5e41ff0a41..40c1cbdfe2 100644 --- a/app/sdks/client-flutter/docs/examples/database/delete-document.md +++ b/app/sdks/client-flutter/docs/examples/database/delete-document.md @@ -1,21 +1,23 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Database database = Database(client); +void main() { // Init SDK + Client client = Client(); + Database database = Database(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = database.deleteDocument( + 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 + 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 index e410508fb1..0c98142315 100644 --- a/app/sdks/client-flutter/docs/examples/database/get-document.md +++ b/app/sdks/client-flutter/docs/examples/database/get-document.md @@ -1,21 +1,23 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Database database = Database(client); +void main() { // Init SDK + Client client = Client(); + Database database = Database(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = database.getDocument( + 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 + 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 index b4270d909b..0685e7f1aa 100644 --- a/app/sdks/client-flutter/docs/examples/database/list-documents.md +++ b/app/sdks/client-flutter/docs/examples/database/list-documents.md @@ -1,20 +1,22 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Database database = Database(client); +void main() { // Init SDK + Client client = Client(); + Database database = Database(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = database.listDocuments( + Future result = database.listDocuments( collectionId: '[COLLECTION_ID]', -); + ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index e9c584e066..2f37cd767a 100644 --- a/app/sdks/client-flutter/docs/examples/database/update-document.md +++ b/app/sdks/client-flutter/docs/examples/database/update-document.md @@ -1,24 +1,26 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Database database = Database(client); +void main() { // Init SDK + Client client = Client(); + Database database = Database(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = database.updateDocument( + 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 + 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 index 743635f053..2a6a6413ba 100644 --- a/app/sdks/client-flutter/docs/examples/locale/get-continents.md +++ b/app/sdks/client-flutter/docs/examples/locale/get-continents.md @@ -1,18 +1,20 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Locale locale = Locale(client); +void main() { // Init SDK + Client client = Client(); + Locale locale = Locale(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = locale.getContinents(); + Future result = locale.getContinents( ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index c46b95ec07..1934fc6709 100644 --- 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 @@ -1,18 +1,20 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Locale locale = Locale(client); +void main() { // Init SDK + Client client = Client(); + Locale locale = Locale(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = locale.getCountriesEU(); + Future result = locale.getCountriesEU( ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index a406f184f9..f6b1f58749 100644 --- a/app/sdks/client-flutter/docs/examples/locale/get-countries-phones.md +++ b/app/sdks/client-flutter/docs/examples/locale/get-countries-phones.md @@ -1,18 +1,20 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Locale locale = Locale(client); +void main() { // Init SDK + Client client = Client(); + Locale locale = Locale(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = locale.getCountriesPhones(); + Future result = locale.getCountriesPhones( ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index c83c02b60c..104584968f 100644 --- a/app/sdks/client-flutter/docs/examples/locale/get-countries.md +++ b/app/sdks/client-flutter/docs/examples/locale/get-countries.md @@ -1,18 +1,20 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Locale locale = Locale(client); +void main() { // Init SDK + Client client = Client(); + Locale locale = Locale(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = locale.getCountries(); + Future result = locale.getCountries( ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index b34f4c7162..8dc01fc68e 100644 --- a/app/sdks/client-flutter/docs/examples/locale/get-currencies.md +++ b/app/sdks/client-flutter/docs/examples/locale/get-currencies.md @@ -1,18 +1,20 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Locale locale = Locale(client); +void main() { // Init SDK + Client client = Client(); + Locale locale = Locale(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = locale.getCurrencies(); + Future result = locale.getCurrencies( ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index fed81b836e..189fceb7d1 100644 --- a/app/sdks/client-flutter/docs/examples/locale/get.md +++ b/app/sdks/client-flutter/docs/examples/locale/get.md @@ -1,18 +1,20 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Locale locale = Locale(client); +void main() { // Init SDK + Client client = Client(); + Locale locale = Locale(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = locale.get(); + Future result = locale.get( ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index b7ee0857ae..9f61be12f4 100644 --- a/app/sdks/client-flutter/docs/examples/storage/create-file.md +++ b/app/sdks/client-flutter/docs/examples/storage/create-file.md @@ -1,23 +1,25 @@ import 'dart:io'; import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Storage storage = Storage(client); +void main() { // Init SDK + Client client = Client(); + Storage storage = Storage(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = storage.createFile( + 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 + 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 index 9a2ed98b96..271ed7b2dd 100644 --- a/app/sdks/client-flutter/docs/examples/storage/delete-file.md +++ b/app/sdks/client-flutter/docs/examples/storage/delete-file.md @@ -1,20 +1,22 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Storage storage = Storage(client); +void main() { // Init SDK + Client client = Client(); + Storage storage = Storage(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = storage.deleteFile( + Future result = storage.deleteFile( fileId: '[FILE_ID]', -); + ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index e00cdc9022..be3385a61b 100644 --- a/app/sdks/client-flutter/docs/examples/storage/get-file-download.md +++ b/app/sdks/client-flutter/docs/examples/storage/get-file-download.md @@ -1,15 +1,17 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Storage storage = Storage(client); +void main() { // Init SDK + Client client = Client(); + Storage storage = Storage(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -String result = storage.getFileDownload( + String result = storage.getFileDownload( fileId: '[FILE_ID]', -); + ); -print(result); // Resource URL string + 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 index 5297ab8342..8bd1a47457 100644 --- a/app/sdks/client-flutter/docs/examples/storage/get-file-preview.md +++ b/app/sdks/client-flutter/docs/examples/storage/get-file-preview.md @@ -1,15 +1,17 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Storage storage = Storage(client); +void main() { // Init SDK + Client client = Client(); + Storage storage = Storage(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -String result = storage.getFilePreview( + String result = storage.getFilePreview( fileId: '[FILE_ID]', -); + ); -print(result); // Resource URL string + 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 index 13b1de4822..5803fd409f 100644 --- a/app/sdks/client-flutter/docs/examples/storage/get-file-view.md +++ b/app/sdks/client-flutter/docs/examples/storage/get-file-view.md @@ -1,15 +1,17 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Storage storage = Storage(client); +void main() { // Init SDK + Client client = Client(); + Storage storage = Storage(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -String result = storage.getFileView( + String result = storage.getFileView( fileId: '[FILE_ID]', -); + ); -print(result); // Resource URL string + 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 index bdeaf55130..feca667fa9 100644 --- a/app/sdks/client-flutter/docs/examples/storage/get-file.md +++ b/app/sdks/client-flutter/docs/examples/storage/get-file.md @@ -1,20 +1,22 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Storage storage = Storage(client); +void main() { // Init SDK + Client client = Client(); + Storage storage = Storage(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = storage.getFile( + Future result = storage.getFile( fileId: '[FILE_ID]', -); + ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index 9ef25d8a01..1963ec694d 100644 --- a/app/sdks/client-flutter/docs/examples/storage/list-files.md +++ b/app/sdks/client-flutter/docs/examples/storage/list-files.md @@ -1,19 +1,21 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Storage storage = Storage(client); +void main() { // Init SDK + Client client = Client(); + Storage storage = Storage(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = storage.listFiles( -); + Future result = storage.listFiles( + ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index 44955c224f..a5ecbfe987 100644 --- a/app/sdks/client-flutter/docs/examples/storage/update-file.md +++ b/app/sdks/client-flutter/docs/examples/storage/update-file.md @@ -1,22 +1,24 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Storage storage = Storage(client); +void main() { // Init SDK + Client client = Client(); + Storage storage = Storage(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = storage.updateFile( + Future result = storage.updateFile( fileId: '[FILE_ID]', read: [], write: [], -); + ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index b06200f66d..e5e82de7b4 100644 --- a/app/sdks/client-flutter/docs/examples/teams/create-membership.md +++ b/app/sdks/client-flutter/docs/examples/teams/create-membership.md @@ -1,23 +1,25 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Teams teams = Teams(client); +void main() { // Init SDK + Client client = Client(); + Teams teams = Teams(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = teams.createMembership( + 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 + 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 index 71bb6219a2..d11958ae6d 100644 --- a/app/sdks/client-flutter/docs/examples/teams/create.md +++ b/app/sdks/client-flutter/docs/examples/teams/create.md @@ -1,20 +1,22 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Teams teams = Teams(client); +void main() { // Init SDK + Client client = Client(); + Teams teams = Teams(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = teams.create( + Future result = teams.create( name: '[NAME]', -); + ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index 4baddf5f9d..3f57b840fe 100644 --- a/app/sdks/client-flutter/docs/examples/teams/delete-membership.md +++ b/app/sdks/client-flutter/docs/examples/teams/delete-membership.md @@ -1,21 +1,23 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Teams teams = Teams(client); +void main() { // Init SDK + Client client = Client(); + Teams teams = Teams(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = teams.deleteMembership( + 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 + 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 index c88521f2a2..9fb488afec 100644 --- a/app/sdks/client-flutter/docs/examples/teams/delete.md +++ b/app/sdks/client-flutter/docs/examples/teams/delete.md @@ -1,20 +1,22 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Teams teams = Teams(client); +void main() { // Init SDK + Client client = Client(); + Teams teams = Teams(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = teams.delete( + Future result = teams.delete( teamId: '[TEAM_ID]', -); + ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index 27e0971de7..4edadfa2b4 100644 --- a/app/sdks/client-flutter/docs/examples/teams/get-memberships.md +++ b/app/sdks/client-flutter/docs/examples/teams/get-memberships.md @@ -1,20 +1,22 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Teams teams = Teams(client); +void main() { // Init SDK + Client client = Client(); + Teams teams = Teams(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = teams.getMemberships( + Future result = teams.getMemberships( teamId: '[TEAM_ID]', -); + ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index ef9c01002c..083565f7a6 100644 --- a/app/sdks/client-flutter/docs/examples/teams/get.md +++ b/app/sdks/client-flutter/docs/examples/teams/get.md @@ -1,20 +1,22 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Teams teams = Teams(client); +void main() { // Init SDK + Client client = Client(); + Teams teams = Teams(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = teams.get( + Future result = teams.get( teamId: '[TEAM_ID]', -); + ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index a9e4313b83..665020e928 100644 --- a/app/sdks/client-flutter/docs/examples/teams/list.md +++ b/app/sdks/client-flutter/docs/examples/teams/list.md @@ -1,19 +1,21 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Teams teams = Teams(client); +void main() { // Init SDK + Client client = Client(); + Teams teams = Teams(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = teams.list( -); + Future result = teams.list( + ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + 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 index a33ecd4c18..616f64e148 100644 --- a/app/sdks/client-flutter/docs/examples/teams/update-membership-status.md +++ b/app/sdks/client-flutter/docs/examples/teams/update-membership-status.md @@ -1,23 +1,25 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Teams teams = Teams(client); +void main() { // Init SDK + Client client = Client(); + Teams teams = Teams(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = teams.updateMembershipStatus( + 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 + 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 index b1cc7e2391..915fb57d38 100644 --- a/app/sdks/client-flutter/docs/examples/teams/update.md +++ b/app/sdks/client-flutter/docs/examples/teams/update.md @@ -1,21 +1,23 @@ import 'package:appwrite/appwrite.dart'; -// Init SDK -Client client = Client(); -Teams teams = Teams(client); +void main() { // Init SDK + Client client = Client(); + Teams teams = Teams(client); -client + client + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID -; + ; -Future result = teams.update( + Future result = teams.update( teamId: '[TEAM_ID]', name: '[NAME]', -); + ); -result - .then((response) { - print(response); - }).catchError((error) { - print(error); - }); \ No newline at end of file + result + .then((response) { + print(response); + }).catchError((error) { + print(error.response); + }); +} \ No newline at end of file diff --git a/app/sdks/client-flutter/lib/client.dart b/app/sdks/client-flutter/lib/client.dart index 3798a0852e..d9e8eedf19 100644 --- a/app/sdks/client-flutter/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.2.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/client-flutter/lib/services/account.dart b/app/sdks/client-flutter/lib/services/account.dart index b191791ab3..8cc237d104 100644 --- a/app/sdks/client-flutter/lib/services/account.dart +++ b/app/sdks/client-flutter/lib/services/account.dart @@ -325,9 +325,10 @@ class Account extends Service { return FlutterWebAuth.authenticate( url: url.toString(), callbackUrlScheme: "appwrite-callback-" + client.config['project'] - ).then((value) { + ).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/client-flutter/lib/services/avatars.dart b/app/sdks/client-flutter/lib/services/avatars.dart index 2ce6ed2633..fc9c403d90 100644 --- a/app/sdks/client-flutter/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 @@ -51,14 +56,14 @@ class Avatars 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 Favicon @@ -75,14 +80,14 @@ class Avatars 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 Country Flag @@ -102,14 +107,14 @@ class Avatars 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 Image from URL @@ -130,14 +135,14 @@ class Avatars 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 QR Code @@ -157,13 +162,13 @@ class Avatars 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/client-flutter/lib/services/storage.dart b/app/sdks/client-flutter/lib/services/storage.dart index 47497c7699..696c15ee3a 100644 --- a/app/sdks/client-flutter/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/client-flutter/pubspec.yaml b/app/sdks/client-flutter/pubspec.yaml index 27d0115d09..2954cdb9e9 100644 --- a/app/sdks/client-flutter/pubspec.yaml +++ b/app/sdks/client-flutter/pubspec.yaml @@ -1,5 +1,5 @@ name: appwrite -version: 0.2.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-flutter diff --git a/app/sdks/client-web/README.md b/app/sdks/client-web/README.md index 780fb2ef78..093783ab41 100644 --- a/app/sdks/client-web/README.md +++ b/app/sdks/client-web/README.md @@ -1,7 +1,7 @@ # 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.6.0-blue.svg?v=1) +![Version](https://img.shields.io/badge/api%20version-0.6.2-blue.svg?v=1) Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Web SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. diff --git a/app/sdks/client-web/docs/examples/account/create-o-auth2session.md b/app/sdks/client-web/docs/examples/account/create-o-auth2session.md index 611df2173d..0c7430741c 100644 --- a/app/sdks/client-web/docs/examples/account/create-o-auth2session.md +++ b/app/sdks/client-web/docs/examples/account/create-o-auth2session.md @@ -1,10 +1,11 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.account.createOAuth2Session('bitbucket'); +let promise = sdk.account.createOAuth2Session('amazon'); promise.then(function (response) { console.log(response); // Success diff --git a/app/sdks/client-web/docs/examples/account/create-recovery.md b/app/sdks/client-web/docs/examples/account/create-recovery.md index 0647f3e468..72130f4de4 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/account/create-session.md b/app/sdks/client-web/docs/examples/account/create-session.md index 1a02c4c131..4a7682c13d 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/account/create-verification.md b/app/sdks/client-web/docs/examples/account/create-verification.md index 69488635f4..7903384a9f 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/account/create.md b/app/sdks/client-web/docs/examples/account/create.md index fb6e235aa3..c9ce798b6a 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/account/delete-session.md b/app/sdks/client-web/docs/examples/account/delete-session.md index 598c9269ec..581e5d132d 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/account/delete-sessions.md b/app/sdks/client-web/docs/examples/account/delete-sessions.md index 7c988afa33..d037673eb3 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/account/delete.md b/app/sdks/client-web/docs/examples/account/delete.md index 2679c444b0..d952d77d7a 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/account/get-logs.md b/app/sdks/client-web/docs/examples/account/get-logs.md index b1234e1929..c53e0446e9 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/account/get-prefs.md b/app/sdks/client-web/docs/examples/account/get-prefs.md index 7e9a1df84f..75835e37fb 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/account/get-sessions.md b/app/sdks/client-web/docs/examples/account/get-sessions.md index 96eefa6422..b4434de336 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/account/get.md b/app/sdks/client-web/docs/examples/account/get.md index 0a0c7a2ccc..f0184a8513 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/account/update-email.md b/app/sdks/client-web/docs/examples/account/update-email.md index 4beeeb8cf8..f48fed78bc 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/account/update-name.md b/app/sdks/client-web/docs/examples/account/update-name.md index 0464d29405..e03e72c4b2 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/account/update-password.md b/app/sdks/client-web/docs/examples/account/update-password.md index 14180f4b5b..22539f3f64 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/account/update-prefs.md b/app/sdks/client-web/docs/examples/account/update-prefs.md index 0e7d005134..b2d4ff175e 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/account/update-recovery.md b/app/sdks/client-web/docs/examples/account/update-recovery.md index 9c16f06cb5..33cf1b63c9 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/account/update-verification.md b/app/sdks/client-web/docs/examples/account/update-verification.md index f01eeb26db..a80e125e30 100644 --- a/app/sdks/client-web/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 index 0e76e4050c..86d0df4a23 100644 --- a/app/sdks/client-web/docs/examples/avatars/get-browser.md +++ b/app/sdks/client-web/docs/examples/avatars/get-browser.md @@ -1,13 +1,10 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID ; -let promise = sdk.avatars.getBrowser('aa'); +let result = sdk.avatars.getBrowser('aa'); -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file +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 index 7b1f980ebc..83a1381adf 100644 --- a/app/sdks/client-web/docs/examples/avatars/get-credit-card.md +++ b/app/sdks/client-web/docs/examples/avatars/get-credit-card.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-favicon.md b/app/sdks/client-web/docs/examples/avatars/get-favicon.md index ce04d0bab7..c0ff93307a 100644 --- a/app/sdks/client-web/docs/examples/avatars/get-favicon.md +++ b/app/sdks/client-web/docs/examples/avatars/get-favicon.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-flag.md b/app/sdks/client-web/docs/examples/avatars/get-flag.md index 71c3db8765..762aeb348e 100644 --- a/app/sdks/client-web/docs/examples/avatars/get-flag.md +++ b/app/sdks/client-web/docs/examples/avatars/get-flag.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-image.md b/app/sdks/client-web/docs/examples/avatars/get-image.md index 2c2b80a8e4..58f0eb8077 100644 --- a/app/sdks/client-web/docs/examples/avatars/get-image.md +++ b/app/sdks/client-web/docs/examples/avatars/get-image.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-q-r.md b/app/sdks/client-web/docs/examples/avatars/get-q-r.md index cbd0dc8c45..fb17032949 100644 --- a/app/sdks/client-web/docs/examples/avatars/get-q-r.md +++ b/app/sdks/client-web/docs/examples/avatars/get-q-r.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/database/create-document.md b/app/sdks/client-web/docs/examples/database/create-document.md index 200a752a07..e04f73f73e 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/database/delete-document.md b/app/sdks/client-web/docs/examples/database/delete-document.md index d40c106ae2..79799b6907 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/database/get-document.md b/app/sdks/client-web/docs/examples/database/get-document.md index a554fe21b9..b9605dccc6 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/database/list-documents.md b/app/sdks/client-web/docs/examples/database/list-documents.md index aab086d8be..14f8a423a1 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/database/update-document.md b/app/sdks/client-web/docs/examples/database/update-document.md index b299576b93..9104b77a71 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/locale/get-continents.md b/app/sdks/client-web/docs/examples/locale/get-continents.md index 54bfeee869..1dfdf8013b 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/locale/get-countries-e-u.md b/app/sdks/client-web/docs/examples/locale/get-countries-e-u.md index 19444cbeb2..6b3f210a1e 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/locale/get-countries-phones.md b/app/sdks/client-web/docs/examples/locale/get-countries-phones.md index b32ddea06e..f35e2152e4 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/locale/get-countries.md b/app/sdks/client-web/docs/examples/locale/get-countries.md index 7ea903cf74..53b96375a1 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/locale/get-currencies.md b/app/sdks/client-web/docs/examples/locale/get-currencies.md index 56b5ba8a7d..57db66401f 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/locale/get.md b/app/sdks/client-web/docs/examples/locale/get.md index 1358ced165..469a046dbc 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/storage/create-file.md b/app/sdks/client-web/docs/examples/storage/create-file.md index 0cfd25a3f0..b23c47027a 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/storage/delete-file.md b/app/sdks/client-web/docs/examples/storage/delete-file.md index 54c3c217c7..c38ab4ba9c 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/storage/get-file-download.md b/app/sdks/client-web/docs/examples/storage/get-file-download.md index 817388b206..ae3a643529 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/storage/get-file-preview.md b/app/sdks/client-web/docs/examples/storage/get-file-preview.md index 81fd86c4fc..30461e4d9a 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/storage/get-file-view.md b/app/sdks/client-web/docs/examples/storage/get-file-view.md index c9bd9c3c69..341dd502de 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/storage/get-file.md b/app/sdks/client-web/docs/examples/storage/get-file.md index abe4f6993f..a1f94c08a6 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/storage/list-files.md b/app/sdks/client-web/docs/examples/storage/list-files.md index 75e4b1c480..c489a0b46d 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/storage/update-file.md b/app/sdks/client-web/docs/examples/storage/update-file.md index 32a5afd8aa..2a2f579b3b 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/teams/create-membership.md b/app/sdks/client-web/docs/examples/teams/create-membership.md index b2baa405a1..78b2d7fa77 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/teams/create.md b/app/sdks/client-web/docs/examples/teams/create.md index 2e7cf60c38..43205ba888 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/teams/delete-membership.md b/app/sdks/client-web/docs/examples/teams/delete-membership.md index a17ad4f009..1b85ef08da 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/teams/delete.md b/app/sdks/client-web/docs/examples/teams/delete.md index 85415016c7..4665ad5773 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/teams/get-memberships.md b/app/sdks/client-web/docs/examples/teams/get-memberships.md index 1ab6bf3ffe..6235ce33f4 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/teams/get.md b/app/sdks/client-web/docs/examples/teams/get.md index 3e0c4d7fac..f4b0f040b1 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/teams/list.md b/app/sdks/client-web/docs/examples/teams/list.md index d74fa47e8c..c4229e2400 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/teams/update-membership-status.md b/app/sdks/client-web/docs/examples/teams/update-membership-status.md index 25f858ebf8..e8b3de0a0b 100644 --- a/app/sdks/client-web/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/client-web/docs/examples/teams/update.md b/app/sdks/client-web/docs/examples/teams/update.md index dedfb63557..bbab80937d 100644 --- a/app/sdks/client-web/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/client-web/src/sdk.js b/app/sdks/client-web/src/sdk.js index 38e04125e3..a423ae9cf9 100644 --- a/app/sdks/client-web/src/sdk.js +++ b/app/sdks/client-web/src/sdk.js @@ -276,10 +276,10 @@ * * Use this endpoint to allow a new user to register a new account in your * project. After the user registration completes successfully, you can use - * the [/account/verfication](/docs/account#createVerification) route to start - * verifying the user email address. To allow your new user to login to his - * new account, you need to create a new [account - * session](/docs/account#createSession). + * the [/account/verfication](/docs/client/account#createVerification) route + * to start verifying the user email address. To allow your new user to login + * to his new account, you need to create a new [account + * session](/docs/client/account#createSession). * * @param {string} email * @param {string} password @@ -522,7 +522,7 @@ * When the user clicks the confirmation link he is redirected back to your * app password reset URL with the secret key and email address values * attached to the URL query string. Use the query string params to submit a - * request to the [PUT /account/recovery](/docs/account#updateRecovery) + * request to the [PUT /account/recovery](/docs/client/account#updateRecovery) * endpoint to complete the process. * * @param {string} email @@ -563,7 +563,7 @@ * Use this endpoint to complete the user account password reset. Both the * **userId** and **secret** arguments will be passed as query parameters to * the redirect URL you have provided when sending your request to the [POST - * /account/recovery](/docs/account#createRecovery) endpoint. + * /account/recovery](/docs/client/account#createRecovery) endpoint. * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) @@ -772,7 +772,7 @@ * should redirect the user back for your app and allow you to complete the * verification process by verifying both the **userId** and **secret** * parameters. Learn more about how to [complete the verification - * process](/docs/account#updateAccountVerification). + * process](/docs/client/account#updateAccountVerification). * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) @@ -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 : ''); }, /** @@ -1167,7 +1168,10 @@ /** * Create Document * - * Create a new Document. + * Create a new Document. Before using this route, you should create a new + * collection resource using either a [server + * integration](/docs/server/database?sdk=nodejs#createCollection) API or + * directly from your database console. * * @param {string} collectionId * @param {object} data @@ -1941,10 +1945,14 @@ * for this list of resources. * * @param {string} teamId + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType * @throws {Error} * @return {Promise} */ - getMemberships: function(teamId) { + getMemberships: function(teamId, search = '', limit = 25, offset = 0, orderType = 'ASC') { if(teamId === undefined) { throw new Error('Missing required parameter: "teamId"'); } @@ -1953,6 +1961,22 @@ let payload = {}; + if(search) { + payload['search'] = search; + } + + if(limit) { + payload['limit'] = limit; + } + + if(offset) { + payload['offset'] = offset; + } + + if(orderType) { + payload['orderType'] = orderType; + } + return http .get(path, { 'content-type': 'application/json', @@ -1968,8 +1992,8 @@ * * 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. + * Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the + * user to accept the invitation to the team. * * Please note that in order to avoid a [Redirect * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) diff --git a/app/sdks/client-web/src/sdk.min.js b/app/sdks/client-web/src/sdk.min.js index 069f1fdb92..bef842f31a 100644 --- a/app/sdks/client-web/src/sdk.min.js +++ b/app/sdks/client-web/src/sdk.min.js @@ -59,7 +59,7 @@ 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} @@ -148,8 +148,12 @@ let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payloa if(name===undefined){throw new Error('Missing required parameter: "name"')} let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(name){payload.name=name} return http.put(path,{'content-type':'application/json',},payload)},delete:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} -let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getMemberships:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} -let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createMembership:function(teamId,email,roles,url,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} +let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getMemberships:function(teamId,search='',limit=25,offset=0,orderType='ASC'){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} +let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(search){payload.search=search} +if(limit){payload.limit=limit} +if(offset){payload.offset=offset} +if(orderType){payload.orderType=orderType} +return http.get(path,{'content-type':'application/json',},payload)},createMembership:function(teamId,email,roles,url,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} if(email===undefined){throw new Error('Missing required parameter: "email"')} if(roles===undefined){throw new Error('Missing required parameter: "roles"')} if(url===undefined){throw new Error('Missing required parameter: "url"')} diff --git a/app/sdks/client-web/types/index.d.ts b/app/sdks/client-web/types/index.d.ts index 822de211fe..2715af9f8d 100644 --- a/app/sdks/client-web/types/index.d.ts +++ b/app/sdks/client-web/types/index.d.ts @@ -64,10 +64,10 @@ declare namespace Appwrite { * * Use this endpoint to allow a new user to register a new account in your * project. After the user registration completes successfully, you can use - * the [/account/verfication](/docs/account#createVerification) route to start - * verifying the user email address. To allow your new user to login to his - * new account, you need to create a new [account - * session](/docs/account#createSession). + * the [/account/verfication](/docs/client/account#createVerification) route + * to start verifying the user email address. To allow your new user to login + * to his new account, you need to create a new [account + * session](/docs/client/account#createSession). * * @param {string} email * @param {string} password @@ -170,7 +170,7 @@ declare namespace Appwrite { * When the user clicks the confirmation link he is redirected back to your * app password reset URL with the secret key and email address values * attached to the URL query string. Use the query string params to submit a - * request to the [PUT /account/recovery](/docs/account#updateRecovery) + * request to the [PUT /account/recovery](/docs/client/account#updateRecovery) * endpoint to complete the process. * * @param {string} email @@ -186,7 +186,7 @@ declare namespace Appwrite { * Use this endpoint to complete the user account password reset. Both the * **userId** and **secret** arguments will be passed as query parameters to * the redirect URL you have provided when sending your request to the [POST - * /account/recovery](/docs/account#createRecovery) endpoint. + * /account/recovery](/docs/client/account#createRecovery) endpoint. * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) @@ -276,7 +276,7 @@ declare namespace Appwrite { * should redirect the user back for your app and allow you to complete the * verification process by verifying both the **userId** and **secret** * parameters. Learn more about how to [complete the verification - * process](/docs/account#updateAccountVerification). + * process](/docs/client/account#updateAccountVerification). * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) @@ -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 @@ -431,7 +431,10 @@ declare namespace Appwrite { /** * Create Document * - * Create a new Document. + * Create a new Document. Before using this route, you should create a new + * collection resource using either a [server + * integration](/docs/server/database?sdk=nodejs#createCollection) API or + * directly from your database console. * * @param {string} collectionId * @param {object} data @@ -758,10 +761,14 @@ declare namespace Appwrite { * for this list of resources. * * @param {string} teamId + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType * @throws {Error} * @return {Promise} */ - getMemberships(teamId: string): Promise; + getMemberships(teamId: string, search: string, limit: number, offset: number, orderType: string): Promise; /** * Create Team Membership @@ -772,8 +779,8 @@ declare namespace Appwrite { * * 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. + * Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the + * user to accept the invitation to the team. * * Please note that in order to avoid a [Redirect * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) diff --git a/app/sdks/console-web/README.md b/app/sdks/console-web/README.md index 5c6508f0a0..68b7e8ff9c 100644 --- a/app/sdks/console-web/README.md +++ b/app/sdks/console-web/README.md @@ -1,7 +1,7 @@ # 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.6.0-blue.svg?v=1) +![Version](https://img.shields.io/badge/api%20version-0.6.2-blue.svg?v=1) Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Console SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. diff --git a/app/sdks/console-web/docs/examples/account/create-o-auth2session.md b/app/sdks/console-web/docs/examples/account/create-o-auth2session.md index b66e4360c6..4a3523693f 100644 --- a/app/sdks/console-web/docs/examples/account/create-o-auth2session.md +++ b/app/sdks/console-web/docs/examples/account/create-o-auth2session.md @@ -1,11 +1,12 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = sdk.account.createOAuth2Session('bitbucket'); +let promise = sdk.account.createOAuth2Session('amazon'); promise.then(function (response) { console.log(response); // Success diff --git a/app/sdks/console-web/docs/examples/account/create-recovery.md b/app/sdks/console-web/docs/examples/account/create-recovery.md index 7b636943e3..d69269b351 100644 --- a/app/sdks/console-web/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-web/docs/examples/account/create-session.md b/app/sdks/console-web/docs/examples/account/create-session.md index 1f930eddc5..0734a84aaa 100644 --- a/app/sdks/console-web/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-web/docs/examples/account/create-verification.md b/app/sdks/console-web/docs/examples/account/create-verification.md index d9088638df..1211b5c642 100644 --- a/app/sdks/console-web/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-web/docs/examples/account/create.md b/app/sdks/console-web/docs/examples/account/create.md index ef9b9b7f95..e61b1fbac4 100644 --- a/app/sdks/console-web/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-web/docs/examples/account/delete-session.md b/app/sdks/console-web/docs/examples/account/delete-session.md index 7d813a356c..84505281f0 100644 --- a/app/sdks/console-web/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-web/docs/examples/account/delete-sessions.md b/app/sdks/console-web/docs/examples/account/delete-sessions.md index fef0113dc7..61bec86399 100644 --- a/app/sdks/console-web/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-web/docs/examples/account/delete.md b/app/sdks/console-web/docs/examples/account/delete.md index cc953421a5..dbb8dbf250 100644 --- a/app/sdks/console-web/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-web/docs/examples/account/get-logs.md b/app/sdks/console-web/docs/examples/account/get-logs.md index 9186ca2ab3..12e6656c96 100644 --- a/app/sdks/console-web/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-web/docs/examples/account/get-prefs.md b/app/sdks/console-web/docs/examples/account/get-prefs.md index c80508e3ee..e328baba32 100644 --- a/app/sdks/console-web/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-web/docs/examples/account/get-sessions.md b/app/sdks/console-web/docs/examples/account/get-sessions.md index 1595e7a7ee..cb281dd4db 100644 --- a/app/sdks/console-web/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-web/docs/examples/account/get.md b/app/sdks/console-web/docs/examples/account/get.md index 8e88b195ae..82c96fb9db 100644 --- a/app/sdks/console-web/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-web/docs/examples/account/update-email.md b/app/sdks/console-web/docs/examples/account/update-email.md index c53eb579aa..c2caaf060e 100644 --- a/app/sdks/console-web/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-web/docs/examples/account/update-name.md b/app/sdks/console-web/docs/examples/account/update-name.md index f9a3fdeffd..047eba688b 100644 --- a/app/sdks/console-web/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-web/docs/examples/account/update-password.md b/app/sdks/console-web/docs/examples/account/update-password.md index a0058d972a..d305031fa0 100644 --- a/app/sdks/console-web/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-web/docs/examples/account/update-prefs.md b/app/sdks/console-web/docs/examples/account/update-prefs.md index fa55eea179..8c4e402ae1 100644 --- a/app/sdks/console-web/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-web/docs/examples/account/update-recovery.md b/app/sdks/console-web/docs/examples/account/update-recovery.md index 883df2f9b2..235a4db481 100644 --- a/app/sdks/console-web/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-web/docs/examples/account/update-verification.md b/app/sdks/console-web/docs/examples/account/update-verification.md index d04203a3cb..ef2c384853 100644 --- a/app/sdks/console-web/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 index fd5959f1bb..cd89107b91 100644 --- a/app/sdks/console-web/docs/examples/avatars/get-browser.md +++ b/app/sdks/console-web/docs/examples/avatars/get-browser.md @@ -1,14 +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 promise = sdk.avatars.getBrowser('aa'); +let result = sdk.avatars.getBrowser('aa'); -promise.then(function (response) { - console.log(response); // Success -}, function (error) { - console.log(error); // Failure -}); \ No newline at end of file +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 index 3f701e3791..4906a4127c 100644 --- a/app/sdks/console-web/docs/examples/avatars/get-credit-card.md +++ b/app/sdks/console-web/docs/examples/avatars/get-credit-card.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-favicon.md b/app/sdks/console-web/docs/examples/avatars/get-favicon.md index 037ddb30a0..ec53212364 100644 --- a/app/sdks/console-web/docs/examples/avatars/get-favicon.md +++ b/app/sdks/console-web/docs/examples/avatars/get-favicon.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-flag.md b/app/sdks/console-web/docs/examples/avatars/get-flag.md index 630673ca08..87122bddb3 100644 --- a/app/sdks/console-web/docs/examples/avatars/get-flag.md +++ b/app/sdks/console-web/docs/examples/avatars/get-flag.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-image.md b/app/sdks/console-web/docs/examples/avatars/get-image.md index 31994d6d88..d6789db732 100644 --- a/app/sdks/console-web/docs/examples/avatars/get-image.md +++ b/app/sdks/console-web/docs/examples/avatars/get-image.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-q-r.md b/app/sdks/console-web/docs/examples/avatars/get-q-r.md index 91a31bf7fa..93d3438746 100644 --- a/app/sdks/console-web/docs/examples/avatars/get-q-r.md +++ b/app/sdks/console-web/docs/examples/avatars/get-q-r.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/database/create-collection.md b/app/sdks/console-web/docs/examples/database/create-collection.md index 13bd67171c..a7a4b90197 100644 --- a/app/sdks/console-web/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-web/docs/examples/database/create-document.md b/app/sdks/console-web/docs/examples/database/create-document.md index 41908a3820..64809c6156 100644 --- a/app/sdks/console-web/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-web/docs/examples/database/delete-collection.md b/app/sdks/console-web/docs/examples/database/delete-collection.md index 4a7753685b..bfb0706bf5 100644 --- a/app/sdks/console-web/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-web/docs/examples/database/delete-document.md b/app/sdks/console-web/docs/examples/database/delete-document.md index 246454a0d4..356a71a437 100644 --- a/app/sdks/console-web/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-web/docs/examples/database/get-collection-logs.md b/app/sdks/console-web/docs/examples/database/get-collection-logs.md index 09a05445ed..8934910901 100644 --- a/app/sdks/console-web/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-web/docs/examples/database/get-collection.md b/app/sdks/console-web/docs/examples/database/get-collection.md index c58d3bf21e..d74d4b3225 100644 --- a/app/sdks/console-web/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-web/docs/examples/database/get-document.md b/app/sdks/console-web/docs/examples/database/get-document.md index 7674814399..51638880c5 100644 --- a/app/sdks/console-web/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-web/docs/examples/database/list-collections.md b/app/sdks/console-web/docs/examples/database/list-collections.md index 73a45b621a..8a18249748 100644 --- a/app/sdks/console-web/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-web/docs/examples/database/list-documents.md b/app/sdks/console-web/docs/examples/database/list-documents.md index 10100f59d5..1d895a566a 100644 --- a/app/sdks/console-web/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-web/docs/examples/database/update-collection.md b/app/sdks/console-web/docs/examples/database/update-collection.md index c3d663bb1e..f00a6c6f8c 100644 --- a/app/sdks/console-web/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-web/docs/examples/database/update-document.md b/app/sdks/console-web/docs/examples/database/update-document.md index d4570fe32b..52c172ab6a 100644 --- a/app/sdks/console-web/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 index 37ff9d820d..95b671992b 100644 --- a/app/sdks/console-web/docs/examples/health/get-anti-virus.md +++ b/app/sdks/console-web/docs/examples/health/get-anti-virus.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-cache.md b/app/sdks/console-web/docs/examples/health/get-cache.md index 046c5ea191..5c41d81868 100644 --- a/app/sdks/console-web/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-web/docs/examples/health/get-d-b.md b/app/sdks/console-web/docs/examples/health/get-d-b.md index 5ce56a6c4e..407f87e2a1 100644 --- a/app/sdks/console-web/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-web/docs/examples/health/get-queue-certificates.md b/app/sdks/console-web/docs/examples/health/get-queue-certificates.md index 0ab304c378..a115c869ba 100644 --- a/app/sdks/console-web/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 index 6cbfbc342c..3c0dc33acf 100644 --- a/app/sdks/console-web/docs/examples/health/get-queue-functions.md +++ b/app/sdks/console-web/docs/examples/health/get-queue-functions.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-logs.md b/app/sdks/console-web/docs/examples/health/get-queue-logs.md index 35078edc21..b3d41b49c6 100644 --- a/app/sdks/console-web/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-web/docs/examples/health/get-queue-tasks.md b/app/sdks/console-web/docs/examples/health/get-queue-tasks.md index 90ae978371..4f34f670a6 100644 --- a/app/sdks/console-web/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-web/docs/examples/health/get-queue-usage.md b/app/sdks/console-web/docs/examples/health/get-queue-usage.md index 1c04d04fe9..3d234be2de 100644 --- a/app/sdks/console-web/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-web/docs/examples/health/get-queue-webhooks.md b/app/sdks/console-web/docs/examples/health/get-queue-webhooks.md index 18970f2157..c5825dcf6c 100644 --- a/app/sdks/console-web/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-web/docs/examples/health/get-storage-local.md b/app/sdks/console-web/docs/examples/health/get-storage-local.md index f034f47f9a..7287745704 100644 --- a/app/sdks/console-web/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-web/docs/examples/health/get-time.md b/app/sdks/console-web/docs/examples/health/get-time.md index d579c981a3..b6087b73d5 100644 --- a/app/sdks/console-web/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-web/docs/examples/health/get.md b/app/sdks/console-web/docs/examples/health/get.md index 0f7b186341..1e7d6fe4e8 100644 --- a/app/sdks/console-web/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-web/docs/examples/locale/get-continents.md b/app/sdks/console-web/docs/examples/locale/get-continents.md index f21e10337d..93144335ea 100644 --- a/app/sdks/console-web/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-web/docs/examples/locale/get-countries-e-u.md b/app/sdks/console-web/docs/examples/locale/get-countries-e-u.md index 7ade8b1808..fffc8696e8 100644 --- a/app/sdks/console-web/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-web/docs/examples/locale/get-countries-phones.md b/app/sdks/console-web/docs/examples/locale/get-countries-phones.md index bc0fb2a6f5..751f4f6cc4 100644 --- a/app/sdks/console-web/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-web/docs/examples/locale/get-countries.md b/app/sdks/console-web/docs/examples/locale/get-countries.md index 21dd02a789..30b1dd95c7 100644 --- a/app/sdks/console-web/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-web/docs/examples/locale/get-currencies.md b/app/sdks/console-web/docs/examples/locale/get-currencies.md index 617398e2f3..4c92714062 100644 --- a/app/sdks/console-web/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-web/docs/examples/locale/get.md b/app/sdks/console-web/docs/examples/locale/get.md index ad06454b69..1fba9877b5 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/create-domain.md b/app/sdks/console-web/docs/examples/projects/create-domain.md index 3362de91c3..756b869a85 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/create-key.md b/app/sdks/console-web/docs/examples/projects/create-key.md index 1632d24862..9556f5b7f7 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/create-platform.md b/app/sdks/console-web/docs/examples/projects/create-platform.md index 474640705a..f4476fe599 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/create-task.md b/app/sdks/console-web/docs/examples/projects/create-task.md index ccec45a35a..5698d000e8 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/create-webhook.md b/app/sdks/console-web/docs/examples/projects/create-webhook.md index 4bb7400949..728786f9fb 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/create.md b/app/sdks/console-web/docs/examples/projects/create.md index c5cfac1bc4..8041ed154e 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/delete-domain.md b/app/sdks/console-web/docs/examples/projects/delete-domain.md index 04d4c18343..1b3df9363b 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/delete-key.md b/app/sdks/console-web/docs/examples/projects/delete-key.md index f71b115718..dc855bcc30 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/delete-platform.md b/app/sdks/console-web/docs/examples/projects/delete-platform.md index 2f29f97b5a..2a180c47e4 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/delete-task.md b/app/sdks/console-web/docs/examples/projects/delete-task.md index 5c82493859..b7f9ad3e47 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/delete-webhook.md b/app/sdks/console-web/docs/examples/projects/delete-webhook.md index 776df8864a..c5e0588ad1 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/delete.md b/app/sdks/console-web/docs/examples/projects/delete.md index ae4ff5ccb1..20b67370f0 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/get-domain.md b/app/sdks/console-web/docs/examples/projects/get-domain.md index 4b3d9c52ed..1622546719 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/get-key.md b/app/sdks/console-web/docs/examples/projects/get-key.md index 8cecb69760..8bb458c335 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/get-platform.md b/app/sdks/console-web/docs/examples/projects/get-platform.md index 2968e093ef..bfeb49393b 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/get-task.md b/app/sdks/console-web/docs/examples/projects/get-task.md index 4cdd44ec6c..c405299d74 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/get-usage.md b/app/sdks/console-web/docs/examples/projects/get-usage.md index 3503d3ee1a..e024a2966c 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/get-webhook.md b/app/sdks/console-web/docs/examples/projects/get-webhook.md index 0d92c8a507..2629d4424d 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/get.md b/app/sdks/console-web/docs/examples/projects/get.md index 98b4ef15ad..bcfb35186b 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/list-domains.md b/app/sdks/console-web/docs/examples/projects/list-domains.md index 48dcaaf31e..5ddfec49b5 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/list-keys.md b/app/sdks/console-web/docs/examples/projects/list-keys.md index 122ff5d676..497ddf9bac 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/list-platforms.md b/app/sdks/console-web/docs/examples/projects/list-platforms.md index 3dba8f1be4..4fd2d311f3 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/list-tasks.md b/app/sdks/console-web/docs/examples/projects/list-tasks.md index dfbd51039d..d42efc2b80 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/list-webhooks.md b/app/sdks/console-web/docs/examples/projects/list-webhooks.md index 32660f6447..6c45849399 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/list.md b/app/sdks/console-web/docs/examples/projects/list.md index 32a2e112cc..428fc4545f 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/update-domain-verification.md b/app/sdks/console-web/docs/examples/projects/update-domain-verification.md index 7a60d9443a..ea53295bcf 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/update-key.md b/app/sdks/console-web/docs/examples/projects/update-key.md index 196e6ceac0..f19b593c9f 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/update-o-auth2.md b/app/sdks/console-web/docs/examples/projects/update-o-auth2.md index 5c202778f5..479c5e9d30 100644 --- a/app/sdks/console-web/docs/examples/projects/update-o-auth2.md +++ b/app/sdks/console-web/docs/examples/projects/update-o-auth2.md @@ -1,11 +1,12 @@ let sdk = new Appwrite(); sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = sdk.projects.updateOAuth2('[PROJECT_ID]', 'bitbucket'); +let promise = sdk.projects.updateOAuth2('[PROJECT_ID]', 'amazon'); promise.then(function (response) { console.log(response); // Success diff --git a/app/sdks/console-web/docs/examples/projects/update-platform.md b/app/sdks/console-web/docs/examples/projects/update-platform.md index 606872f9ce..0e22080ed0 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/update-task.md b/app/sdks/console-web/docs/examples/projects/update-task.md index 8b23e7a0dc..dc95cfda9f 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/update-webhook.md b/app/sdks/console-web/docs/examples/projects/update-webhook.md index 6b1cc8cbed..b1ead71e92 100644 --- a/app/sdks/console-web/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-web/docs/examples/projects/update.md b/app/sdks/console-web/docs/examples/projects/update.md index 34cda4b9e2..9d06850534 100644 --- a/app/sdks/console-web/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-web/docs/examples/storage/create-file.md b/app/sdks/console-web/docs/examples/storage/create-file.md index 0aa8829fe8..673777e380 100644 --- a/app/sdks/console-web/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-web/docs/examples/storage/delete-file.md b/app/sdks/console-web/docs/examples/storage/delete-file.md index e37c8937b0..7278b682ae 100644 --- a/app/sdks/console-web/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-web/docs/examples/storage/get-file-download.md b/app/sdks/console-web/docs/examples/storage/get-file-download.md index 0d0ff8fc3e..5be3f81694 100644 --- a/app/sdks/console-web/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-web/docs/examples/storage/get-file-preview.md b/app/sdks/console-web/docs/examples/storage/get-file-preview.md index 712b38917a..737ead95c3 100644 --- a/app/sdks/console-web/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-web/docs/examples/storage/get-file-view.md b/app/sdks/console-web/docs/examples/storage/get-file-view.md index 08368f8b19..c9f73b7d28 100644 --- a/app/sdks/console-web/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-web/docs/examples/storage/get-file.md b/app/sdks/console-web/docs/examples/storage/get-file.md index f9707981b7..9691be3056 100644 --- a/app/sdks/console-web/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-web/docs/examples/storage/list-files.md b/app/sdks/console-web/docs/examples/storage/list-files.md index 3a40057b7c..5c2560d06d 100644 --- a/app/sdks/console-web/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-web/docs/examples/storage/update-file.md b/app/sdks/console-web/docs/examples/storage/update-file.md index 630ec6c9fc..c053d60470 100644 --- a/app/sdks/console-web/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-web/docs/examples/teams/create-membership.md b/app/sdks/console-web/docs/examples/teams/create-membership.md index 7d60897edf..534577ead3 100644 --- a/app/sdks/console-web/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-web/docs/examples/teams/create.md b/app/sdks/console-web/docs/examples/teams/create.md index 573557179a..6f7232b9c5 100644 --- a/app/sdks/console-web/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-web/docs/examples/teams/delete-membership.md b/app/sdks/console-web/docs/examples/teams/delete-membership.md index 01dc2dfc95..fa1efe401b 100644 --- a/app/sdks/console-web/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-web/docs/examples/teams/delete.md b/app/sdks/console-web/docs/examples/teams/delete.md index d8eb25bf87..cacad26c02 100644 --- a/app/sdks/console-web/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-web/docs/examples/teams/get-memberships.md b/app/sdks/console-web/docs/examples/teams/get-memberships.md index 1b51d214df..e1b959d1eb 100644 --- a/app/sdks/console-web/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-web/docs/examples/teams/get.md b/app/sdks/console-web/docs/examples/teams/get.md index 2c14d01ebd..a8496ad76d 100644 --- a/app/sdks/console-web/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-web/docs/examples/teams/list.md b/app/sdks/console-web/docs/examples/teams/list.md index a266273f3d..b94d6c32ff 100644 --- a/app/sdks/console-web/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-web/docs/examples/teams/update-membership-status.md b/app/sdks/console-web/docs/examples/teams/update-membership-status.md index 3942b0a788..4931f02689 100644 --- a/app/sdks/console-web/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-web/docs/examples/teams/update.md b/app/sdks/console-web/docs/examples/teams/update.md index 00b718e431..5b73121518 100644 --- a/app/sdks/console-web/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-web/docs/examples/users/create.md b/app/sdks/console-web/docs/examples/users/create.md index c4d5acb17d..9adc060ff5 100644 --- a/app/sdks/console-web/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-web/docs/examples/users/delete-session.md b/app/sdks/console-web/docs/examples/users/delete-session.md index dac3ed7c39..96a9b5c94f 100644 --- a/app/sdks/console-web/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-web/docs/examples/users/delete-sessions.md b/app/sdks/console-web/docs/examples/users/delete-sessions.md index 6386b536d5..56092ab5fc 100644 --- a/app/sdks/console-web/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-web/docs/examples/users/get-logs.md b/app/sdks/console-web/docs/examples/users/get-logs.md index cdaf3e8b76..c349383ec1 100644 --- a/app/sdks/console-web/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-web/docs/examples/users/get-prefs.md b/app/sdks/console-web/docs/examples/users/get-prefs.md index a861db2607..7d8a3cd33f 100644 --- a/app/sdks/console-web/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-web/docs/examples/users/get-sessions.md b/app/sdks/console-web/docs/examples/users/get-sessions.md index 4281e3c27e..1b7535855e 100644 --- a/app/sdks/console-web/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-web/docs/examples/users/get.md b/app/sdks/console-web/docs/examples/users/get.md index cccbd13855..751798de39 100644 --- a/app/sdks/console-web/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-web/docs/examples/users/list.md b/app/sdks/console-web/docs/examples/users/list.md index 34888458cd..bbc4895412 100644 --- a/app/sdks/console-web/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-web/docs/examples/users/update-prefs.md b/app/sdks/console-web/docs/examples/users/update-prefs.md index ed254f0608..877aa309a1 100644 --- a/app/sdks/console-web/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-web/docs/examples/users/update-status.md b/app/sdks/console-web/docs/examples/users/update-status.md index c82fd1faa7..6c432ff4c6 100644 --- a/app/sdks/console-web/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-web/src/sdk.js b/app/sdks/console-web/src/sdk.js index e0a6388854..35278ba2b2 100644 --- a/app/sdks/console-web/src/sdk.js +++ b/app/sdks/console-web/src/sdk.js @@ -312,10 +312,10 @@ * * Use this endpoint to allow a new user to register a new account in your * project. After the user registration completes successfully, you can use - * the [/account/verfication](/docs/account#createVerification) route to start - * verifying the user email address. To allow your new user to login to his - * new account, you need to create a new [account - * session](/docs/account#createSession). + * the [/account/verfication](/docs/client/account#createVerification) route + * to start verifying the user email address. To allow your new user to login + * to his new account, you need to create a new [account + * session](/docs/client/account#createSession). * * @param {string} email * @param {string} password @@ -558,7 +558,7 @@ * When the user clicks the confirmation link he is redirected back to your * app password reset URL with the secret key and email address values * attached to the URL query string. Use the query string params to submit a - * request to the [PUT /account/recovery](/docs/account#updateRecovery) + * request to the [PUT /account/recovery](/docs/client/account#updateRecovery) * endpoint to complete the process. * * @param {string} email @@ -599,7 +599,7 @@ * Use this endpoint to complete the user account password reset. Both the * **userId** and **secret** arguments will be passed as query parameters to * the redirect URL you have provided when sending your request to the [POST - * /account/recovery](/docs/account#createRecovery) endpoint. + * /account/recovery](/docs/client/account#createRecovery) endpoint. * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) @@ -810,7 +810,7 @@ * should redirect the user back for your app and allow you to complete the * verification process by verifying both the **userId** and **secret** * parameters. Learn more about how to [complete the verification - * process](/docs/account#updateAccountVerification). + * process](/docs/client/account#updateAccountVerification). * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) @@ -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 : ''); }, /** @@ -1418,7 +1421,10 @@ /** * Create Document * - * Create a new Document. + * Create a new Document. Before using this route, you should create a new + * collection resource using either a [server + * integration](/docs/server/database?sdk=nodejs#createCollection) API or + * directly from your database console. * * @param {string} collectionId * @param {object} data @@ -4216,10 +4222,14 @@ * for this list of resources. * * @param {string} teamId + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType * @throws {Error} * @return {Promise} */ - getMemberships: function(teamId) { + getMemberships: function(teamId, search = '', limit = 25, offset = 0, orderType = 'ASC') { if(teamId === undefined) { throw new Error('Missing required parameter: "teamId"'); } @@ -4228,6 +4238,22 @@ let payload = {}; + if(search) { + payload['search'] = search; + } + + if(limit) { + payload['limit'] = limit; + } + + if(offset) { + payload['offset'] = offset; + } + + if(orderType) { + payload['orderType'] = orderType; + } + return http .get(path, { 'content-type': 'application/json', @@ -4243,8 +4269,8 @@ * * 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. + * Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the + * user to accept the invitation to the team. * * Please note that in order to avoid a [Redirect * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) diff --git a/app/sdks/console-web/src/sdk.min.js b/app/sdks/console-web/src/sdk.min.js index de4dd9aa06..883113d5ce 100644 --- a/app/sdks/console-web/src/sdk.min.js +++ b/app/sdks/console-web/src/sdk.min.js @@ -59,7 +59,7 @@ 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} @@ -319,8 +319,12 @@ let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payloa if(name===undefined){throw new Error('Missing required parameter: "name"')} let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(name){payload.name=name} return http.put(path,{'content-type':'application/json',},payload)},delete:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} -let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getMemberships:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} -let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createMembership:function(teamId,email,roles,url,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} +let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getMemberships:function(teamId,search='',limit=25,offset=0,orderType='ASC'){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} +let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(search){payload.search=search} +if(limit){payload.limit=limit} +if(offset){payload.offset=offset} +if(orderType){payload.orderType=orderType} +return http.get(path,{'content-type':'application/json',},payload)},createMembership:function(teamId,email,roles,url,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} if(email===undefined){throw new Error('Missing required parameter: "email"')} if(roles===undefined){throw new Error('Missing required parameter: "roles"')} if(url===undefined){throw new Error('Missing required parameter: "url"')} diff --git a/app/sdks/console-web/types/index.d.ts b/app/sdks/console-web/types/index.d.ts index a17481eca2..4fa57150e3 100644 --- a/app/sdks/console-web/types/index.d.ts +++ b/app/sdks/console-web/types/index.d.ts @@ -86,10 +86,10 @@ declare namespace Appwrite { * * Use this endpoint to allow a new user to register a new account in your * project. After the user registration completes successfully, you can use - * the [/account/verfication](/docs/account#createVerification) route to start - * verifying the user email address. To allow your new user to login to his - * new account, you need to create a new [account - * session](/docs/account#createSession). + * the [/account/verfication](/docs/client/account#createVerification) route + * to start verifying the user email address. To allow your new user to login + * to his new account, you need to create a new [account + * session](/docs/client/account#createSession). * * @param {string} email * @param {string} password @@ -192,7 +192,7 @@ declare namespace Appwrite { * When the user clicks the confirmation link he is redirected back to your * app password reset URL with the secret key and email address values * attached to the URL query string. Use the query string params to submit a - * request to the [PUT /account/recovery](/docs/account#updateRecovery) + * request to the [PUT /account/recovery](/docs/client/account#updateRecovery) * endpoint to complete the process. * * @param {string} email @@ -208,7 +208,7 @@ declare namespace Appwrite { * Use this endpoint to complete the user account password reset. Both the * **userId** and **secret** arguments will be passed as query parameters to * the redirect URL you have provided when sending your request to the [POST - * /account/recovery](/docs/account#createRecovery) endpoint. + * /account/recovery](/docs/client/account#createRecovery) endpoint. * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) @@ -298,7 +298,7 @@ declare namespace Appwrite { * should redirect the user back for your app and allow you to complete the * verification process by verifying both the **userId** and **secret** * parameters. Learn more about how to [complete the verification - * process](/docs/account#updateAccountVerification). + * process](/docs/client/account#updateAccountVerification). * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) @@ -343,9 +343,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 @@ -523,7 +523,10 @@ declare namespace Appwrite { /** * Create Document * - * Create a new Document. + * Create a new Document. Before using this route, you should create a new + * collection resource using either a [server + * integration](/docs/server/database?sdk=nodejs#createCollection) API or + * directly from your database console. * * @param {string} collectionId * @param {object} data @@ -1565,10 +1568,14 @@ declare namespace Appwrite { * for this list of resources. * * @param {string} teamId + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType * @throws {Error} * @return {Promise} */ - getMemberships(teamId: string): Promise; + getMemberships(teamId: string, search: string, limit: number, offset: number, orderType: string): Promise; /** * Create Team Membership @@ -1579,8 +1586,8 @@ declare namespace Appwrite { * * 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. + * Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the + * user to accept the invitation to the team. * * Please note that in order to avoid a [Redirect * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) 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-nodejs/README.md b/app/sdks/server-nodejs/README.md index a6df1832a3..abf67fea4e 100644 --- a/app/sdks/server-nodejs/README.md +++ b/app/sdks/server-nodejs/README.md @@ -1,7 +1,7 @@ # Appwrite Node.js SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.6.0-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 index 8d09508218..c08e612bcf 100644 --- a/app/sdks/server-nodejs/docs/examples/health/get-anti-virus.md +++ b/app/sdks/server-nodejs/docs/examples/health/get-anti-virus.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-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 index a799c29805..9470e11646 100644 --- a/app/sdks/server-nodejs/docs/examples/health/get-queue-functions.md +++ b/app/sdks/server-nodejs/docs/examples/health/get-queue-functions.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-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-php/README.md b/app/sdks/server-php/README.md index a66297ba59..0d64f84fca 100644 --- a/app/sdks/server-php/README.md +++ b/app/sdks/server-php/README.md @@ -1,7 +1,7 @@ # Appwrite PHP SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-php.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.6.0-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/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 index a1e5b66a9b..89a5fb2a7a 100644 --- a/app/sdks/server-php/docs/examples/health/get-anti-virus.md +++ b/app/sdks/server-php/docs/examples/health/get-anti-virus.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-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 index b8df530241..8ff6510e1c 100644 --- a/app/sdks/server-php/docs/examples/health/get-queue-functions.md +++ b/app/sdks/server-php/docs/examples/health/get-queue-functions.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-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-python/README.md b/app/sdks/server-python/README.md index 546019dac2..1d5c72a9c4 100644 --- a/app/sdks/server-python/README.md +++ b/app/sdks/server-python/README.md @@ -1,9 +1,9 @@ # Appwrite Python SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.6.0-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.6.0. 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/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 index 51e301c12a..0c90f20750 100644 --- a/app/sdks/server-python/docs/examples/health/get-anti-virus.md +++ b/app/sdks/server-python/docs/examples/health/get-anti-virus.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-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 index c282ba7969..6704514eb7 100644 --- a/app/sdks/server-python/docs/examples/health/get-queue-functions.md +++ b/app/sdks/server-python/docs/examples/health/get-queue-functions.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-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-ruby/README.md b/app/sdks/server-ruby/README.md index 758a2dae7d..cbc2cf781c 100644 --- a/app/sdks/server-ruby/README.md +++ b/app/sdks/server-ruby/README.md @@ -1,9 +1,9 @@ # Appwrite Ruby SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.6.0-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.6.0. 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 66c69d18df..f550cecf9f 100644 --- a/app/sdks/server-ruby/appwrite.gemspec +++ b/app/sdks/server-ruby/appwrite.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = 'appwrite' - s.version = '1.0.10' + s.version = '1.0.11' s.summary = "Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Ruby SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)" 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..fc0cfc913f --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +avatars = Appwrite::Avatars.new(client); + +response = avatars.get_browser(code: 'aa'); + +puts response \ No newline at end of file diff --git a/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..b3763f0846 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +avatars = Appwrite::Avatars.new(client); + +response = avatars.get_credit_card(code: 'amex'); + +puts response \ No newline at end of file diff --git a/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..2ee4e75789 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +avatars = Appwrite::Avatars.new(client); + +response = avatars.get_favicon(url: 'https://example.com'); + +puts response \ No newline at end of file diff --git a/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..2e2f01f0f9 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +avatars = Appwrite::Avatars.new(client); + +response = avatars.get_flag(code: 'af'); + +puts response \ No newline at end of file diff --git a/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..682d6bf9df --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +avatars = Appwrite::Avatars.new(client); + +response = avatars.get_image(url: 'https://example.com'); + +puts response \ No newline at end of file diff --git a/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..f145425ca2 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +avatars = Appwrite::Avatars.new(client); + +response = avatars.get_q_r(text: '[TEXT]'); + +puts response \ No newline at end of file diff --git a/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..0317ed9f05 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.create_collection(name: '[NAME]', read: [], write: [], rules: []); + +puts response \ No newline at end of file diff --git a/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..0101c746b4 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.create_document(collection_id: '[COLLECTION_ID]', data: {}, read: [], write: []); + +puts response \ No newline at end of file diff --git a/app/sdks/server-ruby/docs/examples/database/delete-collection.md b/app/sdks/server-ruby/docs/examples/database/delete-collection.md new file mode 100644 index 0000000000..b91c369da7 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('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..6548ec2946 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.delete_document(collection_id: '[COLLECTION_ID]', document_id: '[DOCUMENT_ID]'); + +puts response \ No newline at end of file diff --git a/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..65938d1af9 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('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..1e54e94c10 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.get_collection(collection_id: '[COLLECTION_ID]'); + +puts response \ No newline at end of file diff --git a/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..3040b82c03 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.get_document(collection_id: '[COLLECTION_ID]', document_id: '[DOCUMENT_ID]'); + +puts response \ No newline at end of file diff --git a/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..ec15fe3b08 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.list_collections(); + +puts response \ No newline at end of file diff --git a/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..fa33f10ccf --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.list_documents(collection_id: '[COLLECTION_ID]'); + +puts response \ No newline at end of file diff --git a/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..3ecfbdb4ab --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.update_collection(collection_id: '[COLLECTION_ID]', name: '[NAME]', read: [], write: []); + +puts response \ No newline at end of file diff --git a/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..492d4f3edc --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +database = Appwrite::Database.new(client); + +response = database.update_document(collection_id: '[COLLECTION_ID]', document_id: '[DOCUMENT_ID]', data: {}, read: [], write: []); + +puts response \ No newline at end of file diff --git a/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..0c83a06cf8 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_anti_virus(); + +puts response \ No newline at end of file diff --git a/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..6f51fb6e00 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_cache(); + +puts response \ No newline at end of file diff --git a/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..4bb00577a7 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_d_b(); + +puts response \ No newline at end of file diff --git a/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..f758b7c3a4 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_queue_certificates(); + +puts response \ No newline at end of file diff --git a/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..653607f79d --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_queue_functions(); + +puts response \ No newline at end of file diff --git a/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..c6751f7f91 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_queue_logs(); + +puts response \ No newline at end of file diff --git a/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..c6da38832e --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_queue_tasks(); + +puts response \ No newline at end of file diff --git a/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..ed81452d86 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_queue_usage(); + +puts response \ No newline at end of file diff --git a/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..9e55ab1d87 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_queue_webhooks(); + +puts response \ No newline at end of file diff --git a/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..09c47ae437 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_storage_local(); + +puts response \ No newline at end of file diff --git a/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..3d72794e93 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get_time(); + +puts response \ No newline at end of file diff --git a/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..9496c31b36 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +health = Appwrite::Health.new(client); + +response = health.get(); + +puts response \ No newline at end of file diff --git a/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..92f38922e1 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +locale = Appwrite::Locale.new(client); + +response = locale.get_continents(); + +puts response \ No newline at end of file diff --git a/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..b83125d4a6 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +locale = Appwrite::Locale.new(client); + +response = locale.get_countries_e_u(); + +puts response \ No newline at end of file diff --git a/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..728a1b3cdc --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +locale = Appwrite::Locale.new(client); + +response = locale.get_countries_phones(); + +puts response \ No newline at end of file diff --git a/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..54975db928 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +locale = Appwrite::Locale.new(client); + +response = locale.get_countries(); + +puts response \ No newline at end of file diff --git a/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..4e39b435e1 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +locale = Appwrite::Locale.new(client); + +response = locale.get_currencies(); + +puts response \ No newline at end of file diff --git a/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..b390d505c4 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +locale = Appwrite::Locale.new(client); + +response = locale.get(); + +puts response \ No newline at end of file diff --git a/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..b044e35b86 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +storage = Appwrite::Storage.new(client); + +response = storage.create_file(file: File.new(), read: [], write: []); + +puts response \ No newline at end of file diff --git a/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..1aa67b3537 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +storage = Appwrite::Storage.new(client); + +response = storage.delete_file(file_id: '[FILE_ID]'); + +puts response \ No newline at end of file diff --git a/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..777c565d06 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +storage = Appwrite::Storage.new(client); + +response = storage.get_file_download(file_id: '[FILE_ID]'); + +puts response \ No newline at end of file diff --git a/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..48be3a044e --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +storage = Appwrite::Storage.new(client); + +response = storage.get_file_preview(file_id: '[FILE_ID]'); + +puts response \ No newline at end of file diff --git a/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..a3dc012098 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +storage = Appwrite::Storage.new(client); + +response = storage.get_file_view(file_id: '[FILE_ID]'); + +puts response \ No newline at end of file diff --git a/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..203a4dff7c --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +storage = Appwrite::Storage.new(client); + +response = storage.get_file(file_id: '[FILE_ID]'); + +puts response \ No newline at end of file diff --git a/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..a148da78f9 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +storage = Appwrite::Storage.new(client); + +response = storage.list_files(); + +puts response \ No newline at end of file diff --git a/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..36d5049816 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +storage = Appwrite::Storage.new(client); + +response = storage.update_file(file_id: '[FILE_ID]', read: [], write: []); + +puts response \ No newline at end of file diff --git a/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..fc0a249361 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +teams = Appwrite::Teams.new(client); + +response = teams.create_membership(team_id: '[TEAM_ID]', email: 'email@example.com', roles: [], url: 'https://example.com'); + +puts response \ No newline at end of file diff --git a/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..d7f9c2f8c0 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +teams = Appwrite::Teams.new(client); + +response = teams.create(name: '[NAME]'); + +puts response \ No newline at end of file diff --git a/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..545cacc51f --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +teams = Appwrite::Teams.new(client); + +response = teams.delete_membership(team_id: '[TEAM_ID]', invite_id: '[INVITE_ID]'); + +puts response \ No newline at end of file diff --git a/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..d28907f741 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +teams = Appwrite::Teams.new(client); + +response = teams.delete(team_id: '[TEAM_ID]'); + +puts response \ No newline at end of file diff --git a/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..013d952afc --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +teams = Appwrite::Teams.new(client); + +response = teams.get_memberships(team_id: '[TEAM_ID]'); + +puts response \ No newline at end of file diff --git a/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..1dd4918a12 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +teams = Appwrite::Teams.new(client); + +response = teams.get(team_id: '[TEAM_ID]'); + +puts response \ No newline at end of file diff --git a/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..c0cd72a362 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +teams = Appwrite::Teams.new(client); + +response = teams.list(); + +puts response \ No newline at end of file diff --git a/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..b7e87a8e09 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +teams = Appwrite::Teams.new(client); + +response = teams.update(team_id: '[TEAM_ID]', name: '[NAME]'); + +puts response \ No newline at end of file diff --git a/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..0a152ac366 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.create(email: 'email@example.com', password: 'password'); + +puts response \ No newline at end of file diff --git a/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..149c7d9293 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.delete_session(user_id: '[USER_ID]', session_id: '[SESSION_ID]'); + +puts response \ No newline at end of file diff --git a/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..3f02e08dd1 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.delete_sessions(user_id: '[USER_ID]'); + +puts response \ No newline at end of file diff --git a/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..695a77ad27 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.get_logs(user_id: '[USER_ID]'); + +puts response \ No newline at end of file diff --git a/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..4a0761e283 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.get_prefs(user_id: '[USER_ID]'); + +puts response \ No newline at end of file diff --git a/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..52f37a4609 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.get_sessions(user_id: '[USER_ID]'); + +puts response \ No newline at end of file diff --git a/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..562ac958c3 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.get(user_id: '[USER_ID]'); + +puts response \ No newline at end of file diff --git a/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..096ce859e3 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.list(); + +puts response \ No newline at end of file diff --git a/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..2bb2d42e16 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.update_prefs(user_id: '[USER_ID]', prefs: {}); + +puts response \ No newline at end of file diff --git a/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..088ee380d8 --- /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 + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +; + +users = Appwrite::Users.new(client); + +response = users.update_status(user_id: '[USER_ID]', status: '1'); + +puts response \ No newline at end of file diff --git a/app/sdks/server-ruby/lib/appwrite/client.rb b/app/sdks/server-ruby/lib/appwrite/client.rb index 0620069f74..2cd09d52fe 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.10' + 'x-sdk-version' => 'appwrite:ruby:1.0.11' } @endpoint = 'https://appwrite.io/v1'; end diff --git a/app/sdks/server-ruby/lib/appwrite/services/database.rb b/app/sdks/server-ruby/lib/appwrite/services/database.rb index 8bb9c3bbb4..d8efcc34e1 100644 --- a/app/sdks/server-ruby/lib/appwrite/services/database.rb +++ b/app/sdks/server-ruby/lib/appwrite/services/database.rb @@ -33,7 +33,7 @@ module Appwrite def get_collection(collection_id:) path = '/database/collections/{collectionId}' - .gsub('{collection_id}', collection_id) + .gsub('{collectionId}', collection_id) params = { } @@ -45,7 +45,7 @@ module Appwrite def update_collection(collection_id:, name:, read:, write:, rules: []) path = '/database/collections/{collectionId}' - .gsub('{collection_id}', collection_id) + .gsub('{collectionId}', collection_id) params = { 'name': name, @@ -61,7 +61,7 @@ module Appwrite def delete_collection(collection_id:) path = '/database/collections/{collectionId}' - .gsub('{collection_id}', collection_id) + .gsub('{collectionId}', collection_id) params = { } @@ -73,7 +73,7 @@ module Appwrite def list_documents(collection_id:, filters: [], offset: 0, limit: 50, order_field: '$id', order_type: 'ASC', order_cast: 'string', search: '', first: 0, last: 0) path = '/database/collections/{collectionId}/documents' - .gsub('{collection_id}', collection_id) + .gsub('{collectionId}', collection_id) params = { 'filters': filters, @@ -94,7 +94,7 @@ module Appwrite def create_document(collection_id:, data:, read:, write:, parent_document: '', parent_property: '', parent_property_type: 'assign') path = '/database/collections/{collectionId}/documents' - .gsub('{collection_id}', collection_id) + .gsub('{collectionId}', collection_id) params = { 'data': data, @@ -112,8 +112,8 @@ module Appwrite def get_document(collection_id:, document_id:) path = '/database/collections/{collectionId}/documents/{documentId}' - .gsub('{collection_id}', collection_id) - .gsub('{document_id}', document_id) + .gsub('{collectionId}', collection_id) + .gsub('{documentId}', document_id) params = { } @@ -125,8 +125,8 @@ module Appwrite def update_document(collection_id:, document_id:, data:, read:, write:) path = '/database/collections/{collectionId}/documents/{documentId}' - .gsub('{collection_id}', collection_id) - .gsub('{document_id}', document_id) + .gsub('{collectionId}', collection_id) + .gsub('{documentId}', document_id) params = { 'data': data, @@ -141,8 +141,8 @@ module Appwrite def delete_document(collection_id:, document_id:) path = '/database/collections/{collectionId}/documents/{documentId}' - .gsub('{collection_id}', collection_id) - .gsub('{document_id}', document_id) + .gsub('{collectionId}', collection_id) + .gsub('{documentId}', document_id) params = { } @@ -154,7 +154,7 @@ module Appwrite def get_collection_logs(collection_id:) path = '/database/collections/{collectionId}/logs' - .gsub('{collection_id}', collection_id) + .gsub('{collectionId}', collection_id) params = { } diff --git a/app/sdks/server-ruby/lib/appwrite/services/storage.rb b/app/sdks/server-ruby/lib/appwrite/services/storage.rb index 2fe1a5762f..0e99a2b0d5 100644 --- a/app/sdks/server-ruby/lib/appwrite/services/storage.rb +++ b/app/sdks/server-ruby/lib/appwrite/services/storage.rb @@ -32,7 +32,7 @@ module Appwrite def get_file(file_id:) path = '/storage/files/{fileId}' - .gsub('{file_id}', file_id) + .gsub('{fileId}', file_id) params = { } @@ -44,7 +44,7 @@ module Appwrite def update_file(file_id:, read:, write:) path = '/storage/files/{fileId}' - .gsub('{file_id}', file_id) + .gsub('{fileId}', file_id) params = { 'read': read, @@ -58,7 +58,7 @@ module Appwrite def delete_file(file_id:) path = '/storage/files/{fileId}' - .gsub('{file_id}', file_id) + .gsub('{fileId}', file_id) params = { } @@ -70,7 +70,7 @@ module Appwrite def get_file_download(file_id:) path = '/storage/files/{fileId}/download' - .gsub('{file_id}', file_id) + .gsub('{fileId}', file_id) params = { } @@ -82,7 +82,7 @@ module Appwrite def get_file_preview(file_id:, width: 0, height: 0, quality: 100, background: '', output: '') path = '/storage/files/{fileId}/preview' - .gsub('{file_id}', file_id) + .gsub('{fileId}', file_id) params = { 'width': width, @@ -99,7 +99,7 @@ module Appwrite def get_file_view(file_id:, as: '') path = '/storage/files/{fileId}/view' - .gsub('{file_id}', file_id) + .gsub('{fileId}', file_id) params = { 'as': as diff --git a/app/sdks/server-ruby/lib/appwrite/services/teams.rb b/app/sdks/server-ruby/lib/appwrite/services/teams.rb index de6079b6f8..0e677476d2 100644 --- a/app/sdks/server-ruby/lib/appwrite/services/teams.rb +++ b/app/sdks/server-ruby/lib/appwrite/services/teams.rb @@ -31,7 +31,7 @@ module Appwrite def get(team_id:) path = '/teams/{teamId}' - .gsub('{team_id}', team_id) + .gsub('{teamId}', team_id) params = { } @@ -43,7 +43,7 @@ module Appwrite def update(team_id:, name:) path = '/teams/{teamId}' - .gsub('{team_id}', team_id) + .gsub('{teamId}', team_id) params = { 'name': name @@ -56,7 +56,7 @@ module Appwrite def delete(team_id:) path = '/teams/{teamId}' - .gsub('{team_id}', team_id) + .gsub('{teamId}', team_id) params = { } @@ -68,7 +68,7 @@ module Appwrite def get_memberships(team_id:) path = '/teams/{teamId}/memberships' - .gsub('{team_id}', team_id) + .gsub('{teamId}', team_id) params = { } @@ -80,7 +80,7 @@ module Appwrite def create_membership(team_id:, email:, roles:, url:, name: '') path = '/teams/{teamId}/memberships' - .gsub('{team_id}', team_id) + .gsub('{teamId}', team_id) params = { 'email': email, @@ -96,8 +96,8 @@ module Appwrite def delete_membership(team_id:, invite_id:) path = '/teams/{teamId}/memberships/{inviteId}' - .gsub('{team_id}', team_id) - .gsub('{invite_id}', invite_id) + .gsub('{teamId}', team_id) + .gsub('{inviteId}', invite_id) params = { } diff --git a/app/sdks/server-ruby/lib/appwrite/services/users.rb b/app/sdks/server-ruby/lib/appwrite/services/users.rb index ae790c9403..f75434bd1a 100644 --- a/app/sdks/server-ruby/lib/appwrite/services/users.rb +++ b/app/sdks/server-ruby/lib/appwrite/services/users.rb @@ -32,7 +32,7 @@ module Appwrite def get(user_id:) path = '/users/{userId}' - .gsub('{user_id}', user_id) + .gsub('{userId}', user_id) params = { } @@ -44,7 +44,7 @@ module Appwrite def get_logs(user_id:) path = '/users/{userId}/logs' - .gsub('{user_id}', user_id) + .gsub('{userId}', user_id) params = { } @@ -56,7 +56,7 @@ module Appwrite def get_prefs(user_id:) path = '/users/{userId}/prefs' - .gsub('{user_id}', user_id) + .gsub('{userId}', user_id) params = { } @@ -68,7 +68,7 @@ module Appwrite def update_prefs(user_id:, prefs:) path = '/users/{userId}/prefs' - .gsub('{user_id}', user_id) + .gsub('{userId}', user_id) params = { 'prefs': prefs @@ -81,7 +81,7 @@ module Appwrite def get_sessions(user_id:) path = '/users/{userId}/sessions' - .gsub('{user_id}', user_id) + .gsub('{userId}', user_id) params = { } @@ -93,7 +93,7 @@ module Appwrite def delete_sessions(user_id:) path = '/users/{userId}/sessions' - .gsub('{user_id}', user_id) + .gsub('{userId}', user_id) params = { } @@ -105,8 +105,8 @@ module Appwrite def delete_session(user_id:, session_id:) path = '/users/{userId}/sessions/{sessionId}' - .gsub('{user_id}', user_id) - .gsub('{session_id}', session_id) + .gsub('{userId}', user_id) + .gsub('{sessionId}', session_id) params = { } @@ -118,7 +118,7 @@ module Appwrite def update_status(user_id:, status:) path = '/users/{userId}/status' - .gsub('{user_id}', user_id) + .gsub('{userId}', user_id) params = { 'status': status diff --git a/app/tasks/sdks.php b/app/tasks/sdks.php index 19d2deb3b8..2843443924 100644 --- a/app/tasks/sdks.php +++ b/app/tasks/sdks.php @@ -15,6 +15,7 @@ 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; @@ -107,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 diff --git a/app/views/console/account/index.phtml b/app/views/console/account/index.phtml index 37abdb5ddc..da40715f19 100644 --- a/app/views/console/account/index.phtml +++ b/app/views/console/account/index.phtml @@ -1,6 +1,6 @@

- Home + Home
Your Account @@ -22,15 +22,7 @@
- User Avatar - -
- - Upload - -
- - (via gravatar.com ) + User Avatar
@@ -57,7 +49,7 @@
- +
@@ -85,7 +77,7 @@

-