diff --git a/.dockerignore b/.dockerignore index 7fff0265d6..b92827b7c8 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,4 +6,5 @@ public/styles .git .idea .cd .babelrc -.DS_Store \ No newline at end of file +.DS_Store +debug \ No newline at end of file diff --git a/.env b/.env new file mode 100644 index 0000000000..fc6f388a99 --- /dev/null +++ b/.env @@ -0,0 +1,23 @@ +_APP_ENV=production +_APP_ENV=development +_APP_OPTIONS_ABUSE=disabled +_APP_OPTIONS_FORCE_HTTPS=disabled +_APP_OPENSSL_KEY_V1=your-secret-key +_APP_DOMAIN=demo.appwrite.io +_APP_DOMAIN_TARGET=demo.appwrite.io +_APP_REDIS_HOST=redis +_APP_REDIS_PORT=6379 +_APP_DB_HOST=mariadb +_APP_DB_PORT=3306 +_APP_DB_SCHEMA=appwrite +_APP_DB_USER=user +_APP_DB_PASS=password +_APP_INFLUXDB_HOST=influxdb +_APP_INFLUXDB_PORT=8086 +_APP_STATSD_HOST=telegraf +_APP_STATSD_PORT=8125 +_APP_SMTP_HOST=maildev +_APP_SMTP_PORT=25 +_APP_STORAGE_LIMIT=10000000 +_APP_FUNCTIONS_TIMEOUT=900 +_APP_FUNCTIONS_CONTAINERS=10 \ No newline at end of file diff --git a/.gitignore b/.gitignore index fa6a24789b..d0b2a74730 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,7 @@ /.vscode/ /vendor/ /node_modules/ -/storage/uploads/ -/storage/cache -/storage/db -/storage/influxdb /tests/resources/storage/ /.idea/ .DS_Store -.php_cs.cache -.env \ No newline at end of file +.php_cs.cache \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index a6fbe5944e..89db541ea3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,12 @@ notifications: services: - docker +before_install: + - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - + - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" + - sudo apt-get update + - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce + # cache: # directories: # - docker_images @@ -25,9 +31,11 @@ services: # - docker save -o docker_images/images.tar appwrite_appwrite install: +- docker --version - docker-compose up -d - sleep 90 script: - docker ps -- docker exec appwrite test +- docker-compose logs appwrite +- docker exec appwrite test \ No newline at end of file diff --git a/CHANGES.md b/CHANGES.md index f5ffdc97fb..b1c6906286 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -19,6 +19,32 @@ - Upgraded ClamAV container image to version 1.0.11 ([#412](https://github.com/appwrite/appwrite/issues/412)) - Optimised function execution by using fully-qualified function calls - Added support for boolean 'true' and 'false' in query strings alongside 1 and 0 +- Added pagination for projects list on the console home page. +- Updated storage calculation to match IEC standards +- Now using Alpine as base Docker image +- Upgraded device detctor to version 3.12.6 +- Upgraded MariaDB to version 10.5.5 +- User name max length is now 128 chars and not 100 for better API consistency +- Team name max length is now 128 chars and not 100 for better API consistency +- Collection name max length is now 128 chars and not 256 for better API consistency +- Project name max length is now 128 chars and not 100 for better API consistency +- Webhook name max length is now 128 chars and not 256 for better API consistency +- API Key name max length is now 128 chars and not 256 for better API consistency +- Task name max length is now 128 chars and not 256 for better API consistency +- Platform name max length is now 128 chars and not 256 for better API consistency +- Webhooks payloads are now exactly the same as any of the API response objects +- New and consistent response format for all API object + new response examples in the docs + - Removed user roles attribute from user object (can be fetched from /v1/teams/memberships) ** + - Removed type attribute from session object response (used only internally) + - ** - might be changed before merging to master + +## Breaking Changes (Read before upgrading!) +- **Deprecated** `first` and `last` query params for documents list route in the database API +- **Deprecated** Deprectaed Pubjabi Translations ('pn') +- **Deprecated** `PATCH /account/prefs` is now updating the prefs payload and not just merging it +- **Deprecated** `PATCH /users/:userId/prefs` is now updating the prefs payload and not just merging it +- Switched order of limit and offset params in all the SDKs `listDocuments` method for better consistency +- Default `limit` param value in all the SDKs `listDocuments` method is now 25 for better consistency ## Bug Fixes @@ -41,15 +67,13 @@ - New OAuth adapter for PayPal sandbox - Fixed a bug making read permission overwrite write permission in some cases -## Breaking Changes -- **Deprecated** `first` and `last` query params for documents list route in the database API -- **Deprecated** Deprectaed Pubjabi Translations ('pn') - ## Security - Access to Health API now requires authentication with an API Key with access to `health.read` scope allowed - Added option to force HTTPS connection to the Appwrite server (_APP_OPTIONS_FORCE_HTTPS) - Now using your `_APP_SYSTEM_EMAIL_ADDRESS` as the email address for issuing and renewing SSL certificates +- Block iframe access to Appwrite console using the `X-Frame-Options` header. +- Fixed `roles` param input validator # Version 0.6.2 (PRE-RELEASE) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9e2bb82a65..78623e08fc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -101,8 +101,6 @@ When contributing code, please take into account the following considerations: Security and privacy are extremely important to Appwrite, developers, and users alike. Make sure to follow the best industry standards and practices. - - ## Dependencies Please avoid introducing new dependencies to Appwrite without consulting the team. New dependencies can be very helpful but also introduce new security and privacy issues, complexity, and impact total docker image size. @@ -124,7 +122,7 @@ This is also important for the Appwrite lead developers to be able to give techn To build a new version of the Appwrite server, all you need to do is run the build.sh file like this: ```bash -bash ./build.sh 1.0.0 +bash ./build.sh X.X.X ``` Before running the command, make sure you have proper write permissions to the Appwrite docker hub team. @@ -143,6 +141,27 @@ To run tests manually, use the Appwrite Docker CLI from your terminal: docker exec appwrite test ``` +## Benchmarking + +You can use WRK Docker image to benchmark the server performance. Benchmarking is extremely useful when you want to compare how the server behaves before and after a change has been applied. Replace [APPWRITE_HOSTNAME_OR_IP] with your Appwrite server hostname or IP. Note that localhost is not accessible from inside the WRK container. + +``` + Options: + -c, --connections Connections to keep open + -d, --duration Duration of test + -t, --threads Number of threads to use + + -s, --script Load Lua script file + -H, --header Add header to request + --latency Print latency statistics + --timeout Socket/request timeout + -v, --version Print version details +``` + +```bash +docker run --rm skandyla/wrk -t3 -c100 -d30 https://[APPWRITE_HOSTNAME_OR_IP] +``` + ## Code Maintenance We use some automation tools to help us keep a healthy code base. diff --git a/Dockerfile b/Dockerfile old mode 100644 new mode 100755 index 8a86a910fc..f71dc57ac1 --- a/Dockerfile +++ b/Dockerfile @@ -1,56 +1,65 @@ -FROM ubuntu:18.04 AS builder - -LABEL maintainer="team@appwrite.io" +FROM composer:2.0 as step0 ARG TESTING=false - -ENV TZ=Asia/Tel_Aviv \ - DEBIAN_FRONTEND=noninteractive \ - PHP_VERSION=7.4 \ - PHP_REDIS_VERSION=5.2.1 - -RUN \ - apt-get update && \ - 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 - 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 && \ - # 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 .. +ENV TESTING=$TESTING WORKDIR /usr/local/src/ -# Updating PHP Dependencies and Auto-loading... - -ENV TESTING=$TESTING - -COPY composer.* /usr/local/src/ +COPY composer.lock /usr/local/src/ +COPY composer.json /usr/local/src/ RUN composer update --ignore-platform-reqs --optimize-autoloader \ --no-plugins --no-scripts --prefer-dist \ `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi` -FROM ubuntu:18.04 +FROM php:7.4-cli-alpine as step1 + +ENV TZ=Asia/Tel_Aviv \ + PHP_REDIS_VERSION=5.3.1 \ + PHP_SWOOLE_VERSION=4.5.3 \ + PHP_XDEBUG_VERSION=sdebug_2_9-beta + +RUN \ + apk add --no-cache --virtual .deps \ + make \ + automake \ + autoconf \ + gcc \ + g++ \ + tar \ + wget \ + git \ + zlib-dev \ + brotli-dev + +RUN docker-php-ext-install sockets + +RUN \ + # Redis Extension + 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 && \ + ./configure && \ + make && make install && \ + cd .. && \ + ## Swoole Extension + git clone https://github.com/swoole/swoole-src.git && \ + cd swoole-src && \ + git checkout v$PHP_SWOOLE_VERSION && \ + phpize && \ + ./configure --enable-sockets --enable-http2 && \ + make && make install && \ + cd .. + +FROM php:7.4-cli-alpine as final + LABEL maintainer="team@appwrite.io" ARG VERSION=dev ENV TZ=Asia/Tel_Aviv \ - DEBIAN_FRONTEND=noninteractive \ - PHP_VERSION=7.4 \ + _APP_SERVER=swoole \ _APP_ENV=production \ _APP_DOMAIN=localhost \ _APP_DOMAIN_TARGET=localhost \ @@ -59,7 +68,7 @@ ENV TZ=Asia/Tel_Aviv \ _APP_OPTIONS_ABUSE=enabled \ _APP_OPTIONS_FORCE_HTTPS=disabled \ _APP_OPENSSL_KEY_V1=your-secret-key \ - _APP_STORAGE_LIMIT=104857600 \ + _APP_STORAGE_LIMIT=10000000 \ _APP_STORAGE_ANTIVIRUS=enabled \ _APP_REDIS_HOST=redis \ _APP_REDIS_PORT=6379 \ @@ -74,106 +83,92 @@ ENV TZ=Asia/Tel_Aviv \ _APP_STATSD_PORT=8125 \ _APP_SMTP_HOST=smtp \ _APP_SMTP_PORT=25 \ + _APP_FUNCTIONS_TIMEOUT=900 \ + _APP_FUNCTIONS_CONTAINERS=10 \ _APP_SETUP=self-hosted \ _APP_VERSION=$VERSION #ENV _APP_SMTP_SECURE '' #ENV _APP_SMTP_USERNAME '' #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/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 wget ca-certificates software-properties-common build-essential libpcre3-dev zlib1g-dev libssl-dev openssl gnupg htop supervisor && \ - 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 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 - 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 && \ - # Cleanup - cd ../ && \ - 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/* + apk update \ + && apk add --no-cache --virtual .deps \ + make \ + automake \ + autoconf \ + gcc \ + g++ \ + curl-dev \ + && apk add --no-cache \ + libstdc++ \ + yaml-dev \ + imagemagick \ + imagemagick-dev \ + certbot \ + docker-cli \ + && pecl install imagick yaml \ + && docker-php-ext-enable imagick yaml \ + && docker-php-ext-install sockets opcache pdo_mysql \ + && apk del .deps -# Set Upload Limit (default to 100MB) -RUN echo "upload_max_filesize = ${_APP_STORAGE_LIMIT}" >> /etc/php/$PHP_VERSION/fpm/conf.d/appwrite.ini -RUN echo "post_max_size = ${_APP_STORAGE_LIMIT}" >> /etc/php/$PHP_VERSION/fpm/conf.d/appwrite.ini +WORKDIR /usr/src/code -# Add logs file -RUN echo "" >> /var/log/appwrite.log +COPY --from=step0 /usr/local/src/vendor /usr/src/code/vendor +COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190902/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/ +COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190902/redis.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/ -# Nginx Configuration (with self-signed ssl certificates) -COPY ./docker/nginx.conf.template /etc/nginx/nginx.conf.template -COPY ./docker/ssl/cert.pem /etc/nginx/ssl/cert.pem -COPY ./docker/ssl/key.pem /etc/nginx/ssl/key.pem - -# PHP Configuration -RUN mkdir -p /var/run/php -COPY ./docker/www.conf /etc/php/$PHP_VERSION/fpm/pool.d/www.conf - -# Add PHP Source Code -COPY ./app /usr/share/nginx/html/app +# Add Source Code +COPY ./app /usr/src/code/app COPY ./bin /usr/local/bin -COPY ./docs /usr/share/nginx/html/docs -COPY ./public /usr/share/nginx/html/public -COPY ./src /usr/share/nginx/html/src -COPY --from=builder /usr/local/src/vendor /usr/share/nginx/html/vendor +COPY ./docs /usr/src/code/docs +COPY ./public /usr/src/code/public +COPY ./src /usr/src/code/src +# Set Volumes RUN mkdir -p /storage/uploads && \ mkdir -p /storage/cache && \ mkdir -p /storage/config && \ mkdir -p /storage/certificates && \ + mkdir -p /storage/functions && \ + mkdir -p /storage/debug && \ chown -Rf www-data.www-data /storage/uploads && chmod -Rf 0755 /storage/uploads && \ chown -Rf www-data.www-data /storage/cache && chmod -Rf 0755 /storage/cache && \ chown -Rf www-data.www-data /storage/config && chmod -Rf 0755 /storage/config && \ - chown -Rf www-data.www-data /storage/certificates && chmod -Rf 0755 /storage/certificates - -# Supervisord Conf -COPY ./docker/supervisord.conf /etc/supervisord.conf + chown -Rf www-data.www-data /storage/certificates && chmod -Rf 0755 /storage/certificates && \ + chown -Rf www-data.www-data /storage/functions && chmod -Rf 0755 /storage/functions && \ + chown -Rf www-data.www-data /storage/debug && chmod -Rf 0755 /storage/debug # Executables -RUN chmod +x /usr/local/bin/start -RUN chmod +x /usr/local/bin/doctor -RUN chmod +x /usr/local/bin/migrate -RUN chmod +x /usr/local/bin/test +RUN chmod +x /usr/local/bin/doctor && \ + chmod +x /usr/local/bin/install && \ + chmod +x /usr/local/bin/migrate && \ + chmod +x /usr/local/bin/schedule && \ + chmod +x /usr/local/bin/ssl && \ + chmod +x /usr/local/bin/test && \ + chmod +x /usr/local/bin/vars && \ + chmod +x /usr/local/bin/worker-audits && \ + chmod +x /usr/local/bin/worker-certificates && \ + chmod +x /usr/local/bin/worker-deletes && \ + chmod +x /usr/local/bin/worker-functions && \ + chmod +x /usr/local/bin/worker-mails && \ + chmod +x /usr/local/bin/worker-tasks && \ + chmod +x /usr/local/bin/worker-usage && \ + chmod +x /usr/local/bin/worker-webhooks # Letsencrypt Permissions RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/ +# Enable Extensions +RUN echo extension=swoole.so >> /usr/local/etc/php/conf.d/swoole.ini +RUN echo extension=redis.so >> /usr/local/etc/php/conf.d/redis.ini + +RUN echo "opcache.preload_user=www-data" >> /usr/local/etc/php/conf.d/appwrite.ini +RUN echo "opcache.preload=/usr/src/code/app/preload.php" >> /usr/local/etc/php/conf.d/appwrite.ini +RUN echo "opcache.enable_cli=1" >> /usr/local/etc/php/conf.d/appwrite.ini + EXPOSE 80 -WORKDIR /usr/share/nginx/html - -CMD ["/bin/bash", "/usr/local/bin/start"] +CMD [ "php", "app/http.php", "-dopcache.preload=opcache.preload=/usr/src/code/app/preload.php" ] diff --git a/Dockerfile.nginx b/Dockerfile.nginx new file mode 100644 index 0000000000..b7acd23a7f --- /dev/null +++ b/Dockerfile.nginx @@ -0,0 +1,185 @@ +FROM ubuntu:18.04 AS builder + +LABEL maintainer="team@appwrite.io" + +ARG TESTING=false + +ENV TZ=Asia/Tel_Aviv \ + DEBIAN_FRONTEND=noninteractive \ + PHP_VERSION=7.4 \ + PHP_REDIS_VERSION=5.2.1 + +RUN \ + apt-get update && \ + 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 + 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 && \ + # 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/ + +# Updating PHP Dependencies and Auto-loading... + +ENV TESTING=$TESTING + +COPY composer.* /usr/local/src/ + +RUN composer update --ignore-platform-reqs --optimize-autoloader \ + --no-plugins --no-scripts --prefer-dist \ + `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi` + +FROM ubuntu:18.04 +LABEL maintainer="team@appwrite.io" + +ARG VERSION=dev + +ENV TZ=Asia/Tel_Aviv \ + DEBIAN_FRONTEND=noninteractive \ + PHP_VERSION=7.4 \ + _APP_SERVER=nginx \ + _APP_ENV=production \ + _APP_DOMAIN=localhost \ + _APP_DOMAIN_TARGET=localhost \ + _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=10000000 \ + _APP_STORAGE_ANTIVIRUS=enabled \ + _APP_REDIS_HOST=redis \ + _APP_REDIS_PORT=6379 \ + _APP_DB_HOST=mariadb \ + _APP_DB_PORT=3306 \ + _APP_DB_USER=root \ + _APP_DB_PASS=password \ + _APP_DB_SCHEMA=appwrite \ + _APP_INFLUXDB_HOST=influxdb \ + _APP_INFLUXDB_PORT=8086 \ + _APP_STATSD_HOST=telegraf \ + _APP_STATSD_PORT=8125 \ + _APP_SMTP_HOST=smtp \ + _APP_SMTP_PORT=25 \ + _APP_SETUP=self-hosted \ + _APP_VERSION=$VERSION +#ENV _APP_SMTP_SECURE '' +#ENV _APP_SMTP_USERNAME '' +#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/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 wget ca-certificates software-properties-common build-essential libpcre3-dev zlib1g-dev libssl-dev openssl gnupg htop supervisor && \ + 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 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 certbot && \ + # 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 && \ + # Cleanup + cd ../ && \ + 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) +RUN echo "upload_max_filesize = ${_APP_STORAGE_LIMIT}" >> /etc/php/$PHP_VERSION/fpm/conf.d/appwrite.ini +RUN echo "post_max_size = ${_APP_STORAGE_LIMIT}" >> /etc/php/$PHP_VERSION/fpm/conf.d/appwrite.ini +RUN echo "opcache.preload_user=www-data" >> /etc/php/$PHP_VERSION/fpm/conf.d/appwrite.ini +RUN echo "opcache.preload=/usr/src/code/app/preload.php" >> /etc/php/$PHP_VERSION/fpm/conf.d/appwrite.ini +RUN echo "opcache.enable_cli = 1" >> /etc/php/$PHP_VERSION/fpm/conf.d/appwrite.ini + +# Add logs file +RUN echo "" >> /var/log/appwrite.log + +# Nginx Configuration (with self-signed ssl certificates) +COPY ./docker/nginx.conf.template /etc/nginx/nginx.conf.template +COPY ./docker/ssl/cert.pem /etc/nginx/ssl/cert.pem +COPY ./docker/ssl/key.pem /etc/nginx/ssl/key.pem + +# PHP Configuration +RUN mkdir -p /var/run/php +COPY ./docker/www.conf /etc/php/$PHP_VERSION/fpm/pool.d/www.conf + +# Add PHP Source Code +COPY ./app /usr/src/code/app +COPY ./bin /usr/local/bin +COPY ./docs /usr/src/code/docs +COPY ./public /usr/src/code/public +COPY ./src /usr/src/code/src +COPY --from=builder /usr/local/src/vendor /usr/src/code/vendor + +RUN mkdir -p /storage/uploads && \ + mkdir -p /storage/cache && \ + mkdir -p /storage/config && \ + mkdir -p /storage/certificates && \ + mkdir -p /storage/functions && \ + chown -Rf www-data.www-data /storage/uploads && chmod -Rf 0755 /storage/uploads && \ + chown -Rf www-data.www-data /storage/cache && chmod -Rf 0755 /storage/cache && \ + chown -Rf www-data.www-data /storage/config && chmod -Rf 0755 /storage/config && \ + chown -Rf www-data.www-data /storage/certificates && chmod -Rf 0755 /storage/certificates && \ + chown -Rf www-data.www-data /storage/functions && chmod -Rf 0755 /storage/functions + +# Supervisord Conf +COPY ./docker/supervisord.conf /etc/supervisord.conf + +# Executables +RUN chmod +x /usr/local/bin/start +RUN chmod +x /usr/local/bin/doctor +RUN chmod +x /usr/local/bin/migrate +RUN chmod +x /usr/local/bin/test + +# Letsencrypt Permissions +RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/ + +EXPOSE 80 + +WORKDIR /usr/src/code + +CMD ["/bin/bash", "/usr/local/bin/start"] diff --git a/README.md b/README.md index 198964dcbd..4013df3eb3 100644 --- a/README.md +++ b/README.md @@ -50,9 +50,8 @@ The easiest way to start running your Appwrite server is by running our docker-c ```bash 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 + --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ + appwrite/appwrite:0.7.0 ``` ### Windows @@ -62,9 +61,8 @@ docker run -it --rm \ ```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 + --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^ + appwrite/appwrite:0.7.0 ``` #### PowerShell @@ -72,9 +70,8 @@ docker run -it --rm ^ ```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 + --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw , + appwrite/appwrite:0.7.0 ``` 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. @@ -99,6 +96,7 @@ Getting started with Appwrite is as easy as creating a new project, choosing you * [**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. +* [**Functions**](https://appwrite.io/docs/server/functions) - Customize your Appwrite server by executing your custom code in an isolate environment, you can trigger your code on any Appwrite system event, manually or using a CRON schedule. * [**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. diff --git a/app/cli.php b/app/cli.php new file mode 100644 index 0000000000..c887493bbb --- /dev/null +++ b/app/cli.php @@ -0,0 +1,26 @@ +#!/bin/env php +task('version') + ->desc('Get the server version') + ->action(function () { + Console::log(App::getEnv('_APP_VERSION', 'UNKNOWN')); + }); + +$cli->run(); \ No newline at end of file diff --git a/app/config/collections.php b/app/config/collections.php index 3141419c1b..07b2d22811 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -1,11 +1,10 @@ [ @@ -36,13 +35,7 @@ $collections = [ 'name' => 'Localhost', 'type' => 'web', 'hostname' => 'localhost', - ], - [ - '$collection' => Database::SYSTEM_COLLECTION_PLATFORMS, - 'name' => 'Current Host', - 'type' => 'web', - 'hostname' => \parse_url('https://'.$request->getServer('HTTP_HOST'), PHP_URL_HOST), - ], + ], // Current host is added on app init ], 'legalName' => '', 'legalCountry' => '', @@ -50,9 +43,9 @@ $collections = [ 'legalCity' => '', 'legalAddress' => '', 'legalTaxId' => '', - 'authWhitelistEmails' => (!empty($request->getServer('_APP_CONSOLE_WHITELIST_EMAILS', null))) ? \explode(',', $request->getServer('_APP_CONSOLE_WHITELIST_EMAILS', null)) : [], - 'authWhitelistIPs' => (!empty($request->getServer('_APP_CONSOLE_WHITELIST_IPS', null))) ? \explode(',', $request->getServer('_APP_CONSOLE_WHITELIST_IPS', null)) : [], - 'authWhitelistDomains' => (!empty($request->getServer('_APP_CONSOLE_WHITELIST_DOMAINS', null))) ? \explode(',', $request->getServer('_APP_CONSOLE_WHITELIST_DOMAINS', null)) : [], + 'authWhitelistEmails' => (!empty(App::getEnv('_APP_CONSOLE_WHITELIST_EMAILS', null))) ? \explode(',', App::getEnv('_APP_CONSOLE_WHITELIST_EMAILS', null)) : [], + 'authWhitelistIPs' => (!empty(App::getEnv('_APP_CONSOLE_WHITELIST_IPS', null))) ? \explode(',', App::getEnv('_APP_CONSOLE_WHITELIST_IPS', null)) : [], + 'authWhitelistDomains' => (!empty(App::getEnv('_APP_CONSOLE_WHITELIST_DOMAINS', null))) ? \explode(',', App::getEnv('_APP_CONSOLE_WHITELIST_DOMAINS', null)) : [], ], Database::SYSTEM_COLLECTION_COLLECTIONS => [ '$collection' => Database::SYSTEM_COLLECTION_COLLECTIONS, @@ -65,7 +58,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Name', 'key' => 'name', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => true, 'array' => false, @@ -74,7 +67,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Date Created', 'key' => 'dateCreated', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => 0, 'required' => false, 'array' => false, @@ -83,7 +76,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Date Updated', 'key' => 'dateUpdated', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => 0, 'required' => false, 'array' => false, @@ -92,7 +85,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Structure', 'key' => 'structure', - 'type' => 'boolean', + 'type' => Database::SYSTEM_VAR_TYPE_BOOLEAN, 'default' => false, 'required' => true, 'array' => false, @@ -101,7 +94,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Rules', 'key' => 'rules', - 'type' => 'document', + 'type' => Database::SYSTEM_VAR_TYPE_DOCUMENT, 'default' => [], 'required' => true, 'array' => true, @@ -120,7 +113,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Label', 'key' => 'label', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => true, 'array' => false, @@ -129,7 +122,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Key', 'key' => 'key', - 'type' => 'key', + 'type' => Database::SYSTEM_VAR_TYPE_KEY, 'default' => '', 'required' => true, 'array' => false, @@ -138,7 +131,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Type', 'key' => 'type', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => true, 'array' => false, @@ -147,7 +140,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Default', 'key' => 'default', - 'type' => 'wildcard', + 'type' => Database::SYSTEM_VAR_TYPE_WILDCARD, 'default' => '', 'required' => false, 'array' => false, @@ -156,7 +149,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Required', 'key' => 'required', - 'type' => 'boolean', + 'type' => Database::SYSTEM_VAR_TYPE_BOOLEAN, 'default' => true, 'required' => true, 'array' => false, @@ -165,7 +158,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Array', 'key' => 'array', - 'type' => 'boolean', + 'type' => Database::SYSTEM_VAR_TYPE_BOOLEAN, 'default' => true, 'required' => true, 'array' => false, @@ -174,7 +167,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'list', 'key' => 'list', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, //'default' => '', 'required' => false, 'array' => true, @@ -192,7 +185,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Name', 'key' => 'name', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -201,7 +194,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Email', 'key' => 'email', - 'type' => 'email', + 'type' => Database::SYSTEM_VAR_TYPE_EMAIL, 'default' => '', 'required' => true, 'array' => false, @@ -210,7 +203,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Status', 'key' => 'status', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => '', 'required' => true, 'array' => false, @@ -219,7 +212,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Password', 'key' => 'password', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => true, 'array' => false, @@ -228,7 +221,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Password Update Date', 'key' => 'password-update', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => '', 'required' => true, 'array' => false, @@ -237,16 +230,17 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Prefs', 'key' => 'prefs', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, + 'filter' => ['json'] ], [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Registration Date', 'key' => 'registration', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => '', 'required' => true, 'array' => false, @@ -255,7 +249,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Email Verification Status', 'key' => 'emailVerification', - 'type' => 'boolean', + 'type' => Database::SYSTEM_VAR_TYPE_BOOLEAN, 'default' => '', 'required' => true, 'array' => false, @@ -264,7 +258,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Reset', 'key' => 'reset', - 'type' => 'boolean', + 'type' => Database::SYSTEM_VAR_TYPE_BOOLEAN, 'default' => '', 'required' => true, 'array' => false, @@ -273,7 +267,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Tokens', 'key' => 'tokens', - 'type' => 'document', + 'type' => Database::SYSTEM_VAR_TYPE_DOCUMENT, 'default' => [], 'required' => false, 'array' => true, @@ -283,7 +277,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Memberships', 'key' => 'memberships', - 'type' => 'document', + 'type' => Database::SYSTEM_VAR_TYPE_DOCUMENT, 'default' => [], 'required' => false, 'array' => true, @@ -302,7 +296,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Type', 'key' => 'type', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => null, 'required' => true, 'array' => false, @@ -311,7 +305,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Secret', 'key' => 'secret', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => true, 'array' => false, @@ -320,7 +314,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Expire', 'key' => 'expire', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => 0, 'required' => true, 'array' => false, @@ -329,7 +323,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'User Agent', 'key' => 'userAgent', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => true, 'array' => false, @@ -338,11 +332,128 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'IP', 'key' => 'ip', - 'type' => 'ip', + 'type' => Database::SYSTEM_VAR_TYPE_IP, 'default' => '', 'required' => true, 'array' => false, ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'OS Code', + 'key' => 'osCode', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'OS Name', + 'key' => 'osName', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'OS Version', + 'key' => 'osVersion', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Client Type', + 'key' => 'clientType', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Client Code', + 'key' => 'clientCode', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Client Name', + 'key' => 'clientName', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Client Version', + 'key' => 'clientVersion', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Client Engine', + 'key' => 'clientEngine', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Client Engine Version', + 'key' => 'clientEngineVersion', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Device Name', + 'key' => 'deviceName', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Device Brand', + 'key' => 'deviceBrand', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Device Model', + 'key' => 'deviceModel', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Country Code', + 'key' => 'countryCode', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], ], ], Database::SYSTEM_COLLECTION_MEMBERSHIPS => [ @@ -356,7 +467,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Team ID', 'key' => 'teamId', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => null, 'required' => true, 'array' => false, @@ -365,7 +476,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'User ID', 'key' => 'userId', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => null, 'required' => true, 'array' => false, @@ -374,7 +485,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Roles', 'key' => 'roles', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => true, 'array' => true, @@ -383,7 +494,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Invited', 'key' => 'invited', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => 0, 'required' => false, //FIXME SHOULD BE REQUIRED 'array' => false, @@ -392,7 +503,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Joined', 'key' => 'joined', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => 0, 'required' => true, 'array' => false, @@ -401,7 +512,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Confirm', 'key' => 'confirm', - 'type' => 'boolean', + 'type' => Database::SYSTEM_VAR_TYPE_BOOLEAN, 'default' => '', 'required' => true, 'array' => false, @@ -410,7 +521,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Secret', 'key' => 'secret', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -428,7 +539,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Name', 'key' => 'name', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => true, 'array' => false, @@ -437,7 +548,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Date Created', 'key' => 'dateCreated', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => '', 'required' => false, 'array' => false, @@ -446,7 +557,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Sum', 'key' => 'sum', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => '', 'required' => false, 'array' => false, @@ -464,7 +575,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Name', 'key' => 'name', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => null, 'required' => true, 'array' => false, @@ -473,7 +584,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Description', 'key' => 'description', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => null, 'required' => false, 'array' => false, @@ -482,7 +593,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Logo', 'key' => 'logo', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, ], @@ -490,7 +601,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'URL', 'key' => 'url', - 'type' => 'url', + 'type' => Database::SYSTEM_VAR_TYPE_URL, 'default' => '', 'required' => false, ], @@ -498,7 +609,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Team ID', 'key' => 'teamId', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => 0, 'required' => true, 'array' => false, @@ -507,7 +618,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Legal Name', 'key' => 'legalName', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, ], @@ -515,7 +626,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Legal Country', 'key' => 'legalCountry', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, ], @@ -523,7 +634,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Legal State', 'key' => 'legalState', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, ], @@ -531,7 +642,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Legal City', 'key' => 'legalCity', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, ], @@ -539,7 +650,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Legal Address', 'key' => 'legalAddress', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, ], @@ -547,7 +658,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Legal Tax ID', 'key' => 'legalTaxId', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, ], @@ -555,7 +666,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Webhooks', 'key' => 'webhooks', - 'type' => 'document', + 'type' => Database::SYSTEM_VAR_TYPE_DOCUMENT, 'default' => [], 'required' => false, 'array' => true, @@ -565,7 +676,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'API Keys', 'key' => 'keys', - 'type' => 'document', + 'type' => Database::SYSTEM_VAR_TYPE_DOCUMENT, 'default' => [], 'required' => false, 'array' => true, @@ -575,7 +686,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Tasks', 'key' => 'tasks', - 'type' => 'document', + 'type' => Database::SYSTEM_VAR_TYPE_DOCUMENT, 'default' => [], 'required' => false, 'array' => true, @@ -585,7 +696,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Platforms', 'key' => 'platforms', - 'type' => 'document', + 'type' => Database::SYSTEM_VAR_TYPE_DOCUMENT, 'default' => [], 'required' => false, 'array' => true, @@ -595,7 +706,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Domains', 'key' => 'domains', - 'type' => 'document', + 'type' => Database::SYSTEM_VAR_TYPE_DOCUMENT, 'default' => [], 'required' => false, 'array' => true, @@ -614,7 +725,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Name', 'key' => 'name', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => null, 'required' => true, 'array' => false, @@ -623,7 +734,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Events', 'key' => 'events', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => null, 'required' => false, 'array' => true, @@ -632,7 +743,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'URL', 'key' => 'url', - 'type' => 'url', + 'type' => Database::SYSTEM_VAR_TYPE_URL, 'default' => '', 'required' => false, 'array' => false, @@ -641,7 +752,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Security', 'key' => 'security', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_BOOLEAN, 'default' => '', 'required' => false, 'array' => false, @@ -650,7 +761,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'HTTP User', 'key' => 'httpUser', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -659,10 +770,11 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'HTTP Password', 'key' => 'httpPass', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, + 'filter' => ['encrypt'], ], ], ], @@ -677,7 +789,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Name', 'key' => 'name', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => null, 'required' => true, 'array' => false, @@ -686,7 +798,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Scopes', 'key' => 'scopes', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => null, 'required' => false, 'array' => true, @@ -695,7 +807,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Secret', 'key' => 'secret', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, ], @@ -712,7 +824,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Name', 'key' => 'name', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => null, 'required' => true, 'array' => false, @@ -721,7 +833,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Status', 'key' => 'status', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -730,7 +842,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Updated', 'key' => 'updated', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => '', 'required' => false, 'array' => false, @@ -739,7 +851,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Schedule', 'key' => 'schedule', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -748,7 +860,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Previous', 'key' => 'previous', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => '', 'required' => false, 'array' => false, @@ -757,7 +869,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Next', 'key' => 'next', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => '', 'required' => false, 'array' => false, @@ -766,7 +878,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Duration', 'key' => 'duration', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => '', 'required' => false, 'array' => false, @@ -775,7 +887,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Delay', 'key' => 'delay', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => '', 'required' => false, 'array' => false, @@ -784,7 +896,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Security', 'key' => 'security', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_BOOLEAN, 'default' => '', 'required' => false, 'array' => false, @@ -793,7 +905,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'HTTP Method', 'key' => 'httpMethod', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -802,7 +914,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'HTTP URL', 'key' => 'httpUrl', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -811,7 +923,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'HTTP Headers', 'key' => 'httpHeaders', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => null, 'required' => false, 'array' => true, @@ -820,7 +932,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'HTTP User', 'key' => 'httpUser', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -829,16 +941,17 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'HTTP Password', 'key' => 'httpPass', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, + 'filter' => ['encrypt'], ], [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Log', 'key' => 'log', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -847,7 +960,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Failures', 'key' => 'failures', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => '', 'required' => false, 'array' => false, @@ -865,7 +978,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Type', 'key' => 'type', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => null, 'required' => true, 'array' => false, @@ -874,7 +987,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Name', 'key' => 'name', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => null, 'required' => true, 'array' => false, @@ -883,7 +996,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Date Created', 'key' => 'dateCreated', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => 0, 'required' => false, 'array' => false, @@ -892,7 +1005,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Date Updated', 'key' => 'dateUpdated', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => 0, 'required' => false, 'array' => false, @@ -901,7 +1014,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Key', 'key' => 'key', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -910,7 +1023,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Store', 'key' => 'store', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -919,7 +1032,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Hostname', 'key' => 'hostname', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -937,7 +1050,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Domain', 'key' => 'domain', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => null, 'required' => true, 'array' => false, @@ -946,7 +1059,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Updated', 'key' => 'updated', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => 0, 'required' => false, 'array' => false, @@ -955,7 +1068,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Top Level Domain', 'key' => 'tld', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -964,7 +1077,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Registerable Domain', 'key' => 'registerable', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -973,7 +1086,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Verification', 'key' => 'verification', - 'type' => 'boolean', + 'type' => Database::SYSTEM_VAR_TYPE_BOOLEAN, 'default' => false, 'required' => true, 'array' => false, @@ -982,7 +1095,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Certificate ID', 'key' => 'certificateId', - 'type' => 'key', + 'type' => Database::SYSTEM_VAR_TYPE_KEY, 'default' => '', 'required' => false, 'array' => false, @@ -1000,7 +1113,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Domain', 'key' => 'domain', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => null, 'required' => true, 'array' => false, @@ -1009,7 +1122,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Issue Date', 'key' => 'issueDate', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => 0, 'required' => false, 'array' => false, @@ -1018,7 +1131,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Renew Date', 'key' => 'renewDate', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => 0, 'required' => false, 'array' => false, @@ -1027,7 +1140,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Attempts', 'key' => 'attempts', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => 0, 'required' => false, 'array' => false, @@ -1036,7 +1149,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Log', 'key' => 'log', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -1054,7 +1167,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Date Created', 'key' => 'dateCreated', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => 0, 'required' => false, 'array' => false, @@ -1063,7 +1176,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Folder ID', 'key' => 'folderId', - 'type' => 'key', + 'type' => Database::SYSTEM_VAR_TYPE_KEY, 'default' => 0, 'required' => false, 'array' => false, @@ -1072,7 +1185,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Name', 'key' => 'name', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => true, 'array' => false, @@ -1081,7 +1194,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Path', 'key' => 'path', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => true, 'array' => false, @@ -1090,7 +1203,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Signature', 'key' => 'signature', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => true, 'array' => false, @@ -1099,7 +1212,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Mime Type', 'key' => 'mimeType', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => true, 'array' => false, @@ -1108,7 +1221,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Original Size', 'key' => 'sizeOriginal', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => 0, 'required' => true, 'array' => false, @@ -1117,7 +1230,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Actual Size', 'key' => 'sizeActual', - 'type' => 'numeric', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, 'default' => 0, 'required' => true, 'array' => false, @@ -1126,7 +1239,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Algorithm', 'key' => 'algorithm', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => true, 'array' => false, @@ -1135,7 +1248,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Token', 'key' => 'token', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => true, 'array' => false, @@ -1144,7 +1257,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Comment', 'key' => 'comment', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -1153,7 +1266,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'File OpenSSL Version', 'key' => 'fileOpenSSLVersion', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -1162,7 +1275,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'File OpenSSL Cipher', 'key' => 'fileOpenSSLCipher', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -1171,7 +1284,7 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'File OpenSSL Tag', 'key' => 'fileOpenSSLTag', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -1180,13 +1293,282 @@ $collections = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'File OpenSSL IV', 'key' => 'fileOpenSSLIV', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, ], ], ], + Database::SYSTEM_COLLECTION_FUNCTIONS => [ + '$collection' => Database::SYSTEM_COLLECTION_COLLECTIONS, + '$id' => Database::SYSTEM_COLLECTION_FUNCTIONS, + '$permissions' => ['read' => ['*']], + 'name' => 'Functions', + 'structure' => true, + 'rules' => [ + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Date Created', + 'key' => 'dateCreated', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, + 'default' => 0, + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Date Updated', + 'key' => 'dateUpdated', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, + 'default' => 0, + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Status', + 'key' => 'status', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Name', + 'key' => 'name', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Env', + 'key' => 'env', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Tag', + 'key' => 'tag', + 'type' => Database::SYSTEM_VAR_TYPE_KEY, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Vars', + 'key' => 'vars', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + 'filter' => ['json', 'encrypt'] + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Events', + 'key' => 'events', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => true, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Schedule', + 'key' => 'schedule', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Previous', + 'key' => 'previous', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Next', + 'key' => 'next', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Timeout', + 'key' => 'timeout', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, + 'default' => '', + 'required' => false, + 'array' => false, + ], + ], + ], + Database::SYSTEM_COLLECTION_TAGS => [ + '$collection' => Database::SYSTEM_COLLECTION_COLLECTIONS, + '$id' => Database::SYSTEM_COLLECTION_TAGS, + '$permissions' => ['read' => ['*']], + 'name' => 'Tags', + 'structure' => true, + 'rules' => [ + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Date Created', + 'key' => 'dateCreated', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, + 'default' => 0, + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Function ID', + 'key' => 'functionId', + 'type' => Database::SYSTEM_VAR_TYPE_KEY, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Command', + 'key' => 'command', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Code Path', + 'key' => 'path', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Code Size', + 'key' => 'size', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, + 'default' => '', + 'required' => false, + 'array' => false, + ], + ], + ], + Database::SYSTEM_COLLECTION_EXECUTIONS => [ + '$collection' => Database::SYSTEM_COLLECTION_COLLECTIONS, + '$id' => Database::SYSTEM_COLLECTION_EXECUTIONS, + '$permissions' => ['read' => ['*']], + 'name' => 'Executions', + 'structure' => true, + 'rules' => [ + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Date Created', + 'key' => 'dateCreated', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, + 'default' => 0, + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Function ID', + 'key' => 'functionId', + 'type' => Database::SYSTEM_VAR_TYPE_KEY, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Tag ID', + 'key' => 'tagId', + 'type' => Database::SYSTEM_VAR_TYPE_KEY, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Trigger', + 'key' => 'trigger', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Status', + 'key' => 'status', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Exit Code', + 'key' => 'exitCode', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Stdout', + 'key' => 'stdout', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Stderr', + 'key' => 'stderr', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'default' => '', + 'required' => false, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + 'label' => 'Time', + 'key' => 'time', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, + 'default' => '', + 'required' => false, + 'array' => false, + ], + ], + ], + Database::SYSTEM_COLLECTION_RESERVED => [ + '$collection' => Database::SYSTEM_COLLECTION_COLLECTIONS, + '$id' => Database::SYSTEM_COLLECTION_RESERVED, + '$permissions' => ['read' => ['*']], + 'name' => 'Reserved', + 'structure' => true, + ], ]; /* @@ -1201,7 +1583,7 @@ foreach ($providers as $index => $provider) { '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'OAuth2 '.\ucfirst($index).' ID', 'key' => 'usersOauth2'.\ucfirst($index).'Appid', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -1211,17 +1593,18 @@ foreach ($providers as $index => $provider) { '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'OAuth2 '.\ucfirst($index).' Secret', 'key' => 'usersOauth2'.\ucfirst($index).'Secret', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, + 'filter' => ['encrypt'], ]; $collections[Database::SYSTEM_COLLECTION_USERS]['rules'][] = [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'OAuth2 '.\ucfirst($index).' ID', 'key' => 'oauth2'.\ucfirst($index), - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, @@ -1231,7 +1614,7 @@ foreach ($providers as $index => $provider) { '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'OAuth2 '.\ucfirst($index).' Access Token', 'key' => 'oauth2'.\ucfirst($index).'AccessToken', - 'type' => 'text', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, 'array' => false, diff --git a/app/config/environments.php b/app/config/environments.php new file mode 100644 index 0000000000..cd312555a5 --- /dev/null +++ b/app/config/environments.php @@ -0,0 +1,46 @@ + [ + 'name' => 'Node.js', + 'version' => '14.5', + 'base' => 'node:14.5-alpine', + 'image' => 'appwrite/env-node:14.5', + 'logo' => 'node.png', + ], + 'php-7.4' => [ + 'name' => 'PHP', + 'version' => '7.4', + 'base' => 'php:7.4-cli-alpine', + 'image' => 'appwrite/env-php:7.4', + 'logo' => 'php.png', + ], + 'ruby-2.7' => [ + 'name' => 'Ruby', + 'version' => '2.7', + 'base' => 'ruby:2.7-alpine', + 'image' => 'appwrite/env-ruby:2.7', + 'logo' => 'ruby.png', + ], + 'python-3.8' => [ + 'name' => 'Python', + 'version' => '3.8', + 'base' => 'python:3.8-alpine', + 'image' => 'appwrite/env-python:3.8', + 'logo' => 'python.png', + ], + 'deno-1.2' => [ + 'name' => 'Deno', + 'version' => '1.2', + 'base' => 'hayd/deno:alpine-1.2.0', + 'image' => 'appwrite/env-deno:1.2', + 'logo' => 'deno.png', + ], + // 'dart-2.8' => [ + // 'name' => 'Dart', + // 'version' => '2.8', + // 'base' => 'google/dart:2.8', + // 'image' => 'appwrite/env-dart:2.8', + // 'logo' => 'dart.png', + // ], +]; \ No newline at end of file diff --git a/app/config/events.php b/app/config/events.php index aeee6849f2..34c4a4f2de 100644 --- a/app/config/events.php +++ b/app/config/events.php @@ -55,4 +55,16 @@ return [ 'storage.files.delete' => [ 'description' => 'This event triggers when a storage file is deleted.', ], + 'users.create' => [ + 'description' => 'This event triggers when a user is created from the users API.', + ], + 'users.update.status' => [ + 'description' => 'This event triggers when a user status is updated from the users API.', + ], + 'users.delete' => [ + 'description' => 'This event triggers when a user is deleted from users API.', + ], + 'users.sessions.delete' => [ + 'description' => 'This event triggers when a user session is deleted from users API.', + ], ]; \ No newline at end of file diff --git a/app/config/locales.php b/app/config/locale/codes.php similarity index 100% rename from app/config/locales.php rename to app/config/locale/codes.php diff --git a/app/config/currencies.php b/app/config/locale/currencies.php similarity index 100% rename from app/config/currencies.php rename to app/config/locale/currencies.php diff --git a/app/config/eu.php b/app/config/locale/eu.php similarity index 100% rename from app/config/eu.php rename to app/config/locale/eu.php diff --git a/app/config/languages.php b/app/config/locale/languages.php similarity index 100% rename from app/config/languages.php rename to app/config/locale/languages.php diff --git a/app/config/phones.php b/app/config/locale/phones.php similarity index 100% rename from app/config/phones.php rename to app/config/locale/phones.php diff --git a/app/config/locales/templates/_base.tpl b/app/config/locale/templates/email-base.tpl similarity index 100% rename from app/config/locales/templates/_base.tpl rename to app/config/locale/templates/email-base.tpl diff --git a/app/config/locales/templates/_cta.tpl b/app/config/locale/templates/email-cta.tpl similarity index 100% rename from app/config/locales/templates/_cta.tpl rename to app/config/locale/templates/email-cta.tpl diff --git a/app/config/locales/af.continents.php b/app/config/locale/translations/af.continents.php similarity index 100% rename from app/config/locales/af.continents.php rename to app/config/locale/translations/af.continents.php diff --git a/app/config/locales/af.countries.php b/app/config/locale/translations/af.countries.php similarity index 100% rename from app/config/locales/af.countries.php rename to app/config/locale/translations/af.countries.php diff --git a/app/config/locales/af.php b/app/config/locale/translations/af.php similarity index 100% rename from app/config/locales/af.php rename to app/config/locale/translations/af.php diff --git a/app/config/locales/ar.continents.php b/app/config/locale/translations/ar.continents.php similarity index 100% rename from app/config/locales/ar.continents.php rename to app/config/locale/translations/ar.continents.php diff --git a/app/config/locales/ar.countries.php b/app/config/locale/translations/ar.countries.php similarity index 100% rename from app/config/locales/ar.countries.php rename to app/config/locale/translations/ar.countries.php diff --git a/app/config/locales/ar.php b/app/config/locale/translations/ar.php similarity index 100% rename from app/config/locales/ar.php rename to app/config/locale/translations/ar.php diff --git a/app/config/locales/bn.continents.php b/app/config/locale/translations/bn.continents.php similarity index 100% rename from app/config/locales/bn.continents.php rename to app/config/locale/translations/bn.continents.php diff --git a/app/config/locales/bn.countries.php b/app/config/locale/translations/bn.countries.php similarity index 100% rename from app/config/locales/bn.countries.php rename to app/config/locale/translations/bn.countries.php diff --git a/app/config/locales/bn.php b/app/config/locale/translations/bn.php similarity index 100% rename from app/config/locales/bn.php rename to app/config/locale/translations/bn.php diff --git a/app/config/locales/cat.continents.php b/app/config/locale/translations/cat.continents.php similarity index 100% rename from app/config/locales/cat.continents.php rename to app/config/locale/translations/cat.continents.php diff --git a/app/config/locales/cat.countries.php b/app/config/locale/translations/cat.countries.php similarity index 100% rename from app/config/locales/cat.countries.php rename to app/config/locale/translations/cat.countries.php diff --git a/app/config/locales/cat.php b/app/config/locale/translations/cat.php similarity index 100% rename from app/config/locales/cat.php rename to app/config/locale/translations/cat.php diff --git a/app/config/locales/cz.continents.php b/app/config/locale/translations/cz.continents.php similarity index 100% rename from app/config/locales/cz.continents.php rename to app/config/locale/translations/cz.continents.php diff --git a/app/config/locales/cz.countries.php b/app/config/locale/translations/cz.countries.php similarity index 100% rename from app/config/locales/cz.countries.php rename to app/config/locale/translations/cz.countries.php diff --git a/app/config/locales/cz.php b/app/config/locale/translations/cz.php similarity index 100% rename from app/config/locales/cz.php rename to app/config/locale/translations/cz.php diff --git a/app/config/locales/de.continents.php b/app/config/locale/translations/de.continents.php similarity index 100% rename from app/config/locales/de.continents.php rename to app/config/locale/translations/de.continents.php diff --git a/app/config/locales/de.countries.php b/app/config/locale/translations/de.countries.php similarity index 100% rename from app/config/locales/de.countries.php rename to app/config/locale/translations/de.countries.php diff --git a/app/config/locales/de.php b/app/config/locale/translations/de.php similarity index 100% rename from app/config/locales/de.php rename to app/config/locale/translations/de.php diff --git a/app/config/locales/en.continents.php b/app/config/locale/translations/en.continents.php similarity index 100% rename from app/config/locales/en.continents.php rename to app/config/locale/translations/en.continents.php diff --git a/app/config/locales/en.countries.php b/app/config/locale/translations/en.countries.php similarity index 100% rename from app/config/locales/en.countries.php rename to app/config/locale/translations/en.countries.php diff --git a/app/config/locales/en.php b/app/config/locale/translations/en.php similarity index 100% rename from app/config/locales/en.php rename to app/config/locale/translations/en.php diff --git a/app/config/locales/es.continents.php b/app/config/locale/translations/es.continents.php similarity index 100% rename from app/config/locales/es.continents.php rename to app/config/locale/translations/es.continents.php diff --git a/app/config/locales/es.countries.php b/app/config/locale/translations/es.countries.php similarity index 100% rename from app/config/locales/es.countries.php rename to app/config/locale/translations/es.countries.php diff --git a/app/config/locales/es.php b/app/config/locale/translations/es.php similarity index 100% rename from app/config/locales/es.php rename to app/config/locale/translations/es.php diff --git a/app/config/locales/fi.continents.php b/app/config/locale/translations/fi.continents.php similarity index 100% rename from app/config/locales/fi.continents.php rename to app/config/locale/translations/fi.continents.php diff --git a/app/config/locales/fi.countries.php b/app/config/locale/translations/fi.countries.php similarity index 100% rename from app/config/locales/fi.countries.php rename to app/config/locale/translations/fi.countries.php diff --git a/app/config/locales/fi.php b/app/config/locale/translations/fi.php similarity index 100% rename from app/config/locales/fi.php rename to app/config/locale/translations/fi.php diff --git a/app/config/locales/fo.continents.php b/app/config/locale/translations/fo.continents.php similarity index 100% rename from app/config/locales/fo.continents.php rename to app/config/locale/translations/fo.continents.php diff --git a/app/config/locales/fo.countries.php b/app/config/locale/translations/fo.countries.php similarity index 100% rename from app/config/locales/fo.countries.php rename to app/config/locale/translations/fo.countries.php diff --git a/app/config/locales/fo.php b/app/config/locale/translations/fo.php similarity index 100% rename from app/config/locales/fo.php rename to app/config/locale/translations/fo.php diff --git a/app/config/locales/fr.continents.php b/app/config/locale/translations/fr.continents.php similarity index 100% rename from app/config/locales/fr.continents.php rename to app/config/locale/translations/fr.continents.php diff --git a/app/config/locales/fr.countries.php b/app/config/locale/translations/fr.countries.php similarity index 100% rename from app/config/locales/fr.countries.php rename to app/config/locale/translations/fr.countries.php diff --git a/app/config/locales/fr.php b/app/config/locale/translations/fr.php similarity index 100% rename from app/config/locales/fr.php rename to app/config/locale/translations/fr.php diff --git a/app/config/locales/gr.continents.php b/app/config/locale/translations/gr.continents.php similarity index 100% rename from app/config/locales/gr.continents.php rename to app/config/locale/translations/gr.continents.php diff --git a/app/config/locales/gr.countries.php b/app/config/locale/translations/gr.countries.php similarity index 100% rename from app/config/locales/gr.countries.php rename to app/config/locale/translations/gr.countries.php diff --git a/app/config/locales/gr.php b/app/config/locale/translations/gr.php similarity index 100% rename from app/config/locales/gr.php rename to app/config/locale/translations/gr.php diff --git a/app/config/locales/he.continents.php b/app/config/locale/translations/he.continents.php similarity index 100% rename from app/config/locales/he.continents.php rename to app/config/locale/translations/he.continents.php diff --git a/app/config/locales/he.countries.php b/app/config/locale/translations/he.countries.php similarity index 100% rename from app/config/locales/he.countries.php rename to app/config/locale/translations/he.countries.php diff --git a/app/config/locales/he.php b/app/config/locale/translations/he.php similarity index 100% rename from app/config/locales/he.php rename to app/config/locale/translations/he.php diff --git a/app/config/locales/hi.continents.php b/app/config/locale/translations/hi.continents.php similarity index 100% rename from app/config/locales/hi.continents.php rename to app/config/locale/translations/hi.continents.php diff --git a/app/config/locales/hi.countries.php b/app/config/locale/translations/hi.countries.php similarity index 100% rename from app/config/locales/hi.countries.php rename to app/config/locale/translations/hi.countries.php diff --git a/app/config/locales/hi.php b/app/config/locale/translations/hi.php similarity index 100% rename from app/config/locales/hi.php rename to app/config/locale/translations/hi.php diff --git a/app/config/locales/hu.continents.php b/app/config/locale/translations/hu.continents.php similarity index 100% rename from app/config/locales/hu.continents.php rename to app/config/locale/translations/hu.continents.php diff --git a/app/config/locales/hu.countries.php b/app/config/locale/translations/hu.countries.php similarity index 100% rename from app/config/locales/hu.countries.php rename to app/config/locale/translations/hu.countries.php diff --git a/app/config/locales/hu.php b/app/config/locale/translations/hu.php similarity index 100% rename from app/config/locales/hu.php rename to app/config/locale/translations/hu.php diff --git a/app/config/locales/hy.continents.php b/app/config/locale/translations/hy.continents.php similarity index 100% rename from app/config/locales/hy.continents.php rename to app/config/locale/translations/hy.continents.php diff --git a/app/config/locales/hy.countries.php b/app/config/locale/translations/hy.countries.php similarity index 100% rename from app/config/locales/hy.countries.php rename to app/config/locale/translations/hy.countries.php diff --git a/app/config/locales/hy.php b/app/config/locale/translations/hy.php similarity index 100% rename from app/config/locales/hy.php rename to app/config/locale/translations/hy.php diff --git a/app/config/locales/id.continents.php b/app/config/locale/translations/id.continents.php similarity index 100% rename from app/config/locales/id.continents.php rename to app/config/locale/translations/id.continents.php diff --git a/app/config/locales/id.countries.php b/app/config/locale/translations/id.countries.php similarity index 100% rename from app/config/locales/id.countries.php rename to app/config/locale/translations/id.countries.php diff --git a/app/config/locales/id.php b/app/config/locale/translations/id.php similarity index 100% rename from app/config/locales/id.php rename to app/config/locale/translations/id.php diff --git a/app/config/locales/is.continents.php b/app/config/locale/translations/is.continents.php similarity index 100% rename from app/config/locales/is.continents.php rename to app/config/locale/translations/is.continents.php diff --git a/app/config/locales/is.countries.php b/app/config/locale/translations/is.countries.php similarity index 100% rename from app/config/locales/is.countries.php rename to app/config/locale/translations/is.countries.php diff --git a/app/config/locales/is.php b/app/config/locale/translations/is.php similarity index 100% rename from app/config/locales/is.php rename to app/config/locale/translations/is.php diff --git a/app/config/locales/it.continents.php b/app/config/locale/translations/it.continents.php similarity index 100% rename from app/config/locales/it.continents.php rename to app/config/locale/translations/it.continents.php diff --git a/app/config/locales/it.countries.php b/app/config/locale/translations/it.countries.php similarity index 100% rename from app/config/locales/it.countries.php rename to app/config/locale/translations/it.countries.php diff --git a/app/config/locales/it.php b/app/config/locale/translations/it.php similarity index 100% rename from app/config/locales/it.php rename to app/config/locale/translations/it.php diff --git a/app/config/locales/ja.continents.php b/app/config/locale/translations/ja.continents.php similarity index 100% rename from app/config/locales/ja.continents.php rename to app/config/locale/translations/ja.continents.php diff --git a/app/config/locales/ja.countries.php b/app/config/locale/translations/ja.countries.php similarity index 100% rename from app/config/locales/ja.countries.php rename to app/config/locale/translations/ja.countries.php diff --git a/app/config/locales/ja.php b/app/config/locale/translations/ja.php similarity index 100% rename from app/config/locales/ja.php rename to app/config/locale/translations/ja.php diff --git a/app/config/locales/jv.continents.php b/app/config/locale/translations/jv.continents.php similarity index 100% rename from app/config/locales/jv.continents.php rename to app/config/locale/translations/jv.continents.php diff --git a/app/config/locales/jv.countries.php b/app/config/locale/translations/jv.countries.php similarity index 100% rename from app/config/locales/jv.countries.php rename to app/config/locale/translations/jv.countries.php diff --git a/app/config/locales/jv.php b/app/config/locale/translations/jv.php similarity index 100% rename from app/config/locales/jv.php rename to app/config/locale/translations/jv.php diff --git a/app/config/locales/km.continents.php b/app/config/locale/translations/km.continents.php similarity index 100% rename from app/config/locales/km.continents.php rename to app/config/locale/translations/km.continents.php diff --git a/app/config/locales/km.countries.php b/app/config/locale/translations/km.countries.php similarity index 100% rename from app/config/locales/km.countries.php rename to app/config/locale/translations/km.countries.php diff --git a/app/config/locales/km.php b/app/config/locale/translations/km.php similarity index 100% rename from app/config/locales/km.php rename to app/config/locale/translations/km.php diff --git a/app/config/locales/ko.continents.php b/app/config/locale/translations/ko.continents.php similarity index 100% rename from app/config/locales/ko.continents.php rename to app/config/locale/translations/ko.continents.php diff --git a/app/config/locales/ko.countries.php b/app/config/locale/translations/ko.countries.php similarity index 100% rename from app/config/locales/ko.countries.php rename to app/config/locale/translations/ko.countries.php diff --git a/app/config/locales/ko.php b/app/config/locale/translations/ko.php similarity index 100% rename from app/config/locales/ko.php rename to app/config/locale/translations/ko.php diff --git a/app/config/locales/lt.continents.php b/app/config/locale/translations/lt.continents.php similarity index 100% rename from app/config/locales/lt.continents.php rename to app/config/locale/translations/lt.continents.php diff --git a/app/config/locales/lt.countries.php b/app/config/locale/translations/lt.countries.php similarity index 100% rename from app/config/locales/lt.countries.php rename to app/config/locale/translations/lt.countries.php diff --git a/app/config/locales/lt.php b/app/config/locale/translations/lt.php similarity index 100% rename from app/config/locales/lt.php rename to app/config/locale/translations/lt.php diff --git a/app/config/locales/ml.continents.php b/app/config/locale/translations/ml.continents.php similarity index 100% rename from app/config/locales/ml.continents.php rename to app/config/locale/translations/ml.continents.php diff --git a/app/config/locales/ml.countries.php b/app/config/locale/translations/ml.countries.php similarity index 100% rename from app/config/locales/ml.countries.php rename to app/config/locale/translations/ml.countries.php diff --git a/app/config/locales/ml.php b/app/config/locale/translations/ml.php similarity index 100% rename from app/config/locales/ml.php rename to app/config/locale/translations/ml.php diff --git a/app/config/locales/ms.continents.php b/app/config/locale/translations/ms.continents.php similarity index 100% rename from app/config/locales/ms.continents.php rename to app/config/locale/translations/ms.continents.php diff --git a/app/config/locales/ms.countries.php b/app/config/locale/translations/ms.countries.php similarity index 100% rename from app/config/locales/ms.countries.php rename to app/config/locale/translations/ms.countries.php diff --git a/app/config/locales/ms.php b/app/config/locale/translations/ms.php similarity index 100% rename from app/config/locales/ms.php rename to app/config/locale/translations/ms.php diff --git a/app/config/locales/nl.continents.php b/app/config/locale/translations/nl.continents.php similarity index 100% rename from app/config/locales/nl.continents.php rename to app/config/locale/translations/nl.continents.php diff --git a/app/config/locales/nl.countries.php b/app/config/locale/translations/nl.countries.php similarity index 100% rename from app/config/locales/nl.countries.php rename to app/config/locale/translations/nl.countries.php diff --git a/app/config/locales/nl.php b/app/config/locale/translations/nl.php similarity index 100% rename from app/config/locales/nl.php rename to app/config/locale/translations/nl.php diff --git a/app/config/locales/no.continents.php b/app/config/locale/translations/no.continents.php similarity index 100% rename from app/config/locales/no.continents.php rename to app/config/locale/translations/no.continents.php diff --git a/app/config/locales/no.countries.php b/app/config/locale/translations/no.countries.php similarity index 100% rename from app/config/locales/no.countries.php rename to app/config/locale/translations/no.countries.php diff --git a/app/config/locales/no.php b/app/config/locale/translations/no.php similarity index 100% rename from app/config/locales/no.php rename to app/config/locale/translations/no.php diff --git a/app/config/locales/ph.continents.php b/app/config/locale/translations/ph.continents.php similarity index 100% rename from app/config/locales/ph.continents.php rename to app/config/locale/translations/ph.continents.php diff --git a/app/config/locales/ph.countries.php b/app/config/locale/translations/ph.countries.php similarity index 100% rename from app/config/locales/ph.countries.php rename to app/config/locale/translations/ph.countries.php diff --git a/app/config/locales/ph.php b/app/config/locale/translations/ph.php similarity index 100% rename from app/config/locales/ph.php rename to app/config/locale/translations/ph.php diff --git a/app/config/locales/pl.continents.php b/app/config/locale/translations/pl.continents.php similarity index 100% rename from app/config/locales/pl.continents.php rename to app/config/locale/translations/pl.continents.php diff --git a/app/config/locales/pl.countries.php b/app/config/locale/translations/pl.countries.php similarity index 100% rename from app/config/locales/pl.countries.php rename to app/config/locale/translations/pl.countries.php diff --git a/app/config/locales/pl.php b/app/config/locale/translations/pl.php similarity index 100% rename from app/config/locales/pl.php rename to app/config/locale/translations/pl.php diff --git a/app/config/locales/pt-br.continents.php b/app/config/locale/translations/pt-br.continents.php similarity index 100% rename from app/config/locales/pt-br.continents.php rename to app/config/locale/translations/pt-br.continents.php diff --git a/app/config/locales/pt-br.countries.php b/app/config/locale/translations/pt-br.countries.php similarity index 100% rename from app/config/locales/pt-br.countries.php rename to app/config/locale/translations/pt-br.countries.php diff --git a/app/config/locales/pt-br.php b/app/config/locale/translations/pt-br.php similarity index 100% rename from app/config/locales/pt-br.php rename to app/config/locale/translations/pt-br.php diff --git a/app/config/locales/pt-pt.continents.php b/app/config/locale/translations/pt-pt.continents.php similarity index 100% rename from app/config/locales/pt-pt.continents.php rename to app/config/locale/translations/pt-pt.continents.php diff --git a/app/config/locales/pt-pt.countries.php b/app/config/locale/translations/pt-pt.countries.php similarity index 100% rename from app/config/locales/pt-pt.countries.php rename to app/config/locale/translations/pt-pt.countries.php diff --git a/app/config/locales/pt-pt.php b/app/config/locale/translations/pt-pt.php similarity index 100% rename from app/config/locales/pt-pt.php rename to app/config/locale/translations/pt-pt.php diff --git a/app/config/locales/ro.continents.php b/app/config/locale/translations/ro.continents.php similarity index 100% rename from app/config/locales/ro.continents.php rename to app/config/locale/translations/ro.continents.php diff --git a/app/config/locales/ro.countries.php b/app/config/locale/translations/ro.countries.php similarity index 100% rename from app/config/locales/ro.countries.php rename to app/config/locale/translations/ro.countries.php diff --git a/app/config/locales/ro.php b/app/config/locale/translations/ro.php similarity index 100% rename from app/config/locales/ro.php rename to app/config/locale/translations/ro.php diff --git a/app/config/locales/ru.continents.php b/app/config/locale/translations/ru.continents.php similarity index 100% rename from app/config/locales/ru.continents.php rename to app/config/locale/translations/ru.continents.php diff --git a/app/config/locales/ru.countries.php b/app/config/locale/translations/ru.countries.php similarity index 100% rename from app/config/locales/ru.countries.php rename to app/config/locale/translations/ru.countries.php diff --git a/app/config/locales/ru.php b/app/config/locale/translations/ru.php similarity index 100% rename from app/config/locales/ru.php rename to app/config/locale/translations/ru.php diff --git a/app/config/locales/si.continents.php b/app/config/locale/translations/si.continents.php similarity index 100% rename from app/config/locales/si.continents.php rename to app/config/locale/translations/si.continents.php diff --git a/app/config/locales/si.countries.php b/app/config/locale/translations/si.countries.php similarity index 100% rename from app/config/locales/si.countries.php rename to app/config/locale/translations/si.countries.php diff --git a/app/config/locales/si.php b/app/config/locale/translations/si.php similarity index 100% rename from app/config/locales/si.php rename to app/config/locale/translations/si.php diff --git a/app/config/locales/sl.continents.php b/app/config/locale/translations/sl.continents.php similarity index 100% rename from app/config/locales/sl.continents.php rename to app/config/locale/translations/sl.continents.php diff --git a/app/config/locales/sl.countries.php b/app/config/locale/translations/sl.countries.php similarity index 100% rename from app/config/locales/sl.countries.php rename to app/config/locale/translations/sl.countries.php diff --git a/app/config/locales/sl.php b/app/config/locale/translations/sl.php similarity index 100% rename from app/config/locales/sl.php rename to app/config/locale/translations/sl.php diff --git a/app/config/locales/sq.continents.php b/app/config/locale/translations/sq.continents.php similarity index 100% rename from app/config/locales/sq.continents.php rename to app/config/locale/translations/sq.continents.php diff --git a/app/config/locales/sq.countries.php b/app/config/locale/translations/sq.countries.php similarity index 100% rename from app/config/locales/sq.countries.php rename to app/config/locale/translations/sq.countries.php diff --git a/app/config/locales/sq.php b/app/config/locale/translations/sq.php similarity index 100% rename from app/config/locales/sq.php rename to app/config/locale/translations/sq.php diff --git a/app/config/locales/sv.continents.php b/app/config/locale/translations/sv.continents.php similarity index 100% rename from app/config/locales/sv.continents.php rename to app/config/locale/translations/sv.continents.php diff --git a/app/config/locales/sv.countries.php b/app/config/locale/translations/sv.countries.php similarity index 100% rename from app/config/locales/sv.countries.php rename to app/config/locale/translations/sv.countries.php diff --git a/app/config/locales/sv.php b/app/config/locale/translations/sv.php similarity index 100% rename from app/config/locales/sv.php rename to app/config/locale/translations/sv.php diff --git a/app/config/locales/ta.continents.php b/app/config/locale/translations/ta.continents.php similarity index 100% rename from app/config/locales/ta.continents.php rename to app/config/locale/translations/ta.continents.php diff --git a/app/config/locales/ta.countries.php b/app/config/locale/translations/ta.countries.php similarity index 100% rename from app/config/locales/ta.countries.php rename to app/config/locale/translations/ta.countries.php diff --git a/app/config/locales/ta.php b/app/config/locale/translations/ta.php similarity index 100% rename from app/config/locales/ta.php rename to app/config/locale/translations/ta.php diff --git a/app/config/locales/templates/af.email.auth.confirm.tpl b/app/config/locale/translations/templates/af.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/af.email.auth.confirm.tpl rename to app/config/locale/translations/templates/af.email.auth.confirm.tpl diff --git a/app/config/locales/templates/af.email.auth.invitation.tpl b/app/config/locale/translations/templates/af.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/af.email.auth.invitation.tpl rename to app/config/locale/translations/templates/af.email.auth.invitation.tpl diff --git a/app/config/locales/templates/af.email.auth.recovery.tpl b/app/config/locale/translations/templates/af.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/af.email.auth.recovery.tpl rename to app/config/locale/translations/templates/af.email.auth.recovery.tpl diff --git a/app/config/locales/templates/alb.email.auth.confirm.tpl b/app/config/locale/translations/templates/alb.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/alb.email.auth.confirm.tpl rename to app/config/locale/translations/templates/alb.email.auth.confirm.tpl diff --git a/app/config/locales/templates/alb.email.auth.invitation.tpl b/app/config/locale/translations/templates/alb.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/alb.email.auth.invitation.tpl rename to app/config/locale/translations/templates/alb.email.auth.invitation.tpl diff --git a/app/config/locales/templates/alb.email.auth.recovery.tpl b/app/config/locale/translations/templates/alb.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/alb.email.auth.recovery.tpl rename to app/config/locale/translations/templates/alb.email.auth.recovery.tpl diff --git a/app/config/locales/templates/ar.email.auth.confirm.tpl b/app/config/locale/translations/templates/ar.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/ar.email.auth.confirm.tpl rename to app/config/locale/translations/templates/ar.email.auth.confirm.tpl diff --git a/app/config/locales/templates/ar.email.auth.invitation.tpl b/app/config/locale/translations/templates/ar.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/ar.email.auth.invitation.tpl rename to app/config/locale/translations/templates/ar.email.auth.invitation.tpl diff --git a/app/config/locales/templates/ar.email.auth.recovery.tpl b/app/config/locale/translations/templates/ar.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/ar.email.auth.recovery.tpl rename to app/config/locale/translations/templates/ar.email.auth.recovery.tpl diff --git a/app/config/locales/templates/bn.email.auth.confirm.tpl b/app/config/locale/translations/templates/bn.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/bn.email.auth.confirm.tpl rename to app/config/locale/translations/templates/bn.email.auth.confirm.tpl diff --git a/app/config/locales/templates/bn.email.auth.invitation.tpl b/app/config/locale/translations/templates/bn.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/bn.email.auth.invitation.tpl rename to app/config/locale/translations/templates/bn.email.auth.invitation.tpl diff --git a/app/config/locales/templates/bn.email.auth.recovery.tpl b/app/config/locale/translations/templates/bn.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/bn.email.auth.recovery.tpl rename to app/config/locale/translations/templates/bn.email.auth.recovery.tpl diff --git a/app/config/locales/templates/cat.email.auth.confirm.tpl b/app/config/locale/translations/templates/cat.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/cat.email.auth.confirm.tpl rename to app/config/locale/translations/templates/cat.email.auth.confirm.tpl diff --git a/app/config/locales/templates/cat.email.auth.invitation.tpl b/app/config/locale/translations/templates/cat.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/cat.email.auth.invitation.tpl rename to app/config/locale/translations/templates/cat.email.auth.invitation.tpl diff --git a/app/config/locales/templates/cat.email.auth.recovery.tpl b/app/config/locale/translations/templates/cat.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/cat.email.auth.recovery.tpl rename to app/config/locale/translations/templates/cat.email.auth.recovery.tpl diff --git a/app/config/locales/templates/cz.email.auth.confirm.tpl b/app/config/locale/translations/templates/cz.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/cz.email.auth.confirm.tpl rename to app/config/locale/translations/templates/cz.email.auth.confirm.tpl diff --git a/app/config/locales/templates/cz.email.auth.invitation.tpl b/app/config/locale/translations/templates/cz.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/cz.email.auth.invitation.tpl rename to app/config/locale/translations/templates/cz.email.auth.invitation.tpl diff --git a/app/config/locales/templates/cz.email.auth.recovery.tpl b/app/config/locale/translations/templates/cz.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/cz.email.auth.recovery.tpl rename to app/config/locale/translations/templates/cz.email.auth.recovery.tpl diff --git a/app/config/locales/templates/de.email.auth.confirm.tpl b/app/config/locale/translations/templates/de.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/de.email.auth.confirm.tpl rename to app/config/locale/translations/templates/de.email.auth.confirm.tpl diff --git a/app/config/locales/templates/de.email.auth.invitation.tpl b/app/config/locale/translations/templates/de.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/de.email.auth.invitation.tpl rename to app/config/locale/translations/templates/de.email.auth.invitation.tpl diff --git a/app/config/locales/templates/de.email.auth.recovery.tpl b/app/config/locale/translations/templates/de.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/de.email.auth.recovery.tpl rename to app/config/locale/translations/templates/de.email.auth.recovery.tpl diff --git a/app/config/locales/templates/en.email.auth.confirm.tpl b/app/config/locale/translations/templates/en.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/en.email.auth.confirm.tpl rename to app/config/locale/translations/templates/en.email.auth.confirm.tpl diff --git a/app/config/locales/templates/en.email.auth.invitation.tpl b/app/config/locale/translations/templates/en.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/en.email.auth.invitation.tpl rename to app/config/locale/translations/templates/en.email.auth.invitation.tpl diff --git a/app/config/locales/templates/en.email.auth.recovery.tpl b/app/config/locale/translations/templates/en.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/en.email.auth.recovery.tpl rename to app/config/locale/translations/templates/en.email.auth.recovery.tpl diff --git a/app/config/locales/templates/es.email.auth.confirm.tpl b/app/config/locale/translations/templates/es.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/es.email.auth.confirm.tpl rename to app/config/locale/translations/templates/es.email.auth.confirm.tpl diff --git a/app/config/locales/templates/es.email.auth.invitation.tpl b/app/config/locale/translations/templates/es.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/es.email.auth.invitation.tpl rename to app/config/locale/translations/templates/es.email.auth.invitation.tpl diff --git a/app/config/locales/templates/es.email.auth.recovery.tpl b/app/config/locale/translations/templates/es.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/es.email.auth.recovery.tpl rename to app/config/locale/translations/templates/es.email.auth.recovery.tpl diff --git a/app/config/locales/templates/fi.email.auth.confirm.tpl b/app/config/locale/translations/templates/fi.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/fi.email.auth.confirm.tpl rename to app/config/locale/translations/templates/fi.email.auth.confirm.tpl diff --git a/app/config/locales/templates/fi.email.auth.invitation.tpl b/app/config/locale/translations/templates/fi.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/fi.email.auth.invitation.tpl rename to app/config/locale/translations/templates/fi.email.auth.invitation.tpl diff --git a/app/config/locales/templates/fi.email.auth.recovery.tpl b/app/config/locale/translations/templates/fi.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/fi.email.auth.recovery.tpl rename to app/config/locale/translations/templates/fi.email.auth.recovery.tpl diff --git a/app/config/locales/templates/fo.email.auth.confirm.tpl b/app/config/locale/translations/templates/fo.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/fo.email.auth.confirm.tpl rename to app/config/locale/translations/templates/fo.email.auth.confirm.tpl diff --git a/app/config/locales/templates/fo.email.auth.invitation.tpl b/app/config/locale/translations/templates/fo.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/fo.email.auth.invitation.tpl rename to app/config/locale/translations/templates/fo.email.auth.invitation.tpl diff --git a/app/config/locales/templates/fo.email.auth.recovery.tpl b/app/config/locale/translations/templates/fo.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/fo.email.auth.recovery.tpl rename to app/config/locale/translations/templates/fo.email.auth.recovery.tpl diff --git a/app/config/locales/templates/fr.email.auth.confirm.tpl b/app/config/locale/translations/templates/fr.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/fr.email.auth.confirm.tpl rename to app/config/locale/translations/templates/fr.email.auth.confirm.tpl diff --git a/app/config/locales/templates/fr.email.auth.invitation.tpl b/app/config/locale/translations/templates/fr.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/fr.email.auth.invitation.tpl rename to app/config/locale/translations/templates/fr.email.auth.invitation.tpl diff --git a/app/config/locales/templates/fr.email.auth.recovery.tpl b/app/config/locale/translations/templates/fr.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/fr.email.auth.recovery.tpl rename to app/config/locale/translations/templates/fr.email.auth.recovery.tpl diff --git a/app/config/locales/templates/gr.email.auth.confirm.tpl b/app/config/locale/translations/templates/gr.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/gr.email.auth.confirm.tpl rename to app/config/locale/translations/templates/gr.email.auth.confirm.tpl diff --git a/app/config/locales/templates/gr.email.auth.invitation.tpl b/app/config/locale/translations/templates/gr.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/gr.email.auth.invitation.tpl rename to app/config/locale/translations/templates/gr.email.auth.invitation.tpl diff --git a/app/config/locales/templates/gr.email.auth.recovery.tpl b/app/config/locale/translations/templates/gr.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/gr.email.auth.recovery.tpl rename to app/config/locale/translations/templates/gr.email.auth.recovery.tpl diff --git a/app/config/locales/templates/he.email.auth.confirm.tpl b/app/config/locale/translations/templates/he.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/he.email.auth.confirm.tpl rename to app/config/locale/translations/templates/he.email.auth.confirm.tpl diff --git a/app/config/locales/templates/he.email.auth.invitation.tpl b/app/config/locale/translations/templates/he.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/he.email.auth.invitation.tpl rename to app/config/locale/translations/templates/he.email.auth.invitation.tpl diff --git a/app/config/locales/templates/he.email.auth.recovery.tpl b/app/config/locale/translations/templates/he.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/he.email.auth.recovery.tpl rename to app/config/locale/translations/templates/he.email.auth.recovery.tpl diff --git a/app/config/locales/templates/hi.email.auth.confirm.tpl b/app/config/locale/translations/templates/hi.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/hi.email.auth.confirm.tpl rename to app/config/locale/translations/templates/hi.email.auth.confirm.tpl diff --git a/app/config/locales/templates/hi.email.auth.invitation.tpl b/app/config/locale/translations/templates/hi.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/hi.email.auth.invitation.tpl rename to app/config/locale/translations/templates/hi.email.auth.invitation.tpl diff --git a/app/config/locales/templates/hi.email.auth.recovery.tpl b/app/config/locale/translations/templates/hi.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/hi.email.auth.recovery.tpl rename to app/config/locale/translations/templates/hi.email.auth.recovery.tpl diff --git a/app/config/locales/templates/hu.email.auth.confirm.tpl b/app/config/locale/translations/templates/hu.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/hu.email.auth.confirm.tpl rename to app/config/locale/translations/templates/hu.email.auth.confirm.tpl diff --git a/app/config/locales/templates/hu.email.auth.invitation.tpl b/app/config/locale/translations/templates/hu.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/hu.email.auth.invitation.tpl rename to app/config/locale/translations/templates/hu.email.auth.invitation.tpl diff --git a/app/config/locales/templates/hu.email.auth.recovery.tpl b/app/config/locale/translations/templates/hu.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/hu.email.auth.recovery.tpl rename to app/config/locale/translations/templates/hu.email.auth.recovery.tpl diff --git a/app/config/locales/templates/hy.email.auth.confirm.tpl b/app/config/locale/translations/templates/hy.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/hy.email.auth.confirm.tpl rename to app/config/locale/translations/templates/hy.email.auth.confirm.tpl diff --git a/app/config/locales/templates/hy.email.auth.invitation.tpl b/app/config/locale/translations/templates/hy.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/hy.email.auth.invitation.tpl rename to app/config/locale/translations/templates/hy.email.auth.invitation.tpl diff --git a/app/config/locales/templates/hy.email.auth.recovery.tpl b/app/config/locale/translations/templates/hy.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/hy.email.auth.recovery.tpl rename to app/config/locale/translations/templates/hy.email.auth.recovery.tpl diff --git a/app/config/locales/templates/id.email.auth.confirm.tpl b/app/config/locale/translations/templates/id.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/id.email.auth.confirm.tpl rename to app/config/locale/translations/templates/id.email.auth.confirm.tpl diff --git a/app/config/locales/templates/id.email.auth.invitation.tpl b/app/config/locale/translations/templates/id.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/id.email.auth.invitation.tpl rename to app/config/locale/translations/templates/id.email.auth.invitation.tpl diff --git a/app/config/locales/templates/id.email.auth.recovery.tpl b/app/config/locale/translations/templates/id.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/id.email.auth.recovery.tpl rename to app/config/locale/translations/templates/id.email.auth.recovery.tpl diff --git a/app/config/locales/templates/is.email.auth.confirm.tpl b/app/config/locale/translations/templates/is.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/is.email.auth.confirm.tpl rename to app/config/locale/translations/templates/is.email.auth.confirm.tpl diff --git a/app/config/locales/templates/is.email.auth.invitation.tpl b/app/config/locale/translations/templates/is.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/is.email.auth.invitation.tpl rename to app/config/locale/translations/templates/is.email.auth.invitation.tpl diff --git a/app/config/locales/templates/is.email.auth.recovery.tpl b/app/config/locale/translations/templates/is.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/is.email.auth.recovery.tpl rename to app/config/locale/translations/templates/is.email.auth.recovery.tpl diff --git a/app/config/locales/templates/it.email.auth.confirm.tpl b/app/config/locale/translations/templates/it.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/it.email.auth.confirm.tpl rename to app/config/locale/translations/templates/it.email.auth.confirm.tpl diff --git a/app/config/locales/templates/it.email.auth.invitation.tpl b/app/config/locale/translations/templates/it.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/it.email.auth.invitation.tpl rename to app/config/locale/translations/templates/it.email.auth.invitation.tpl diff --git a/app/config/locales/templates/it.email.auth.recovery.tpl b/app/config/locale/translations/templates/it.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/it.email.auth.recovery.tpl rename to app/config/locale/translations/templates/it.email.auth.recovery.tpl diff --git a/app/config/locales/templates/ja.email.auth.confirm.tpl b/app/config/locale/translations/templates/ja.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/ja.email.auth.confirm.tpl rename to app/config/locale/translations/templates/ja.email.auth.confirm.tpl diff --git a/app/config/locales/templates/ja.email.auth.invitation.tpl b/app/config/locale/translations/templates/ja.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/ja.email.auth.invitation.tpl rename to app/config/locale/translations/templates/ja.email.auth.invitation.tpl diff --git a/app/config/locales/templates/ja.email.auth.recovery.tpl b/app/config/locale/translations/templates/ja.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/ja.email.auth.recovery.tpl rename to app/config/locale/translations/templates/ja.email.auth.recovery.tpl diff --git a/app/config/locales/templates/jv.email.auth.confirm.tpl b/app/config/locale/translations/templates/jv.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/jv.email.auth.confirm.tpl rename to app/config/locale/translations/templates/jv.email.auth.confirm.tpl diff --git a/app/config/locales/templates/jv.email.auth.invitation.tpl b/app/config/locale/translations/templates/jv.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/jv.email.auth.invitation.tpl rename to app/config/locale/translations/templates/jv.email.auth.invitation.tpl diff --git a/app/config/locales/templates/jv.email.auth.recovery.tpl b/app/config/locale/translations/templates/jv.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/jv.email.auth.recovery.tpl rename to app/config/locale/translations/templates/jv.email.auth.recovery.tpl diff --git a/app/config/locales/templates/km.email.auth.confirm.tpl b/app/config/locale/translations/templates/km.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/km.email.auth.confirm.tpl rename to app/config/locale/translations/templates/km.email.auth.confirm.tpl diff --git a/app/config/locales/templates/km.email.auth.invitation.tpl b/app/config/locale/translations/templates/km.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/km.email.auth.invitation.tpl rename to app/config/locale/translations/templates/km.email.auth.invitation.tpl diff --git a/app/config/locales/templates/km.email.auth.recovery.tpl b/app/config/locale/translations/templates/km.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/km.email.auth.recovery.tpl rename to app/config/locale/translations/templates/km.email.auth.recovery.tpl diff --git a/app/config/locales/templates/ko.email.auth.confirm.tpl b/app/config/locale/translations/templates/ko.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/ko.email.auth.confirm.tpl rename to app/config/locale/translations/templates/ko.email.auth.confirm.tpl diff --git a/app/config/locales/templates/ko.email.auth.invitation.tpl b/app/config/locale/translations/templates/ko.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/ko.email.auth.invitation.tpl rename to app/config/locale/translations/templates/ko.email.auth.invitation.tpl diff --git a/app/config/locales/templates/ko.email.auth.recovery.tpl b/app/config/locale/translations/templates/ko.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/ko.email.auth.recovery.tpl rename to app/config/locale/translations/templates/ko.email.auth.recovery.tpl diff --git a/app/config/locales/templates/lt.email.auth.confirm.tpl b/app/config/locale/translations/templates/lt.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/lt.email.auth.confirm.tpl rename to app/config/locale/translations/templates/lt.email.auth.confirm.tpl diff --git a/app/config/locales/templates/lt.email.auth.invitation.tpl b/app/config/locale/translations/templates/lt.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/lt.email.auth.invitation.tpl rename to app/config/locale/translations/templates/lt.email.auth.invitation.tpl diff --git a/app/config/locales/templates/lt.email.auth.recovery.tpl b/app/config/locale/translations/templates/lt.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/lt.email.auth.recovery.tpl rename to app/config/locale/translations/templates/lt.email.auth.recovery.tpl diff --git a/app/config/locales/templates/ml.email.auth.confirm.tpl b/app/config/locale/translations/templates/ml.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/ml.email.auth.confirm.tpl rename to app/config/locale/translations/templates/ml.email.auth.confirm.tpl diff --git a/app/config/locales/templates/ml.email.auth.invitation.tpl b/app/config/locale/translations/templates/ml.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/ml.email.auth.invitation.tpl rename to app/config/locale/translations/templates/ml.email.auth.invitation.tpl diff --git a/app/config/locales/templates/ml.email.auth.recovery.tpl b/app/config/locale/translations/templates/ml.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/ml.email.auth.recovery.tpl rename to app/config/locale/translations/templates/ml.email.auth.recovery.tpl diff --git a/app/config/locales/templates/my.email.auth.confirm.tpl b/app/config/locale/translations/templates/my.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/my.email.auth.confirm.tpl rename to app/config/locale/translations/templates/my.email.auth.confirm.tpl diff --git a/app/config/locales/templates/my.email.auth.invitation.tpl b/app/config/locale/translations/templates/my.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/my.email.auth.invitation.tpl rename to app/config/locale/translations/templates/my.email.auth.invitation.tpl diff --git a/app/config/locales/templates/my.email.auth.recovery.tpl b/app/config/locale/translations/templates/my.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/my.email.auth.recovery.tpl rename to app/config/locale/translations/templates/my.email.auth.recovery.tpl diff --git a/app/config/locales/templates/nl.email.auth.confirm.tpl b/app/config/locale/translations/templates/nl.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/nl.email.auth.confirm.tpl rename to app/config/locale/translations/templates/nl.email.auth.confirm.tpl diff --git a/app/config/locales/templates/nl.email.auth.invitation.tpl b/app/config/locale/translations/templates/nl.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/nl.email.auth.invitation.tpl rename to app/config/locale/translations/templates/nl.email.auth.invitation.tpl diff --git a/app/config/locales/templates/nl.email.auth.recovery.tpl b/app/config/locale/translations/templates/nl.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/nl.email.auth.recovery.tpl rename to app/config/locale/translations/templates/nl.email.auth.recovery.tpl diff --git a/app/config/locales/templates/no.email.auth.confirm.tpl b/app/config/locale/translations/templates/no.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/no.email.auth.confirm.tpl rename to app/config/locale/translations/templates/no.email.auth.confirm.tpl diff --git a/app/config/locales/templates/no.email.auth.invitation.tpl b/app/config/locale/translations/templates/no.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/no.email.auth.invitation.tpl rename to app/config/locale/translations/templates/no.email.auth.invitation.tpl diff --git a/app/config/locales/templates/no.email.auth.recovery.tpl b/app/config/locale/translations/templates/no.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/no.email.auth.recovery.tpl rename to app/config/locale/translations/templates/no.email.auth.recovery.tpl diff --git a/app/config/locales/templates/ph.email.auth.confirm.tpl b/app/config/locale/translations/templates/ph.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/ph.email.auth.confirm.tpl rename to app/config/locale/translations/templates/ph.email.auth.confirm.tpl diff --git a/app/config/locales/templates/ph.email.auth.invitation.tpl b/app/config/locale/translations/templates/ph.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/ph.email.auth.invitation.tpl rename to app/config/locale/translations/templates/ph.email.auth.invitation.tpl diff --git a/app/config/locales/templates/ph.email.auth.recovery.tpl b/app/config/locale/translations/templates/ph.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/ph.email.auth.recovery.tpl rename to app/config/locale/translations/templates/ph.email.auth.recovery.tpl diff --git a/app/config/locales/templates/pl.email.auth.confirm.tpl b/app/config/locale/translations/templates/pl.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/pl.email.auth.confirm.tpl rename to app/config/locale/translations/templates/pl.email.auth.confirm.tpl diff --git a/app/config/locales/templates/pl.email.auth.invitation.tpl b/app/config/locale/translations/templates/pl.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/pl.email.auth.invitation.tpl rename to app/config/locale/translations/templates/pl.email.auth.invitation.tpl diff --git a/app/config/locales/templates/pl.email.auth.recovery.tpl b/app/config/locale/translations/templates/pl.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/pl.email.auth.recovery.tpl rename to app/config/locale/translations/templates/pl.email.auth.recovery.tpl diff --git a/app/config/locales/templates/pt-br.email.auth.confirm.tpl b/app/config/locale/translations/templates/pt-br.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/pt-br.email.auth.confirm.tpl rename to app/config/locale/translations/templates/pt-br.email.auth.confirm.tpl diff --git a/app/config/locales/templates/pt-br.email.auth.invitation.tpl b/app/config/locale/translations/templates/pt-br.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/pt-br.email.auth.invitation.tpl rename to app/config/locale/translations/templates/pt-br.email.auth.invitation.tpl diff --git a/app/config/locales/templates/pt-br.email.auth.recovery.tpl b/app/config/locale/translations/templates/pt-br.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/pt-br.email.auth.recovery.tpl rename to app/config/locale/translations/templates/pt-br.email.auth.recovery.tpl diff --git a/app/config/locales/templates/pt-pt.email.auth.confirm.tpl b/app/config/locale/translations/templates/pt-pt.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/pt-pt.email.auth.confirm.tpl rename to app/config/locale/translations/templates/pt-pt.email.auth.confirm.tpl diff --git a/app/config/locales/templates/pt-pt.email.auth.invitation.tpl b/app/config/locale/translations/templates/pt-pt.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/pt-pt.email.auth.invitation.tpl rename to app/config/locale/translations/templates/pt-pt.email.auth.invitation.tpl diff --git a/app/config/locales/templates/pt-pt.email.auth.recovery.tpl b/app/config/locale/translations/templates/pt-pt.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/pt-pt.email.auth.recovery.tpl rename to app/config/locale/translations/templates/pt-pt.email.auth.recovery.tpl diff --git a/app/config/locales/templates/ro.email.auth.confirm.tpl b/app/config/locale/translations/templates/ro.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/ro.email.auth.confirm.tpl rename to app/config/locale/translations/templates/ro.email.auth.confirm.tpl diff --git a/app/config/locales/templates/ro.email.auth.invitation.tpl b/app/config/locale/translations/templates/ro.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/ro.email.auth.invitation.tpl rename to app/config/locale/translations/templates/ro.email.auth.invitation.tpl diff --git a/app/config/locales/templates/ro.email.auth.recovery.tpl b/app/config/locale/translations/templates/ro.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/ro.email.auth.recovery.tpl rename to app/config/locale/translations/templates/ro.email.auth.recovery.tpl diff --git a/app/config/locales/templates/ru.email.auth.confirm.tpl b/app/config/locale/translations/templates/ru.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/ru.email.auth.confirm.tpl rename to app/config/locale/translations/templates/ru.email.auth.confirm.tpl diff --git a/app/config/locales/templates/ru.email.auth.invitation.tpl b/app/config/locale/translations/templates/ru.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/ru.email.auth.invitation.tpl rename to app/config/locale/translations/templates/ru.email.auth.invitation.tpl diff --git a/app/config/locales/templates/ru.email.auth.recovery.tpl b/app/config/locale/translations/templates/ru.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/ru.email.auth.recovery.tpl rename to app/config/locale/translations/templates/ru.email.auth.recovery.tpl diff --git a/app/config/locales/templates/si.email.auth.confirm.tpl b/app/config/locale/translations/templates/si.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/si.email.auth.confirm.tpl rename to app/config/locale/translations/templates/si.email.auth.confirm.tpl diff --git a/app/config/locales/templates/si.email.auth.invitation.tpl b/app/config/locale/translations/templates/si.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/si.email.auth.invitation.tpl rename to app/config/locale/translations/templates/si.email.auth.invitation.tpl diff --git a/app/config/locales/templates/si.email.auth.recovery.tpl b/app/config/locale/translations/templates/si.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/si.email.auth.recovery.tpl rename to app/config/locale/translations/templates/si.email.auth.recovery.tpl diff --git a/app/config/locales/templates/sl.email.auth.confirm.tpl b/app/config/locale/translations/templates/sl.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/sl.email.auth.confirm.tpl rename to app/config/locale/translations/templates/sl.email.auth.confirm.tpl diff --git a/app/config/locales/templates/sl.email.auth.invitation.tpl b/app/config/locale/translations/templates/sl.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/sl.email.auth.invitation.tpl rename to app/config/locale/translations/templates/sl.email.auth.invitation.tpl diff --git a/app/config/locales/templates/sl.email.auth.recovery.tpl b/app/config/locale/translations/templates/sl.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/sl.email.auth.recovery.tpl rename to app/config/locale/translations/templates/sl.email.auth.recovery.tpl diff --git a/app/config/locales/templates/sv.email.auth.confirm.tpl b/app/config/locale/translations/templates/sv.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/sv.email.auth.confirm.tpl rename to app/config/locale/translations/templates/sv.email.auth.confirm.tpl diff --git a/app/config/locales/templates/sv.email.auth.invitation.tpl b/app/config/locale/translations/templates/sv.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/sv.email.auth.invitation.tpl rename to app/config/locale/translations/templates/sv.email.auth.invitation.tpl diff --git a/app/config/locales/templates/sv.email.auth.recovery.tpl b/app/config/locale/translations/templates/sv.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/sv.email.auth.recovery.tpl rename to app/config/locale/translations/templates/sv.email.auth.recovery.tpl diff --git a/app/config/locales/templates/ta.email.auth.confirm.tpl b/app/config/locale/translations/templates/ta.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/ta.email.auth.confirm.tpl rename to app/config/locale/translations/templates/ta.email.auth.confirm.tpl diff --git a/app/config/locales/templates/ta.email.auth.invitation.tpl b/app/config/locale/translations/templates/ta.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/ta.email.auth.invitation.tpl rename to app/config/locale/translations/templates/ta.email.auth.invitation.tpl diff --git a/app/config/locales/templates/ta.email.auth.recovery.tpl b/app/config/locale/translations/templates/ta.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/ta.email.auth.recovery.tpl rename to app/config/locale/translations/templates/ta.email.auth.recovery.tpl diff --git a/app/config/locales/templates/th.email.auth.confirm.tpl b/app/config/locale/translations/templates/th.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/th.email.auth.confirm.tpl rename to app/config/locale/translations/templates/th.email.auth.confirm.tpl diff --git a/app/config/locales/templates/th.email.auth.invitation.tpl b/app/config/locale/translations/templates/th.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/th.email.auth.invitation.tpl rename to app/config/locale/translations/templates/th.email.auth.invitation.tpl diff --git a/app/config/locales/templates/th.email.auth.recovery.tpl b/app/config/locale/translations/templates/th.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/th.email.auth.recovery.tpl rename to app/config/locale/translations/templates/th.email.auth.recovery.tpl diff --git a/app/config/locales/templates/tr.email.auth.confirm.tpl b/app/config/locale/translations/templates/tr.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/tr.email.auth.confirm.tpl rename to app/config/locale/translations/templates/tr.email.auth.confirm.tpl diff --git a/app/config/locales/templates/tr.email.auth.invitation.tpl b/app/config/locale/translations/templates/tr.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/tr.email.auth.invitation.tpl rename to app/config/locale/translations/templates/tr.email.auth.invitation.tpl diff --git a/app/config/locales/templates/tr.email.auth.recovery.tpl b/app/config/locale/translations/templates/tr.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/tr.email.auth.recovery.tpl rename to app/config/locale/translations/templates/tr.email.auth.recovery.tpl diff --git a/app/config/locales/templates/ua.email.auth.confirm.tpl b/app/config/locale/translations/templates/ua.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/ua.email.auth.confirm.tpl rename to app/config/locale/translations/templates/ua.email.auth.confirm.tpl diff --git a/app/config/locales/templates/ua.email.auth.invitation.tpl b/app/config/locale/translations/templates/ua.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/ua.email.auth.invitation.tpl rename to app/config/locale/translations/templates/ua.email.auth.invitation.tpl diff --git a/app/config/locales/templates/ua.email.auth.recovery.tpl b/app/config/locale/translations/templates/ua.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/ua.email.auth.recovery.tpl rename to app/config/locale/translations/templates/ua.email.auth.recovery.tpl diff --git a/app/config/locales/templates/vi.email.auth.confirm.tpl b/app/config/locale/translations/templates/vi.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/vi.email.auth.confirm.tpl rename to app/config/locale/translations/templates/vi.email.auth.confirm.tpl diff --git a/app/config/locales/templates/vi.email.auth.invitation.tpl b/app/config/locale/translations/templates/vi.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/vi.email.auth.invitation.tpl rename to app/config/locale/translations/templates/vi.email.auth.invitation.tpl diff --git a/app/config/locales/templates/vi.email.auth.recovery.tpl b/app/config/locale/translations/templates/vi.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/vi.email.auth.recovery.tpl rename to app/config/locale/translations/templates/vi.email.auth.recovery.tpl diff --git a/app/config/locales/templates/zh-cn.email.auth.confirm.tpl b/app/config/locale/translations/templates/zh-cn.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/zh-cn.email.auth.confirm.tpl rename to app/config/locale/translations/templates/zh-cn.email.auth.confirm.tpl diff --git a/app/config/locales/templates/zh-cn.email.auth.invitation.tpl b/app/config/locale/translations/templates/zh-cn.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/zh-cn.email.auth.invitation.tpl rename to app/config/locale/translations/templates/zh-cn.email.auth.invitation.tpl diff --git a/app/config/locales/templates/zh-cn.email.auth.recovery.tpl b/app/config/locale/translations/templates/zh-cn.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/zh-cn.email.auth.recovery.tpl rename to app/config/locale/translations/templates/zh-cn.email.auth.recovery.tpl diff --git a/app/config/locales/templates/zh-tw.email.auth.confirm.tpl b/app/config/locale/translations/templates/zh-tw.email.auth.confirm.tpl similarity index 100% rename from app/config/locales/templates/zh-tw.email.auth.confirm.tpl rename to app/config/locale/translations/templates/zh-tw.email.auth.confirm.tpl diff --git a/app/config/locales/templates/zh-tw.email.auth.invitation.tpl b/app/config/locale/translations/templates/zh-tw.email.auth.invitation.tpl similarity index 100% rename from app/config/locales/templates/zh-tw.email.auth.invitation.tpl rename to app/config/locale/translations/templates/zh-tw.email.auth.invitation.tpl diff --git a/app/config/locales/templates/zh-tw.email.auth.recovery.tpl b/app/config/locale/translations/templates/zh-tw.email.auth.recovery.tpl similarity index 100% rename from app/config/locales/templates/zh-tw.email.auth.recovery.tpl rename to app/config/locale/translations/templates/zh-tw.email.auth.recovery.tpl diff --git a/app/config/locales/th.continents.php b/app/config/locale/translations/th.continents.php similarity index 100% rename from app/config/locales/th.continents.php rename to app/config/locale/translations/th.continents.php diff --git a/app/config/locales/th.countries.php b/app/config/locale/translations/th.countries.php similarity index 100% rename from app/config/locales/th.countries.php rename to app/config/locale/translations/th.countries.php diff --git a/app/config/locales/th.php b/app/config/locale/translations/th.php similarity index 100% rename from app/config/locales/th.php rename to app/config/locale/translations/th.php diff --git a/app/config/locales/tr.continents.php b/app/config/locale/translations/tr.continents.php similarity index 100% rename from app/config/locales/tr.continents.php rename to app/config/locale/translations/tr.continents.php diff --git a/app/config/locales/tr.countries.php b/app/config/locale/translations/tr.countries.php similarity index 100% rename from app/config/locales/tr.countries.php rename to app/config/locale/translations/tr.countries.php diff --git a/app/config/locales/tr.php b/app/config/locale/translations/tr.php similarity index 100% rename from app/config/locales/tr.php rename to app/config/locale/translations/tr.php diff --git a/app/config/locales/ua.continents.php b/app/config/locale/translations/ua.continents.php similarity index 100% rename from app/config/locales/ua.continents.php rename to app/config/locale/translations/ua.continents.php diff --git a/app/config/locales/ua.countries.php b/app/config/locale/translations/ua.countries.php similarity index 100% rename from app/config/locales/ua.countries.php rename to app/config/locale/translations/ua.countries.php diff --git a/app/config/locales/ua.php b/app/config/locale/translations/ua.php similarity index 100% rename from app/config/locales/ua.php rename to app/config/locale/translations/ua.php diff --git a/app/config/locales/vi.continents.php b/app/config/locale/translations/vi.continents.php similarity index 100% rename from app/config/locales/vi.continents.php rename to app/config/locale/translations/vi.continents.php diff --git a/app/config/locales/vi.countries.php b/app/config/locale/translations/vi.countries.php similarity index 100% rename from app/config/locales/vi.countries.php rename to app/config/locale/translations/vi.countries.php diff --git a/app/config/locales/vi.php b/app/config/locale/translations/vi.php similarity index 100% rename from app/config/locales/vi.php rename to app/config/locale/translations/vi.php diff --git a/app/config/locales/zh-cn.continents.php b/app/config/locale/translations/zh-cn.continents.php similarity index 100% rename from app/config/locales/zh-cn.continents.php rename to app/config/locale/translations/zh-cn.continents.php diff --git a/app/config/locales/zh-cn.countries.php b/app/config/locale/translations/zh-cn.countries.php similarity index 100% rename from app/config/locales/zh-cn.countries.php rename to app/config/locale/translations/zh-cn.countries.php diff --git a/app/config/locales/zh-cn.php b/app/config/locale/translations/zh-cn.php similarity index 100% rename from app/config/locales/zh-cn.php rename to app/config/locale/translations/zh-cn.php diff --git a/app/config/locales/zh-tw.continents.php b/app/config/locale/translations/zh-tw.continents.php similarity index 100% rename from app/config/locales/zh-tw.continents.php rename to app/config/locale/translations/zh-tw.continents.php diff --git a/app/config/locales/zh-tw.countries.php b/app/config/locale/translations/zh-tw.countries.php similarity index 100% rename from app/config/locales/zh-tw.countries.php rename to app/config/locale/translations/zh-tw.countries.php diff --git a/app/config/locales/zh-tw.php b/app/config/locale/translations/zh-tw.php similarity index 100% rename from app/config/locales/zh-tw.php rename to app/config/locale/translations/zh-tw.php diff --git a/app/config/platforms.php b/app/config/platforms.php index 35e03c7a44..eea2a273e9 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -30,7 +30,7 @@ return [ [ 'key' => 'flutter', 'name' => 'Flutter', - 'version' => '0.3.0-dev.1', + 'version' => '0.3.0-dev.2', 'url' => 'https://github.com/appwrite/sdk-for-flutter', 'enabled' => true, 'beta' => true, diff --git a/app/config/roles.php b/app/config/roles.php index 4d2420ec58..0a4ec4369c 100644 --- a/app/config/roles.php +++ b/app/config/roles.php @@ -37,6 +37,8 @@ $admins = [ 'users.write', 'collections.read', 'collections.write', + 'functions.read', + 'functions.write', 'platforms.read', 'platforms.write', 'keys.read', diff --git a/app/config/scopes.php b/app/config/scopes.php index 59ad2a0859..88c67d70dd 100644 --- a/app/config/scopes.php +++ b/app/config/scopes.php @@ -11,6 +11,9 @@ return [ // List of publicly visible scopes 'documents.write', 'files.read', 'files.write', + 'functions.read', + 'functions.write', + 'health.read', // 'platforms.read', // 'platforms.write', // 'keys.read', diff --git a/app/config/services.php b/app/config/services.php index cc5df8c8e2..e500f9a241 100644 --- a/app/config/services.php +++ b/app/config/services.php @@ -3,89 +3,96 @@ return [ '/' => [ 'name' => 'Homepage', - 'controller' => 'controllers/web/home.php', + 'controller' => 'web/home.php', 'sdk' => false, 'tests' => false, ], 'console/' => [ 'name' => 'Console', - 'controller' => 'controllers/web/console.php', + 'controller' => 'web/console.php', 'sdk' => false, 'tests' => false, ], 'v1/account' => [ 'name' => 'Account', 'description' => '/docs/services/account.md', - 'controller' => 'controllers/api/account.php', + 'controller' => 'api/account.php', 'sdk' => true, 'tests' => false, ], 'v1/avatars' => [ 'name' => 'Avatars', 'description' => '/docs/services/avatars.md', - 'controller' => 'controllers/api/avatars.php', + 'controller' => 'api/avatars.php', 'sdk' => true, 'tests' => false, ], 'v1/database' => [ 'name' => 'Database', 'description' => '/docs/services/database.md', - 'controller' => 'controllers/api/database.php', + 'controller' => 'api/database.php', 'sdk' => true, 'tests' => false, ], 'v1/locale' => [ 'name' => 'Locale', 'description' => '/docs/services/locale.md', - 'controller' => 'controllers/api/locale.php', + 'controller' => 'api/locale.php', 'sdk' => true, 'tests' => false, ], 'v1/health' => [ 'name' => 'Health', 'description' => '/docs/services/health.md', - 'controller' => 'controllers/api/health.php', + 'controller' => 'api/health.php', 'sdk' => true, 'tests' => false, ], 'v1/projects' => [ 'name' => 'Projects', - 'controller' => 'controllers/api/projects.php', + 'controller' => 'api/projects.php', 'sdk' => true, 'tests' => false, ], 'v1/storage' => [ 'name' => 'Storage', 'description' => '/docs/services/storage.md', - 'controller' => 'controllers/api/storage.php', + 'controller' => 'api/storage.php', 'sdk' => true, 'tests' => false, ], 'v1/teams' => [ 'name' => 'Teams', 'description' => '/docs/services/teams.md', - 'controller' => 'controllers/api/teams.php', + 'controller' => 'api/teams.php', 'sdk' => true, 'tests' => false, ], 'v1/users' => [ 'name' => 'Users', 'description' => '/docs/services/users.md', - 'controller' => 'controllers/api/users.php', + 'controller' => 'api/users.php', + 'sdk' => true, + 'tests' => false, + ], + 'v1/functions' => [ + 'name' => 'Users', + 'description' => '/docs/services/functions.md', + 'controller' => 'api/functions.php', 'sdk' => true, 'tests' => false, ], 'v1/mock' => [ 'name' => 'Mock', 'description' => '', - 'controller' => 'controllers/mock.php', + 'controller' => 'mock.php', 'sdk' => false, 'tests' => true, ], 'v1/graphql' => [ 'name' => 'GraphQL', 'description' => 'GraphQL Endpoint', - 'controller' => 'controllers/api/graphql.php', + 'controller' => 'api/graphql.php', 'sdk' => false, 'tests' => false, ], diff --git a/app/config/specs/0.6.2.client.json b/app/config/specs/0.6.2.client.json index 6524743bca..2a778b4596 100644 --- a/app/config/specs/0.6.2.client.json +++ b/app/config/specs/0.6.2.client.json @@ -1,2 +1,2 @@ -{"swagger":"2.0","info":{"version":"0.6.2","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@localhost.test"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"appwrite.io","basePath":"\/v1","schemes":["https"],"consumes":["application\/json","multipart\/form-data"],"produces":["application\/json"],"securityDefinitions":{"Project":{"type":"apiKey","name":"X-Appwrite-Project","description":"Your project ID","in":"header","extensions":{"demo":"5df5acd0d48c2"}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","extensions":{"demo":"en"}}},"paths":{"\/account":{"get":{"summary":"Get Account","operationId":"get","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","extensions":{"weight":38,"cookies":false,"type":"","demo":"docs\/examples\/account\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]},"post":{"summary":"Create Account","operationId":"create","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [\/account\/verfication](\/docs\/client\/account#createVerification) route to start verifying the user email address. To allow your new user to login to his new account, you need to create a new [account session](\/docs\/client\/account#createSession).","extensions":{"weight":32,"cookies":false,"type":"","demo":"docs\/examples\/account\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]},"delete":{"summary":"Delete Account","operationId":"delete","consumes":["application\/json"],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","extensions":{"weight":46,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"updateEmail","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.","extensions":{"weight":44,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","extensions":{"weight":41,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account Name","operationId":"updateName","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account name.","extensions":{"weight":42,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"User name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]}},"\/account\/password":{"patch":{"summary":"Update Account Password","operationId":"updatePassword","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user password. For validation, user is required to pass the password twice.","extensions":{"weight":43,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"password","description":"New user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"oldPassword","description":"Old user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","extensions":{"weight":39,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]},"patch":{"summary":"Update Account Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","extensions":{"weight":45,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/account\/recovery":{"post":{"summary":"Create Password Recovery","operationId":"createRecovery","consumes":["application\/json"],"tags":["account"],"description":"Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT \/account\/recovery](\/docs\/client\/account#updateRecovery) endpoint to complete the process.","extensions":{"weight":49,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-recovery.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-recovery.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Password Recovery","operationId":"updateRecovery","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/docs\/client\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.","extensions":{"weight":50,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-recovery.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-recovery.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"userId","description":"User account UID address.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid reset token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"},{"name":"password","description":"New password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"passwordAgain","description":"New password again. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","extensions":{"weight":40,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]},"post":{"summary":"Create Account Session","operationId":"createSession","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login into his account by providing a valid email and password combination. This route will create a new session for the user.","extensions":{"weight":33,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]},"delete":{"summary":"Delete All Account Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["account"],"description":"Delete all sessions from the user account and remove any sessions cookies from the end client.","extensions":{"weight":48,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-sessions.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]}},"\/account\/sessions\/oauth2\/{provider}":{"get":{"summary":"Create Account Session with OAuth2","operationId":"createOAuth2Session","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login to his account using the OAuth2 provider of his choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.","extensions":{"weight":34,"cookies":false,"type":"webAuth","demo":"docs\/examples\/account\/create-o-auth2session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-oauth2.md","rate-limit":50,"rate-time":3600,"rate-key":"ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, twitch, vk, yahoo, yandex.","required":true,"type":"string","x-example":"amazon","in":"path"},{"name":"success","description":"URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"\/auth\/oauth2\/success","in":"query"},{"name":"failure","description":"URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"\/auth\/oauth2\/failure","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all his account sessions across all his different devices. When using the option id argument, only the session unique ID provider will be deleted.","extensions":{"weight":47,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-session.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/verification":{"post":{"summary":"Create Email Verification","operationId":"createVerification","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](\/docs\/client\/account#updateAccountVerification). \n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n","extensions":{"weight":51,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"url","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Email Verification","operationId":"updateVerification","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","extensions":{"weight":52,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid verification token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}},"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"getBrowser","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","extensions":{"weight":54,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-browser.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"getCreditCard","consumes":["application\/json"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.","extensions":{"weight":53,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-credit-card.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa.","required":true,"type":"string","x-example":"amex","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"getFavicon","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL.","extensions":{"weight":57,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-favicon.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"url","description":"Website URL which you want to fetch the favicon from.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"}]}},"\/avatars\/flags\/{code}":{"get":{"summary":"Get Country Flag","operationId":"getFlag","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings.","extensions":{"weight":55,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-flag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"getImage","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.","extensions":{"weight":56,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-image.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"url","description":"Image URL which you want to crop.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"getInitials","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.","extensions":{"weight":59,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-initials.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"Full Name. When empty, current user name or email will be used.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"query"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"},{"name":"background","description":"Changes background color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"}]}},"\/avatars\/qr":{"get":{"summary":"Get QR Code","operationId":"getQR","consumes":["application\/json"],"tags":["avatars"],"description":"Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.","extensions":{"weight":58,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-q-r.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"text","description":"Plain text to be converted to QR code image.","required":true,"type":"string","x-example":"[TEXT]","in":"query"},{"name":"size","description":"QR code size. Pass an integer between 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"listDocuments","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":66,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"offset","description":"Offset value. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":50,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"$id","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"createDocument","consumes":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","extensions":{"weight":65,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"parentDocument","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"[PARENT_DOCUMENT]","default":"","in":"formData"},{"name":"parentProperty","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","default":"","in":"formData"},{"name":"parentPropertyType","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"assign","default":"assign","in":"formData"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"getDocument","consumes":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","extensions":{"weight":67,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"updateDocument","consumes":["application\/json"],"tags":["database"],"description":"","extensions":{"weight":68,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Document","operationId":"deleteDocument","consumes":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted.","extensions":{"weight":69,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"get","consumes":["application\/json"],"tags":["locale"],"description":"Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))","extensions":{"weight":70,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"getContinents","consumes":["application\/json"],"tags":["locale"],"description":"List of all continents. You can use the locale header to get the data in a supported language.","extensions":{"weight":74,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"getCountries","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries. You can use the locale header to get the data in a supported language.","extensions":{"weight":71,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"getCountriesEU","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.","extensions":{"weight":72,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"getCountriesPhones","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries phone codes. You can use the locale header to get the data in a supported language.","extensions":{"weight":73,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"getCurrencies","consumes":["application\/json"],"tags":["locale"],"description":"List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.","extensions":{"weight":75,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"getLanguages","consumes":["application\/json"],"tags":["locale"],"description":"List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.","extensions":{"weight":76,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"listFiles","consumes":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":124,"cookies":false,"type":"","demo":"docs\/examples\/storage\/list-files.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"createFile","consumes":["multipart\/form-data"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","extensions":{"weight":123,"cookies":false,"type":"upload","demo":"docs\/examples\/storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"file","description":"Binary File.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"getFile","consumes":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","extensions":{"weight":125,"cookies":false,"type":"","demo":"docs\/examples\/storage\/get-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"updateFile","consumes":["application\/json"],"tags":["storage"],"description":"Update file by its unique ID. Only users with write permissions have access to update this resource.","extensions":{"weight":129,"cookies":false,"type":"","demo":"docs\/examples\/storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete File","operationId":"deleteFile","consumes":["application\/json"],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","extensions":{"weight":130,"cookies":false,"type":"","demo":"docs\/examples\/storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"getFileDownload","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.","extensions":{"weight":127,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-download.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"getFilePreview","consumes":["application\/json"],"tags":["storage"],"description":"Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image.","extensions":{"weight":126,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-preview.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"getFileView","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.","extensions":{"weight":128,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-view.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"list","consumes":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":132,"cookies":false,"type":"","demo":"docs\/examples\/teams\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"create","consumes":["application\/json"],"tags":["teams"],"description":"Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","extensions":{"weight":131,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":["owner"],"in":"formData"}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"get","consumes":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","extensions":{"weight":133,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"update","consumes":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":134,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]},"delete":{"summary":"Delete Team","operationId":"delete","consumes":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":135,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"getMemberships","consumes":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","extensions":{"weight":137,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"createMembership","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","extensions":{"weight":136,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"email","description":"New team member email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"name","description":"New team member name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"deleteMembership","consumes":["application\/json"],"tags":["teams"],"description":"This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if he didn't accept it.","extensions":{"weight":139,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"updateMembershipStatus","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after he is being redirected back to your app from the invitation email he was sent.","extensions":{"weight":138,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update-membership-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"},{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Secret key.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}}},"definitions":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/localhost\/docs"}} \ No newline at end of file +{"swagger":"2.0","info":{"version":"0.6.2","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@localhost.test"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"appwrite.io","basePath":"\/v1","schemes":["https"],"consumes":["application\/json","multipart\/form-data"],"produces":["application\/json"],"securityDefinitions":{"Project":{"type":"apiKey","name":"X-Appwrite-Project","description":"Your project ID","in":"header","extensions":{"demo":"5df5acd0d48c2"}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","extensions":{"demo":"en"}}},"paths":{"\/account":{"get":{"summary":"Get Account","operationId":"get","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","extensions":{"weight":38,"cookies":false,"type":"","demo":"docs\/examples\/account\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]},"post":{"summary":"Create Account","operationId":"create","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [\/account\/verfication](\/docs\/client\/account#createVerification) route to start verifying the user email address. To allow your new user to login to his new account, you need to create a new [account session](\/docs\/client\/account#createSession).","extensions":{"weight":32,"cookies":false,"type":"","demo":"docs\/examples\/account\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]},"delete":{"summary":"Delete Account","operationId":"delete","consumes":["application\/json"],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","extensions":{"weight":46,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"updateEmail","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.","extensions":{"weight":44,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","extensions":{"weight":41,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account Name","operationId":"updateName","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account name.","extensions":{"weight":42,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"User name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]}},"\/account\/password":{"patch":{"summary":"Update Account Password","operationId":"updatePassword","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user password. For validation, user is required to pass the password twice.","extensions":{"weight":43,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"password","description":"New user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"oldPassword","description":"Old user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","extensions":{"weight":39,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]},"patch":{"summary":"Update Account Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","extensions":{"weight":45,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/account\/recovery":{"post":{"summary":"Create Password Recovery","operationId":"createRecovery","consumes":["application\/json"],"tags":["account"],"description":"Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT \/account\/recovery](\/docs\/client\/account#updateRecovery) endpoint to complete the process.","extensions":{"weight":49,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-recovery.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-recovery.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Password Recovery","operationId":"updateRecovery","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/docs\/client\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.","extensions":{"weight":50,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-recovery.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-recovery.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"userId","description":"User account UID address.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid reset token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"},{"name":"password","description":"New password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"passwordAgain","description":"New password again. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","extensions":{"weight":40,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]},"post":{"summary":"Create Account Session","operationId":"createSession","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login into his account by providing a valid email and password combination. This route will create a new session for the user.","extensions":{"weight":33,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]},"delete":{"summary":"Delete All Account Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["account"],"description":"Delete all sessions from the user account and remove any sessions cookies from the end client.","extensions":{"weight":48,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-sessions.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]}},"\/account\/sessions\/oauth2\/{provider}":{"get":{"summary":"Create Account Session with OAuth2","operationId":"createOAuth2Session","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login to his account using the OAuth2 provider of his choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.","extensions":{"weight":34,"cookies":false,"type":"webAuth","demo":"docs\/examples\/account\/create-o-auth2session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-oauth2.md","rate-limit":50,"rate-time":3600,"rate-key":"ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, twitch, vk, yahoo, yandex.","required":true,"type":"string","x-example":"amazon","in":"path"},{"name":"success","description":"URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/success","in":"query"},{"name":"failure","description":"URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/failure","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all his account sessions across all his different devices. When using the option id argument, only the session unique ID provider will be deleted.","extensions":{"weight":47,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-session.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/verification":{"post":{"summary":"Create Email Verification","operationId":"createVerification","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](\/docs\/client\/account#updateAccountVerification). \n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n","extensions":{"weight":51,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"url","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Email Verification","operationId":"updateVerification","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","extensions":{"weight":52,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid verification token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}},"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"getBrowser","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","extensions":{"weight":54,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-browser.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"getCreditCard","consumes":["application\/json"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.","extensions":{"weight":53,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-credit-card.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa.","required":true,"type":"string","x-example":"amex","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"getFavicon","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL.","extensions":{"weight":57,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-favicon.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"url","description":"Website URL which you want to fetch the favicon from.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"}]}},"\/avatars\/flags\/{code}":{"get":{"summary":"Get Country Flag","operationId":"getFlag","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings.","extensions":{"weight":55,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-flag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"getImage","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.","extensions":{"weight":56,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-image.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"url","description":"Image URL which you want to crop.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"getInitials","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.","extensions":{"weight":59,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-initials.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"Full Name. When empty, current user name or email will be used.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"query"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"},{"name":"background","description":"Changes background color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"}]}},"\/avatars\/qr":{"get":{"summary":"Get QR Code","operationId":"getQR","consumes":["application\/json"],"tags":["avatars"],"description":"Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.","extensions":{"weight":58,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-q-r.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"text","description":"Plain text to be converted to QR code image.","required":true,"type":"string","x-example":"[TEXT]","in":"query"},{"name":"size","description":"QR code size. Pass an integer between 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"listDocuments","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":66,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"offset","description":"Offset value. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":50,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"$id","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"createDocument","consumes":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","extensions":{"weight":65,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"parentDocument","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"[PARENT_DOCUMENT]","default":"","in":"formData"},{"name":"parentProperty","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","default":"","in":"formData"},{"name":"parentPropertyType","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"assign","default":"assign","in":"formData"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"getDocument","consumes":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","extensions":{"weight":67,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"updateDocument","consumes":["application\/json"],"tags":["database"],"description":"","extensions":{"weight":68,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Document","operationId":"deleteDocument","consumes":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted.","extensions":{"weight":69,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"get","consumes":["application\/json"],"tags":["locale"],"description":"Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))","extensions":{"weight":70,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"getContinents","consumes":["application\/json"],"tags":["locale"],"description":"List of all continents. You can use the locale header to get the data in a supported language.","extensions":{"weight":74,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"getCountries","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries. You can use the locale header to get the data in a supported language.","extensions":{"weight":71,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"getCountriesEU","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.","extensions":{"weight":72,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"getCountriesPhones","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries phone codes. You can use the locale header to get the data in a supported language.","extensions":{"weight":73,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"getCurrencies","consumes":["application\/json"],"tags":["locale"],"description":"List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.","extensions":{"weight":75,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"getLanguages","consumes":["application\/json"],"tags":["locale"],"description":"List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.","extensions":{"weight":76,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"listFiles","consumes":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":124,"cookies":false,"type":"","demo":"docs\/examples\/storage\/list-files.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"createFile","consumes":["multipart\/form-data"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","extensions":{"weight":123,"cookies":false,"type":"upload","demo":"docs\/examples\/storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"file","description":"Binary File.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"getFile","consumes":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","extensions":{"weight":125,"cookies":false,"type":"","demo":"docs\/examples\/storage\/get-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"updateFile","consumes":["application\/json"],"tags":["storage"],"description":"Update file by its unique ID. Only users with write permissions have access to update this resource.","extensions":{"weight":129,"cookies":false,"type":"","demo":"docs\/examples\/storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete File","operationId":"deleteFile","consumes":["application\/json"],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","extensions":{"weight":130,"cookies":false,"type":"","demo":"docs\/examples\/storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"getFileDownload","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.","extensions":{"weight":127,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-download.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"getFilePreview","consumes":["application\/json"],"tags":["storage"],"description":"Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image.","extensions":{"weight":126,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-preview.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"getFileView","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.","extensions":{"weight":128,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-view.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"list","consumes":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":132,"cookies":false,"type":"","demo":"docs\/examples\/teams\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"create","consumes":["application\/json"],"tags":["teams"],"description":"Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","extensions":{"weight":131,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":["owner"],"in":"formData"}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"get","consumes":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","extensions":{"weight":133,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"update","consumes":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":134,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]},"delete":{"summary":"Delete Team","operationId":"delete","consumes":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":135,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"getMemberships","consumes":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","extensions":{"weight":137,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"createMembership","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","extensions":{"weight":136,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"email","description":"New team member email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"name","description":"New team member name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"deleteMembership","consumes":["application\/json"],"tags":["teams"],"description":"This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if he didn't accept it.","extensions":{"weight":139,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"updateMembershipStatus","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after he is being redirected back to your app from the invitation email he was sent.","extensions":{"weight":138,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update-membership-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"},{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Secret key.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}}},"definitions":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/localhost\/docs"}} \ No newline at end of file diff --git a/app/config/specs/0.7.0.client.json b/app/config/specs/0.7.0.client.json new file mode 100644 index 0000000000..1453566c2b --- /dev/null +++ b/app/config/specs/0.7.0.client.json @@ -0,0 +1,2 @@ + +{"swagger":"2.0","info":{"version":"0.7.0","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@localhost.test"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"appwrite.io","basePath":"\/v1","schemes":["https"],"consumes":["application\/json","multipart\/form-data"],"produces":["application\/json"],"securityDefinitions":{"Project":{"type":"apiKey","name":"X-Appwrite-Project","description":"Your project ID","in":"header","extensions":{"demo":"5df5acd0d48c2"}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","extensions":{"demo":"en"}}},"paths":{"\/account":{"get":{"summary":"Get Account","operationId":"get","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","extensions":{"weight":41,"cookies":false,"type":"","demo":"docs\/examples\/account\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]},"post":{"summary":"Create Account","operationId":"create","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [\/account\/verfication](\/docs\/client\/account#createVerification) route to start verifying the user email address. To allow your new user to login to his new account, you need to create a new [account session](\/docs\/client\/account#createSession).","extensions":{"weight":35,"cookies":false,"type":"","demo":"docs\/examples\/account\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]},"delete":{"summary":"Delete Account","operationId":"delete","consumes":["application\/json"],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","extensions":{"weight":49,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"updateEmail","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.","extensions":{"weight":47,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","extensions":{"weight":44,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account Name","operationId":"updateName","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account name.","extensions":{"weight":45,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"User name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]}},"\/account\/password":{"patch":{"summary":"Update Account Password","operationId":"updatePassword","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user password. For validation, user is required to pass the password twice.","extensions":{"weight":46,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"password","description":"New user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"oldPassword","description":"Old user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","extensions":{"weight":42,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]},"patch":{"summary":"Update Account Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","extensions":{"weight":48,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/account\/recovery":{"post":{"summary":"Create Password Recovery","operationId":"createRecovery","consumes":["application\/json"],"tags":["account"],"description":"Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT \/account\/recovery](\/docs\/client\/account#updateRecovery) endpoint to complete the process.","extensions":{"weight":52,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-recovery.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-recovery.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Password Recovery","operationId":"updateRecovery","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/docs\/client\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.","extensions":{"weight":53,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-recovery.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-recovery.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"userId","description":"User account UID address.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid reset token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"},{"name":"password","description":"New password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"passwordAgain","description":"New password again. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","extensions":{"weight":43,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]},"post":{"summary":"Create Account Session","operationId":"createSession","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login into his account by providing a valid email and password combination. This route will create a new session for the user.","extensions":{"weight":36,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]},"delete":{"summary":"Delete All Account Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["account"],"description":"Delete all sessions from the user account and remove any sessions cookies from the end client.","extensions":{"weight":51,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-sessions.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]}},"\/account\/sessions\/oauth2\/{provider}":{"get":{"summary":"Create Account Session with OAuth2","operationId":"createOAuth2Session","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login to his account using the OAuth2 provider of his choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.","extensions":{"weight":37,"cookies":false,"type":"webAuth","demo":"docs\/examples\/account\/create-o-auth2session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-oauth2.md","rate-limit":50,"rate-time":3600,"rate-key":"ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, twitch, vk, yahoo, yandex.","required":true,"type":"string","x-example":"amazon","in":"path"},{"name":"success","description":"URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/success","in":"query"},{"name":"failure","description":"URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/failure","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all his account sessions across all his different devices. When using the option id argument, only the session unique ID provider will be deleted.","extensions":{"weight":50,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-session.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/verification":{"post":{"summary":"Create Email Verification","operationId":"createVerification","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](\/docs\/client\/account#updateAccountVerification). \n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n","extensions":{"weight":54,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"url","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Email Verification","operationId":"updateVerification","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","extensions":{"weight":55,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid verification token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}},"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"getBrowser","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","extensions":{"weight":57,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-browser.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"getCreditCard","consumes":["application\/json"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.","extensions":{"weight":56,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-credit-card.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa.","required":true,"type":"string","x-example":"amex","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"getFavicon","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL.","extensions":{"weight":60,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-favicon.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"url","description":"Website URL which you want to fetch the favicon from.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"}]}},"\/avatars\/flags\/{code}":{"get":{"summary":"Get Country Flag","operationId":"getFlag","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings.","extensions":{"weight":58,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-flag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"getImage","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.","extensions":{"weight":59,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-image.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"url","description":"Image URL which you want to crop.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"getInitials","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.","extensions":{"weight":62,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-initials.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"Full Name. When empty, current user name or email will be used. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"query"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"},{"name":"background","description":"Changes background color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"}]}},"\/avatars\/qr":{"get":{"summary":"Get QR Code","operationId":"getQR","consumes":["application\/json"],"tags":["avatars"],"description":"Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.","extensions":{"weight":61,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-q-r.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"text","description":"Plain text to be converted to QR code image.","required":true,"type":"string","x-example":"[TEXT]","in":"query"},{"name":"size","description":"QR code size. Pass an integer between 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"listDocuments","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":69,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Offset value. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"$id","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"createDocument","consumes":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","extensions":{"weight":68,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"parentDocument","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"[PARENT_DOCUMENT]","default":"","in":"formData"},{"name":"parentProperty","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","default":"","in":"formData"},{"name":"parentPropertyType","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"assign","default":"assign","in":"formData"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"getDocument","consumes":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","extensions":{"weight":70,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"updateDocument","consumes":["application\/json"],"tags":["database"],"description":"","extensions":{"weight":71,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Document","operationId":"deleteDocument","consumes":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted.","extensions":{"weight":72,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"get","consumes":["application\/json"],"tags":["locale"],"description":"Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))","extensions":{"weight":73,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"getContinents","consumes":["application\/json"],"tags":["locale"],"description":"List of all continents. You can use the locale header to get the data in a supported language.","extensions":{"weight":77,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"getCountries","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries. You can use the locale header to get the data in a supported language.","extensions":{"weight":74,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"getCountriesEU","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.","extensions":{"weight":75,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"getCountriesPhones","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries phone codes. You can use the locale header to get the data in a supported language.","extensions":{"weight":76,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"getCurrencies","consumes":["application\/json"],"tags":["locale"],"description":"List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.","extensions":{"weight":78,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"getLanguages","consumes":["application\/json"],"tags":["locale"],"description":"List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.","extensions":{"weight":79,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"listFiles","consumes":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":127,"cookies":false,"type":"","demo":"docs\/examples\/storage\/list-files.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"createFile","consumes":["multipart\/form-data"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","extensions":{"weight":126,"cookies":false,"type":"upload","demo":"docs\/examples\/storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"getFile","consumes":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","extensions":{"weight":128,"cookies":false,"type":"","demo":"docs\/examples\/storage\/get-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"updateFile","consumes":["application\/json"],"tags":["storage"],"description":"Update file by its unique ID. Only users with write permissions have access to update this resource.","extensions":{"weight":132,"cookies":false,"type":"","demo":"docs\/examples\/storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete File","operationId":"deleteFile","consumes":["application\/json"],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","extensions":{"weight":133,"cookies":false,"type":"","demo":"docs\/examples\/storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"getFileDownload","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.","extensions":{"weight":130,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-download.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"getFilePreview","consumes":["application\/json"],"tags":["storage"],"description":"Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image.","extensions":{"weight":129,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-preview.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"getFileView","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.","extensions":{"weight":131,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-view.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"list","consumes":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":135,"cookies":false,"type":"","demo":"docs\/examples\/teams\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"create","consumes":["application\/json"],"tags":["teams"],"description":"Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","extensions":{"weight":134,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"Team name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":["owner"],"in":"formData"}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"get","consumes":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","extensions":{"weight":136,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"update","consumes":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":137,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"name","description":"Team name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]},"delete":{"summary":"Delete Team","operationId":"delete","consumes":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":138,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"getMemberships","consumes":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","extensions":{"weight":140,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"createMembership","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","extensions":{"weight":139,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"email","description":"New team member email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"name","description":"New team member name. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"deleteMembership","consumes":["application\/json"],"tags":["teams"],"description":"This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if he didn't accept it.","extensions":{"weight":142,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"updateMembershipStatus","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after he is being redirected back to your app from the invitation email he was sent.","extensions":{"weight":141,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update-membership-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"},{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Secret key.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}}},"definitions":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/localhost\/docs"}} \ No newline at end of file diff --git a/app/config/specs/0.7.0.console.json b/app/config/specs/0.7.0.console.json new file mode 100644 index 0000000000..67769fa542 --- /dev/null +++ b/app/config/specs/0.7.0.console.json @@ -0,0 +1,2 @@ + +{"swagger":"2.0","info":{"version":"0.7.0","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@localhost.test"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"appwrite.io","basePath":"\/v1","schemes":["https"],"consumes":["application\/json","multipart\/form-data"],"produces":["application\/json"],"securityDefinitions":{"Project":{"type":"apiKey","name":"X-Appwrite-Project","description":"Your project ID","in":"header","extensions":{"demo":"5df5acd0d48c2"}},"Key":{"type":"apiKey","name":"X-Appwrite-Key","description":"Your secret API key","in":"header","extensions":{"demo":"919c2d18fb5d4...a2ae413da83346ad2"}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","extensions":{"demo":"en"}},"Mode":{"type":"apiKey","name":"X-Appwrite-Mode","description":"","in":"header","extensions":{"demo":""}}},"paths":{"\/account":{"get":{"summary":"Get Account","operationId":"get","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","extensions":{"weight":41,"cookies":false,"type":"","demo":"docs\/examples\/account\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]},"post":{"summary":"Create Account","operationId":"create","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [\/account\/verfication](\/docs\/client\/account#createVerification) route to start verifying the user email address. To allow your new user to login to his new account, you need to create a new [account session](\/docs\/client\/account#createSession).","extensions":{"weight":35,"cookies":false,"type":"","demo":"docs\/examples\/account\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]},"delete":{"summary":"Delete Account","operationId":"delete","consumes":["application\/json"],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","extensions":{"weight":49,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"updateEmail","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.","extensions":{"weight":47,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","extensions":{"weight":44,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account Name","operationId":"updateName","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account name.","extensions":{"weight":45,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"User name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]}},"\/account\/password":{"patch":{"summary":"Update Account Password","operationId":"updatePassword","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user password. For validation, user is required to pass the password twice.","extensions":{"weight":46,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"password","description":"New user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"oldPassword","description":"Old user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","extensions":{"weight":42,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]},"patch":{"summary":"Update Account Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","extensions":{"weight":48,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/account\/recovery":{"post":{"summary":"Create Password Recovery","operationId":"createRecovery","consumes":["application\/json"],"tags":["account"],"description":"Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT \/account\/recovery](\/docs\/client\/account#updateRecovery) endpoint to complete the process.","extensions":{"weight":52,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-recovery.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-recovery.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Password Recovery","operationId":"updateRecovery","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/docs\/client\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.","extensions":{"weight":53,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-recovery.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-recovery.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User account UID address.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid reset token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"},{"name":"password","description":"New password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"passwordAgain","description":"New password again. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","extensions":{"weight":43,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]},"post":{"summary":"Create Account Session","operationId":"createSession","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login into his account by providing a valid email and password combination. This route will create a new session for the user.","extensions":{"weight":36,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]},"delete":{"summary":"Delete All Account Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["account"],"description":"Delete all sessions from the user account and remove any sessions cookies from the end client.","extensions":{"weight":51,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-sessions.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/sessions\/oauth2\/{provider}":{"get":{"summary":"Create Account Session with OAuth2","operationId":"createOAuth2Session","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login to his account using the OAuth2 provider of his choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.","extensions":{"weight":37,"cookies":false,"type":"webAuth","demo":"docs\/examples\/account\/create-o-auth2session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-oauth2.md","rate-limit":50,"rate-time":3600,"rate-key":"ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, twitch, vk, yahoo, yandex.","required":true,"type":"string","x-example":"amazon","in":"path"},{"name":"success","description":"URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/success","in":"query"},{"name":"failure","description":"URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/failure","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all his account sessions across all his different devices. When using the option id argument, only the session unique ID provider will be deleted.","extensions":{"weight":50,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-session.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/verification":{"post":{"summary":"Create Email Verification","operationId":"createVerification","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](\/docs\/client\/account#updateAccountVerification). \n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n","extensions":{"weight":54,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"url","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Email Verification","operationId":"updateVerification","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","extensions":{"weight":55,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid verification token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}},"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"getBrowser","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","extensions":{"weight":57,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-browser.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"getCreditCard","consumes":["application\/json"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.","extensions":{"weight":56,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-credit-card.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa.","required":true,"type":"string","x-example":"amex","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"getFavicon","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL.","extensions":{"weight":60,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-favicon.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"url","description":"Website URL which you want to fetch the favicon from.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"}]}},"\/avatars\/flags\/{code}":{"get":{"summary":"Get Country Flag","operationId":"getFlag","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings.","extensions":{"weight":58,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-flag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"getImage","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.","extensions":{"weight":59,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-image.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"url","description":"Image URL which you want to crop.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"getInitials","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.","extensions":{"weight":62,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-initials.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Full Name. When empty, current user name or email will be used. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"query"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"},{"name":"background","description":"Changes background color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"}]}},"\/avatars\/qr":{"get":{"summary":"Get QR Code","operationId":"getQR","consumes":["application\/json"],"tags":["avatars"],"description":"Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.","extensions":{"weight":61,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-q-r.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"text","description":"Plain text to be converted to QR code image.","required":true,"type":"string","x-example":"[TEXT]","in":"query"},{"name":"size","description":"QR code size. Pass an integer between 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/database\/collections":{"get":{"summary":"List Collections","operationId":"listCollections","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":64,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Collection","operationId":"createCollection","consumes":["application\/json"],"tags":["database"],"description":"Create a new Collection.","extensions":{"weight":63,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Collection name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"rules","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/database\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"getCollection","consumes":["application\/json"],"tags":["database"],"description":"Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.","extensions":{"weight":65,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"updateCollection","consumes":["application\/json"],"tags":["database"],"description":"Update collection by its unique ID.","extensions":{"weight":66,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"name","description":"Collection name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"rules","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"formData"}]},"delete":{"summary":"Delete Collection","operationId":"deleteCollection","consumes":["application\/json"],"tags":["database"],"description":"Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.","extensions":{"weight":67,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"listDocuments","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":69,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Offset value. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"$id","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"createDocument","consumes":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","extensions":{"weight":68,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"parentDocument","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"[PARENT_DOCUMENT]","default":"","in":"formData"},{"name":"parentProperty","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","default":"","in":"formData"},{"name":"parentPropertyType","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"assign","default":"assign","in":"formData"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"getDocument","consumes":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","extensions":{"weight":70,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"updateDocument","consumes":["application\/json"],"tags":["database"],"description":"","extensions":{"weight":71,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Document","operationId":"deleteDocument","consumes":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted.","extensions":{"weight":72,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/functions":{"get":{"summary":"List Functions","operationId":"list","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":155,"cookies":false,"type":"","demo":"docs\/examples\/functions\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-functions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Function","operationId":"create","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":154,"cookies":false,"type":"","demo":"docs\/examples\/functions\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Function name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"env","description":"Execution enviornment.","required":true,"type":"string","x-example":"node-14","in":"formData"},{"name":"vars","description":"Key-value JSON object.","required":false,"type":"object","x-example":"{}","default":[],"in":"formData"},{"name":"events","description":"Events list.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"formData"},{"name":"schedule","description":"Schedule CRON syntax.","required":false,"type":"string","default":"","in":"formData"},{"name":"timeout","description":"Function maximum execution time in seconds.","required":false,"type":"integer","format":"int32","x-example":1,"default":15,"in":"formData"}]}},"\/functions\/{functionId}":{"get":{"summary":"Get Function","operationId":"get","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":156,"cookies":false,"type":"","demo":"docs\/examples\/functions\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]},"put":{"summary":"Update Function","operationId":"update","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":157,"cookies":false,"type":"","demo":"docs\/examples\/functions\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"name","description":"Function name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"vars","description":"Key-value JSON object.","required":false,"type":"object","x-example":"{}","default":[],"in":"formData"},{"name":"events","description":"Events list.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"formData"},{"name":"schedule","description":"Schedule CRON syntax.","required":false,"type":"string","default":"","in":"formData"},{"name":"timeout","description":"Function maximum execution time in seconds.","required":false,"type":"integer","format":"int32","x-example":1,"default":15,"in":"formData"}]},"delete":{"summary":"Delete Function","operationId":"delete","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":159,"cookies":false,"type":"","demo":"docs\/examples\/functions\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/executions":{"get":{"summary":"List Executions","operationId":"listExecutions","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":165,"cookies":false,"type":"","demo":"docs\/examples\/functions\/list-executions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-executions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Execution","operationId":"createExecution","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":164,"cookies":false,"type":"","demo":"docs\/examples\/functions\/create-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"async","description":"Execute code asynchronously. Pass 1 for true, 0 for false. Default value is 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"formData"}]}},"\/functions\/{functionId}\/executions\/{executionId}":{"get":{"summary":"Get Execution","operationId":"getExecution","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":166,"cookies":false,"type":"","demo":"docs\/examples\/functions\/get-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution unique ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/tag":{"patch":{"summary":"Update Function Tag","operationId":"updateTag","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":158,"cookies":false,"type":"","demo":"docs\/examples\/functions\/update-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tag","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG]","in":"formData"}]}},"\/functions\/{functionId}\/tags":{"get":{"summary":"List Tags","operationId":"listTags","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":161,"cookies":false,"type":"","demo":"docs\/examples\/functions\/list-tags.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-tags.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Tag","operationId":"createTag","consumes":["multipart\/form-data"],"tags":["functions"],"description":"","extensions":{"weight":160,"cookies":false,"type":"","demo":"docs\/examples\/functions\/create-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"command","description":"Code execution command.","required":true,"type":"string","x-example":"[COMMAND]","in":"formData"},{"name":"code","description":"Gzip file containing your code.","required":true,"type":"file","in":"formData"}]}},"\/functions\/{functionId}\/tags\/{tagId}":{"get":{"summary":"Get Tag","operationId":"getTag","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":162,"cookies":false,"type":"","demo":"docs\/examples\/functions\/get-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]},"delete":{"summary":"Delete Tag","operationId":"deleteTag","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":163,"cookies":false,"type":"","demo":"docs\/examples\/functions\/delete-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"get","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","extensions":{"weight":80,"cookies":false,"type":"","demo":"docs\/examples\/health\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/anti-virus":{"get":{"summary":"Get Anti virus","operationId":"getAntiVirus","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite Anti Virus server is up and connection is successful.","extensions":{"weight":92,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-anti-virus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"getCache","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","extensions":{"weight":83,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-cache.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-cache.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/db":{"get":{"summary":"Get DB","operationId":"getDB","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","extensions":{"weight":82,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-d-b.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-db.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/certificates":{"get":{"summary":"Get Certificate Queue","operationId":"getQueueCertificates","consumes":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","extensions":{"weight":89,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-certificates.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-certificates.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/functions":{"get":{"summary":"Get Functions Queue","operationId":"getQueueFunctions","consumes":["application\/json"],"tags":["health"],"description":"","extensions":{"weight":90,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-functions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-functions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/logs":{"get":{"summary":"Get Logs Queue","operationId":"getQueueLogs","consumes":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":87,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/tasks":{"get":{"summary":"Get Tasks Queue","operationId":"getQueueTasks","consumes":["application\/json"],"tags":["health"],"description":"Get the number of tasks that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":86,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-tasks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/usage":{"get":{"summary":"Get Usage Queue","operationId":"getQueueUsage","consumes":["application\/json"],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":88,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"getQueueWebhooks","consumes":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":85,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-webhooks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-webhooks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/storage\/local":{"get":{"summary":"Get Local Storage","operationId":"getStorageLocal","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","extensions":{"weight":91,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-storage-local.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-local.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/time":{"get":{"summary":"Get Time","operationId":"getTime","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","extensions":{"weight":84,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-time.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-time.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"get","consumes":["application\/json"],"tags":["locale"],"description":"Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))","extensions":{"weight":73,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"getContinents","consumes":["application\/json"],"tags":["locale"],"description":"List of all continents. You can use the locale header to get the data in a supported language.","extensions":{"weight":77,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"getCountries","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries. You can use the locale header to get the data in a supported language.","extensions":{"weight":74,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"getCountriesEU","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.","extensions":{"weight":75,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"getCountriesPhones","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries phone codes. You can use the locale header to get the data in a supported language.","extensions":{"weight":76,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"getCurrencies","consumes":["application\/json"],"tags":["locale"],"description":"List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.","extensions":{"weight":78,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"getLanguages","consumes":["application\/json"],"tags":["locale"],"description":"List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.","extensions":{"weight":79,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/projects":{"get":{"summary":"List Projects","operationId":"list","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":95,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Project","operationId":"create","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":94,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Project name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"formData"},{"name":"description","description":"Project description. Max length: 256 chars.","required":false,"type":"string","x-example":"[DESCRIPTION]","default":"","in":"formData"},{"name":"logo","description":"Project logo.","required":false,"type":"string","x-example":"[LOGO]","default":"","in":"formData"},{"name":"url","description":"Project URL.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"","in":"formData"},{"name":"legalName","description":"Project legal Name. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_NAME]","default":"","in":"formData"},{"name":"legalCountry","description":"Project legal Country. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_COUNTRY]","default":"","in":"formData"},{"name":"legalState","description":"Project legal State. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_STATE]","default":"","in":"formData"},{"name":"legalCity","description":"Project legal City. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_CITY]","default":"","in":"formData"},{"name":"legalAddress","description":"Project legal Address. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_ADDRESS]","default":"","in":"formData"},{"name":"legalTaxId","description":"Project legal Tax ID. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_TAX_ID]","default":"","in":"formData"}]}},"\/projects\/{projectId}":{"get":{"summary":"Get Project","operationId":"get","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":96,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"patch":{"summary":"Update Project","operationId":"update","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":98,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"name","description":"Project name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"description","description":"Project description. Max length: 256 chars.","required":false,"type":"string","x-example":"[DESCRIPTION]","default":"","in":"formData"},{"name":"logo","description":"Project logo.","required":false,"type":"string","x-example":"[LOGO]","default":"","in":"formData"},{"name":"url","description":"Project URL.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"","in":"formData"},{"name":"legalName","description":"Project legal name. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_NAME]","default":"","in":"formData"},{"name":"legalCountry","description":"Project legal country. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_COUNTRY]","default":"","in":"formData"},{"name":"legalState","description":"Project legal state. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_STATE]","default":"","in":"formData"},{"name":"legalCity","description":"Project legal city. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_CITY]","default":"","in":"formData"},{"name":"legalAddress","description":"Project legal address. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_ADDRESS]","default":"","in":"formData"},{"name":"legalTaxId","description":"Project legal tax ID. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_TAX_ID]","default":"","in":"formData"}]},"delete":{"summary":"Delete Project","operationId":"delete","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":100,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"password","description":"Your user password for confirmation. Must be between 6 to 32 chars.","required":true,"type":"string","x-example":"[PASSWORD]","in":"formData"}]}},"\/projects\/{projectId}\/domains":{"get":{"summary":"List Domains","operationId":"listDomains","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":122,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-domains.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Domain","operationId":"createDomain","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":121,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domain","description":"Domain name.","required":true,"type":"string","in":"formData"}]}},"\/projects\/{projectId}\/domains\/{domainId}":{"get":{"summary":"Get Domain","operationId":"getDomain","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":123,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]},"delete":{"summary":"Delete Domain","operationId":"deleteDomain","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":125,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]}},"\/projects\/{projectId}\/domains\/{domainId}\/verification":{"patch":{"summary":"Update Domain Verification Status","operationId":"updateDomainVerification","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":124,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-domain-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]}},"\/projects\/{projectId}\/keys":{"get":{"summary":"List Keys","operationId":"listKeys","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":107,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-keys.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Key","operationId":"createKey","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":106,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"name","description":"Key name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"scopes","description":"Key scopes list.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/projects\/{projectId}\/keys\/{keyId}":{"get":{"summary":"Get Key","operationId":"getKey","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":108,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"keyId","description":"Key unique ID.","required":true,"type":"string","x-example":"[KEY_ID]","in":"path"}]},"put":{"summary":"Update Key","operationId":"updateKey","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":109,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"keyId","description":"Key unique ID.","required":true,"type":"string","x-example":"[KEY_ID]","in":"path"},{"name":"name","description":"Key name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"scopes","description":"Key scopes list","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Key","operationId":"deleteKey","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":110,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"keyId","description":"Key unique ID.","required":true,"type":"string","x-example":"[KEY_ID]","in":"path"}]}},"\/projects\/{projectId}\/oauth2":{"patch":{"summary":"Update Project OAuth2","operationId":"updateOAuth2","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":99,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-o-auth2.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"provider","description":"Provider Name","required":true,"type":"string","x-example":"amazon","in":"formData"},{"name":"appId","description":"Provider app ID. Max length: 256 chars.","required":false,"type":"string","x-example":"[APP_ID]","default":"","in":"formData"},{"name":"secret","description":"Provider secret key. Max length: 512 chars.","required":false,"type":"string","x-example":"[SECRET]","default":"","in":"formData"}]}},"\/projects\/{projectId}\/platforms":{"get":{"summary":"List Platforms","operationId":"listPlatforms","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":117,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-platforms.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Platform","operationId":"createPlatform","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":116,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"type","description":"Platform type.","required":true,"type":"string","x-example":"web","in":"formData"},{"name":"name","description":"Platform name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"key","description":"Package name for android or bundle ID for iOS. Max length: 256 chars.","required":false,"type":"string","x-example":"[KEY]","default":"","in":"formData"},{"name":"store","description":"App store or Google Play store ID. Max length: 256 chars.","required":false,"type":"string","x-example":"[STORE]","default":"","in":"formData"},{"name":"hostname","description":"Platform client hostname. Max length: 256 chars.","required":false,"type":"string","x-example":"[HOSTNAME]","default":"","in":"formData"}]}},"\/projects\/{projectId}\/platforms\/{platformId}":{"get":{"summary":"Get Platform","operationId":"getPlatform","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":118,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"platformId","description":"Platform unique ID.","required":true,"type":"string","x-example":"[PLATFORM_ID]","in":"path"}]},"put":{"summary":"Update Platform","operationId":"updatePlatform","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":119,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"platformId","description":"Platform unique ID.","required":true,"type":"string","x-example":"[PLATFORM_ID]","in":"path"},{"name":"name","description":"Platform name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"key","description":"Package name for android or bundle ID for iOS. Max length: 256 chars.","required":false,"type":"string","x-example":"[KEY]","default":"","in":"formData"},{"name":"store","description":"App store or Google Play store ID. Max length: 256 chars.","required":false,"type":"string","x-example":"[STORE]","default":"","in":"formData"},{"name":"hostname","description":"Platform client URL. Max length: 256 chars.","required":false,"type":"string","x-example":"[HOSTNAME]","default":"","in":"formData"}]},"delete":{"summary":"Delete Platform","operationId":"deletePlatform","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":120,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"platformId","description":"Platform unique ID.","required":true,"type":"string","x-example":"[PLATFORM_ID]","in":"path"}]}},"\/projects\/{projectId}\/tasks":{"get":{"summary":"List Tasks","operationId":"listTasks","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":112,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Task","operationId":"createTask","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":111,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"name","description":"Task name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"status","description":"Task status.","required":true,"type":"string","x-example":"play","in":"formData"},{"name":"schedule","description":"Task schedule CRON syntax.","required":true,"type":"string","in":"formData"},{"name":"security","description":"Certificate verification, false for disabled or true for enabled.","required":true,"type":"boolean","x-example":false,"in":"formData"},{"name":"httpMethod","description":"Task HTTP method.","required":true,"type":"string","x-example":"GET","in":"formData"},{"name":"httpUrl","description":"Task HTTP URL","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"},{"name":"httpHeaders","description":"Task HTTP headers list.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"httpUser","description":"Task HTTP user. Max length: 256 chars.","required":false,"type":"string","x-example":"[HTTP_USER]","default":"","in":"formData"},{"name":"httpPass","description":"Task HTTP password. Max length: 256 chars.","required":false,"type":"string","x-example":"[HTTP_PASS]","default":"","in":"formData"}]}},"\/projects\/{projectId}\/tasks\/{taskId}":{"get":{"summary":"Get Task","operationId":"getTask","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":113,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"}]},"put":{"summary":"Update Task","operationId":"updateTask","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":114,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"},{"name":"name","description":"Task name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"status","description":"Task status.","required":true,"type":"string","x-example":"play","in":"formData"},{"name":"schedule","description":"Task schedule CRON syntax.","required":true,"type":"string","in":"formData"},{"name":"security","description":"Certificate verification, false for disabled or true for enabled.","required":true,"type":"boolean","x-example":false,"in":"formData"},{"name":"httpMethod","description":"Task HTTP method.","required":true,"type":"string","x-example":"GET","in":"formData"},{"name":"httpUrl","description":"Task HTTP URL.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"},{"name":"httpHeaders","description":"Task HTTP headers list.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"httpUser","description":"Task HTTP user. Max length: 256 chars.","required":false,"type":"string","x-example":"[HTTP_USER]","default":"","in":"formData"},{"name":"httpPass","description":"Task HTTP password. Max length: 256 chars.","required":false,"type":"string","x-example":"[HTTP_PASS]","default":"","in":"formData"}]},"delete":{"summary":"Delete Task","operationId":"deleteTask","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":115,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get Project","operationId":"getUsage","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":97,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"daily","default":"last30","in":"query"}]}},"\/projects\/{projectId}\/webhooks":{"get":{"summary":"List Webhooks","operationId":"listWebhooks","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":102,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-webhooks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Webhook","operationId":"createWebhook","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":101,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"name","description":"Webhook name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"events","description":"Events list.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"Webhook URL.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"},{"name":"security","description":"Certificate verification, false for disabled or true for enabled.","required":true,"type":"boolean","x-example":false,"in":"formData"},{"name":"httpUser","description":"Webhook HTTP user. Max length: 256 chars.","required":false,"type":"string","x-example":"[HTTP_USER]","default":"","in":"formData"},{"name":"httpPass","description":"Webhook HTTP password. Max length: 256 chars.","required":false,"type":"string","x-example":"[HTTP_PASS]","default":"","in":"formData"}]}},"\/projects\/{projectId}\/webhooks\/{webhookId}":{"get":{"summary":"Get Webhook","operationId":"getWebhook","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":103,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"webhookId","description":"Webhook unique ID.","required":true,"type":"string","x-example":"[WEBHOOK_ID]","in":"path"}]},"put":{"summary":"Update Webhook","operationId":"updateWebhook","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":104,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"webhookId","description":"Webhook unique ID.","required":true,"type":"string","x-example":"[WEBHOOK_ID]","in":"path"},{"name":"name","description":"Webhook name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"events","description":"Events list.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"Webhook URL.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"},{"name":"security","description":"Certificate verification, false for disabled or true for enabled.","required":true,"type":"boolean","x-example":false,"in":"formData"},{"name":"httpUser","description":"Webhook HTTP user. Max length: 256 chars.","required":false,"type":"string","x-example":"[HTTP_USER]","default":"","in":"formData"},{"name":"httpPass","description":"Webhook HTTP password. Max length: 256 chars.","required":false,"type":"string","x-example":"[HTTP_PASS]","default":"","in":"formData"}]},"delete":{"summary":"Delete Webhook","operationId":"deleteWebhook","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":105,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"webhookId","description":"Webhook unique ID.","required":true,"type":"string","x-example":"[WEBHOOK_ID]","in":"path"}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"listFiles","consumes":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":127,"cookies":false,"type":"","demo":"docs\/examples\/storage\/list-files.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"createFile","consumes":["multipart\/form-data"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","extensions":{"weight":126,"cookies":false,"type":"upload","demo":"docs\/examples\/storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"getFile","consumes":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","extensions":{"weight":128,"cookies":false,"type":"","demo":"docs\/examples\/storage\/get-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"updateFile","consumes":["application\/json"],"tags":["storage"],"description":"Update file by its unique ID. Only users with write permissions have access to update this resource.","extensions":{"weight":132,"cookies":false,"type":"","demo":"docs\/examples\/storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete File","operationId":"deleteFile","consumes":["application\/json"],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","extensions":{"weight":133,"cookies":false,"type":"","demo":"docs\/examples\/storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"getFileDownload","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.","extensions":{"weight":130,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-download.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"getFilePreview","consumes":["application\/json"],"tags":["storage"],"description":"Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image.","extensions":{"weight":129,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-preview.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"getFileView","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.","extensions":{"weight":131,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-view.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"list","consumes":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":135,"cookies":false,"type":"","demo":"docs\/examples\/teams\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"create","consumes":["application\/json"],"tags":["teams"],"description":"Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","extensions":{"weight":134,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Team name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":["owner"],"in":"formData"}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"get","consumes":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","extensions":{"weight":136,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"update","consumes":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":137,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"name","description":"Team name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]},"delete":{"summary":"Delete Team","operationId":"delete","consumes":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":138,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"getMemberships","consumes":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","extensions":{"weight":140,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"createMembership","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","extensions":{"weight":139,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"email","description":"New team member email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"name","description":"New team member name. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"deleteMembership","consumes":["application\/json"],"tags":["teams"],"description":"This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if he didn't accept it.","extensions":{"weight":142,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"updateMembershipStatus","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after he is being redirected back to your app from the invitation email he was sent.","extensions":{"weight":141,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update-membership-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"},{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Secret key.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}},"\/users":{"get":{"summary":"List Users","operationId":"list","consumes":["application\/json"],"tags":["users"],"description":"Get a list of all the project users. You can use the query params to filter your results.","extensions":{"weight":144,"cookies":false,"type":"","demo":"docs\/examples\/users\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-users.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create User","operationId":"create","consumes":["application\/json"],"tags":["users"],"description":"Create a new user.","extensions":{"weight":143,"cookies":false,"type":"","demo":"docs\/examples\/users\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]}},"\/users\/{userId}":{"get":{"summary":"Get User","operationId":"get","consumes":["application\/json"],"tags":["users"],"description":"Get user by its unique ID.","extensions":{"weight":145,"cookies":false,"type":"","demo":"docs\/examples\/users\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User","operationId":"deleteUser","consumes":["application\/json"],"tags":["users"],"description":"Delete a user by its unique ID.","extensions":{"weight":153,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["users"],"description":"Get user activity logs list by its unique ID.","extensions":{"weight":148,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/prefs":{"get":{"summary":"Get User Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["users"],"description":"Get user preferences by its unique ID.","extensions":{"weight":146,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["users"],"description":"Update user preferences by its unique ID. You can pass only the specific settings you wish to update.","extensions":{"weight":150,"cookies":false,"type":"","demo":"docs\/examples\/users\/update-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"Get User Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["users"],"description":"Get user sessions list by its unique ID.","extensions":{"weight":147,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["users"],"description":"Delete all user sessions by its unique ID.","extensions":{"weight":152,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/sessions\/{sessionId}":{"delete":{"summary":"Delete User Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["users"],"description":"Delete user sessions by its unique ID.","extensions":{"weight":151,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"User unique session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"updateStatus","consumes":["application\/json"],"tags":["users"],"description":"Update user status by its unique ID.","extensions":{"weight":149,"cookies":false,"type":"","demo":"docs\/examples\/users\/update-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"status","description":"User Status code. To activate the user pass 1, to block the user pass 2 and for disabling the user pass 0","required":true,"type":"string","x-example":1,"in":"formData"}]}}},"definitions":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/localhost\/docs"}} \ No newline at end of file diff --git a/app/config/specs/0.7.0.server.json b/app/config/specs/0.7.0.server.json new file mode 100644 index 0000000000..4b7c8546f8 --- /dev/null +++ b/app/config/specs/0.7.0.server.json @@ -0,0 +1,2 @@ + +{"swagger":"2.0","info":{"version":"0.7.0","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@localhost.test"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"appwrite.io","basePath":"\/v1","schemes":["https"],"consumes":["application\/json","multipart\/form-data"],"produces":["application\/json"],"securityDefinitions":{"Project":{"type":"apiKey","name":"X-Appwrite-Project","description":"Your project ID","in":"header","extensions":{"demo":"5df5acd0d48c2"}},"Key":{"type":"apiKey","name":"X-Appwrite-Key","description":"Your secret API key","in":"header","extensions":{"demo":"919c2d18fb5d4...a2ae413da83346ad2"}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","extensions":{"demo":"en"}}},"paths":{"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"getBrowser","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","extensions":{"weight":57,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-browser.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"getCreditCard","consumes":["application\/json"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.","extensions":{"weight":56,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-credit-card.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa.","required":true,"type":"string","x-example":"amex","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"getFavicon","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL.","extensions":{"weight":60,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-favicon.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"url","description":"Website URL which you want to fetch the favicon from.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"}]}},"\/avatars\/flags\/{code}":{"get":{"summary":"Get Country Flag","operationId":"getFlag","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings.","extensions":{"weight":58,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-flag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"getImage","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.","extensions":{"weight":59,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-image.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"url","description":"Image URL which you want to crop.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"getInitials","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.","extensions":{"weight":62,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-initials.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Full Name. When empty, current user name or email will be used. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"query"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"},{"name":"background","description":"Changes background color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"}]}},"\/avatars\/qr":{"get":{"summary":"Get QR Code","operationId":"getQR","consumes":["application\/json"],"tags":["avatars"],"description":"Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.","extensions":{"weight":61,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-q-r.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"text","description":"Plain text to be converted to QR code image.","required":true,"type":"string","x-example":"[TEXT]","in":"query"},{"name":"size","description":"QR code size. Pass an integer between 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/database\/collections":{"get":{"summary":"List Collections","operationId":"listCollections","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":64,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Collection","operationId":"createCollection","consumes":["application\/json"],"tags":["database"],"description":"Create a new Collection.","extensions":{"weight":63,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Collection name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"rules","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/database\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"getCollection","consumes":["application\/json"],"tags":["database"],"description":"Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.","extensions":{"weight":65,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"updateCollection","consumes":["application\/json"],"tags":["database"],"description":"Update collection by its unique ID.","extensions":{"weight":66,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"name","description":"Collection name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"rules","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"formData"}]},"delete":{"summary":"Delete Collection","operationId":"deleteCollection","consumes":["application\/json"],"tags":["database"],"description":"Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.","extensions":{"weight":67,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"listDocuments","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":69,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Offset value. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"$id","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"createDocument","consumes":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","extensions":{"weight":68,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"parentDocument","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"[PARENT_DOCUMENT]","default":"","in":"formData"},{"name":"parentProperty","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","default":"","in":"formData"},{"name":"parentPropertyType","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"assign","default":"assign","in":"formData"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"getDocument","consumes":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","extensions":{"weight":70,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"updateDocument","consumes":["application\/json"],"tags":["database"],"description":"","extensions":{"weight":71,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Document","operationId":"deleteDocument","consumes":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted.","extensions":{"weight":72,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/functions":{"get":{"summary":"List Functions","operationId":"list","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":155,"cookies":false,"type":"","demo":"docs\/examples\/functions\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-functions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Function","operationId":"create","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":154,"cookies":false,"type":"","demo":"docs\/examples\/functions\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Function name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"env","description":"Execution enviornment.","required":true,"type":"string","x-example":"node-14","in":"formData"},{"name":"vars","description":"Key-value JSON object.","required":false,"type":"object","x-example":"{}","default":[],"in":"formData"},{"name":"events","description":"Events list.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"formData"},{"name":"schedule","description":"Schedule CRON syntax.","required":false,"type":"string","default":"","in":"formData"},{"name":"timeout","description":"Function maximum execution time in seconds.","required":false,"type":"integer","format":"int32","x-example":1,"default":15,"in":"formData"}]}},"\/functions\/{functionId}":{"get":{"summary":"Get Function","operationId":"get","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":156,"cookies":false,"type":"","demo":"docs\/examples\/functions\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]},"put":{"summary":"Update Function","operationId":"update","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":157,"cookies":false,"type":"","demo":"docs\/examples\/functions\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"name","description":"Function name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"vars","description":"Key-value JSON object.","required":false,"type":"object","x-example":"{}","default":[],"in":"formData"},{"name":"events","description":"Events list.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"formData"},{"name":"schedule","description":"Schedule CRON syntax.","required":false,"type":"string","default":"","in":"formData"},{"name":"timeout","description":"Function maximum execution time in seconds.","required":false,"type":"integer","format":"int32","x-example":1,"default":15,"in":"formData"}]},"delete":{"summary":"Delete Function","operationId":"delete","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":159,"cookies":false,"type":"","demo":"docs\/examples\/functions\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/executions":{"get":{"summary":"List Executions","operationId":"listExecutions","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":165,"cookies":false,"type":"","demo":"docs\/examples\/functions\/list-executions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-executions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Execution","operationId":"createExecution","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":164,"cookies":false,"type":"","demo":"docs\/examples\/functions\/create-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"async","description":"Execute code asynchronously. Pass 1 for true, 0 for false. Default value is 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"formData"}]}},"\/functions\/{functionId}\/executions\/{executionId}":{"get":{"summary":"Get Execution","operationId":"getExecution","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":166,"cookies":false,"type":"","demo":"docs\/examples\/functions\/get-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution unique ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/tag":{"patch":{"summary":"Update Function Tag","operationId":"updateTag","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":158,"cookies":false,"type":"","demo":"docs\/examples\/functions\/update-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tag","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG]","in":"formData"}]}},"\/functions\/{functionId}\/tags":{"get":{"summary":"List Tags","operationId":"listTags","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":161,"cookies":false,"type":"","demo":"docs\/examples\/functions\/list-tags.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-tags.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Tag","operationId":"createTag","consumes":["multipart\/form-data"],"tags":["functions"],"description":"","extensions":{"weight":160,"cookies":false,"type":"","demo":"docs\/examples\/functions\/create-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"command","description":"Code execution command.","required":true,"type":"string","x-example":"[COMMAND]","in":"formData"},{"name":"code","description":"Gzip file containing your code.","required":true,"type":"file","in":"formData"}]}},"\/functions\/{functionId}\/tags\/{tagId}":{"get":{"summary":"Get Tag","operationId":"getTag","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":162,"cookies":false,"type":"","demo":"docs\/examples\/functions\/get-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]},"delete":{"summary":"Delete Tag","operationId":"deleteTag","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":163,"cookies":false,"type":"","demo":"docs\/examples\/functions\/delete-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"get","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","extensions":{"weight":80,"cookies":false,"type":"","demo":"docs\/examples\/health\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/anti-virus":{"get":{"summary":"Get Anti virus","operationId":"getAntiVirus","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite Anti Virus server is up and connection is successful.","extensions":{"weight":92,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-anti-virus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"getCache","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","extensions":{"weight":83,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-cache.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-cache.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/db":{"get":{"summary":"Get DB","operationId":"getDB","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","extensions":{"weight":82,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-d-b.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-db.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/certificates":{"get":{"summary":"Get Certificate Queue","operationId":"getQueueCertificates","consumes":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","extensions":{"weight":89,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-certificates.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-certificates.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/functions":{"get":{"summary":"Get Functions Queue","operationId":"getQueueFunctions","consumes":["application\/json"],"tags":["health"],"description":"","extensions":{"weight":90,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-functions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-functions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/logs":{"get":{"summary":"Get Logs Queue","operationId":"getQueueLogs","consumes":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":87,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/tasks":{"get":{"summary":"Get Tasks Queue","operationId":"getQueueTasks","consumes":["application\/json"],"tags":["health"],"description":"Get the number of tasks that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":86,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-tasks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/usage":{"get":{"summary":"Get Usage Queue","operationId":"getQueueUsage","consumes":["application\/json"],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":88,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"getQueueWebhooks","consumes":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":85,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-webhooks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-webhooks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/storage\/local":{"get":{"summary":"Get Local Storage","operationId":"getStorageLocal","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","extensions":{"weight":91,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-storage-local.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-local.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/time":{"get":{"summary":"Get Time","operationId":"getTime","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","extensions":{"weight":84,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-time.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-time.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"get","consumes":["application\/json"],"tags":["locale"],"description":"Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))","extensions":{"weight":73,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"getContinents","consumes":["application\/json"],"tags":["locale"],"description":"List of all continents. You can use the locale header to get the data in a supported language.","extensions":{"weight":77,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"getCountries","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries. You can use the locale header to get the data in a supported language.","extensions":{"weight":74,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"getCountriesEU","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.","extensions":{"weight":75,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"getCountriesPhones","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries phone codes. You can use the locale header to get the data in a supported language.","extensions":{"weight":76,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"getCurrencies","consumes":["application\/json"],"tags":["locale"],"description":"List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.","extensions":{"weight":78,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"getLanguages","consumes":["application\/json"],"tags":["locale"],"description":"List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.","extensions":{"weight":79,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"listFiles","consumes":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":127,"cookies":false,"type":"","demo":"docs\/examples\/storage\/list-files.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"createFile","consumes":["multipart\/form-data"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","extensions":{"weight":126,"cookies":false,"type":"upload","demo":"docs\/examples\/storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"getFile","consumes":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","extensions":{"weight":128,"cookies":false,"type":"","demo":"docs\/examples\/storage\/get-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"updateFile","consumes":["application\/json"],"tags":["storage"],"description":"Update file by its unique ID. Only users with write permissions have access to update this resource.","extensions":{"weight":132,"cookies":false,"type":"","demo":"docs\/examples\/storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete File","operationId":"deleteFile","consumes":["application\/json"],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","extensions":{"weight":133,"cookies":false,"type":"","demo":"docs\/examples\/storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"getFileDownload","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.","extensions":{"weight":130,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-download.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"getFilePreview","consumes":["application\/json"],"tags":["storage"],"description":"Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image.","extensions":{"weight":129,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-preview.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"getFileView","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.","extensions":{"weight":131,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-view.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"list","consumes":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":135,"cookies":false,"type":"","demo":"docs\/examples\/teams\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"create","consumes":["application\/json"],"tags":["teams"],"description":"Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","extensions":{"weight":134,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Team name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":["owner"],"in":"formData"}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"get","consumes":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","extensions":{"weight":136,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"update","consumes":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":137,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"name","description":"Team name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]},"delete":{"summary":"Delete Team","operationId":"delete","consumes":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":138,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"getMemberships","consumes":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","extensions":{"weight":140,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"createMembership","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","extensions":{"weight":139,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"email","description":"New team member email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"name","description":"New team member name. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"deleteMembership","consumes":["application\/json"],"tags":["teams"],"description":"This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if he didn't accept it.","extensions":{"weight":142,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/users":{"get":{"summary":"List Users","operationId":"list","consumes":["application\/json"],"tags":["users"],"description":"Get a list of all the project users. You can use the query params to filter your results.","extensions":{"weight":144,"cookies":false,"type":"","demo":"docs\/examples\/users\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-users.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create User","operationId":"create","consumes":["application\/json"],"tags":["users"],"description":"Create a new user.","extensions":{"weight":143,"cookies":false,"type":"","demo":"docs\/examples\/users\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]}},"\/users\/{userId}":{"get":{"summary":"Get User","operationId":"get","consumes":["application\/json"],"tags":["users"],"description":"Get user by its unique ID.","extensions":{"weight":145,"cookies":false,"type":"","demo":"docs\/examples\/users\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User","operationId":"deleteUser","consumes":["application\/json"],"tags":["users"],"description":"Delete a user by its unique ID.","extensions":{"weight":153,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["users"],"description":"Get user activity logs list by its unique ID.","extensions":{"weight":148,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/prefs":{"get":{"summary":"Get User Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["users"],"description":"Get user preferences by its unique ID.","extensions":{"weight":146,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["users"],"description":"Update user preferences by its unique ID. You can pass only the specific settings you wish to update.","extensions":{"weight":150,"cookies":false,"type":"","demo":"docs\/examples\/users\/update-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"Get User Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["users"],"description":"Get user sessions list by its unique ID.","extensions":{"weight":147,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["users"],"description":"Delete all user sessions by its unique ID.","extensions":{"weight":152,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/sessions\/{sessionId}":{"delete":{"summary":"Delete User Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["users"],"description":"Delete user sessions by its unique ID.","extensions":{"weight":151,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"User unique session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"updateStatus","consumes":["application\/json"],"tags":["users"],"description":"Update user status by its unique ID.","extensions":{"weight":149,"cookies":false,"type":"","demo":"docs\/examples\/users\/update-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"status","description":"User Status code. To activate the user pass 1, to block the user pass 2 and for disabling the user pass 0","required":true,"type":"string","x-example":1,"in":"formData"}]}}},"definitions":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/localhost\/docs"}} \ No newline at end of file diff --git a/app/config/storage/inputs.php b/app/config/storage/inputs.php new file mode 100644 index 0000000000..c580316c53 --- /dev/null +++ b/app/config/storage/inputs.php @@ -0,0 +1,8 @@ + 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'gif' => 'image/gif', + 'png' => 'image/png', +]; \ No newline at end of file diff --git a/app/config/storage/logos.php b/app/config/storage/logos.php new file mode 100644 index 0000000000..3170762dca --- /dev/null +++ b/app/config/storage/logos.php @@ -0,0 +1,43 @@ + __DIR__.'/logos/none.png', + + // Video Files + 'video/mp4' => __DIR__.'/logos/video.png', + 'video/x-flv' => __DIR__.'/logos/video.png', + 'application/x-mpegURL' => __DIR__.'/logos/video.png', + 'video/MP2T' => __DIR__.'/logos/video.png', + 'video/3gpp' => __DIR__.'/logos/video.png', + 'video/quicktime' => __DIR__.'/logos/video.png', + 'video/x-msvideo' => __DIR__.'/logos/video.png', + 'video/x-ms-wmv' => __DIR__.'/logos/video.png', + + // // Microsoft Word + 'application/msword' => __DIR__.'/logos/word.png', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => __DIR__.'/logos/word.png', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => __DIR__.'/logos/word.png', + 'application/vnd.ms-word.document.macroEnabled.12' => __DIR__.'/logos/word.png', + + // // Microsoft Excel + 'application/vnd.ms-excel' => __DIR__.'/logos/excel.png', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => __DIR__.'/logos/excel.png', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => __DIR__.'/logos/excel.png', + 'application/vnd.ms-excel.sheet.macroEnabled.12' => __DIR__.'/logos/excel.png', + 'application/vnd.ms-excel.template.macroEnabled.12' => __DIR__.'/logos/excel.png', + 'application/vnd.ms-excel.addin.macroEnabled.12' => __DIR__.'/logos/excel.png', + 'application/vnd.ms-excel.sheet.binary.macroEnabled.12' => __DIR__.'/logos/excel.png', + + // // Microsoft Power Point + 'application/vnd.ms-powerpoint' => __DIR__.'/logos/ppt.png', + 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => __DIR__.'/logos/ppt.png', + 'application/vnd.openxmlformats-officedocument.presentationml.template' => __DIR__.'/logos/ppt.png', + 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => __DIR__.'/logos/ppt.png', + 'application/vnd.ms-powerpoint.addin.macroEnabled.12' => __DIR__.'/logos/ppt.png', + 'application/vnd.ms-powerpoint.presentation.macroEnabled.12' => __DIR__.'/logos/ppt.png', + 'application/vnd.ms-powerpoint.template.macroEnabled.12' => __DIR__.'/logos/ppt.png', + 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12' => __DIR__.'/logos/ppt.png', + + // Adobe PDF + 'application/pdf' => __DIR__.'/logos/pdf.png', +]; \ No newline at end of file diff --git a/app/config/files/excel.png b/app/config/storage/logos/excel.png similarity index 100% rename from app/config/files/excel.png rename to app/config/storage/logos/excel.png diff --git a/app/config/files/none.png b/app/config/storage/logos/none.png similarity index 100% rename from app/config/files/none.png rename to app/config/storage/logos/none.png diff --git a/app/config/files/pdf.png b/app/config/storage/logos/pdf.png similarity index 100% rename from app/config/files/pdf.png rename to app/config/storage/logos/pdf.png diff --git a/app/config/files/ppt.png b/app/config/storage/logos/ppt.png similarity index 100% rename from app/config/files/ppt.png rename to app/config/storage/logos/ppt.png diff --git a/app/config/files/video.png b/app/config/storage/logos/video.png similarity index 100% rename from app/config/files/video.png rename to app/config/storage/logos/video.png diff --git a/app/config/files/word.png b/app/config/storage/logos/word.png similarity index 100% rename from app/config/files/word.png rename to app/config/storage/logos/word.png diff --git a/app/config/storage/mimes.php b/app/config/storage/mimes.php new file mode 100644 index 0000000000..242a990b8d --- /dev/null +++ b/app/config/storage/mimes.php @@ -0,0 +1,50 @@ + 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'gif' => 'image/gif', + 'png' => 'image/png', + 'webp' => 'image/webp', +]; \ No newline at end of file diff --git a/app/config/variables.php b/app/config/variables.php new file mode 100644 index 0000000000..c1b9982764 --- /dev/null +++ b/app/config/variables.php @@ -0,0 +1,136 @@ + '_APP_ENV', + 'default' => 'production', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_OPTIONS_ABUSE', + 'default' => 'enabled', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_OPTIONS_FORCE_HTTPS', + 'default' => 'enabled', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_OPENSSL_KEY_V1', + 'default' => 'your-secret-key', + 'required' => true, + 'question' => 'Choose a secret API key, make sure to make a backup of your key in a secure location', + ], + [ + 'name' => '_APP_DOMAIN', + 'default' => 'localhost', + 'required' => true, + 'question' => 'Enter your Appwrite hostname', + ], + [ + 'name' => '_APP_DOMAIN_TARGET', + 'default' => 'localhost', + 'required' => true, + 'question' => "Enter a DNS A record hostname to serve as a CNAME for your custom domains.\nYou can use the same value as used for the Appwrite hostname.", + ], + [ + 'name' => '_APP_REDIS_HOST', + 'default' => 'redis', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_REDIS_PORT', + 'default' => '6379', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_DB_HOST', + 'default' => 'mariadb', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_DB_PORT', + 'default' => '3306', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_DB_SCHEMA', + 'default' => 'appwrite', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_DB_USER', + 'default' => 'user', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_DB_PASS', + 'default' => 'password', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_INFLUXDB_HOST', + 'default' => 'influxdb', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_INFLUXDB_PORT', + 'default' => '8086', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_STATSD_HOST', + 'default' => 'telegraf', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_STATSD_PORT', + 'default' => '8125', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_SMTP_HOST', + 'default' => 'smtp', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_SMTP_PORT', + 'default' => '25', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_STORAGE_LIMIT', + 'default' => '100000000', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_FUNCTIONS_TIMEOUT', + 'default' => '900', + 'required' => false, + 'question' => '', + ], + [ + 'name' => '_APP_FUNCTIONS_CONTAINERS', + 'default' => '10', + 'required' => false, + 'question' => '', + ], +]; \ No newline at end of file diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 8ba5784412..3fe3509c21 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -1,10 +1,7 @@ init(function() use (&$oauth2Keys) { - foreach (Config::getParam('providers') as $key => $provider) { - if (!$provider['enabled']) { - continue; - } - - $oauth2Keys[] = 'oauth2'.\ucfirst($key); - $oauth2Keys[] = 'oauth2'.\ucfirst($key).'AccessToken'; - } -}, 'account'); - -$utopia->post('/v1/account') +App::post('/v1/account') ->desc('Create Account') ->groups(['api', 'account']) - ->label('webhook', 'account.create') + ->label('event', 'account.create') ->label('scope', 'public') ->label('sdk.platform', [APP_PLATFORM_CLIENT]) ->label('sdk.namespace', 'account') ->label('sdk.method', 'create') ->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. Must be between 6 to 32 chars.') - ->param('name', '', function () { return new Text(100); }, 'User name.', true) - ->action( - function ($email, $password, $name) use ($request, $response, $audit, $projectDB, $project, $webhook, $oauth2Keys) { - if ('console' === $project->getId()) { - $whitlistEmails = $project->getAttribute('authWhitelistEmails'); - $whitlistIPs = $project->getAttribute('authWhitelistIPs'); - $whitlistDomains = $project->getAttribute('authWhitelistDomains'); + ->param('email', '', new Email(), 'User email.') + ->param('password', '', new Password(), 'User password. Must be between 6 to 32 chars.') + ->param('name', '', new Text(128), 'User name. Max length: 128 chars.', true) + ->action(function ($email, $password, $name, $request, $response, $project, $projectDB, $audits) { + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $project */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $audits */ - if (!empty($whitlistEmails) && !\in_array($email, $whitlistEmails)) { - throw new Exception('Console registration is restricted to specific emails. Contact your administrator for more information.', 401); - } + if ('console' === $project->getId()) { + $whitlistEmails = $project->getAttribute('authWhitelistEmails'); + $whitlistIPs = $project->getAttribute('authWhitelistIPs'); + $whitlistDomains = $project->getAttribute('authWhitelistDomains'); - if (!empty($whitlistIPs) && !\in_array($request->getIP(), $whitlistIPs)) { - throw new Exception('Console registration is restricted to specific IPs. Contact your administrator for more information.', 401); - } - - if (!empty($whitlistDomains) && !\in_array(\substr(\strrchr($email, '@'), 1), $whitlistDomains)) { - throw new Exception('Console registration is restricted to specific domains. Contact your administrator for more information.', 401); - } + if (!empty($whitlistEmails) && !\in_array($email, $whitlistEmails)) { + throw new Exception('Console registration is restricted to specific emails. Contact your administrator for more information.', 401); } - $profile = $projectDB->getCollectionFirst([ // Get user by email address - 'limit' => 1, - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_USERS, - 'email='.$email, - ], - ]); - - if (!empty($profile)) { - throw new Exception('Account already exists', 409); + if (!empty($whitlistIPs) && !\in_array($request->getIP(), $whitlistIPs)) { + throw new Exception('Console registration is restricted to specific IPs. Contact your administrator for more information.', 401); } - Authorization::disable(); - - try { - $user = $projectDB->createDocument([ - '$collection' => Database::SYSTEM_COLLECTION_USERS, - '$permissions' => [ - 'read' => ['*'], - 'write' => ['user:{self}'], - ], - 'email' => $email, - 'emailVerification' => false, - 'status' => Auth::USER_STATUS_UNACTIVATED, - 'password' => Auth::passwordHash($password), - 'password-update' => \time(), - 'registration' => \time(), - 'reset' => false, - 'name' => $name, - ], ['email' => $email]); - } catch (Duplicate $th) { - throw new Exception('Account already exists', 409); + if (!empty($whitlistDomains) && !\in_array(\substr(\strrchr($email, '@'), 1), $whitlistDomains)) { + throw new Exception('Console registration is restricted to specific domains. Contact your administrator for more information.', 401); } - - Authorization::enable(); - - if (false === $user) { - throw new Exception('Failed saving user to DB', 500); - } - - $webhook - ->setParam('payload', [ - 'name' => $name, - 'email' => $email, - ]) - ; - - $audit - ->setParam('userId', $user->getId()) - ->setParam('event', 'account.create') - ->setParam('resource', 'users/'.$user->getId()) - ; - - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->json(\array_merge($user->getArrayCopy(\array_merge( - [ - '$id', - 'email', - 'registration', - 'name', - ], - $oauth2Keys - )), ['roles' => Authorization::getRoles()])); } - ); -$utopia->post('/v1/account/sessions') + $profile = $projectDB->getCollectionFirst([ // Get user by email address + 'limit' => 1, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_USERS, + 'email='.$email, + ], + ]); + + if (!empty($profile)) { + throw new Exception('Account already exists', 409); + } + + Authorization::disable(); + + try { + $user = $projectDB->createDocument([ + '$collection' => Database::SYSTEM_COLLECTION_USERS, + '$permissions' => [ + 'read' => ['*'], + 'write' => ['user:{self}'], + ], + 'email' => $email, + 'emailVerification' => false, + 'status' => Auth::USER_STATUS_UNACTIVATED, + 'password' => Auth::passwordHash($password), + 'password-update' => \time(), + 'registration' => \time(), + 'reset' => false, + 'name' => $name, + ], ['email' => $email]); + } catch (Duplicate $th) { + throw new Exception('Account already exists', 409); + } + + Authorization::enable(); + + if (false === $user) { + throw new Exception('Failed saving user to DB', 500); + } + + $audits + ->setParam('userId', $user->getId()) + ->setParam('event', 'account.create') + ->setParam('resource', 'users/'.$user->getId()) + ; + + $user + ->setAttribute('roles', Authorization::getRoles()) + ; + + $response->setStatusCode(Response::STATUS_CODE_CREATED); + $response->dynamic($user, Response::MODEL_USER); + }, ['request', 'response', 'project', 'projectDB', 'audits']); + +App::post('/v1/account/sessions') ->desc('Create Account Session') ->groups(['api', 'account']) - ->label('webhook', 'account.sessions.create') + ->label('event', 'account.sessions.create') ->label('scope', 'public') ->label('sdk.platform', [APP_PLATFORM_CLIENT]) ->label('sdk.namespace', 'account') @@ -156,86 +131,131 @@ $utopia->post('/v1/account/sessions') ->label('sdk.description', '/docs/references/account/create-session.md') ->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. Must be between 6 to 32 chars.') - ->action( - function ($email, $password) use ($response, $request, $projectDB, $audit, $webhook) { - $protocol = Config::getParam('protocol'); - $profile = $projectDB->getCollectionFirst([ // Get user by email address - 'limit' => 1, - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_USERS, - 'email='.$email, - ], - ]); + ->param('email', '', new Email(), 'User email.') + ->param('password', '', new Password(), 'User password. Must be between 6 to 32 chars.') + ->action(function ($email, $password, $request, $response, $projectDB, $locale, $geodb, $audits) { + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Utopia\Locale\Locale $locale */ + /** @var GeoIp2\Database\Reader $geodb */ + /** @var Appwrite\Event\Event $audits */ - if (false == $profile || !Auth::passwordVerify($password, $profile->getAttribute('password'))) { - $audit - //->setParam('userId', $profile->getId()) - ->setParam('event', 'account.sesssions.failed') - ->setParam('resource', 'users/'.($profile ? $profile->getId() : '')) - ; + $protocol = $request->getProtocol(); + $profile = $projectDB->getCollectionFirst([ // Get user by email address + 'limit' => 1, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_USERS, + 'email='.$email, + ], + ]); - throw new Exception('Invalid credentials', 401); // Wrong password or username - } - - $expiry = \time() + Auth::TOKEN_EXPIRATION_LOGIN_LONG; - $secret = Auth::tokenGenerator(); - $session = new Document([ - '$collection' => Database::SYSTEM_COLLECTION_TOKENS, - '$permissions' => ['read' => ['user:'.$profile->getId()], 'write' => ['user:'.$profile->getId()]], - 'type' => Auth::TOKEN_TYPE_LOGIN, - 'secret' => Auth::hash($secret), // On way hash encryption to protect DB leak - 'expire' => $expiry, - 'userAgent' => $request->getServer('HTTP_USER_AGENT', 'UNKNOWN'), - 'ip' => $request->getIP(), - ]); - - Authorization::setRole('user:'.$profile->getId()); - - $session = $projectDB->createDocument($session->getArrayCopy()); - - if (false === $session) { - throw new Exception('Failed saving session to DB', 500); - } - - $profile->setAttribute('tokens', $session, Document::SET_TYPE_APPEND); - - $profile = $projectDB->updateDocument($profile->getArrayCopy()); - - if (false === $profile) { - throw new Exception('Failed saving user to DB', 500); - } - - $webhook - ->setParam('payload', [ - 'name' => $profile->getAttribute('name', ''), - 'email' => $profile->getAttribute('email', ''), - ]) + if (false == $profile || !Auth::passwordVerify($password, $profile->getAttribute('password'))) { + $audits + //->setParam('userId', $profile->getId()) + ->setParam('event', 'account.sesssions.failed') + ->setParam('resource', 'users/'.($profile ? $profile->getId() : '')) ; - $audit - ->setParam('userId', $profile->getId()) - ->setParam('event', 'account.sessions.create') - ->setParam('resource', 'users/'.$profile->getId()) - ; + throw new Exception('Invalid credentials', 401); // Wrong password or username + } - if (!Config::getParam('domainVerification')) { - $response - ->addHeader('X-Fallback-Cookies', \json_encode([Auth::$cookieName => Auth::encodeSession($profile->getId(), $secret)])) - ; - } - - $response - ->addCookie(Auth::$cookieName.'_legacy', Auth::encodeSession($profile->getId(), $secret), $expiry, '/', COOKIE_DOMAIN, ('https' == $protocol), true, null) - ->addCookie(Auth::$cookieName, Auth::encodeSession($profile->getId(), $secret), $expiry, '/', COOKIE_DOMAIN, ('https' == $protocol), true, COOKIE_SAMESITE) - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->json($session->getArrayCopy(['$id', 'type', 'expire'])) + $dd = new DeviceDetector($request->getUserAgent('UNKNOWN')); + + $dd->parse(); + + $os = $dd->getOs(); + $osCode = (isset($os['short_name'])) ? $os['short_name'] : ''; + $osName = (isset($os['name'])) ? $os['name'] : ''; + $osVersion = (isset($os['version'])) ? $os['version'] : ''; + + $client = $dd->getClient(); + $clientType = (isset($client['type'])) ? $client['type'] : ''; + $clientCode = (isset($client['short_name'])) ? $client['short_name'] : ''; + $clientName = (isset($client['name'])) ? $client['name'] : ''; + $clientVersion = (isset($client['version'])) ? $client['version'] : ''; + $clientEngine = (isset($client['engine'])) ? $client['engine'] : ''; + $clientEngineVersion = (isset($client['engine_version'])) ? $client['engine_version'] : ''; + + $expiry = \time() + Auth::TOKEN_EXPIRATION_LOGIN_LONG; + $secret = Auth::tokenGenerator(); + $session = new Document([ + '$collection' => Database::SYSTEM_COLLECTION_TOKENS, + '$permissions' => ['read' => ['user:'.$profile->getId()], 'write' => ['user:'.$profile->getId()]], + 'type' => Auth::TOKEN_TYPE_LOGIN, + 'secret' => Auth::hash($secret), // On way hash encryption to protect DB leak + 'expire' => $expiry, + 'userAgent' => $request->getUserAgent('UNKNOWN'), + 'ip' => $request->getIP(), + + 'osCode' => $osCode, + 'osName' => $osName, + 'osVersion' => $osVersion, + 'clientType' => $clientType, + 'clientCode' => $clientCode, + 'clientName' => $clientName, + 'clientVersion' => $clientVersion, + 'clientEngine' => $clientEngine, + 'clientEngineVersion' => $clientEngineVersion, + 'deviceName' => $dd->getDeviceName(), + 'deviceBrand' => $dd->getBrandName(), + 'deviceModel' => $dd->getModel(), + ]); + + try { + $record = $geodb->country($request->getIP()); + $session + ->setAttribute('countryCode', \strtolower($record->country->isoCode)) + ; + } catch (\Exception $e) { + $session + ->setAttribute('countryCode', '--') ; } - ); -$utopia->get('/v1/account/sessions/oauth2/:provider') + Authorization::setRole('user:'.$profile->getId()); + + $session = $projectDB->createDocument($session->getArrayCopy()); + + if (false === $session) { + throw new Exception('Failed saving session to DB', 500); + } + + $profile->setAttribute('tokens', $session, Document::SET_TYPE_APPEND); + + $profile = $projectDB->updateDocument($profile->getArrayCopy()); + + if (false === $profile) { + throw new Exception('Failed saving user to DB', 500); + } + + $audits + ->setParam('userId', $profile->getId()) + ->setParam('event', 'account.sessions.create') + ->setParam('resource', 'users/'.$profile->getId()) + ; + + if (!Config::getParam('domainVerification')) { + $response + ->addHeader('X-Fallback-Cookies', \json_encode([Auth::$cookieName => Auth::encodeSession($profile->getId(), $secret)])) + ; + } + + $response + ->addCookie(Auth::$cookieName.'_legacy', Auth::encodeSession($profile->getId(), $secret), $expiry, '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, null) + ->addCookie(Auth::$cookieName, Auth::encodeSession($profile->getId(), $secret), $expiry, '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, Config::getParam('cookieSamesite')) + ->setStatusCode(Response::STATUS_CODE_CREATED) + ; + + $session + ->setAttribute('current', true) + ->setAttribute('countryName', (isset($countries[$session->getAttribute('countryCode')])) ? $countries[$session->getAttribute('countryCode')] : $locale->getText('locale.country.unknown')) + ; + + $response->dynamic($session, Response::MODEL_SESSION); + }, ['request', 'response', 'projectDB', 'locale', 'geodb', 'audits']); + +App::get('/v1/account/sessions/oauth2/:provider') ->desc('Create Account Session with OAuth2') ->groups(['api', 'account']) ->label('error', __DIR__.'/../../views/general/error.phtml') @@ -249,285 +269,337 @@ $utopia->get('/v1/account/sessions/oauth2/:provider') ->label('sdk.methodType', 'webAuth') ->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. 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) - ->param('scopes', [], function () { return new ArrayList(new Text(128)); }, 'A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.', true) - ->action( - function ($provider, $success, $failure, $scopes) use ($response, $request, $project) { - $protocol = Config::getParam('protocol'); - $callback = $protocol.'://'.$request->getServer('HTTP_HOST').'/v1/account/sessions/oauth2/callback/'.$provider.'/'.$project->getId(); - $appId = $project->getAttribute('usersOauth2'.\ucfirst($provider).'Appid', ''); - $appSecret = $project->getAttribute('usersOauth2'.\ucfirst($provider).'Secret', '{}'); + ->param('provider', '', new WhiteList(\array_keys(Config::getParam('providers')), true), 'OAuth2 Provider. Currently, supported providers are: ' . \implode(', ', \array_keys(\array_filter(Config::getParam('providers'), function($node) {return (!$node['mock']);}))).'.') + ->param('success', $oauthDefaultSuccess, function ($clients) { return new Host($clients); }, 'URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', true, ['clients']) + ->param('failure', $oauthDefaultFailure, function ($clients) { return new Host($clients); }, 'URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', true, ['clients']) + ->param('scopes', [], new ArrayList(new Text(128)), 'A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.', true) + ->action(function ($provider, $success, $failure, $scopes, $request, $response, $project) { + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $project */ - $appSecret = \json_decode($appSecret, true); + $protocol = $request->getProtocol(); + $callback = $protocol.'://'.$request->getHostname().'/v1/account/sessions/oauth2/callback/'.$provider.'/'.$project->getId(); + $appId = $project->getAttribute('usersOauth2'.\ucfirst($provider).'Appid', ''); + $appSecret = $project->getAttribute('usersOauth2'.\ucfirst($provider).'Secret', '{}'); - if (!empty($appSecret) && isset($appSecret['version'])) { - $key = $request->getServer('_APP_OPENSSL_KEY_V'.$appSecret['version']); - $appSecret = OpenSSL::decrypt($appSecret['data'], $appSecret['method'], $key, 0, \hex2bin($appSecret['iv']), \hex2bin($appSecret['tag'])); - } + $appSecret = \json_decode($appSecret, true); - if (empty($appId) || empty($appSecret)) { - throw new Exception('This provider is disabled. Please configure the provider app ID and app secret key from your '.APP_NAME.' console to continue.', 412); - } - - $classname = 'Appwrite\\Auth\\OAuth2\\'.\ucfirst($provider); - - if (!\class_exists($classname)) { - throw new Exception('Provider is not supported', 501); - } - - $oauth2 = new $classname($appId, $appSecret, $callback, ['success' => $success, 'failure' => $failure], $scopes); - - $response - ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') - ->addHeader('Pragma', 'no-cache') - ->redirect($oauth2->getLoginURL()); + if (!empty($appSecret) && isset($appSecret['version'])) { + $key = App::getEnv('_APP_OPENSSL_KEY_V'.$appSecret['version']); + $appSecret = OpenSSL::decrypt($appSecret['data'], $appSecret['method'], $key, 0, \hex2bin($appSecret['iv']), \hex2bin($appSecret['tag'])); } - ); -$utopia->get('/v1/account/sessions/oauth2/callback/:provider/:projectId') + if (empty($appId) || empty($appSecret)) { + throw new Exception('This provider is disabled. Please configure the provider app ID and app secret key from your '.APP_NAME.' console to continue.', 412); + } + + $classname = 'Appwrite\\Auth\\OAuth2\\'.\ucfirst($provider); + + if (!\class_exists($classname)) { + throw new Exception('Provider is not supported', 501); + } + + $oauth2 = new $classname($appId, $appSecret, $callback, ['success' => $success, 'failure' => $failure], $scopes); + + $response + ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') + ->addHeader('Pragma', 'no-cache') + ->redirect($oauth2->getLoginURL()); + }, ['request', 'response', 'project']); + +App::get('/v1/account/sessions/oauth2/callback/:provider/:projectId') ->desc('OAuth2 Callback') ->groups(['api', 'account']) ->label('error', __DIR__.'/../../views/general/error.phtml') ->label('scope', 'public') ->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])); - } - ); + ->param('projectId', '', new Text(1024), 'Project unique ID.') + ->param('provider', '', new WhiteList(\array_keys(Config::getParam('providers')), true), 'OAuth2 provider.') + ->param('code', '', new Text(1024), 'OAuth2 code.') + ->param('state', '', new Text(2048), 'Login state params.', true) + ->action(function ($projectId, $provider, $code, $state, $request, $response) { + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ -$utopia->post('/v1/account/sessions/oauth2/callback/:provider/:projectId') + $domain = $request->getHostname(); + $protocol = $request->getProtocol(); + + $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])); + }, ['request', 'response']); + +App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId') ->desc('OAuth2 Callback') ->groups(['api', 'account']) ->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])); - } - ); + ->param('projectId', '', new Text(1024), 'Project unique ID.') + ->param('provider', '', new WhiteList(\array_keys(Config::getParam('providers')), true), 'OAuth2 provider.') + ->param('code', '', new Text(1024), 'OAuth2 code.') + ->param('state', '', new Text(2048), 'Login state params.', true) + ->action(function ($projectId, $provider, $code, $state, $request, $response) { + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ -$utopia->get('/v1/account/sessions/oauth2/:provider/redirect') + $domain = $request->getHostname(); + $protocol = $request->getProtocol(); + + $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])); + }, ['request', 'response']); + +App::get('/v1/account/sessions/oauth2/:provider/redirect') ->desc('OAuth2 Redirect') ->groups(['api', 'account']) ->label('error', __DIR__.'/../../views/general/error.phtml') - ->label('webhook', 'account.sessions.create') + ->label('event', 'account.sessions.create') ->label('scope', 'public') ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') ->label('docs', false) - ->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); }, 'OAuth2 state params.', true) - ->action( - function ($provider, $code, $state) use ($response, $request, $user, $projectDB, $project, $audit, $oauthDefaultSuccess) { - $protocol = Config::getParam('protocol'); - $callback = $protocol.'://'.$request->getServer('HTTP_HOST').'/v1/account/sessions/oauth2/callback/'.$provider.'/'.$project->getId(); - $defaultState = ['success' => $project->getAttribute('url', ''), 'failure' => '']; - $validateURL = new URL(); + ->param('provider', '', new WhiteList(\array_keys(Config::getParam('providers')), true), 'OAuth2 provider.') + ->param('code', '', new Text(1024), 'OAuth2 code.') + ->param('state', '', new Text(2048), 'OAuth2 state params.', true) + ->action(function ($provider, $code, $state, $request, $response, $project, $user, $projectDB, $geodb, $audits) use ($oauthDefaultSuccess) { + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $project */ + /** @var Appwrite\Database\Document $user */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var GeoIp2\Database\Reader $geodb */ + /** @var Appwrite\Event\Event $audits */ + + $protocol = $request->getProtocol(); + $callback = $protocol.'://'.$request->getHostname().'/v1/account/sessions/oauth2/callback/'.$provider.'/'.$project->getId(); + $defaultState = ['success' => $project->getAttribute('url', ''), 'failure' => '']; + $validateURL = new URL(); - $appId = $project->getAttribute('usersOauth2'.\ucfirst($provider).'Appid', ''); - $appSecret = $project->getAttribute('usersOauth2'.\ucfirst($provider).'Secret', '{}'); + $appId = $project->getAttribute('usersOauth2'.\ucfirst($provider).'Appid', ''); + $appSecret = $project->getAttribute('usersOauth2'.\ucfirst($provider).'Secret', '{}'); - $appSecret = \json_decode($appSecret, true); + $appSecret = \json_decode($appSecret, true); - if (!empty($appSecret) && isset($appSecret['version'])) { - $key = $request->getServer('_APP_OPENSSL_KEY_V'.$appSecret['version']); - $appSecret = OpenSSL::decrypt($appSecret['data'], $appSecret['method'], $key, 0, \hex2bin($appSecret['iv']), \hex2bin($appSecret['tag'])); + if (!empty($appSecret) && isset($appSecret['version'])) { + $key = App::getEnv('_APP_OPENSSL_KEY_V'.$appSecret['version']); + $appSecret = OpenSSL::decrypt($appSecret['data'], $appSecret['method'], $key, 0, \hex2bin($appSecret['iv']), \hex2bin($appSecret['tag'])); + } + + $classname = 'Appwrite\\Auth\\OAuth2\\'.\ucfirst($provider); + + if (!\class_exists($classname)) { + throw new Exception('Provider is not supported', 501); + } + + $oauth2 = new $classname($appId, $appSecret, $callback); + + if (!empty($state)) { + try { + $state = \array_merge($defaultState, $oauth2->parseState($state)); + } catch (\Exception $exception) { + throw new Exception('Failed to parse login state params as passed from OAuth2 provider'); + } + } else { + $state = $defaultState; + } + + if (!$validateURL->isValid($state['success'])) { + throw new Exception('Invalid redirect URL for success login', 400); + } + + 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); + + if (empty($accessToken)) { + if (!empty($state['failure'])) { + $response->redirect($state['failure'], 301, 0); } - $classname = 'Appwrite\\Auth\\OAuth2\\'.\ucfirst($provider); + throw new Exception('Failed to obtain access token'); + } - if (!\class_exists($classname)) { - throw new Exception('Provider is not supported', 501); + $oauth2ID = $oauth2->getUserID($accessToken); + + if (empty($oauth2ID)) { + if (!empty($state['failure'])) { + $response->redirect($state['failure'], 301, 0); } - $oauth2 = new $classname($appId, $appSecret, $callback); + throw new Exception('Missing ID from OAuth2 provider', 400); + } - if (!empty($state)) { - try { - $state = \array_merge($defaultState, $oauth2->parseState($state)); - } catch (\Exception $exception) { - throw new Exception('Failed to parse login state params as passed from OAuth2 provider'); - } - } else { - $state = $defaultState; - } + $current = Auth::tokenVerify($user->getAttribute('tokens', []), Auth::TOKEN_TYPE_LOGIN, Auth::$secret); - if (!$validateURL->isValid($state['success'])) { - throw new Exception('Invalid redirect URL for success login', 400); - } + if ($current) { + $projectDB->deleteDocument($current); //throw new Exception('User already logged in', 401); + } - 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); + $user = (empty($user->getId())) ? $projectDB->getCollectionFirst([ // Get user by provider id + 'limit' => 1, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_USERS, + 'oauth2'.\ucfirst($provider).'='.$oauth2ID, + ], + ]) : $user; - if (empty($accessToken)) { - if (!empty($state['failure'])) { - $response->redirect($state['failure'], 301, 0); - } + if (empty($user)) { // No user logged in or with OAuth2 provider ID, create new one or connect with account with same email + $name = $oauth2->getUserName($accessToken); + $email = $oauth2->getUserEmail($accessToken); - throw new Exception('Failed to obtain access token'); - } - - $oauth2ID = $oauth2->getUserID($accessToken); - - if (empty($oauth2ID)) { - if (!empty($state['failure'])) { - $response->redirect($state['failure'], 301, 0); - } - - throw new Exception('Missing ID from OAuth2 provider', 400); - } - - $current = Auth::tokenVerify($user->getAttribute('tokens', []), Auth::TOKEN_TYPE_LOGIN, Auth::$secret); - - if ($current) { - $projectDB->deleteDocument($current); //throw new Exception('User already logged in', 401); - } - - $user = (empty($user->getId())) ? $projectDB->getCollectionFirst([ // Get user by provider id + $user = $projectDB->getCollectionFirst([ // Get user by provider email address 'limit' => 1, 'filters' => [ '$collection='.Database::SYSTEM_COLLECTION_USERS, - 'oauth2'.\ucfirst($provider).'='.$oauth2ID, + 'email='.$email, ], - ]) : $user; - - if (empty($user)) { // No user logged in or with OAuth2 provider ID, create new one or connect with account with same email - $name = $oauth2->getUserName($accessToken); - $email = $oauth2->getUserEmail($accessToken); - - $user = $projectDB->getCollectionFirst([ // Get user by provider email address - 'limit' => 1, - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_USERS, - 'email='.$email, - ], - ]); - - if (!$user || empty($user->getId())) { // Last option -> create user alone, generate random password - Authorization::disable(); - - try { - $user = $projectDB->createDocument([ - '$collection' => Database::SYSTEM_COLLECTION_USERS, - '$permissions' => ['read' => ['*'], 'write' => ['user:{self}']], - 'email' => $email, - 'emailVerification' => true, - 'status' => Auth::USER_STATUS_ACTIVATED, // Email should already be authenticated by OAuth2 provider - 'password' => Auth::passwordHash(Auth::passwordGenerator()), - 'password-update' => \time(), - 'registration' => \time(), - 'reset' => false, - 'name' => $name, - ], ['email' => $email]); - } catch (Duplicate $th) { - throw new Exception('Account already exists', 409); - } - - Authorization::enable(); - - if (false === $user) { - throw new Exception('Failed saving user to DB', 500); - } - } - } - - // Create session token, verify user account and update OAuth2 ID and Access Token - - $secret = Auth::tokenGenerator(); - $expiry = \time() + Auth::TOKEN_EXPIRATION_LOGIN_LONG; - $session = new Document([ - '$collection' => Database::SYSTEM_COLLECTION_TOKENS, - '$permissions' => ['read' => ['user:'.$user['$id']], 'write' => ['user:'.$user['$id']]], - 'type' => Auth::TOKEN_TYPE_LOGIN, - 'secret' => Auth::hash($secret), // On way hash encryption to protect DB leak - 'expire' => $expiry, - 'userAgent' => $request->getServer('HTTP_USER_AGENT', 'UNKNOWN'), - 'ip' => $request->getIP(), ]); - $user - ->setAttribute('oauth2'.\ucfirst($provider), $oauth2ID) - ->setAttribute('oauth2'.\ucfirst($provider).'AccessToken', $accessToken) - ->setAttribute('status', Auth::USER_STATUS_ACTIVATED) - ->setAttribute('tokens', $session, Document::SET_TYPE_APPEND) + if (!$user || empty($user->getId())) { // Last option -> create user alone, generate random password + Authorization::disable(); + + try { + $user = $projectDB->createDocument([ + '$collection' => Database::SYSTEM_COLLECTION_USERS, + '$permissions' => ['read' => ['*'], 'write' => ['user:{self}']], + 'email' => $email, + 'emailVerification' => true, + 'status' => Auth::USER_STATUS_ACTIVATED, // Email should already be authenticated by OAuth2 provider + 'password' => Auth::passwordHash(Auth::passwordGenerator()), + 'password-update' => \time(), + 'registration' => \time(), + 'reset' => false, + 'name' => $name, + ], ['email' => $email]); + } catch (Duplicate $th) { + throw new Exception('Account already exists', 409); + } + + Authorization::enable(); + + if (false === $user) { + throw new Exception('Failed saving user to DB', 500); + } + } + } + + // Create session token, verify user account and update OAuth2 ID and Access Token + + + $dd = new DeviceDetector($request->getUserAgent('UNKNOWN')); + + $dd->parse(); + + $os = $dd->getOs(); + $osCode = (isset($os['short_name'])) ? $os['short_name'] : ''; + $osName = (isset($os['name'])) ? $os['name'] : ''; + $osVersion = (isset($os['version'])) ? $os['version'] : ''; + + $client = $dd->getClient(); + $clientType = (isset($client['type'])) ? $client['type'] : ''; + $clientCode = (isset($client['short_name'])) ? $client['short_name'] : ''; + $clientName = (isset($client['name'])) ? $client['name'] : ''; + $clientVersion = (isset($client['version'])) ? $client['version'] : ''; + $clientEngine = (isset($client['engine'])) ? $client['engine'] : ''; + $clientEngineVersion = (isset($client['engine_version'])) ? $client['engine_version'] : ''; + + $secret = Auth::tokenGenerator(); + $expiry = \time() + Auth::TOKEN_EXPIRATION_LOGIN_LONG; + $session = new Document([ + '$collection' => Database::SYSTEM_COLLECTION_TOKENS, + '$permissions' => ['read' => ['user:'.$user['$id']], 'write' => ['user:'.$user['$id']]], + 'type' => Auth::TOKEN_TYPE_LOGIN, + 'secret' => Auth::hash($secret), // On way hash encryption to protect DB leak + 'expire' => $expiry, + 'userAgent' => $request->getUserAgent('UNKNOWN'), + 'ip' => $request->getIP(), + + 'osCode' => $osCode, + 'osName' => $osName, + 'osVersion' => $osVersion, + 'clientType' => $clientType, + 'clientCode' => $clientCode, + 'clientName' => $clientName, + 'clientVersion' => $clientVersion, + 'clientEngine' => $clientEngine, + 'clientEngineVersion' => $clientEngineVersion, + 'deviceName' => $dd->getDeviceName(), + 'deviceBrand' => $dd->getBrandName(), + 'deviceModel' => $dd->getModel(), + ]); + + try { + $record = $geodb->country($request->getIP()); + $session + ->setAttribute('countryCode', \strtolower($record->country->isoCode)) ; - - Authorization::setRole('user:'.$user->getId()); - - $user = $projectDB->updateDocument($user->getArrayCopy()); - - if (false === $user) { - throw new Exception('Failed saving user to DB', 500); - } - - $audit - ->setParam('userId', $user->getId()) - ->setParam('event', 'account.sessions.create') - ->setParam('resource', 'users/'.$user->getId()) - ->setParam('data', ['provider' => $provider]) - ; - - if (!Config::getParam('domainVerification')) { - $response - ->addHeader('X-Fallback-Cookies', \json_encode([Auth::$cookieName => Auth::encodeSession($user->getId(), $secret)])) - ; - } - - // Add keys for non-web platforms - TODO - add verification phase to aviod session sniffing - if (parse_url($state['success'], PHP_URL_PATH) === $oauthDefaultSuccess) { - $state['success'] = URLParser::parse($state['success']); - $query = URLParser::parseQuery($state['success']['query']); - $query['project'] = $project->getId(); - $query['domain'] = COOKIE_DOMAIN; - $query['key'] = Auth::$cookieName; - $query['secret'] = Auth::encodeSession($user->getId(), $secret); - $state['success']['query'] = URLParser::unparseQuery($query); - $state['success'] = URLParser::unparse($state['success']); - } - - $response - ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') - ->addHeader('Pragma', 'no-cache') - ->addCookie(Auth::$cookieName.'_legacy', Auth::encodeSession($user->getId(), $secret), $expiry, '/', COOKIE_DOMAIN, ('https' == $protocol), true, null) - ->addCookie(Auth::$cookieName, Auth::encodeSession($user->getId(), $secret), $expiry, '/', COOKIE_DOMAIN, ('https' == $protocol), true, COOKIE_SAMESITE) - ->redirect($state['success']) + } catch (\Exception $e) { + $session + ->setAttribute('countryCode', '--') ; } - ); -$utopia->get('/v1/account') + $user + ->setAttribute('oauth2'.\ucfirst($provider), $oauth2ID) + ->setAttribute('oauth2'.\ucfirst($provider).'AccessToken', $accessToken) + ->setAttribute('status', Auth::USER_STATUS_ACTIVATED) + ->setAttribute('tokens', $session, Document::SET_TYPE_APPEND) + ; + + Authorization::setRole('user:'.$user->getId()); + + $user = $projectDB->updateDocument($user->getArrayCopy()); + + if (false === $user) { + throw new Exception('Failed saving user to DB', 500); + } + + $audits + ->setParam('userId', $user->getId()) + ->setParam('event', 'account.sessions.create') + ->setParam('resource', 'users/'.$user->getId()) + ->setParam('data', ['provider' => $provider]) + ; + + if (!Config::getParam('domainVerification')) { + $response + ->addHeader('X-Fallback-Cookies', \json_encode([Auth::$cookieName => Auth::encodeSession($user->getId(), $secret)])) + ; + } + + // Add keys for non-web platforms - TODO - add verification phase to aviod session sniffing + if (parse_url($state['success'], PHP_URL_PATH) === parse_url($oauthDefaultSuccess, PHP_URL_PATH)) { + $state['success'] = URLParser::parse($state['success']); + $query = URLParser::parseQuery($state['success']['query']); + $query['project'] = $project->getId(); + $query['domain'] = Config::getParam('cookieDomain'); + $query['key'] = Auth::$cookieName; + $query['secret'] = Auth::encodeSession($user->getId(), $secret); + $state['success']['query'] = URLParser::unparseQuery($query); + $state['success'] = URLParser::unparse($state['success']); + } + + $response + ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') + ->addHeader('Pragma', 'no-cache') + ->addCookie(Auth::$cookieName.'_legacy', Auth::encodeSession($user->getId(), $secret), $expiry, '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, null) + ->addCookie(Auth::$cookieName, Auth::encodeSession($user->getId(), $secret), $expiry, '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, Config::getParam('cookieSamesite')) + ->redirect($state['success']) + ; + }, ['request', 'response', 'project', 'user', 'projectDB', 'geodb', 'audits']); + +App::get('/v1/account') ->desc('Get Account') ->groups(['api', 'account']) ->label('scope', 'account') @@ -536,22 +608,18 @@ $utopia->get('/v1/account') ->label('sdk.method', 'get') ->label('sdk.description', '/docs/references/account/get.md') ->label('sdk.response', ['200' => 'user']) - ->action( - function () use ($response, &$user, $oauth2Keys) { - $response->json(\array_merge($user->getArrayCopy(\array_merge( - [ - '$id', - 'email', - 'emailVerification', - 'registration', - 'name', - ], - $oauth2Keys - )), ['roles' => Authorization::getRoles()])); - } - ); + ->action(function ($response, $user) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $user */ -$utopia->get('/v1/account/prefs') + $user + ->setAttribute('roles', Authorization::getRoles()) + ; + + $response->dynamic($user, Response::MODEL_USER); + }, ['response', 'user']); + +App::get('/v1/account/prefs') ->desc('Get Account Preferences') ->groups(['api', 'account']) ->label('scope', 'account') @@ -559,22 +627,16 @@ $utopia->get('/v1/account/prefs') ->label('sdk.namespace', 'account') ->label('sdk.method', 'getPrefs') ->label('sdk.description', '/docs/references/account/get-prefs.md') - ->action( - function () use ($response, $user) { - $prefs = $user->getAttribute('prefs', '{}'); + ->action(function ($response, $user) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $user */ - try { - $prefs = \json_decode($prefs, true); - $prefs = ($prefs) ? $prefs : []; - } catch (\Exception $error) { - throw new Exception('Failed to parse prefs', 500); - } + $prefs = $user->getAttribute('prefs', new \stdClass); - $response->json($prefs); - } - ); + $response->json($prefs); + }, ['response', 'user']); -$utopia->get('/v1/account/sessions') +App::get('/v1/account/sessions') ->desc('Get Account Sessions') ->groups(['api', 'account']) ->label('scope', 'account') @@ -582,58 +644,36 @@ $utopia->get('/v1/account/sessions') ->label('sdk.namespace', 'account') ->label('sdk.method', 'getSessions') ->label('sdk.description', '/docs/references/account/get-sessions.md') - ->action( - function () use ($response, $user) { - $tokens = $user->getAttribute('tokens', []); - $reader = new Reader(__DIR__.'/../../db/DBIP/dbip-country-lite-2020-01.mmdb'); - $sessions = []; - $current = Auth::tokenVerify($tokens, Auth::TOKEN_TYPE_LOGIN, Auth::$secret); - $index = 0; - $countries = Locale::getText('countries'); + ->action(function ($response, $user, $locale) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $user */ + /** @var Utopia\Locale\Locale $locale */ - foreach ($tokens as $token) { /* @var $token Document */ - if (Auth::TOKEN_TYPE_LOGIN != $token->getAttribute('type')) { - continue; - } + $tokens = $user->getAttribute('tokens', []); + $sessions = []; + $countries = $locale->getText('countries'); + $current = Auth::tokenVerify($tokens, Auth::TOKEN_TYPE_LOGIN, Auth::$secret); - $userAgent = (!empty($token->getAttribute('userAgent'))) ? $token->getAttribute('userAgent') : 'UNKNOWN'; - - $dd = new DeviceDetector($userAgent); - - // OPTIONAL: If called, bot detection will completely be skipped (bots will be detected as regular devices then) - // $dd->skipBotDetection(); - - $dd->parse(); - - $sessions[$index] = [ - '$id' => $token->getId(), - 'OS' => $dd->getOs(), - 'client' => $dd->getClient(), - 'device' => $dd->getDevice(), - 'brand' => $dd->getBrand(), - 'model' => $dd->getModel(), - 'ip' => $token->getAttribute('ip', ''), - 'geo' => [], - 'current' => ($current == $token->getId()) ? true : false, - ]; - - try { - $record = $reader->country($token->getAttribute('ip', '')); - $sessions[$index]['geo']['isoCode'] = \strtolower($record->country->isoCode); - $sessions[$index]['geo']['country'] = (isset($countries[$record->country->isoCode])) ? $countries[$record->country->isoCode] : Locale::getText('locale.country.unknown'); - } catch (\Exception $e) { - $sessions[$index]['geo']['isoCode'] = '--'; - $sessions[$index]['geo']['country'] = Locale::getText('locale.country.unknown'); - } - - ++$index; + foreach ($tokens as $token) { /* @var $token Document */ + if (Auth::TOKEN_TYPE_LOGIN != $token->getAttribute('type')) { + continue; } - $response->json($sessions); - } - ); + $token->setAttribute('countryName', (isset($countries[$token->getAttribute('contryCode')])) + ? $countries[$token->getAttribute('contryCode')] + : $locale->getText('locale.country.unknown')); + $token->setAttribute('current', ($current == $token->getId()) ? true : false); -$utopia->get('/v1/account/logs') + $sessions[] = $token; + } + + $response->dynamic(new Document([ + 'sum' => count($sessions), + 'sessions' => $sessions + ]), Response::MODEL_SESSION_LIST); + }, ['response', 'user', 'locale']); + +App::get('/v1/account/logs') ->desc('Get Account Logs') ->groups(['api', 'account']) ->label('scope', 'account') @@ -641,398 +681,355 @@ $utopia->get('/v1/account/logs') ->label('sdk.namespace', 'account') ->label('sdk.method', 'getLogs') ->label('sdk.description', '/docs/references/account/get-logs.md') - ->action( - function () use ($response, $register, $project, $user) { - $adapter = new AuditAdapter($register->get('db')); - $adapter->setNamespace('app_'.$project->getId()); + ->action(function ($response, $register, $project, $user, $locale, $geodb) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $project */ + /** @var Appwrite\Database\Document $user */ + /** @var Utopia\Locale\Locale $locale */ + /** @var GeoIp2\Database\Reader $geodb */ - $audit = new Audit($adapter); - $countries = Locale::getText('countries'); + $adapter = new AuditAdapter($register->get('db')); + $adapter->setNamespace('app_'.$project->getId()); - $logs = $audit->getLogsByUserAndActions($user->getId(), [ - 'account.create', - 'account.delete', - 'account.update.name', - 'account.update.email', - 'account.update.password', - 'account.update.prefs', - 'account.sessions.create', - 'account.sessions.delete', - 'account.recovery.create', - 'account.recovery.update', - 'account.verification.create', - 'account.verification.update', - 'teams.membership.create', - 'teams.membership.update', - 'teams.membership.delete', + $audit = new Audit($adapter); + $countries = $locale->getText('countries'); + + $logs = $audit->getLogsByUserAndActions($user->getId(), [ + 'account.create', + 'account.delete', + 'account.update.name', + 'account.update.email', + 'account.update.password', + 'account.update.prefs', + 'account.sessions.create', + 'account.sessions.delete', + 'account.recovery.create', + 'account.recovery.update', + 'account.verification.create', + 'account.verification.update', + 'teams.membership.create', + 'teams.membership.update', + 'teams.membership.delete', + ]); + + $output = []; + + foreach ($logs as $i => &$log) { + $log['userAgent'] = (!empty($log['userAgent'])) ? $log['userAgent'] : 'UNKNOWN'; + + $dd = new DeviceDetector($log['userAgent']); + + $dd->skipBotDetection(); // OPTIONAL: If called, bot detection will completely be skipped (bots will be detected as regular devices then) + + $dd->parse(); + + $os = $dd->getOs(); + $osCode = (isset($os['short_name'])) ? $os['short_name'] : ''; + $osName = (isset($os['name'])) ? $os['name'] : ''; + $osVersion = (isset($os['version'])) ? $os['version'] : ''; + + $client = $dd->getClient(); + $clientType = (isset($client['type'])) ? $client['type'] : ''; + $clientCode = (isset($client['short_name'])) ? $client['short_name'] : ''; + $clientName = (isset($client['name'])) ? $client['name'] : ''; + $clientVersion = (isset($client['version'])) ? $client['version'] : ''; + $clientEngine = (isset($client['engine'])) ? $client['engine'] : ''; + $clientEngineVersion = (isset($client['engine_version'])) ? $client['engine_version'] : ''; + + $output[$i] = new Document([ + 'event' => $log['event'], + 'ip' => $log['ip'], + 'time' => \strtotime($log['time']), + + 'osCode' => $osCode, + 'osName' => $osName, + 'osVersion' => $osVersion, + 'clientType' => $clientType, + 'clientCode' => $clientCode, + 'clientName' => $clientName, + 'clientVersion' => $clientVersion, + 'clientEngine' => $clientEngine, + 'clientEngineVersion' => $clientEngineVersion, + 'deviceName' => $dd->getDeviceName(), + 'deviceBrand' => $dd->getBrandName(), + 'deviceModel' => $dd->getModel(), ]); - $reader = new Reader(__DIR__.'/../../db/DBIP/dbip-country-lite-2020-01.mmdb'); - $output = []; - - foreach ($logs as $i => &$log) { - $log['userAgent'] = (!empty($log['userAgent'])) ? $log['userAgent'] : 'UNKNOWN'; - - $dd = new DeviceDetector($log['userAgent']); - - $dd->skipBotDetection(); // OPTIONAL: If called, bot detection will completely be skipped (bots will be detected as regular devices then) - - $dd->parse(); - - $output[$i] = [ - 'event' => $log['event'], - 'ip' => $log['ip'], - 'time' => \strtotime($log['time']), - 'OS' => $dd->getOs(), - 'client' => $dd->getClient(), - 'device' => $dd->getDevice(), - 'brand' => $dd->getBrand(), - 'model' => $dd->getModel(), - 'geo' => [], - ]; - - try { - $record = $reader->country($log['ip']); - $output[$i]['geo']['isoCode'] = \strtolower($record->country->isoCode); - $output[$i]['geo']['country'] = $record->country->name; - $output[$i]['geo']['country'] = (isset($countries[$record->country->isoCode])) ? $countries[$record->country->isoCode] : Locale::getText('locale.country.unknown'); - } catch (\Exception $e) { - $output[$i]['geo']['isoCode'] = '--'; - $output[$i]['geo']['country'] = Locale::getText('locale.country.unknown'); - } + try { + $record = $geodb->country($log['ip']); + $output[$i]->setAttribute('countryCode', \strtolower($record->country->isoCode)); + $output[$i]->setAttribute('countryName', (isset($countries[$record->country->isoCode])) ? $countries[$record->country->isoCode] : $locale->getText('locale.country.unknown')); + } catch (\Exception $e) { + $output[$i]->setAttribute('countryCode', '--'); + $output[$i]->setAttribute('countryName', $locale->getText('locale.country.unknown')); } - - $response->json($output); } - ); -$utopia->patch('/v1/account/name') + $response->dynamic(new Document(['logs' => $output]), Response::MODEL_LOG_LIST); + }, ['response', 'register', 'project', 'user', 'locale', 'geodb']); + +App::patch('/v1/account/name') ->desc('Update Account Name') ->groups(['api', 'account']) - ->label('webhook', 'account.update.name') + ->label('event', 'account.update.name') ->label('scope', 'account') ->label('sdk.platform', [APP_PLATFORM_CLIENT]) ->label('sdk.namespace', 'account') ->label('sdk.method', 'updateName') ->label('sdk.description', '/docs/references/account/update-name.md') - ->param('name', '', function () { return new Text(100); }, 'User name.') - ->action( - function ($name) use ($response, $user, $projectDB, $audit, $oauth2Keys) { - $user = $projectDB->updateDocument(\array_merge($user->getArrayCopy(), [ - 'name' => $name, - ])); + ->param('name', '', new Text(128), 'User name. Max length: 128 chars.') + ->action(function ($name, $response, $user, $projectDB, $audits) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $user */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $audits */ - if (false === $user) { - throw new Exception('Failed saving user to DB', 500); - } + $user = $projectDB->updateDocument(\array_merge($user->getArrayCopy(), [ + 'name' => $name, + ])); - $audit - ->setParam('userId', $user->getId()) - ->setParam('event', 'account.update.name') - ->setParam('resource', 'users/'.$user->getId()) - ; - - $response->json(\array_merge($user->getArrayCopy(\array_merge( - [ - '$id', - 'email', - 'registration', - 'name', - ], - $oauth2Keys - )), ['roles' => Authorization::getRoles()])); + if (false === $user) { + throw new Exception('Failed saving user to DB', 500); } - ); -$utopia->patch('/v1/account/password') + $user->setAttribute('roles', Authorization::getRoles()); + + $audits + ->setParam('userId', $user->getId()) + ->setParam('event', 'account.update.name') + ->setParam('resource', 'users/'.$user->getId()) + ; + + $response->dynamic($user, Response::MODEL_USER); + }, ['response', 'user', 'projectDB', 'audits']); + +App::patch('/v1/account/password') ->desc('Update Account Password') ->groups(['api', 'account']) - ->label('webhook', 'account.update.password') + ->label('event', 'account.update.password') ->label('scope', 'account') ->label('sdk.platform', [APP_PLATFORM_CLIENT]) ->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. 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 - throw new Exception('Invalid credentials', 401); - } + ->param('password', '', new Password(), 'New user password. Must be between 6 to 32 chars.') + ->param('oldPassword', '', new Password(), 'Old user password. Must be between 6 to 32 chars.') + ->action(function ($password, $oldPassword, $response, $user, $projectDB, $audits) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $user */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $audits */ - $user = $projectDB->updateDocument(\array_merge($user->getArrayCopy(), [ - 'password' => Auth::passwordHash($password), - ])); - - if (false === $user) { - throw new Exception('Failed saving user to DB', 500); - } - - $audit - ->setParam('userId', $user->getId()) - ->setParam('event', 'account.update.password') - ->setParam('resource', 'users/'.$user->getId()) - ; - - $response->json(\array_merge($user->getArrayCopy(\array_merge( - [ - '$id', - 'email', - 'registration', - 'name', - ], - $oauth2Keys - )), ['roles' => Authorization::getRoles()])); + if (!Auth::passwordVerify($oldPassword, $user->getAttribute('password'))) { // Double check user password + throw new Exception('Invalid credentials', 401); } - ); -$utopia->patch('/v1/account/email') + $user = $projectDB->updateDocument(\array_merge($user->getArrayCopy(), [ + 'password' => Auth::passwordHash($password), + ])); + + if (false === $user) { + throw new Exception('Failed saving user to DB', 500); + } + + $user->setAttribute('roles', Authorization::getRoles()); + + $audits + ->setParam('userId', $user->getId()) + ->setParam('event', 'account.update.password') + ->setParam('resource', 'users/'.$user->getId()) + ; + + $response->dynamic($user, Response::MODEL_USER); + }, ['response', 'user', 'projectDB', 'audits']); + +App::patch('/v1/account/email') ->desc('Update Account Email') ->groups(['api', 'account']) - ->label('webhook', 'account.update.email') + ->label('event', 'account.update.email') ->label('scope', 'account') ->label('sdk.platform', [APP_PLATFORM_CLIENT]) ->label('sdk.namespace', 'account') ->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. 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 - throw new Exception('Invalid credentials', 401); - } + ->param('email', '', new Email(), 'User email.') + ->param('password', '', new Password(), 'User password. Must be between 6 to 32 chars.') + ->action(function ($email, $password, $response, $user, $projectDB, $audits) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $user */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $audits */ - $profile = $projectDB->getCollectionFirst([ // Get user by email address - 'limit' => 1, - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_USERS, - 'email='.$email, - ], - ]); - - if (!empty($profile)) { - throw new Exception('User already registered', 400); - } - - // TODO after this user needs to confirm mail again - - $user = $projectDB->updateDocument(\array_merge($user->getArrayCopy(), [ - 'email' => $email, - 'emailVerification' => false, - ])); - - if (false === $user) { - throw new Exception('Failed saving user to DB', 500); - } - - $audit - ->setParam('userId', $user->getId()) - ->setParam('event', 'account.update.email') - ->setParam('resource', 'users/'.$user->getId()) - ; - - $response->json(\array_merge($user->getArrayCopy(\array_merge( - [ - '$id', - 'email', - 'registration', - 'name', - ], - $oauth2Keys - )), ['roles' => Authorization::getRoles()])); + if (!Auth::passwordVerify($password, $user->getAttribute('password'))) { // Double check user password + throw new Exception('Invalid credentials', 401); } - ); -$utopia->patch('/v1/account/prefs') + $profile = $projectDB->getCollectionFirst([ // Get user by email address + 'limit' => 1, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_USERS, + 'email='.$email, + ], + ]); + + if (!empty($profile)) { + throw new Exception('User already registered', 400); + } + + // TODO after this user needs to confirm mail again + + $user = $projectDB->updateDocument(\array_merge($user->getArrayCopy(), [ + 'email' => $email, + 'emailVerification' => false, + ])); + + if (false === $user) { + throw new Exception('Failed saving user to DB', 500); + } + + $user->setAttribute('roles', Authorization::getRoles()); + + $audits + ->setParam('userId', $user->getId()) + ->setParam('event', 'account.update.email') + ->setParam('resource', 'users/'.$user->getId()) + ; + + $response->dynamic($user, Response::MODEL_USER); + }, ['response', 'user', 'projectDB', 'audits']); + +App::patch('/v1/account/prefs') ->desc('Update Account Preferences') ->groups(['api', 'account']) - ->label('webhook', 'account.update.prefs') + ->label('event', 'account.update.prefs') ->label('scope', 'account') ->label('sdk.platform', [APP_PLATFORM_CLIENT]) ->label('sdk.namespace', 'account') ->label('sdk.method', 'updatePrefs') - ->param('prefs', '', function () { return new Assoc();}, 'Prefs key-value JSON object.') ->label('sdk.description', '/docs/references/account/update-prefs.md') - ->action( - function ($prefs) use ($response, $user, $projectDB, $audit) { - $old = \json_decode($user->getAttribute('prefs', '{}'), true); - $old = ($old) ? $old : []; + ->param('prefs', [], new Assoc(), 'Prefs key-value JSON object.') + ->action(function ($prefs, $response, $user, $projectDB, $audits) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $user */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $audits */ + + $user = $projectDB->updateDocument(\array_merge($user->getArrayCopy(), [ + 'prefs' => $prefs, + ])); - $user = $projectDB->updateDocument(\array_merge($user->getArrayCopy(), [ - 'prefs' => \json_encode(\array_merge($old, $prefs)), - ])); - - if (false === $user) { - throw new Exception('Failed saving user to DB', 500); - } - - $audit - ->setParam('event', 'account.update.prefs') - ->setParam('resource', 'users/'.$user->getId()) - ; - - $prefs = $user->getAttribute('prefs', '{}'); - - try { - $prefs = \json_decode($prefs, true); - $prefs = ($prefs) ? $prefs : []; - } catch (\Exception $error) { - throw new Exception('Failed to parse prefs', 500); - } - - $response->json($prefs); + if (false === $user) { + throw new Exception('Failed saving user to DB', 500); } - ); -$utopia->delete('/v1/account') + $audits + ->setParam('event', 'account.update.prefs') + ->setParam('resource', 'users/'.$user->getId()) + ; + + $prefs = $user->getAttribute('prefs', new \stdClass); + + $response->json($prefs); + }, ['response', 'user', 'projectDB', 'audits']); + +App::delete('/v1/account') ->desc('Delete Account') ->groups(['api', 'account']) - ->label('webhook', 'account.delete') + ->label('event', 'account.delete') ->label('scope', 'account') ->label('sdk.platform', [APP_PLATFORM_CLIENT]) ->label('sdk.namespace', 'account') ->label('sdk.method', 'delete') ->label('sdk.description', '/docs/references/account/delete.md') - ->action( - function () use ($response, $user, $projectDB, $audit, $webhook) { - $protocol = Config::getParam('protocol'); - $user = $projectDB->updateDocument(\array_merge($user->getArrayCopy(), [ - 'status' => Auth::USER_STATUS_BLOCKED, - ])); + ->action(function ($request, $response, $user, $projectDB, $audits, $webhooks) { + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $user */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $audits */ + /** @var Appwrite\Event\Event $webhooks */ - if (false === $user) { - throw new Exception('Failed saving user to DB', 500); - } + $protocol = $request->getProtocol(); + $user = $projectDB->updateDocument(\array_merge($user->getArrayCopy(), [ + 'status' => Auth::USER_STATUS_BLOCKED, + ])); - //TODO delete all tokens or only current session? - //TODO delete all user data according to GDPR. Make sure everything is backed up and backups are deleted later - /* - * Data to delete - * * Tokens - * * Memberships - */ + if (false === $user) { + throw new Exception('Failed saving user to DB', 500); + } - $audit - ->setParam('userId', $user->getId()) - ->setParam('event', 'account.delete') - ->setParam('resource', 'users/'.$user->getId()) - ->setParam('data', $user->getArrayCopy()) - ; + //TODO delete all tokens or only current session? + //TODO delete all user data according to GDPR. Make sure everything is backed up and backups are deleted later + /* + * Data to delete + * * Tokens + * * Memberships + */ - $webhook - ->setParam('payload', [ - 'name' => $user->getAttribute('name', ''), - 'email' => $user->getAttribute('email', ''), - ]) - ; + $audits + ->setParam('userId', $user->getId()) + ->setParam('event', 'account.delete') + ->setParam('resource', 'users/'.$user->getId()) + ->setParam('data', $user->getArrayCopy()) + ; - if (!Config::getParam('domainVerification')) { - $response - ->addHeader('X-Fallback-Cookies', \json_encode([])) - ; - } + $webhooks + ->setParam('payload', $response->output($user, Response::MODEL_USER)) + ; + if (!Config::getParam('domainVerification')) { $response - ->addCookie(Auth::$cookieName.'_legacy', '', \time() - 3600, '/', COOKIE_DOMAIN, ('https' == $protocol), true, null) - ->addCookie(Auth::$cookieName, '', \time() - 3600, '/', COOKIE_DOMAIN, ('https' == $protocol), true, COOKIE_SAMESITE) - ->noContent() + ->addHeader('X-Fallback-Cookies', \json_encode([])) ; } - ); -$utopia->delete('/v1/account/sessions/:sessionId') + $response + ->addCookie(Auth::$cookieName.'_legacy', '', \time() - 3600, '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, null) + ->addCookie(Auth::$cookieName, '', \time() - 3600, '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, Config::getParam('cookieSamesite')) + ->noContent() + ; + }, ['request', 'response', 'user', 'projectDB', 'audits', 'webhooks']); + +App::delete('/v1/account/sessions/:sessionId') ->desc('Delete Account Session') ->groups(['api', 'account']) ->label('scope', 'account') - ->label('webhook', 'account.sessions.delete') + ->label('event', 'account.sessions.delete') ->label('sdk.platform', [APP_PLATFORM_CLIENT]) ->label('sdk.namespace', 'account') ->label('sdk.method', 'deleteSession') ->label('sdk.description', '/docs/references/account/delete-session.md') ->label('abuse-limit', 100) - ->param('sessionId', null, function () { return new UID(); }, 'Session unique ID. Use the string \'current\' to delete the current device session.') - ->action( - function ($sessionId) use ($response, $user, $projectDB, $webhook, $audit) { - $protocol = Config::getParam('protocol'); - $sessionId = ($sessionId === 'current') - ? Auth::tokenVerify($user->getAttribute('tokens'), Auth::TOKEN_TYPE_LOGIN, Auth::$secret) - : $sessionId; - - $tokens = $user->getAttribute('tokens', []); + ->param('sessionId', null, new UID(), 'Session unique ID. Use the string \'current\' to delete the current device session.') + ->action(function ($sessionId, $request, $response, $user, $projectDB, $audits, $webhooks) { + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $user */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $audits */ + /** @var Appwrite\Event\Event $webhooks */ - foreach ($tokens as $token) { /* @var $token Document */ - if (($sessionId == $token->getId()) && Auth::TOKEN_TYPE_LOGIN == $token->getAttribute('type')) { - if (!$projectDB->deleteDocument($token->getId())) { - throw new Exception('Failed to remove token from DB', 500); - } + $protocol = $request->getProtocol(); + $sessionId = ($sessionId === 'current') + ? Auth::tokenVerify($user->getAttribute('tokens'), Auth::TOKEN_TYPE_LOGIN, Auth::$secret) + : $sessionId; + + $tokens = $user->getAttribute('tokens', []); - $audit - ->setParam('userId', $user->getId()) - ->setParam('event', 'account.sessions.delete') - ->setParam('resource', '/user/'.$user->getId()) - ; - - $webhook - ->setParam('payload', [ - 'name' => $user->getAttribute('name', ''), - 'email' => $user->getAttribute('email', ''), - ]) - ; - - if (!Config::getParam('domainVerification')) { - $response - ->addHeader('X-Fallback-Cookies', \json_encode([])) - ; - } - - if ($token->getAttribute('secret') == Auth::hash(Auth::$secret)) { // If current session delete the cookies too - $response - ->addCookie(Auth::$cookieName.'_legacy', '', \time() - 3600, '/', COOKIE_DOMAIN, ('https' == $protocol), true, null) - ->addCookie(Auth::$cookieName, '', \time() - 3600, '/', COOKIE_DOMAIN, ('https' == $protocol), true, COOKIE_SAMESITE) - ; - } - - return $response->noContent(); - } - } - - throw new Exception('Session not found', 404); - } - ); - -$utopia->delete('/v1/account/sessions') - ->desc('Delete All Account Sessions') - ->groups(['api', 'account']) - ->label('scope', 'account') - ->label('webhook', 'account.sessions.delete') - ->label('sdk.platform', [APP_PLATFORM_CLIENT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'deleteSessions') - ->label('sdk.description', '/docs/references/account/delete-sessions.md') - ->label('abuse-limit', 100) - ->action( - function () use ($response, $user, $projectDB, $audit, $webhook) { - $protocol = Config::getParam('protocol'); - $tokens = $user->getAttribute('tokens', []); - - foreach ($tokens as $token) { /* @var $token Document */ + foreach ($tokens as $token) { /* @var $token Document */ + if (($sessionId == $token->getId()) && Auth::TOKEN_TYPE_LOGIN == $token->getAttribute('type')) { if (!$projectDB->deleteDocument($token->getId())) { throw new Exception('Failed to remove token from DB', 500); } - $audit + $audits ->setParam('userId', $user->getId()) ->setParam('event', 'account.sessions.delete') ->setParam('resource', '/user/'.$user->getId()) ; - $webhook - ->setParam('payload', [ - 'name' => $user->getAttribute('name', ''), - 'email' => $user->getAttribute('email', ''), - ]) + $webhooks + ->setParam('payload', $response->output($user, Response::MODEL_USER)) ; if (!Config::getParam('domainVerification')) { @@ -1043,17 +1040,72 @@ $utopia->delete('/v1/account/sessions') if ($token->getAttribute('secret') == Auth::hash(Auth::$secret)) { // If current session delete the cookies too $response - ->addCookie(Auth::$cookieName.'_legacy', '', \time() - 3600, '/', COOKIE_DOMAIN, ('https' == $protocol), true, null) - ->addCookie(Auth::$cookieName, '', \time() - 3600, '/', COOKIE_DOMAIN, ('https' == $protocol), true, COOKIE_SAMESITE) + ->addCookie(Auth::$cookieName.'_legacy', '', \time() - 3600, '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, null) + ->addCookie(Auth::$cookieName, '', \time() - 3600, '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, Config::getParam('cookieSamesite')) ; } + + return $response->noContent(); + } + } + + throw new Exception('Session not found', 404); + }, ['request', 'response', 'user', 'projectDB', 'audits', 'webhooks']); + +App::delete('/v1/account/sessions') + ->desc('Delete All Account Sessions') + ->groups(['api', 'account']) + ->label('scope', 'account') + ->label('event', 'account.sessions.delete') + ->label('sdk.platform', [APP_PLATFORM_CLIENT]) + ->label('sdk.namespace', 'account') + ->label('sdk.method', 'deleteSessions') + ->label('sdk.description', '/docs/references/account/delete-sessions.md') + ->label('abuse-limit', 100) + ->action(function ($request, $response, $user, $projectDB, $audits, $webhooks) { + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $user */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $audits */ + /** @var Appwrite\Event\Event $webhooks */ + + $protocol = $request->getProtocol(); + $tokens = $user->getAttribute('tokens', []); + + foreach ($tokens as $token) { /* @var $token Document */ + if (!$projectDB->deleteDocument($token->getId())) { + throw new Exception('Failed to remove token from DB', 500); } - $response->noContent(); - } - ); + $audits + ->setParam('userId', $user->getId()) + ->setParam('event', 'account.sessions.delete') + ->setParam('resource', '/user/'.$user->getId()) + ; + + $webhooks + ->setParam('payload', $response->output($user, Response::MODEL_USER)) + ; -$utopia->post('/v1/account/recovery') + if (!Config::getParam('domainVerification')) { + $response + ->addHeader('X-Fallback-Cookies', \json_encode([])) + ; + } + + if ($token->getAttribute('secret') == Auth::hash(Auth::$secret)) { // If current session delete the cookies too + $response + ->addCookie(Auth::$cookieName.'_legacy', '', \time() - 3600, '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, null) + ->addCookie(Auth::$cookieName, '', \time() - 3600, '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, Config::getParam('cookieSamesite')) + ; + } + } + + $response->noContent(); + }, ['request', 'response', 'user', 'projectDB', 'audits', 'webhooks']); + +App::post('/v1/account/recovery') ->desc('Create Password Recovery') ->groups(['api', 'account']) ->label('scope', 'public') @@ -1063,96 +1115,103 @@ $utopia->post('/v1/account/recovery') ->label('sdk.description', '/docs/references/account/create-recovery.md') ->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. 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, $mail, $audit, $project) { - $profile = $projectDB->getCollectionFirst([ // Get user by email address - 'limit' => 1, - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_USERS, - 'email='.$email, - ], - ]); + ->param('email', '', new Email(), 'User email.') + ->param('url', '', function ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['clients']) + ->action(function ($email, $url, $request, $response, $projectDB, $project, $locale, $mails, $audits) { + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Database\Document $project */ + /** @var Utopia\Locale\Locale $locale */ + /** @var Appwrite\Event\Event $mails */ + /** @var Appwrite\Event\Event $audits */ - if (empty($profile)) { - throw new Exception('User not found', 404); // TODO maybe hide this - } + $profile = $projectDB->getCollectionFirst([ // Get user by email address + 'limit' => 1, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_USERS, + 'email='.$email, + ], + ]); - $secret = Auth::tokenGenerator(); - $recovery = new Document([ - '$collection' => Database::SYSTEM_COLLECTION_TOKENS, - '$permissions' => ['read' => ['user:'.$profile->getId()], 'write' => ['user:'.$profile->getId()]], - 'type' => Auth::TOKEN_TYPE_RECOVERY, - 'secret' => Auth::hash($secret), // On way hash encryption to protect DB leak - 'expire' => \time() + Auth::TOKEN_EXPIRATION_RECOVERY, - 'userAgent' => $request->getServer('HTTP_USER_AGENT', 'UNKNOWN'), - 'ip' => $request->getIP(), - ]); - - Authorization::setRole('user:'.$profile->getId()); - - $recovery = $projectDB->createDocument($recovery->getArrayCopy()); - - if (false === $recovery) { - throw new Exception('Failed saving recovery to DB', 500); - } - - $profile->setAttribute('tokens', $recovery, Document::SET_TYPE_APPEND); - - $profile = $projectDB->updateDocument($profile->getArrayCopy()); - - if (false === $profile) { - throw new Exception('Failed to save user to DB', 500); - } - - $url = Template::parseURL($url); - $url['query'] = Template::mergeQuery(((isset($url['query'])) ? $url['query'] : ''), ['userId' => $profile->getId(), 'secret' => $secret]); - $url = Template::unParseURL($url); - - $body = new Template(__DIR__.'/../../config/locales/templates/_base.tpl'); - $content = new Template(__DIR__.'/../../config/locales/templates/'.Locale::getText('account.emails.recovery.body')); - $cta = new Template(__DIR__.'/../../config/locales/templates/_cta.tpl'); - - $body - ->setParam('{{content}}', $content->render()) - ->setParam('{{cta}}', $cta->render()) - ->setParam('{{title}}', Locale::getText('account.emails.recovery.title')) - ->setParam('{{direction}}', Locale::getText('settings.direction')) - ->setParam('{{project}}', $project->getAttribute('name', ['[APP-NAME]'])) - ->setParam('{{name}}', $profile->getAttribute('name')) - ->setParam('{{redirect}}', $url) - ->setParam('{{bg-body}}', '#f6f6f6') - ->setParam('{{bg-content}}', '#ffffff') - ->setParam('{{bg-cta}}', '#3498db') - ->setParam('{{bg-cta-hover}}', '#34495e') - ->setParam('{{text-content}}', '#000000') - ->setParam('{{text-cta}}', '#ffffff') - ; - - $mail - ->setParam('event', 'account.recovery.create') - ->setParam('recipient', $profile->getAttribute('email', '')) - ->setParam('name', $profile->getAttribute('name', '')) - ->setParam('subject', Locale::getText('account.emails.recovery.title')) - ->setParam('body', $body->render()) - ->trigger(); - ; - - $audit - ->setParam('userId', $profile->getId()) - ->setParam('event', 'account.recovery.create') - ->setParam('resource', 'users/'.$profile->getId()) - ; - - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->json($recovery->getArrayCopy(['$id', 'type', 'expire'])) - ; + if (empty($profile)) { + throw new Exception('User not found', 404); // TODO maybe hide this } - ); -$utopia->put('/v1/account/recovery') + $secret = Auth::tokenGenerator(); + $recovery = new Document([ + '$collection' => Database::SYSTEM_COLLECTION_TOKENS, + '$permissions' => ['read' => ['user:'.$profile->getId()], 'write' => ['user:'.$profile->getId()]], + 'type' => Auth::TOKEN_TYPE_RECOVERY, + 'secret' => Auth::hash($secret), // On way hash encryption to protect DB leak + 'expire' => \time() + Auth::TOKEN_EXPIRATION_RECOVERY, + 'userAgent' => $request->getUserAgent('UNKNOWN'), + 'ip' => $request->getIP(), + ]); + + Authorization::setRole('user:'.$profile->getId()); + + $recovery = $projectDB->createDocument($recovery->getArrayCopy()); + + if (false === $recovery) { + throw new Exception('Failed saving recovery to DB', 500); + } + + $profile->setAttribute('tokens', $recovery, Document::SET_TYPE_APPEND); + + $profile = $projectDB->updateDocument($profile->getArrayCopy()); + + if (false === $profile) { + throw new Exception('Failed to save user to DB', 500); + } + + $url = Template::parseURL($url); + $url['query'] = Template::mergeQuery(((isset($url['query'])) ? $url['query'] : ''), ['userId' => $profile->getId(), 'secret' => $secret]); + $url = Template::unParseURL($url); + + $body = new Template(__DIR__.'/../../config/locale/templates/email-base.tpl'); + $content = new Template(__DIR__.'/../../config/locale/translations/templates/'.$locale->getText('account.emails.recovery.body')); + $cta = new Template(__DIR__.'/../../config/locale/templates/email-cta.tpl'); + + $body + ->setParam('{{content}}', $content->render()) + ->setParam('{{cta}}', $cta->render()) + ->setParam('{{title}}', $locale->getText('account.emails.recovery.title')) + ->setParam('{{direction}}', $locale->getText('settings.direction')) + ->setParam('{{project}}', $project->getAttribute('name', ['[APP-NAME]'])) + ->setParam('{{name}}', $profile->getAttribute('name')) + ->setParam('{{redirect}}', $url) + ->setParam('{{bg-body}}', '#f6f6f6') + ->setParam('{{bg-content}}', '#ffffff') + ->setParam('{{bg-cta}}', '#3498db') + ->setParam('{{bg-cta-hover}}', '#34495e') + ->setParam('{{text-content}}', '#000000') + ->setParam('{{text-cta}}', '#ffffff') + ; + + $mails + ->setParam('event', 'account.recovery.create') + ->setParam('from', ($project->getId() === 'console') ? '' : \sprintf($locale->getText('account.emails.team'), $project->getAttribute('name'))) + ->setParam('recipient', $profile->getAttribute('email', '')) + ->setParam('name', $profile->getAttribute('name', '')) + ->setParam('subject', $locale->getText('account.emails.recovery.title')) + ->setParam('body', $body->render()) + ->trigger(); + ; + + $audits + ->setParam('userId', $profile->getId()) + ->setParam('event', 'account.recovery.create') + ->setParam('resource', 'users/'.$profile->getId()) + ; + + $response + ->setStatusCode(Response::STATUS_CODE_CREATED) + ->json($recovery->getArrayCopy(['$id', 'type', 'expire'])) + ; + }, ['request', 'response', 'projectDB', 'project', 'locale', 'mails', 'audits']); + +App::put('/v1/account/recovery') ->desc('Complete Password Recovery') ->groups(['api', 'account']) ->label('scope', 'public') @@ -1162,67 +1221,69 @@ $utopia->put('/v1/account/recovery') ->label('sdk.description', '/docs/references/account/update-recovery.md') ->label('abuse-limit', 10) ->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. 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) { - throw new Exception('Passwords must match', 400); - } - - $profile = $projectDB->getCollectionFirst([ // Get user by email address - 'limit' => 1, - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_USERS, - '$id='.$userId, - ], - ]); - - if (empty($profile)) { - throw new Exception('User not found', 404); // TODO maybe hide this - } - - $recovery = Auth::tokenVerify($profile->getAttribute('tokens', []), Auth::TOKEN_TYPE_RECOVERY, $secret); - - if (!$recovery) { - throw new Exception('Invalid recovery token', 401); - } - - Authorization::setRole('user:'.$profile->getId()); - - $profile = $projectDB->updateDocument(\array_merge($profile->getArrayCopy(), [ - 'password' => Auth::passwordHash($password), - 'password-update' => \time(), - 'emailVerification' => true, - ])); - - if (false === $profile) { - throw new Exception('Failed saving user to DB', 500); - } - - /** - * We act like we're updating and validating - * the recovery token but actually we don't need it anymore. - */ - if (!$projectDB->deleteDocument($recovery)) { - throw new Exception('Failed to remove recovery from DB', 500); - } - - $audit - ->setParam('userId', $profile->getId()) - ->setParam('event', 'account.recovery.update') - ->setParam('resource', 'users/'.$profile->getId()) - ; - - $recovery = $profile->search('$id', $recovery, $profile->getAttribute('tokens', [])); - - $response->json($recovery->getArrayCopy(['$id', 'type', 'expire'])); + ->param('userId', '', new UID(), 'User account UID address.') + ->param('secret', '', new Text(256), 'Valid reset token.') + ->param('password', '', new Password(), 'New password. Must be between 6 to 32 chars.') + ->param('passwordAgain', '', new Password(), 'New password again. Must be between 6 to 32 chars.') + ->action(function ($userId, $secret, $password, $passwordAgain, $response, $projectDB, $audits) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $audits */ + + if ($password !== $passwordAgain) { + throw new Exception('Passwords must match', 400); } - ); -$utopia->post('/v1/account/verification') + $profile = $projectDB->getCollectionFirst([ // Get user by email address + 'limit' => 1, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_USERS, + '$id='.$userId, + ], + ]); + + if (empty($profile)) { + throw new Exception('User not found', 404); // TODO maybe hide this + } + + $recovery = Auth::tokenVerify($profile->getAttribute('tokens', []), Auth::TOKEN_TYPE_RECOVERY, $secret); + + if (!$recovery) { + throw new Exception('Invalid recovery token', 401); + } + + Authorization::setRole('user:'.$profile->getId()); + + $profile = $projectDB->updateDocument(\array_merge($profile->getArrayCopy(), [ + 'password' => Auth::passwordHash($password), + 'password-update' => \time(), + 'emailVerification' => true, + ])); + + if (false === $profile) { + throw new Exception('Failed saving user to DB', 500); + } + + /** + * We act like we're updating and validating + * the recovery token but actually we don't need it anymore. + */ + if (!$projectDB->deleteDocument($recovery)) { + throw new Exception('Failed to remove recovery from DB', 500); + } + + $audits + ->setParam('userId', $profile->getId()) + ->setParam('event', 'account.recovery.update') + ->setParam('resource', 'users/'.$profile->getId()) + ; + + $recovery = $profile->search('$id', $recovery, $profile->getAttribute('tokens', [])); + + $response->json($recovery->getArrayCopy(['$id', 'type', 'expire'])); + }, ['response', 'projectDB', 'audits']); + +App::post('/v1/account/verification') ->desc('Create Email Verification') ->groups(['api', 'account']) ->label('scope', 'account') @@ -1232,84 +1293,92 @@ $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. 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, $mail, $user, $project, $projectDB, $audit) { - $verificationSecret = Auth::tokenGenerator(); + ->param('url', '', function ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['clients']) // TODO add built-in confirm page + ->action(function ($url, $request, $response, $project, $user, $projectDB, $locale, $audits, $mails) { + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $project */ + /** @var Appwrite\Database\Document $user */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Utopia\Locale\Locale $locale */ + /** @var Appwrite\Event\Event $audits */ + /** @var Appwrite\Event\Event $mails */ + + $verificationSecret = Auth::tokenGenerator(); + + $verification = new Document([ + '$collection' => Database::SYSTEM_COLLECTION_TOKENS, + '$permissions' => ['read' => ['user:'.$user->getId()], 'write' => ['user:'.$user->getId()]], + 'type' => Auth::TOKEN_TYPE_VERIFICATION, + 'secret' => Auth::hash($verificationSecret), // On way hash encryption to protect DB leak + 'expire' => \time() + Auth::TOKEN_EXPIRATION_CONFIRM, + 'userAgent' => $request->getUserAgent('UNKNOWN'), + 'ip' => $request->getIP(), + ]); - $verification = new Document([ - '$collection' => Database::SYSTEM_COLLECTION_TOKENS, - '$permissions' => ['read' => ['user:'.$user->getId()], 'write' => ['user:'.$user->getId()]], - 'type' => Auth::TOKEN_TYPE_VERIFICATION, - 'secret' => Auth::hash($verificationSecret), // On way hash encryption to protect DB leak - 'expire' => \time() + Auth::TOKEN_EXPIRATION_CONFIRM, - 'userAgent' => $request->getServer('HTTP_USER_AGENT', 'UNKNOWN'), - 'ip' => $request->getIP(), - ]); - - Authorization::setRole('user:'.$user->getId()); + Authorization::setRole('user:'.$user->getId()); - $verification = $projectDB->createDocument($verification->getArrayCopy()); + $verification = $projectDB->createDocument($verification->getArrayCopy()); - if (false === $verification) { - throw new Exception('Failed saving verification to DB', 500); - } - - $user->setAttribute('tokens', $verification, Document::SET_TYPE_APPEND); - - $user = $projectDB->updateDocument($user->getArrayCopy()); - - if (false === $user) { - throw new Exception('Failed to save user to DB', 500); - } - - $url = Template::parseURL($url); - $url['query'] = Template::mergeQuery(((isset($url['query'])) ? $url['query'] : ''), ['userId' => $user->getId(), 'secret' => $verificationSecret]); - $url = Template::unParseURL($url); - - $body = new Template(__DIR__.'/../../config/locales/templates/_base.tpl'); - $content = new Template(__DIR__.'/../../config/locales/templates/'.Locale::getText('account.emails.verification.body')); - $cta = new Template(__DIR__.'/../../config/locales/templates/_cta.tpl'); - - $body - ->setParam('{{content}}', $content->render()) - ->setParam('{{cta}}', $cta->render()) - ->setParam('{{title}}', Locale::getText('account.emails.verification.title')) - ->setParam('{{direction}}', Locale::getText('settings.direction')) - ->setParam('{{project}}', $project->getAttribute('name', ['[APP-NAME]'])) - ->setParam('{{name}}', $user->getAttribute('name')) - ->setParam('{{redirect}}', $url) - ->setParam('{{bg-body}}', '#f6f6f6') - ->setParam('{{bg-content}}', '#ffffff') - ->setParam('{{bg-cta}}', '#3498db') - ->setParam('{{bg-cta-hover}}', '#34495e') - ->setParam('{{text-content}}', '#000000') - ->setParam('{{text-cta}}', '#ffffff') - ; - - $mail - ->setParam('event', 'account.verification.create') - ->setParam('recipient', $user->getAttribute('email')) - ->setParam('name', $user->getAttribute('name')) - ->setParam('subject', Locale::getText('account.emails.verification.title')) - ->setParam('body', $body->render()) - ->trigger() - ; - - $audit - ->setParam('userId', $user->getId()) - ->setParam('event', 'account.verification.create') - ->setParam('resource', 'users/'.$user->getId()) - ; - - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->json($verification->getArrayCopy(['$id', 'type', 'expire'])) - ; + if (false === $verification) { + throw new Exception('Failed saving verification to DB', 500); } - ); -$utopia->put('/v1/account/verification') + $user->setAttribute('tokens', $verification, Document::SET_TYPE_APPEND); + + $user = $projectDB->updateDocument($user->getArrayCopy()); + + if (false === $user) { + throw new Exception('Failed to save user to DB', 500); + } + + $url = Template::parseURL($url); + $url['query'] = Template::mergeQuery(((isset($url['query'])) ? $url['query'] : ''), ['userId' => $user->getId(), 'secret' => $verificationSecret]); + $url = Template::unParseURL($url); + + $body = new Template(__DIR__.'/../../config/locale/templates/email-base.tpl'); + $content = new Template(__DIR__.'/../../config/locale/translations/templates/'.$locale->getText('account.emails.verification.body')); + $cta = new Template(__DIR__.'/../../config/locale/templates/email-cta.tpl'); + + $body + ->setParam('{{content}}', $content->render()) + ->setParam('{{cta}}', $cta->render()) + ->setParam('{{title}}', $locale->getText('account.emails.verification.title')) + ->setParam('{{direction}}', $locale->getText('settings.direction')) + ->setParam('{{project}}', $project->getAttribute('name', ['[APP-NAME]'])) + ->setParam('{{name}}', $user->getAttribute('name')) + ->setParam('{{redirect}}', $url) + ->setParam('{{bg-body}}', '#f6f6f6') + ->setParam('{{bg-content}}', '#ffffff') + ->setParam('{{bg-cta}}', '#3498db') + ->setParam('{{bg-cta-hover}}', '#34495e') + ->setParam('{{text-content}}', '#000000') + ->setParam('{{text-cta}}', '#ffffff') + ; + + $mails + ->setParam('event', 'account.verification.create') + ->setParam('from', ($project->getId() === 'console') ? '' : \sprintf($locale->getText('account.emails.team'), $project->getAttribute('name'))) + ->setParam('recipient', $user->getAttribute('email')) + ->setParam('name', $user->getAttribute('name')) + ->setParam('subject', $locale->getText('account.emails.verification.title')) + ->setParam('body', $body->render()) + ->trigger() + ; + + $audits + ->setParam('userId', $user->getId()) + ->setParam('event', 'account.verification.create') + ->setParam('resource', 'users/'.$user->getId()) + ; + + $response + ->setStatusCode(Response::STATUS_CODE_CREATED) + ->json($verification->getArrayCopy(['$id', 'type', 'expire'])) + ; + }, ['request', 'response', 'project', 'user', 'projectDB', 'locale', 'audits', 'mails']); + +App::put('/v1/account/verification') ->desc('Complete Email Verification') ->groups(['api', 'account']) ->label('scope', 'public') @@ -1319,54 +1388,57 @@ $utopia->put('/v1/account/verification') ->label('sdk.description', '/docs/references/account/update-verification.md') ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{param-userId}') - ->param('userId', '', function () { return new UID(); }, 'User unique ID.') - ->param('secret', '', function () { return new Text(256); }, 'Valid verification token.') - ->action( - function ($userId, $secret) use ($response, $user, $projectDB, $audit) { - $profile = $projectDB->getCollectionFirst([ // Get user by email address - 'limit' => 1, - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_USERS, - '$id='.$userId, - ], - ]); + ->param('userId', '', new UID(), 'User unique ID.') + ->param('secret', '', new Text(256), 'Valid verification token.') + ->action(function ($userId, $secret, $response, $user, $projectDB, $audits) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $user */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $audits */ - if (empty($profile)) { - throw new Exception('User not found', 404); // TODO maybe hide this - } + $profile = $projectDB->getCollectionFirst([ // Get user by email address + 'limit' => 1, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_USERS, + '$id='.$userId, + ], + ]); - $verification = Auth::tokenVerify($profile->getAttribute('tokens', []), Auth::TOKEN_TYPE_VERIFICATION, $secret); - - if (!$verification) { - throw new Exception('Invalid verification token', 401); - } - - Authorization::setRole('user:'.$profile->getId()); - - $profile = $projectDB->updateDocument(\array_merge($profile->getArrayCopy(), [ - 'emailVerification' => true, - ])); - - if (false === $profile) { - throw new Exception('Failed saving user to DB', 500); - } - - /** - * We act like we're updating and validating - * the verification token but actually we don't need it anymore. - */ - if (!$projectDB->deleteDocument($verification)) { - throw new Exception('Failed to remove verification from DB', 500); - } - - $audit - ->setParam('userId', $profile->getId()) - ->setParam('event', 'account.verification.update') - ->setParam('resource', 'users/'.$user->getId()) - ; - - $verification = $profile->search('$id', $verification, $profile->getAttribute('tokens', [])); - - $response->json($verification->getArrayCopy(['$id', 'type', 'expire'])); + if (empty($profile)) { + throw new Exception('User not found', 404); // TODO maybe hide this } - ); \ No newline at end of file + + $verification = Auth::tokenVerify($profile->getAttribute('tokens', []), Auth::TOKEN_TYPE_VERIFICATION, $secret); + + if (!$verification) { + throw new Exception('Invalid verification token', 401); + } + + Authorization::setRole('user:'.$profile->getId()); + + $profile = $projectDB->updateDocument(\array_merge($profile->getArrayCopy(), [ + 'emailVerification' => true, + ])); + + if (false === $profile) { + throw new Exception('Failed saving user to DB', 500); + } + + /** + * We act like we're updating and validating + * the verification token but actually we don't need it anymore. + */ + if (!$projectDB->deleteDocument($verification)) { + throw new Exception('Failed to remove verification from DB', 500); + } + + $audits + ->setParam('userId', $profile->getId()) + ->setParam('event', 'account.verification.update') + ->setParam('resource', 'users/'.$user->getId()) + ; + + $verification = $profile->search('$id', $verification, $profile->getAttribute('tokens', [])); + + $response->json($verification->getArrayCopy(['$id', 'type', 'expire'])); + }, ['response', 'user', 'projectDB', 'audits']); \ No newline at end of file diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 9e888f7f7d..f558795fe3 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -1,7 +1,6 @@ include __DIR__.'/../../config/avatars/browsers.php', - 'credit-cards' => include __DIR__.'/../../config/avatars/credit-cards.php', - 'flags' => include __DIR__.'/../../config/avatars/flags.php', -]; +$avatarCallback = function ($type, $code, $width, $height, $quality, $response) { + /** @var Appwrite\Utopia\Response $response */ -$avatarCallback = function ($type, $code, $width, $height, $quality) use ($types, $response) { $code = \strtolower($code); $type = \strtolower($type); + $set = Config::getParam('avatar-'.$type, []); - if (!\array_key_exists($type, $types)) { + if (empty($set)) { throw new Exception('Avatar set not found', 404); } - if (!\array_key_exists($code, $types[$type])) { + if (!\array_key_exists($code, $set)) { throw new Exception('Avatar not found', 404); } @@ -44,7 +40,7 @@ $avatarCallback = function ($type, $code, $width, $height, $quality) use ($types $output = 'png'; $date = \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)).' GMT'; // 45 days cache $key = \md5('/v1/avatars/:type/:code-'.$code.$width.$height.$quality.$output); - $path = $types[$type][$code]; + $path = $set[$code]; $type = 'png'; if (!\is_readable($path)) { @@ -57,11 +53,11 @@ $avatarCallback = function ($type, $code, $width, $height, $quality) use ($types if ($data) { //$output = (empty($output)) ? $type : $output; - $response + return $response ->setContentType('image/png') ->addHeader('Expires', $date) ->addHeader('X-Appwrite-Cache', 'hit') - ->send($data, 0) + ->send($data) ; } @@ -71,403 +67,397 @@ $avatarCallback = function ($type, $code, $width, $height, $quality) use ($types $output = (empty($output)) ? $type : $output; + $data = $resize->output($output, $quality); + + $cache->save($key, $data); + $response ->setContentType('image/png') ->addHeader('Expires', $date) ->addHeader('X-Appwrite-Cache', 'miss') - ->send('', null) + ->send($data, null); ; - $data = $resize->output($output, $quality); - - $cache->save($key, $data); - - echo $data; - unset($resize); }; -$utopia->get('/v1/avatars/credit-cards/:code') +App::get('/v1/avatars/credit-cards/:code') ->desc('Get Credit Card Icon') ->groups(['api', 'avatars']) - ->param('code', '', function () use ($types) { return new WhiteList(\array_keys($types['credit-cards'])); }, 'Credit Card Code. Possible values: '.\implode(', ', \array_keys($types['credit-cards'])).'.') - ->param('width', 100, function () { return new Range(0, 2000); }, 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) - ->param('height', 100, function () { return new Range(0, 2000); }, 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) - ->param('quality', 100, function () { return new Range(0, 100); }, 'Image quality. Pass an integer between 0 to 100. Defaults to 100.', true) ->label('scope', 'avatars.read') ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'avatars') ->label('sdk.method', 'getCreditCard') ->label('sdk.methodType', 'location') ->label('sdk.description', '/docs/references/avatars/get-credit-card.md') - ->action(function ($code, $width, $height, $quality) use ($avatarCallback) { - return $avatarCallback('credit-cards', $code, $width, $height, $quality); - }); + ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-credit-cards'))), 'Credit Card Code. Possible values: '.\implode(', ', \array_keys(Config::getParam('avatar-credit-cards'))).'.') + ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) + ->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) + ->param('quality', 100, new Range(0, 100), 'Image quality. Pass an integer between 0 to 100. Defaults to 100.', true) + ->action(function ($code, $width, $height, $quality, $response) use ($avatarCallback) { + return $avatarCallback('credit-cards', $code, $width, $height, $quality, $response); + }, ['response']); -$utopia->get('/v1/avatars/browsers/:code') +App::get('/v1/avatars/browsers/:code') ->desc('Get Browser Icon') ->groups(['api', 'avatars']) - ->param('code', '', function () use ($types) { return new WhiteList(\array_keys($types['browsers'])); }, 'Browser Code.') - ->param('width', 100, function () { return new Range(0, 2000); }, 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) - ->param('height', 100, function () { return new Range(0, 2000); }, 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) - ->param('quality', 100, function () { return new Range(0, 100); }, 'Image quality. Pass an integer between 0 to 100. Defaults to 100.', true) ->label('scope', 'avatars.read') ->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); - }); + ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-browsers'))), 'Browser Code.') + ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) + ->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) + ->param('quality', 100, new Range(0, 100), 'Image quality. Pass an integer between 0 to 100. Defaults to 100.', true) + ->action(function ($code, $width, $height, $quality, $response) use ($avatarCallback) { + return $avatarCallback('browsers', $code, $width, $height, $quality, $response); + }, ['response']); -$utopia->get('/v1/avatars/flags/:code') +App::get('/v1/avatars/flags/:code') ->desc('Get Country Flag') ->groups(['api', 'avatars']) - ->param('code', '', function () use ($types) { return new WhiteList(\array_keys($types['flags'])); }, 'Country Code. ISO Alpha-2 country code format.') - ->param('width', 100, function () { return new Range(0, 2000); }, 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) - ->param('height', 100, function () { return new Range(0, 2000); }, 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) - ->param('quality', 100, function () { return new Range(0, 100); }, 'Image quality. Pass an integer between 0 to 100. Defaults to 100.', true) ->label('scope', 'avatars.read') ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'avatars') ->label('sdk.method', 'getFlag') ->label('sdk.methodType', 'location') ->label('sdk.description', '/docs/references/avatars/get-flag.md') - ->action(function ($code, $width, $height, $quality) use ($avatarCallback) { - return $avatarCallback('flags', $code, $width, $height, $quality); - }); + ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-flags'))), 'Country Code. ISO Alpha-2 country code format.') + ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) + ->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) + ->param('quality', 100, new Range(0, 100), 'Image quality. Pass an integer between 0 to 100. Defaults to 100.', true) + ->action(function ($code, $width, $height, $quality, $response) use ($avatarCallback) { + return $avatarCallback('flags', $code, $width, $height, $quality, $response); + }, ['response']); -$utopia->get('/v1/avatars/image') +App::get('/v1/avatars/image') ->desc('Get Image from URL') ->groups(['api', 'avatars']) - ->param('url', '', function () { return new URL(); }, 'Image URL which you want to crop.') - ->param('width', 400, function () { return new Range(0, 2000); }, 'Resize preview image width, Pass an integer between 0 to 2000.', true) - ->param('height', 400, function () { return new Range(0, 2000); }, 'Resize preview image height, Pass an integer between 0 to 2000.', true) ->label('scope', 'avatars.read') ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'avatars') ->label('sdk.method', 'getImage') ->label('sdk.methodType', 'location') ->label('sdk.description', '/docs/references/avatars/get-image.md') - ->action( - function ($url, $width, $height) use ($response) { - $quality = 80; - $output = 'png'; - $date = \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)).' GMT'; // 45 days cache - $key = \md5('/v2/avatars/images-'.$url.'-'.$width.'/'.$height.'/'.$quality); - $type = 'png'; - $cache = new Cache(new Filesystem(APP_STORAGE_CACHE.'/app-0')); // Limit file number or size - $data = $cache->load($key, 60 * 60 * 24 * 7 /* 1 week */); + ->param('url', '', new URL(), 'Image URL which you want to crop.') + ->param('width', 400, new Range(0, 2000), 'Resize preview image width, Pass an integer between 0 to 2000.', true) + ->param('height', 400, new Range(0, 2000), 'Resize preview image height, Pass an integer between 0 to 2000.', true) + ->action(function ($url, $width, $height, $response) { + /** @var Appwrite\Utopia\Response $response */ - if ($data) { - $response - ->setContentType('image/png') - ->addHeader('Expires', $date) - ->addHeader('X-Appwrite-Cache', 'hit') - ->send($data, 0) - ; - } + $quality = 80; + $output = 'png'; + $date = \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)).' GMT'; // 45 days cache + $key = \md5('/v2/avatars/images-'.$url.'-'.$width.'/'.$height.'/'.$quality); + $type = 'png'; + $cache = new Cache(new Filesystem(APP_STORAGE_CACHE.'/app-0')); // Limit file number or size + $data = $cache->load($key, 60 * 60 * 24 * 7 /* 1 week */); - if (!\extension_loaded('imagick')) { - throw new Exception('Imagick extension is missing', 500); - } - - $fetch = @\file_get_contents($url, false); - - if (!$fetch) { - throw new Exception('Image not found', 404); - } - - try { - $resize = new Resize($fetch); - } catch (\Exception $exception) { - throw new Exception('Unable to parse image', 500); - } - - $resize->crop((int) $width, (int) $height); - - $output = (empty($output)) ? $type : $output; - - $response + if ($data) { + return $response ->setContentType('image/png') ->addHeader('Expires', $date) - ->addHeader('X-Appwrite-Cache', 'miss') - ->send('', null) + ->addHeader('X-Appwrite-Cache', 'hit') + ->send($data) ; - - $data = $resize->output($output, $quality); - - $cache->save($key, $data); - - echo $data; - - unset($resize); } - ); -$utopia->get('/v1/avatars/favicon') + if (!\extension_loaded('imagick')) { + throw new Exception('Imagick extension is missing', 500); + } + + $fetch = @\file_get_contents($url, false); + + if (!$fetch) { + throw new Exception('Image not found', 404); + } + + try { + $resize = new Resize($fetch); + } catch (\Exception $exception) { + throw new Exception('Unable to parse image', 500); + } + + $resize->crop((int) $width, (int) $height); + + $output = (empty($output)) ? $type : $output; + + $data = $resize->output($output, $quality); + + $cache->save($key, $data); + + $response + ->setContentType('image/png') + ->addHeader('Expires', $date) + ->addHeader('X-Appwrite-Cache', 'miss') + ->send($data); + ; + + unset($resize); + }, ['response']); + +App::get('/v1/avatars/favicon') ->desc('Get Favicon') ->groups(['api', 'avatars']) - ->param('url', '', function () { return new URL(); }, 'Website URL which you want to fetch the favicon from.') ->label('scope', 'avatars.read') ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'avatars') ->label('sdk.method', 'getFavicon') ->label('sdk.methodType', 'location') ->label('sdk.description', '/docs/references/avatars/get-favicon.md') - ->action( - function ($url) use ($response, $request) { - $width = 56; - $height = 56; - $quality = 80; - $output = 'png'; - $date = \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)).' GMT'; // 45 days cache - $key = \md5('/v2/avatars/favicon-'.$url); - $type = 'png'; - $cache = new Cache(new Filesystem(APP_STORAGE_CACHE.'/app-0')); // Limit file number or size - $data = $cache->load($key, 60 * 60 * 24 * 30 * 3 /* 3 months */); + ->param('url', '', new URL(), 'Website URL which you want to fetch the favicon from.') + ->action(function ($url, $response) { + /** @var Appwrite\Utopia\Response $response */ - if ($data) { - $response - ->setContentType('image/png') - ->addHeader('Expires', $date) - ->addHeader('X-Appwrite-Cache', 'hit') - ->send($data, 0) - ; - } + $width = 56; + $height = 56; + $quality = 80; + $output = 'png'; + $date = \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)).' GMT'; // 45 days cache + $key = \md5('/v2/avatars/favicon-'.$url); + $type = 'png'; + $cache = new Cache(new Filesystem(APP_STORAGE_CACHE.'/app-0')); // Limit file number or size + $data = $cache->load($key, 60 * 60 * 24 * 30 * 3 /* 3 months */); - if (!\extension_loaded('imagick')) { - throw new Exception('Imagick extension is missing', 500); - } - - $curl = \curl_init(); - - \curl_setopt_array($curl, [ - CURLOPT_RETURNTRANSFER => 1, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_MAXREDIRS => 3, - CURLOPT_URL => $url, - CURLOPT_USERAGENT => \sprintf(APP_USERAGENT, - Config::getParam('version'), - $request->getServer('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS', APP_EMAIL_SECURITY) - ), - ]); - - $html = \curl_exec($curl); - - \curl_close($curl); - - if (!$html) { - throw new Exception('Failed to fetch remote URL', 404); - } - - $doc = new DOMDocument(); - $doc->strictErrorChecking = false; - @$doc->loadHTML($html); - - $links = $doc->getElementsByTagName('link'); - $outputHref = ''; - $outputExt = ''; - $space = 0; - - foreach ($links as $link) { /* @var $link DOMElement */ - $href = $link->getAttribute('href'); - $rel = $link->getAttribute('rel'); - $sizes = $link->getAttribute('sizes'); - $absolute = URLParse::unparse(\array_merge(\parse_url($url), \parse_url($href))); - - switch (\strtolower($rel)) { - case 'icon': - case 'shortcut icon': - //case 'apple-touch-icon': - $ext = \pathinfo(\parse_url($absolute, PHP_URL_PATH), PATHINFO_EXTENSION); - - switch ($ext) { - case 'ico': - case 'png': - case 'jpg': - case 'jpeg': - $size = \explode('x', \strtolower($sizes)); - - $sizeWidth = (isset($size[0])) ? (int) $size[0] : 0; - $sizeHeight = (isset($size[1])) ? (int) $size[1] : 0; - - if (($sizeWidth * $sizeHeight) >= $space) { - $space = $sizeWidth * $sizeHeight; - $outputHref = $absolute; - $outputExt = $ext; - } - - break; - } - - break; - } - } - - if (empty($outputHref) || empty($outputExt)) { - $default = \parse_url($url); - - $outputHref = $default['scheme'].'://'.$default['host'].'/favicon.ico'; - $outputExt = 'ico'; - } - - if ('ico' == $outputExt) { // Skip crop, Imagick isn\'t supporting icon files - $data = @\file_get_contents($outputHref, false); - - if (empty($data) || (\mb_substr($data, 0, 5) === 'save($key, $data); - - $response - ->setContentType('image/x-icon') - ->addHeader('Expires', $date) - ->addHeader('X-Appwrite-Cache', 'miss') - ->send($data, 0) - ; - } - - $fetch = @\file_get_contents($outputHref, false); - - if (!$fetch) { - throw new Exception('Icon not found', 404); - } - - $resize = new Resize($fetch); - - $resize->crop((int) $width, (int) $height); - - $output = (empty($output)) ? $type : $output; - - $response + if ($data) { + return $response ->setContentType('image/png') ->addHeader('Expires', $date) - ->addHeader('X-Appwrite-Cache', 'miss') - ->send('', null) + ->addHeader('X-Appwrite-Cache', 'hit') + ->send($data) ; + } - $data = $resize->output($output, $quality); + if (!\extension_loaded('imagick')) { + throw new Exception('Imagick extension is missing', 500); + } + + $curl = \curl_init(); + + \curl_setopt_array($curl, [ + CURLOPT_RETURNTRANSFER => 1, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_MAXREDIRS => 3, + CURLOPT_URL => $url, + CURLOPT_USERAGENT => \sprintf(APP_USERAGENT, + App::getEnv('_APP_VERSION', 'UNKNOWN'), + App::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS', APP_EMAIL_SECURITY) + ), + ]); + + $html = \curl_exec($curl); + + \curl_close($curl); + + if (!$html) { + throw new Exception('Failed to fetch remote URL', 404); + } + + $doc = new DOMDocument(); + $doc->strictErrorChecking = false; + @$doc->loadHTML($html); + + $links = $doc->getElementsByTagName('link'); + $outputHref = ''; + $outputExt = ''; + $space = 0; + + foreach ($links as $link) { /* @var $link DOMElement */ + $href = $link->getAttribute('href'); + $rel = $link->getAttribute('rel'); + $sizes = $link->getAttribute('sizes'); + $absolute = URLParse::unparse(\array_merge(\parse_url($url), \parse_url($href))); + + switch (\strtolower($rel)) { + case 'icon': + case 'shortcut icon': + //case 'apple-touch-icon': + $ext = \pathinfo(\parse_url($absolute, PHP_URL_PATH), PATHINFO_EXTENSION); + + switch ($ext) { + case 'ico': + case 'png': + case 'jpg': + case 'jpeg': + $size = \explode('x', \strtolower($sizes)); + + $sizeWidth = (isset($size[0])) ? (int) $size[0] : 0; + $sizeHeight = (isset($size[1])) ? (int) $size[1] : 0; + + if (($sizeWidth * $sizeHeight) >= $space) { + $space = $sizeWidth * $sizeHeight; + $outputHref = $absolute; + $outputExt = $ext; + } + + break; + } + + break; + } + } + + if (empty($outputHref) || empty($outputExt)) { + $default = \parse_url($url); + + $outputHref = $default['scheme'].'://'.$default['host'].'/favicon.ico'; + $outputExt = 'ico'; + } + + if ('ico' == $outputExt) { // Skip crop, Imagick isn\'t supporting icon files + $data = @\file_get_contents($outputHref, false); + + if (empty($data) || (\mb_substr($data, 0, 5) === 'save($key, $data); - echo $data; - - unset($resize); + return $response + ->setContentType('image/x-icon') + ->addHeader('Expires', $date) + ->addHeader('X-Appwrite-Cache', 'miss') + ->send($data) + ; } - ); -$utopia->get('/v1/avatars/qr') + $fetch = @\file_get_contents($outputHref, false); + + if (!$fetch) { + throw new Exception('Icon not found', 404); + } + + $resize = new Resize($fetch); + + $resize->crop((int) $width, (int) $height); + + $output = (empty($output)) ? $type : $output; + + $data = $resize->output($output, $quality); + + $cache->save($key, $data); + + $response + ->setContentType('image/png') + ->addHeader('Expires', $date) + ->addHeader('X-Appwrite-Cache', 'miss') + ->send($data); + + unset($resize); + }, ['response']); + +App::get('/v1/avatars/qr') ->desc('Get QR Code') ->groups(['api', 'avatars']) - ->param('text', '', function () { return new Text(512); }, 'Plain text to be converted to QR code image.') - ->param('size', 400, function () { return new Range(0, 1000); }, 'QR code size. Pass an integer between 0 to 1000. Defaults to 400.', true) - ->param('margin', 1, function () { return new Range(0, 10); }, 'Margin from edge. Pass an integer between 0 to 10. Defaults to 1.', true) - ->param('download', false, function () { return new Boolean(true); }, 'Return resulting image with \'Content-Disposition: attachment \' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.', true) ->label('scope', 'avatars.read') ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'avatars') ->label('sdk.method', 'getQR') ->label('sdk.methodType', 'location') ->label('sdk.description', '/docs/references/avatars/get-qr.md') - ->action( - function ($text, $size, $margin, $download) use ($response) { - $download = ($download === '1' || $download === 'true' || $download === 1 || $download === true); + ->param('text', '', new Text(512), 'Plain text to be converted to QR code image.') + ->param('size', 400, new Range(0, 1000), 'QR code size. Pass an integer between 0 to 1000. Defaults to 400.', true) + ->param('margin', 1, new Range(0, 10), 'Margin from edge. Pass an integer between 0 to 10. Defaults to 1.', true) + ->param('download', false, new Boolean(true), 'Return resulting image with \'Content-Disposition: attachment \' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.', true) + ->action(function ($text, $size, $margin, $download, $response) { + /** @var Appwrite\Utopia\Response $response */ - $renderer = new ImageRenderer( - new RendererStyle($size, $margin), - new ImagickImageBackEnd('png', 100) - ); + $download = ($download === '1' || $download === 'true' || $download === 1 || $download === true); - $writer = new Writer($renderer); + $renderer = new ImageRenderer( + new RendererStyle($size, $margin), + new ImagickImageBackEnd('png', 100) + ); - if ($download) { - $response->addHeader('Content-Disposition', 'attachment; filename="qr.png"'); - } + $writer = new Writer($renderer); - $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)) - ; + if ($download) { + $response->addHeader('Content-Disposition', 'attachment; filename="qr.png"'); } - ); -$utopia->get('/v1/avatars/initials') + $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)) + ; + }, ['response']); + +App::get('/v1/avatars/initials') ->desc('Get User Initials') ->groups(['api', 'avatars']) - ->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 - ]; + ->param('name', '', new Text(128), 'Full Name. When empty, current user name or email will be used. Max length: 128 chars.', true) + ->param('width', 500, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) + ->param('height', 500, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) + ->param('color', '', new HexColor(), 'Changes text color. By default a random color will be picked and stay will persistent to the given name.', true) + ->param('background', '', new HexColor(), 'Changes background color. By default a random color will be picked and stay will persistent to the given name.', true) + ->action(function ($name, $width, $height, $color, $background, $response, $user) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $user */ - $rand = \rand(0, \count($themes)-1); + $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 + ]; - $name = (!empty($name)) ? $name : $user->getAttribute('name', $user->getAttribute('email', '')); - $words = \explode(' ', \strtoupper($name)); - $initials = null; - $code = 0; + $rand = \rand(0, \count($themes)-1); - foreach ($words as $key => $w) { - $initials .= (isset($w[0])) ? $w[0] : ''; - $code += (isset($w[0])) ? \ord($w[0]) : 0; + $name = (!empty($name)) ? $name : $user->getAttribute('name', $user->getAttribute('email', '')); + $words = \explode(' ', \strtoupper($name)); + $initials = null; + $code = 0; - if ($key == 1) { - break; - } + 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 + + $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()) + ; + }, ['response', 'user']); \ No newline at end of file diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php index dadf7e9576..cb3a016ce8 100644 --- a/app/controllers/api/database.php +++ b/app/controllers/api/database.php @@ -1,19 +1,12 @@ post('/v1/database/collections') +App::post('/v1/database/collections') ->desc('Create Collection') ->groups(['api', 'database']) - ->label('webhook', 'database.collections.create') + ->label('event', 'database.collections.create') ->label('scope', 'collections.write') ->label('sdk.namespace', 'database') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.method', 'createCollection') ->label('sdk.description', '/docs/references/database/create-collection.md') - ->param('name', '', function () { return new Text(256); }, 'Collection name.') - ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') - ->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') - ->param('rules', [], function () use ($projectDB) { return new ArrayList(new Collection($projectDB, [Database::SYSTEM_COLLECTION_RULES], ['$collection' => Database::SYSTEM_COLLECTION_RULES, '$permissions' => ['read' => [], 'write' => []]])); }, 'Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation.') - ->action( - function ($name, $read, $write, $rules) use ($response, $projectDB, $webhook, $audit) { - $parsedRules = []; + ->param('name', '', new Text(128), 'Collection name. Max length: 128 chars.') + ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') + ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') + ->param('rules', [], function ($projectDB) { return new ArrayList(new Collection($projectDB, [Database::SYSTEM_COLLECTION_RULES], ['$collection' => Database::SYSTEM_COLLECTION_RULES, '$permissions' => ['read' => [], 'write' => []]])); }, 'Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation.', false, ['projectDB']) + ->action(function ($name, $read, $write, $rules, $response, $projectDB, $audits) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $audits */ - foreach ($rules as &$rule) { - $parsedRules[] = \array_merge([ - '$collection' => Database::SYSTEM_COLLECTION_RULES, - '$permissions' => [ - 'read' => $read, - 'write' => $write, - ], - ], $rule); - } + $parsedRules = []; - try { - $data = $projectDB->createDocument([ - '$collection' => Database::SYSTEM_COLLECTION_COLLECTIONS, - 'name' => $name, - 'dateCreated' => \time(), - 'dateUpdated' => \time(), - 'structure' => true, - '$permissions' => [ - 'read' => $read, - 'write' => $write, - ], - 'rules' => $parsedRules, - ]); - } catch (AuthorizationException $exception) { - throw new Exception('Unauthorized action', 401); - } catch (StructureException $exception) { - throw new Exception('Bad structure. '.$exception->getMessage(), 400); - } catch (\Exception $exception) { - throw new Exception('Failed saving document to DB', 500); - } - - if (false === $data) { - throw new Exception('Failed saving collection to DB', 500); - } - - $data = $data->getArrayCopy(); - - $webhook - ->setParam('payload', $data) - ; - - $audit - ->setParam('event', 'database.collections.create') - ->setParam('resource', 'database/collection/'.$data['$id']) - ->setParam('data', $data) - ; - - /* - * View - */ - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->json($data) - ; + foreach ($rules as &$rule) { + $parsedRules[] = \array_merge([ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + '$permissions' => [ + 'read' => $read, + 'write' => $write, + ], + ], $rule); } - ); -$utopia->get('/v1/database/collections') + try { + $data = $projectDB->createDocument([ + '$collection' => Database::SYSTEM_COLLECTION_COLLECTIONS, + 'name' => $name, + 'dateCreated' => \time(), + 'dateUpdated' => \time(), + 'structure' => true, + '$permissions' => [ + 'read' => $read, + 'write' => $write, + ], + 'rules' => $parsedRules, + ]); + } catch (AuthorizationException $exception) { + throw new Exception('Unauthorized permissions', 401); + } catch (StructureException $exception) { + throw new Exception('Bad structure. '.$exception->getMessage(), 400); + } catch (\Exception $exception) { + throw new Exception('Failed saving document to DB', 500); + } + + if (false === $data) { + throw new Exception('Failed saving collection to DB', 500); + } + + $audits + ->setParam('event', 'database.collections.create') + ->setParam('resource', 'database/collection/'.$data->getId()) + ->setParam('data', $data->getArrayCopy()) + ; + + $response->setStatusCode(Response::STATUS_CODE_CREATED); + $response->dynamic($data, Response::MODEL_COLLECTION); + }, ['response', 'projectDB', 'audits']); + +App::get('/v1/database/collections') ->desc('List Collections') ->groups(['api', 'database']) ->label('scope', 'collections.read') @@ -109,48 +91,33 @@ $utopia->get('/v1/database/collections') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.method', 'listCollections') ->label('sdk.description', '/docs/references/database/list-collections.md') - ->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, 40000); }, '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 ($search, $limit, $offset, $orderType) use ($response, $projectDB) { - /*$vl = new Structure($projectDB); + ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) + ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) + ->param('offset', 0, new Range(0, 40000), 'Results offset. The default value is 0. Use this param to manage pagination.', true) + ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true) + ->action(function ($search, $limit, $offset, $orderType, $response, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ - var_dump($vl->isValid(new Document([ - '$collection' => Database::SYSTEM_COLLECTION_RULES, - '$permissions' => [ - 'read' => ['*'], - 'write' => ['*'], - ], - 'label' => 'Platforms', - 'key' => 'platforms', - 'type' => 'document', - 'default' => [], - 'required' => false, - 'array' => true, - 'options' => [Database::SYSTEM_COLLECTION_PLATFORMS], - ]))); + $results = $projectDB->getCollection([ + 'limit' => $limit, + 'offset' => $offset, + 'orderField' => 'name', + 'orderType' => $orderType, + 'orderCast' => 'string', + 'search' => $search, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_COLLECTIONS, + ], + ]); - var_dump($vl->getDescription());*/ + $response->dynamic(new Document([ + 'sum' => $projectDB->getSum(), + 'collections' => $results + ]), Response::MODEL_COLLECTION_LIST); + }, ['response', 'projectDB']); - $results = $projectDB->getCollection([ - 'limit' => $limit, - 'offset' => $offset, - 'orderField' => 'name', - 'orderType' => $orderType, - 'orderCast' => 'string', - 'search' => $search, - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_COLLECTIONS, - ], - ]); - - $response->json(['sum' => $projectDB->getSum(), 'collections' => $results]); - } - ); - -$utopia->get('/v1/database/collections/:collectionId') +App::get('/v1/database/collections/:collectionId') ->desc('Get Collection') ->groups(['api', 'database']) ->label('scope', 'collections.read') @@ -158,316 +125,244 @@ $utopia->get('/v1/database/collections/:collectionId') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.method', 'getCollection') ->label('sdk.description', '/docs/references/database/get-collection.md') - ->param('collectionId', '', function () { return new UID(); }, 'Collection unique ID.') - ->action( - function ($collectionId) use ($response, $projectDB) { - $collection = $projectDB->getDocument($collectionId, false); + ->param('collectionId', '', new UID(), 'Collection unique ID.') + ->action(function ($collectionId, $response, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ + + $collection = $projectDB->getDocument($collectionId, false); - if (empty($collection->getId()) || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) { - throw new Exception('Collection not found', 404); - } - - $response->json($collection->getArrayCopy()); + if (empty($collection->getId()) || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) { + throw new Exception('Collection not found', 404); } - ); -// $utopia->get('/v1/database/collections/:collectionId/logs') -// ->desc('Get Collection Logs') -// ->groups(['api', 'database']) -// ->label('scope', 'collections.read') -// ->label('sdk.platform', [APP_PLATFORM_SERVER]) -// ->label('sdk.namespace', 'database') -// ->label('sdk.method', 'getCollectionLogs') -// ->label('sdk.description', '/docs/references/database/get-collection-logs.md') -// ->param('collectionId', '', function () { return new UID(); }, 'Collection unique ID.') -// ->action( -// function ($collectionId) use ($response, $register, $projectDB, $project) { -// $collection = $projectDB->getDocument($collectionId, false); + $response->dynamic($collection, Response::MODEL_COLLECTION); + }, ['response', 'projectDB']); -// if (empty($collection->getId()) || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) { -// throw new Exception('Collection not found', 404); -// } - -// $adapter = new AuditAdapter($register->get('db')); -// $adapter->setNamespace('app_'.$project->getId()); - -// $audit = new Audit($adapter); - -// $countries = Locale::getText('countries'); - -// $logs = $audit->getLogsByResource('database/collection/'.$collection->getId()); - -// $reader = new Reader(__DIR__.'/../../db/DBIP/dbip-country-lite-2020-01.mmdb'); -// $output = []; - -// foreach ($logs as $i => &$log) { -// $log['userAgent'] = (!empty($log['userAgent'])) ? $log['userAgent'] : 'UNKNOWN'; - -// $dd = new DeviceDetector($log['userAgent']); - -// $dd->skipBotDetection(); // OPTIONAL: If called, bot detection will completely be skipped (bots will be detected as regular devices then) - -// $dd->parse(); - -// $output[$i] = [ -// 'event' => $log['event'], -// 'ip' => $log['ip'], -// 'time' => strtotime($log['time']), -// 'OS' => $dd->getOs(), -// 'client' => $dd->getClient(), -// 'device' => $dd->getDevice(), -// 'brand' => $dd->getBrand(), -// 'model' => $dd->getModel(), -// 'geo' => [], -// ]; - -// try { -// $record = $reader->country($log['ip']); -// $output[$i]['geo']['isoCode'] = strtolower($record->country->isoCode); -// $output[$i]['geo']['country'] = $record->country->name; -// $output[$i]['geo']['country'] = (isset($countries[$record->country->isoCode])) ? $countries[$record->country->isoCode] : Locale::getText('locale.country.unknown'); -// } catch (\Exception $e) { -// $output[$i]['geo']['isoCode'] = '--'; -// $output[$i]['geo']['country'] = Locale::getText('locale.country.unknown'); -// } -// } - -// $response->json($output); -// } -// ); - -$utopia->put('/v1/database/collections/:collectionId') +App::put('/v1/database/collections/:collectionId') ->desc('Update Collection') ->groups(['api', 'database']) ->label('scope', 'collections.write') - ->label('webhook', 'database.collections.update') + ->label('event', 'database.collections.update') ->label('sdk.namespace', 'database') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.method', 'updateCollection') ->label('sdk.description', '/docs/references/database/update-collection.md') - ->param('collectionId', '', function () { return new UID(); }, 'Collection unique ID.') - ->param('name', null, function () { return new Text(256); }, 'Collection name.') - ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(/docs/permissions) and get a full list of available permissions.') - ->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') - ->param('rules', [], function () use ($projectDB) { return new ArrayList(new Collection($projectDB, [Database::SYSTEM_COLLECTION_RULES], ['$collection' => Database::SYSTEM_COLLECTION_RULES, '$permissions' => ['read' => [], 'write' => []]])); }, 'Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation.', true) - ->action( - function ($collectionId, $name, $read, $write, $rules) use ($response, $projectDB, $webhook, $audit) { - $collection = $projectDB->getDocument($collectionId, false); + ->param('collectionId', '', new UID(), 'Collection unique ID.') + ->param('name', null, new Text(128), 'Collection name. Max length: 128 chars.') + ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(/docs/permissions) and get a full list of available permissions.') + ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') + ->param('rules', [], function ($projectDB) { return new ArrayList(new Collection($projectDB, [Database::SYSTEM_COLLECTION_RULES], ['$collection' => Database::SYSTEM_COLLECTION_RULES, '$permissions' => ['read' => [], 'write' => []]])); }, 'Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation.', true, ['projectDB']) + ->action(function ($collectionId, $name, $read, $write, $rules, $response, $projectDB, $audits) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $audits */ - if (empty($collection->getId()) || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) { - throw new Exception('Collection not found', 404); - } + $collection = $projectDB->getDocument($collectionId, false); - $parsedRules = []; - - foreach ($rules as &$rule) { - $parsedRules[] = \array_merge([ - '$collection' => Database::SYSTEM_COLLECTION_RULES, - '$permissions' => [ - 'read' => $read, - 'write' => $write, - ], - ], $rule); - } - - try { - $collection = $projectDB->updateDocument(\array_merge($collection->getArrayCopy(), [ - 'name' => $name, - 'structure' => true, - 'dateUpdated' => \time(), - '$permissions' => [ - 'read' => $read, - 'write' => $write, - ], - 'rules' => $parsedRules, - ])); - } catch (AuthorizationException $exception) { - throw new Exception('Unauthorized action', 401); - } catch (StructureException $exception) { - throw new Exception('Bad structure. '.$exception->getMessage(), 400); - } catch (\Exception $exception) { - throw new Exception('Failed saving document to DB', 500); - } - - if (false === $collection) { - throw new Exception('Failed saving collection to DB', 500); - } - - $data = $collection->getArrayCopy(); - - $webhook - ->setParam('payload', $data) - ; - - $audit - ->setParam('event', 'database.collections.update') - ->setParam('resource', 'database/collections/'.$data['$id']) - ->setParam('data', $data) - ; - - $response->json($collection->getArrayCopy()); + if (empty($collection->getId()) || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) { + throw new Exception('Collection not found', 404); } - ); -$utopia->delete('/v1/database/collections/:collectionId') + $parsedRules = []; + + foreach ($rules as &$rule) { + $parsedRules[] = \array_merge([ + '$collection' => Database::SYSTEM_COLLECTION_RULES, + '$permissions' => [ + 'read' => $read, + 'write' => $write, + ], + ], $rule); + } + + try { + $collection = $projectDB->updateDocument(\array_merge($collection->getArrayCopy(), [ + 'name' => $name, + 'structure' => true, + 'dateUpdated' => \time(), + '$permissions' => [ + 'read' => $read, + 'write' => $write, + ], + 'rules' => $parsedRules, + ])); + } catch (AuthorizationException $exception) { + throw new Exception('Unauthorized permissions', 401); + } catch (StructureException $exception) { + throw new Exception('Bad structure. '.$exception->getMessage(), 400); + } catch (\Exception $exception) { + throw new Exception('Failed saving document to DB', 500); + } + + if (false === $collection) { + throw new Exception('Failed saving collection to DB', 500); + } + + $audits + ->setParam('event', 'database.collections.update') + ->setParam('resource', 'database/collections/'.$collection->getId()) + ->setParam('data', $collection->getArrayCopy()) + ; + + $response->dynamic($collection, Response::MODEL_COLLECTION); + }, ['response', 'projectDB', 'audits']); + +App::delete('/v1/database/collections/:collectionId') ->desc('Delete Collection') ->groups(['api', 'database']) ->label('scope', 'collections.write') - ->label('webhook', 'database.collections.delete') + ->label('event', 'database.collections.delete') ->label('sdk.namespace', 'database') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.method', 'deleteCollection') ->label('sdk.description', '/docs/references/database/delete-collection.md') - ->param('collectionId', '', function () { return new UID(); }, 'Collection unique ID.') - ->action( - function ($collectionId) use ($response, $projectDB, $webhook, $audit) { - $collection = $projectDB->getDocument($collectionId, false); + ->param('collectionId', '', new UID(), 'Collection unique ID.') + ->action(function ($collectionId, $response, $projectDB, $webhooks, $audits) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $webhooks */ + /** @var Appwrite\Event\Event $audits */ - if (empty($collection->getId()) || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) { - throw new Exception('Collection not found', 404); - } + $collection = $projectDB->getDocument($collectionId, false); - if (!$projectDB->deleteDocument($collectionId)) { - throw new Exception('Failed to remove collection from DB', 500); - } - - $data = $collection->getArrayCopy(); - - $webhook - ->setParam('payload', $data) - ; - - $audit - ->setParam('event', 'database.collections.delete') - ->setParam('resource', 'database/collections/'.$data['$id']) - ->setParam('data', $data) - ; - - $response->noContent(); + if (empty($collection->getId()) || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) { + throw new Exception('Collection not found', 404); } - ); -$utopia->post('/v1/database/collections/:collectionId/documents') + if (!$projectDB->deleteDocument($collectionId)) { + throw new Exception('Failed to remove collection from DB', 500); + } + + $webhooks + ->setParam('payload', $response->output($collection, Response::MODEL_COLLECTION)) + ; + + $audits + ->setParam('event', 'database.collections.delete') + ->setParam('resource', 'database/collections/'.$collection->getId()) + ->setParam('data', $collection->getArrayCopy()) + ; + + $response->noContent(); + }, ['response', 'projectDB', 'webhooks', 'audits']); + +App::post('/v1/database/collections/:collectionId/documents') ->desc('Create Document') ->groups(['api', 'database']) - ->label('webhook', 'database.documents.create') + ->label('event', 'database.documents.create') ->label('scope', 'documents.write') ->label('sdk.namespace', 'database') ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.method', 'createDocument') ->label('sdk.description', '/docs/references/database/create-document.md') - ->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).') - ->param('data', [], function () { return new JSON(); }, 'Document data as JSON object.') - ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') - ->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') - ->param('parentDocument', '', function () { return new UID(); }, 'Parent document unique ID. Use when you want your new document to be a child of a parent document.', true) - ->param('parentProperty', '', function () { return new Key(); }, 'Parent document property name. Use when you want your new document to be a child of a parent document.', true) - ->param('parentPropertyType', Document::SET_TYPE_ASSIGN, function () { return new WhiteList([Document::SET_TYPE_ASSIGN, Document::SET_TYPE_APPEND, Document::SET_TYPE_PREPEND]); }, 'Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.', true) - ->action( - function ($collectionId, $data, $read, $write, $parentDocument, $parentProperty, $parentPropertyType) use ($response, $projectDB, $webhook, $audit) { - $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array + ->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).') + ->param('data', [], new JSON(), 'Document data as JSON object.') + ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') + ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') + ->param('parentDocument', '', new UID(), 'Parent document unique ID. Use when you want your new document to be a child of a parent document.', true) + ->param('parentProperty', '', new Key(), 'Parent document property name. Use when you want your new document to be a child of a parent document.', true) + ->param('parentPropertyType', Document::SET_TYPE_ASSIGN, new WhiteList([Document::SET_TYPE_ASSIGN, Document::SET_TYPE_APPEND, Document::SET_TYPE_PREPEND], true), 'Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.', true) + ->action(function ($collectionId, $data, $read, $write, $parentDocument, $parentProperty, $parentPropertyType, $response, $projectDB, $audits) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $audits */ + + $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array - if (empty($data)) { - throw new Exception('Missing payload', 400); + if (empty($data)) { + throw new Exception('Missing payload', 400); + } + + if (isset($data['$id'])) { + throw new Exception('$id is not allowed for creating new documents, try update instead', 400); + } + + $collection = $projectDB->getDocument($collectionId, false); + + if (\is_null($collection->getId()) || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) { + throw new Exception('Collection not found', 404); + } + + $data['$collection'] = $collectionId; // Adding this param to make API easier for developers + $data['$permissions'] = [ + 'read' => $read, + 'write' => $write, + ]; + + // Read parent document + validate not 404 + validate read / write permission like patch method + // Add payload to parent document property + if ((!empty($parentDocument)) && (!empty($parentProperty))) { + $parentDocument = $projectDB->getDocument($parentDocument, false); + + if (empty($parentDocument->getArrayCopy())) { // Check empty + throw new Exception('No parent document found', 404); } - if (isset($data['$id'])) { - throw new Exception('$id is not allowed for creating new documents, try update instead', 400); - } - - $collection = $projectDB->getDocument($collectionId, false); - - if (\is_null($collection->getId()) || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) { - throw new Exception('Collection not found', 404); - } - - $data['$collection'] = $collectionId; // Adding this param to make API easier for developers - $data['$permissions'] = [ - 'read' => $read, - 'write' => $write, - ]; - - // Read parent document + validate not 404 + validate read / write permission like patch method - // Add payload to parent document property - if ((!empty($parentDocument)) && (!empty($parentProperty))) { - $parentDocument = $projectDB->getDocument($parentDocument, false); - - if (empty($parentDocument->getArrayCopy())) { // Check empty - throw new Exception('No parent document found', 404); - } - - /* - * 1. Check child has valid structure, - * 2. Check user have write permission for parent document - * 3. Assign parent data (including child) to $data - * 4. Validate the combined result has valid structure (inside $projectDB->createDocument method) - */ - - $new = new Document($data); - - $structure = new Structure($projectDB); - - if (!$structure->isValid($new)) { - throw new Exception('Invalid data structure: '.$structure->getDescription(), 400); - } - - $authorization = new Authorization($parentDocument, 'write'); - - if (!$authorization->isValid($new->getPermissions())) { - throw new Exception('Unauthorized action', 401); - } - - $parentDocument - ->setAttribute($parentProperty, $data, $parentPropertyType); - - $data = $parentDocument->getArrayCopy(); - } - - /** - * Set default collection values - */ - foreach ($collection->getAttribute('rules') as $key => $rule) { - $key = (isset($rule['key'])) ? $rule['key'] : ''; - $default = (isset($rule['default'])) ? $rule['default'] : null; - - if (!isset($data[$key])) { - $data[$key] = $default; - } - } - - try { - $data = $projectDB->createDocument($data); - } catch (AuthorizationException $exception) { - throw new Exception('Unauthorized action', 401); - } catch (StructureException $exception) { - throw new Exception('Bad structure. '.$exception->getMessage(), 400); - } catch (\Exception $exception) { - throw new Exception('Failed saving document to DB'.$exception->getMessage(), 500); - } - - $data = $data->getArrayCopy(); - - $webhook - ->setParam('payload', $data) - ; - - $audit - ->setParam('event', 'database.documents.create') - ->setParam('resource', 'database/document/'.$data['$id']) - ->setParam('data', $data) - ; - /* - * View + * 1. Check child has valid structure, + * 2. Check user have write permission for parent document + * 3. Assign parent data (including child) to $data + * 4. Validate the combined result has valid structure (inside $projectDB->createDocument method) */ - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->json($data) - ; - } - ); -$utopia->get('/v1/database/collections/:collectionId/documents') + $new = new Document($data); + + $structure = new Structure($projectDB); + + if (!$structure->isValid($new)) { + throw new Exception('Invalid data structure: '.$structure->getDescription(), 400); + } + + $authorization = new Authorization($parentDocument, 'write'); + + if (!$authorization->isValid($new->getPermissions())) { + throw new Exception('Unauthorized permissions', 401); + } + + $parentDocument + ->setAttribute($parentProperty, $data, $parentPropertyType); + + $data = $parentDocument->getArrayCopy(); + $collection = $projectDB->getDocument($parentDocument->getCollection(), false); + } + + /** + * Set default collection values + */ + foreach ($collection->getAttribute('rules') as $key => $rule) { + $key = (isset($rule['key'])) ? $rule['key'] : ''; + $default = (isset($rule['default'])) ? $rule['default'] : null; + + if (!isset($data[$key])) { + $data[$key] = $default; + } + } + + try { + $data = $projectDB->createDocument($data); + } catch (AuthorizationException $exception) { + throw new Exception('Unauthorized permissions', 401); + } catch (StructureException $exception) { + throw new Exception('Bad structure. '.$exception->getMessage(), 400); + } catch (\Exception $exception) { + throw new Exception('Failed saving document to DB'.$exception->getMessage(), 500); + } + + $audits + ->setParam('event', 'database.documents.create') + ->setParam('resource', 'database/document/'.$data['$id']) + ->setParam('data', $data->getArrayCopy()) + ; + + $response + ->setStatusCode(Response::STATUS_CODE_CREATED) + ; + + $response->dynamic($data, Response::MODEL_ANY); + }, ['response', 'projectDB', 'audits']); + +App::get('/v1/database/collections/:collectionId/documents') ->desc('List Documents') ->groups(['api', 'database']) ->label('scope', 'documents.read') @@ -475,59 +370,57 @@ $utopia->get('/v1/database/collections/:collectionId/documents') ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.method', 'listDocuments') ->label('sdk.description', '/docs/references/database/list-documents.md') - ->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).') - ->param('filters', [], function () { return new ArrayList(new Text(128)); }, 'Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: \'name=John Doe\' or \'category.$id>=5bed2d152c362\'.', true) - ->param('offset', 0, function () { return new Range(0, 900000000); }, 'Offset value. Use this value to manage pagination.', true) - ->param('limit', 50, function () { return new Range(0, 1000); }, 'Maximum number of documents to return in response. Use this value to manage pagination.', true) - ->param('orderField', '$id', function () { return new Text(128); }, 'Document field that results will be sorted by.', true) - ->param('orderType', 'ASC', function () { return new WhiteList(array('DESC', 'ASC')); }, 'Order direction. Possible values are DESC for descending order, or ASC for ascending order.', true) - ->param('orderCast', 'string', function () { return new WhiteList(array('int', 'string', 'date', 'time', 'datetime')); }, 'Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.', true) - ->param('search', '', function () { return new Text(256); }, 'Search query. Enter any free text search. The database will try to find a match against all document attributes and children.', true) - ->action( - function ($collectionId, $filters, $offset, $limit, $orderField, $orderType, $orderCast, $search) use ($response, $projectDB, $utopia) { - $collection = $projectDB->getDocument($collectionId, false); + ->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).') + ->param('filters', [], new ArrayList(new Text(128)), 'Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: \'name=John Doe\' or \'category.$id>=5bed2d152c362\'.', true) + ->param('limit', 25, new Range(0, 1000), 'Maximum number of documents to return in response. Use this value to manage pagination.', true) + ->param('offset', 0, new Range(0, 900000000), 'Offset value. Use this value to manage pagination.', true) + ->param('orderField', '$id', new Text(128), 'Document field that results will be sorted by.', true) + ->param('orderType', 'ASC', new WhiteList(['DESC', 'ASC'], true), 'Order direction. Possible values are DESC for descending order, or ASC for ascending order.', true) + ->param('orderCast', 'string', new WhiteList(['int', 'string', 'date', 'time', 'datetime'], true), 'Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.', true) + ->param('search', '', new Text(256), 'Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.', true) + ->action(function ($collectionId, $filters, $limit, $offset, $orderField, $orderType, $orderCast, $search, $response, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ - if (\is_null($collection->getId()) || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) { - throw new Exception('Collection not found', 404); - } + $collection = $projectDB->getDocument($collectionId, false); - $list = $projectDB->getCollection([ - 'limit' => $limit, - 'offset' => $offset, - 'orderField' => $orderField, - 'orderType' => $orderType, - 'orderCast' => $orderCast, - 'search' => $search, - 'filters' => \array_merge($filters, [ - '$collection='.$collectionId, - ]), - ]); - - if ($utopia->isDevelopment()) { - $collection - ->setAttribute('debug', $projectDB->getDebug()) - ->setAttribute('limit', $limit) - ->setAttribute('offset', $offset) - ->setAttribute('orderField', $orderField) - ->setAttribute('orderType', $orderType) - ->setAttribute('orderCast', $orderCast) - ->setAttribute('filters', $filters) - ; - } - - $collection - ->setAttribute('sum', $projectDB->getSum()) - ->setAttribute('documents', $list) - ; - - /* - * View - */ - $response->json($collection->getArrayCopy(/*['$id', '$collection', 'name', 'documents']*/[], ['rules'])); + if (\is_null($collection->getId()) || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) { + throw new Exception('Collection not found', 404); } - ); -$utopia->get('/v1/database/collections/:collectionId/documents/:documentId') + $list = $projectDB->getCollection([ + 'limit' => $limit, + 'offset' => $offset, + 'orderField' => $orderField, + 'orderType' => $orderType, + 'orderCast' => $orderCast, + 'search' => $search, + 'filters' => \array_merge($filters, [ + '$collection='.$collectionId, + ]), + ]); + + // if (App::isDevelopment()) { + // $collection + // ->setAttribute('debug', $projectDB->getDebug()) + // ->setAttribute('limit', $limit) + // ->setAttribute('offset', $offset) + // ->setAttribute('orderField', $orderField) + // ->setAttribute('orderType', $orderType) + // ->setAttribute('orderCast', $orderCast) + // ->setAttribute('filters', $filters) + // ; + // } + + $collection + ->setAttribute('sum', $projectDB->getSum()) + ->setAttribute('documents', $list) + ; + + $response->dynamic($collection, Response::MODEL_DOCUMENT_LIST); + }, ['response', 'projectDB']); + +App::get('/v1/database/collections/:collectionId/documents/:documentId') ->desc('Get Document') ->groups(['api', 'database']) ->label('scope', 'documents.read') @@ -535,170 +428,144 @@ $utopia->get('/v1/database/collections/:collectionId/documents/:documentId') ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.method', 'getDocument') ->label('sdk.description', '/docs/references/database/get-document.md') - ->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).') - ->param('documentId', null, function () { return new UID(); }, 'Document unique ID.') - ->action( - function ($collectionId, $documentId) use ($response, $request, $projectDB) { - $document = $projectDB->getDocument($documentId, false); - $collection = $projectDB->getDocument($collectionId, false); + ->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).') + ->param('documentId', null, new UID(), 'Document unique ID.') + ->action(function ($collectionId, $documentId, $request, $response, $projectDB) { + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ - if (empty($document->getArrayCopy()) || $document->getCollection() != $collection->getId()) { // Check empty - throw new Exception('No document found', 404); - } + $document = $projectDB->getDocument($documentId, false); + $collection = $projectDB->getDocument($collectionId, false); - $output = $document->getArrayCopy(); - - $paths = \explode('/', $request->getParam('q', '')); - $paths = \array_slice($paths, 7, \count($paths)); - - if (\count($paths) > 0) { - if (\count($paths) % 2 == 1) { - $output = $document->getAttribute(\implode('.', $paths)); - } else { - $id = (int) \array_pop($paths); - $output = $document->search('$id', $id, $document->getAttribute(\implode('.', $paths))); - } - - $output = ($output instanceof Document) ? $output->getArrayCopy() : $output; - - if (!\is_array($output)) { - throw new Exception('No document found', 404); - } - } - - /* - * View - */ - $response->json($output); + if (empty($document->getArrayCopy()) || $document->getCollection() != $collection->getId()) { // Check empty + throw new Exception('No document found', 404); } - ); -$utopia->patch('/v1/database/collections/:collectionId/documents/:documentId') + $response->dynamic($document, Response::MODEL_ANY); + }, ['request', 'response', 'projectDB']); + +App::patch('/v1/database/collections/:collectionId/documents/:documentId') ->desc('Update Document') ->groups(['api', 'database']) - ->label('webhook', 'database.documents.update') + ->label('event', 'database.documents.update') ->label('scope', 'documents.write') ->label('sdk.namespace', 'database') ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.method', 'updateDocument') ->label('sdk.description', '/docs/references/database/update-document.md') - ->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).') - ->param('documentId', null, function () { return new UID(); }, 'Document unique ID.') - ->param('data', [], function () { return new JSON(); }, 'Document data as JSON object.') - ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') - ->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') - ->action( - function ($collectionId, $documentId, $data, $read, $write) use ($response, $projectDB, $webhook, $audit) { - $collection = $projectDB->getDocument($collectionId, false); - $document = $projectDB->getDocument($documentId, false); + ->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).') + ->param('documentId', null, new UID(), 'Document unique ID.') + ->param('data', [], new JSON(), 'Document data as JSON object.') + ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') + ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') + ->action(function ($collectionId, $documentId, $data, $read, $write, $response, $projectDB, $audits) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $audits */ - $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array + $collection = $projectDB->getDocument($collectionId, false); + $document = $projectDB->getDocument($documentId, false); - if (!\is_array($data)) { - throw new Exception('Data param should be a valid JSON', 400); - } + $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array - if (\is_null($collection->getId()) || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) { - throw new Exception('Collection not found', 404); - } - - if (empty($document->getArrayCopy()) || $document->getCollection() != $collectionId) { // Check empty - throw new Exception('No document found', 404); - } - - //TODO check merge read write permissions - - if (!empty($read)) { // Overwrite permissions only when passed - $data['$permissions']['read'] = $read; - } - - if (!empty($write)) { // Overwrite permissions only when passed - $data['$permissions']['write'] = $write; - } - - $data = \array_merge($document->getArrayCopy(), $data); - - $data['$collection'] = $collection->getId(); // Make sure user don't switch collectionID - $data['$id'] = $document->getId(); // Make sure user don't switch document unique ID - - if (empty($data)) { - throw new Exception('Missing payload', 400); - } - try { - $data = $projectDB->updateDocument($data); - } catch (AuthorizationException $exception) { - throw new Exception('Unauthorized action', 401); - } catch (StructureException $exception) { - throw new Exception('Bad structure. '.$exception->getMessage(), 400); - } catch (\Exception $exception) { - throw new Exception('Failed saving document to DB', 500); - } - - $data = $data->getArrayCopy(); - - $webhook - ->setParam('payload', $data) - ; - - $audit - ->setParam('event', 'database.documents.update') - ->setParam('resource', 'database/document/'.$data['$id']) - ->setParam('data', $data) - ; - - /* - * View - */ - $response->json($data); + if (!\is_array($data)) { + throw new Exception('Data param should be a valid JSON object', 400); } - ); -$utopia->delete('/v1/database/collections/:collectionId/documents/:documentId') + if (\is_null($collection->getId()) || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) { + throw new Exception('Collection not found', 404); + } + + if (empty($document->getArrayCopy()) || $document->getCollection() != $collectionId) { // Check empty + throw new Exception('No document found', 404); + } + + //TODO check merge read write permissions + + if (!empty($read)) { // Overwrite permissions only when passed + $data['$permissions']['read'] = $read; + } + + if (!empty($write)) { // Overwrite permissions only when passed + $data['$permissions']['write'] = $write; + } + + $data = \array_merge($document->getArrayCopy(), $data); + + $data['$collection'] = $collection->getId(); // Make sure user don't switch collectionID + $data['$id'] = $document->getId(); // Make sure user don't switch document unique ID + + if (empty($data)) { + throw new Exception('Missing payload', 400); + } + + try { + $data = $projectDB->updateDocument($data); + } catch (AuthorizationException $exception) { + throw new Exception('Unauthorized permissions', 401); + } catch (StructureException $exception) { + throw new Exception('Bad structure. '.$exception->getMessage(), 400); + } catch (\Exception $exception) { + throw new Exception('Failed saving document to DB', 500); + } + + $audits + ->setParam('event', 'database.documents.update') + ->setParam('resource', 'database/document/'.$data->getId()) + ->setParam('data', $data->getArrayCopy()) + ; + + $response->dynamic($data, Response::MODEL_ANY); + }, ['response', 'projectDB', 'audits']); + +App::delete('/v1/database/collections/:collectionId/documents/:documentId') ->desc('Delete Document') ->groups(['api', 'database']) ->label('scope', 'documents.write') - ->label('webhook', 'database.documents.delete') + ->label('event', 'database.documents.delete') ->label('sdk.namespace', 'database') ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.method', 'deleteDocument') ->label('sdk.description', '/docs/references/database/delete-document.md') - ->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).') - ->param('documentId', null, function () { return new UID(); }, 'Document unique ID.') - ->action( - function ($collectionId, $documentId) use ($response, $projectDB, $audit, $webhook) { - $collection = $projectDB->getDocument($collectionId, false); - $document = $projectDB->getDocument($documentId, false); + ->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).') + ->param('documentId', null, new UID(), 'Document unique ID.') + ->action(function ($collectionId, $documentId, $response, $projectDB, $webhooks, $audits) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $webhooks */ + /** @var Appwrite\Event\Event $audits */ - if (empty($document->getArrayCopy()) || $document->getCollection() != $collectionId) { // Check empty - throw new Exception('No document found', 404); - } + $collection = $projectDB->getDocument($collectionId, false); + $document = $projectDB->getDocument($documentId, false); - if (\is_null($collection->getId()) || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) { - throw new Exception('Collection not found', 404); - } - - try { - $projectDB->deleteDocument($documentId); - } catch (AuthorizationException $exception) { - throw new Exception('Unauthorized action', 401); - } catch (StructureException $exception) { - throw new Exception('Bad structure. '.$exception->getMessage(), 400); - } catch (\Exception $exception) { - throw new Exception('Failed to remove document from DB', 500); - } - - $data = $document->getArrayCopy(); - - $webhook - ->setParam('payload', $data) - ; - - $audit - ->setParam('event', 'database.documents.delete') - ->setParam('resource', 'database/document/'.$data['$id']) - ->setParam('data', $data) // Audit document in case of malicious or disastrous action - ; - - $response->noContent(); + if (empty($document->getArrayCopy()) || $document->getCollection() != $collectionId) { // Check empty + throw new Exception('No document found', 404); } - ); + + if (\is_null($collection->getId()) || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) { + throw new Exception('Collection not found', 404); + } + + try { + $projectDB->deleteDocument($documentId); + } catch (AuthorizationException $exception) { + throw new Exception('Unauthorized permissions', 401); + } catch (StructureException $exception) { + throw new Exception('Bad structure. '.$exception->getMessage(), 400); + } catch (\Exception $exception) { + throw new Exception('Failed to remove document from DB', 500); + } + + $webhooks + ->setParam('payload', $response->output($document, Response::MODEL_ANY)) + ; + + $audits + ->setParam('event', 'database.documents.delete') + ->setParam('resource', 'database/document/'.$document->getId()) + ->setParam('data', $document->getArrayCopy()) // Audit document in case of malicious or disastrous action + ; + + $response->noContent(); + }, ['response', 'projectDB', 'webhooks', 'audits']); \ No newline at end of file diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php new file mode 100644 index 0000000000..b1ed7eed61 --- /dev/null +++ b/app/controllers/api/functions.php @@ -0,0 +1,672 @@ +groups(['api', 'functions']) + ->desc('Create Function') + ->label('scope', 'functions.write') + ->label('sdk.platform', [APP_PLATFORM_SERVER]) + ->label('sdk.namespace', 'functions') + ->label('sdk.method', 'create') + ->label('sdk.description', '/docs/references/functions/create-function.md') + ->param('name', '', new Text(128), 'Function name. Max length: 128 chars.') + ->param('env', '', new WhiteList(array_keys(Config::getParam('environments')), true), 'Execution enviornment.') + ->param('vars', [], new Assoc(), 'Key-value JSON object.', true) + ->param('events', [], new ArrayList(new WhiteList(array_keys(Config::getParam('events')), true)), 'Events list.', true) + ->param('schedule', '', new Cron(), 'Schedule CRON syntax.', true) + ->param('timeout', 15, new Range(1, 900), 'Function maximum execution time in seconds.', true) + ->action(function ($name, $env, $vars, $events, $schedule, $timeout, $response, $projectDB) { + $function = $projectDB->createDocument([ + '$collection' => Database::SYSTEM_COLLECTION_FUNCTIONS, + '$permissions' => [ + 'read' => [], + 'write' => [], + ], + 'dateCreated' => time(), + 'dateUpdated' => time(), + 'status' => 'disabled', + 'name' => $name, + 'env' => $env, + 'tag' => '', + 'vars' => $vars, + 'events' => $events, + 'schedule' => $schedule, + 'previous' => null, + 'next' => null, + 'timeout' => $timeout, + ]); + + if (false === $function) { + throw new Exception('Failed saving function to DB', 500); + } + + $response->setStatusCode(Response::STATUS_CODE_CREATED); + $response->dynamic($function, Response::MODEL_FUNCTION); + }, ['response', 'projectDB']); + +App::get('/v1/functions') + ->groups(['api', 'functions']) + ->desc('List Functions') + ->label('scope', 'functions.read') + ->label('sdk.platform', [APP_PLATFORM_SERVER]) + ->label('sdk.namespace', 'functions') + ->label('sdk.method', 'list') + ->label('sdk.description', '/docs/references/functions/list-functions.md') + ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) + ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) + ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true) + ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true) + ->action(function ($search, $limit, $offset, $orderType, $response, $projectDB) { + $results = $projectDB->getCollection([ + 'limit' => $limit, + 'offset' => $offset, + 'orderField' => 'dateCreated', + 'orderType' => $orderType, + 'orderCast' => 'int', + 'search' => $search, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_FUNCTIONS, + ], + ]); + + $response->dynamic(new Document([ + 'sum' => $projectDB->getSum(), + 'functions' => $results + ]), Response::MODEL_FUNCTION_LIST); + }, ['response', 'projectDB']); + +App::get('/v1/functions/:functionId') + ->groups(['api', 'functions']) + ->desc('Get Function') + ->label('scope', 'functions.read') + ->label('sdk.platform', [APP_PLATFORM_SERVER]) + ->label('sdk.namespace', 'functions') + ->label('sdk.method', 'get') + ->label('sdk.description', '/docs/references/functions/get-function.md') + ->param('functionId', '', new UID(), 'Function unique ID.') + ->action(function ($functionId, $response, $projectDB) { + $function = $projectDB->getDocument($functionId); + + if (empty($function->getId()) || Database::SYSTEM_COLLECTION_FUNCTIONS != $function->getCollection()) { + throw new Exception('Function not found', 404); + } + + $response->dynamic($function, Response::MODEL_FUNCTION); + }, ['response', 'projectDB']); + +App::get('/v1/functions/:functionId/usage') + ->desc('Get Function Usage') + ->groups(['api', 'functions']) + ->label('scope', 'functions.read') + ->label('sdk.platform', [APP_PLATFORM_CONSOLE]) + ->label('sdk.namespace', 'functions') + ->label('sdk.method', 'getUsage') + ->param('functionId', '', new UID(), 'Function unique ID.') + ->param('range', '30d', new WhiteList(['24h', '7d', '30d', '90d']), 'Date range.', true) + ->action(function ($functionId, $range, $response, $project, $projectDB, $register) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $project */ + /** @var Appwrite\Database\Database $consoleDB */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Utopia\Registry\Registry $register */ + + $function = $projectDB->getDocument($functionId); + + if (empty($function->getId()) || Database::SYSTEM_COLLECTION_FUNCTIONS != $function->getCollection()) { + throw new Exception('Function not found', 404); + } + + $period = [ + '24h' => [ + 'start' => DateTime::createFromFormat('U', \strtotime('-24 hours')), + 'end' => DateTime::createFromFormat('U', \strtotime('+1 hour')), + 'group' => '30m', + ], + '7d' => [ + 'start' => DateTime::createFromFormat('U', \strtotime('-7 days')), + 'end' => DateTime::createFromFormat('U', \strtotime('now')), + 'group' => '1d', + ], + '30d' => [ + 'start' => DateTime::createFromFormat('U', \strtotime('-30 days')), + 'end' => DateTime::createFromFormat('U', \strtotime('now')), + 'group' => '1d', + ], + '90d' => [ + 'start' => DateTime::createFromFormat('U', \strtotime('-90 days')), + 'end' => DateTime::createFromFormat('U', \strtotime('now')), + 'group' => '1d', + ], + ]; + + $client = $register->get('influxdb'); + + $executions = []; + $failures = []; + $compute = []; + + if ($client) { + $start = $period[$range]['start']->format(DateTime::RFC3339); + $end = $period[$range]['end']->format(DateTime::RFC3339); + $database = $client->selectDB('telegraf'); + + // Executions + $result = $database->query('SELECT sum(value) AS "value" FROM "appwrite_usage_executions_all" WHERE time > \''.$start.'\' AND time < \''.$end.'\' AND "metric_type"=\'counter\' AND "project"=\''.$project->getId().'\' AND "functionId"=\''.$function->getId().'\' GROUP BY time('.$period[$range]['group'].') FILL(null)'); + $points = $result->getPoints(); + + foreach ($points as $point) { + $executions[] = [ + 'value' => (!empty($point['value'])) ? $point['value'] : 0, + 'date' => \strtotime($point['time']), + ]; + } + + // Failures + $result = $database->query('SELECT sum(value) AS "value" FROM "appwrite_usage_executions_all" WHERE time > \''.$start.'\' AND time < \''.$end.'\' AND "metric_type"=\'counter\' AND "project"=\''.$project->getId().'\' AND "functionId"=\''.$function->getId().'\' AND "functionStatus"=\'failed\' GROUP BY time('.$period[$range]['group'].') FILL(null)'); + $points = $result->getPoints(); + + foreach ($points as $point) { + $failures[] = [ + 'value' => (!empty($point['value'])) ? $point['value'] : 0, + 'date' => \strtotime($point['time']), + ]; + } + + // Compute + $result = $database->query('SELECT sum(value) AS "value" FROM "appwrite_usage_executions_time" WHERE time > \''.$start.'\' AND time < \''.$end.'\' AND "metric_type"=\'counter\' AND "project"=\''.$project->getId().'\' AND "functionId"=\''.$function->getId().'\' GROUP BY time('.$period[$range]['group'].') FILL(null)'); + $points = $result->getPoints(); + + foreach ($points as $point) { + $compute[] = [ + 'value' => round((!empty($point['value'])) ? $point['value'] / 1000 : 0, 2), // minutes + 'date' => \strtotime($point['time']), + ]; + } + } + + $response->json([ + 'range' => $range, + 'executions' => [ + 'data' => $executions, + 'total' => \array_sum(\array_map(function ($item) { + return $item['value']; + }, $executions)), + ], + 'failures' => [ + 'data' => $failures, + 'total' => \array_sum(\array_map(function ($item) { + return $item['value']; + }, $failures)), + ], + 'compute' => [ + 'data' => $compute, + 'total' => \array_sum(\array_map(function ($item) { + return $item['value']; + }, $compute)), + ], + ]); + }, ['response', 'project', 'projectDB', 'register']); + +App::put('/v1/functions/:functionId') + ->groups(['api', 'functions']) + ->desc('Update Function') + ->label('scope', 'functions.write') + ->label('sdk.platform', [APP_PLATFORM_SERVER]) + ->label('sdk.namespace', 'functions') + ->label('sdk.method', 'update') + ->label('sdk.description', '/docs/references/functions/update-function.md') + ->param('functionId', '', new UID(), 'Function unique ID.') + ->param('name', '', new Text(128), 'Function name. Max length: 128 chars.') + ->param('vars', [], new Assoc(), 'Key-value JSON object.', true) + ->param('events', [], new ArrayList(new WhiteList(array_keys(Config::getParam('events')), true)), 'Events list.', true) + ->param('schedule', '', new Cron(), 'Schedule CRON syntax.', true) + ->param('timeout', 15, new Range(1, 900), 'Function maximum execution time in seconds.', true) + ->action(function ($functionId, $name, $vars, $events, $schedule, $timeout, $response, $projectDB) { + $function = $projectDB->getDocument($functionId); + + if (empty($function->getId()) || Database::SYSTEM_COLLECTION_FUNCTIONS != $function->getCollection()) { + throw new Exception('Function not found', 404); + } + + $cron = (!empty($function->getAttribute('tag', null)) && !empty($schedule)) ? CronExpression::factory($schedule) : null; + $next = (!empty($function->getAttribute('tag', null)) && !empty($schedule)) ? $cron->getNextRunDate()->format('U') : null; + + $function = $projectDB->updateDocument(array_merge($function->getArrayCopy(), [ + 'dateUpdated' => time(), + 'name' => $name, + 'vars' => $vars, + 'events' => $events, + 'schedule' => $schedule, + 'previous' => null, + 'next' => $next, + 'timeout' => $timeout, + ])); + + if (false === $function) { + throw new Exception('Failed saving function to DB', 500); + } + + $response->dynamic($function, Response::MODEL_FUNCTION); + }, ['response', 'projectDB']); + +App::patch('/v1/functions/:functionId/tag') + ->groups(['api', 'functions']) + ->desc('Update Function Tag') + ->label('scope', 'functions.write') + ->label('sdk.platform', [APP_PLATFORM_SERVER]) + ->label('sdk.namespace', 'functions') + ->label('sdk.method', 'updateTag') + ->label('sdk.description', '/docs/references/functions/update-tag.md') + ->param('functionId', '', new UID(), 'Function unique ID.') + ->param('tag', '', new UID(), 'Tag unique ID.') + ->action(function ($functionId, $tag, $response, $projectDB) { + $function = $projectDB->getDocument($functionId); + $tag = $projectDB->getDocument($tag); + + if (empty($function->getId()) || Database::SYSTEM_COLLECTION_FUNCTIONS != $function->getCollection()) { + throw new Exception('Function not found', 404); + } + + if (empty($tag->getId()) || Database::SYSTEM_COLLECTION_TAGS != $tag->getCollection()) { + throw new Exception('Tag not found', 404); + } + + $schedule = $function->getAttribute('schedule', ''); + $cron = (!empty($function->getAttribute('tag')&& !empty($schedule))) ? CronExpression::factory($schedule) : null; + $next = (!empty($function->getAttribute('tag')&& !empty($schedule))) ? $cron->getNextRunDate()->format('U') : null; + + $function = $projectDB->updateDocument(array_merge($function->getArrayCopy(), [ + 'tag' => $tag->getId(), + 'next' => $next, + ])); + + if (false === $function) { + throw new Exception('Failed saving function to DB', 500); + } + + $response->dynamic($function, Response::MODEL_FUNCTION); + }, ['response', 'projectDB']); + +App::delete('/v1/functions/:functionId') + ->groups(['api', 'functions']) + ->desc('Delete Function') + ->label('scope', 'functions.write') + ->label('sdk.platform', [APP_PLATFORM_SERVER]) + ->label('sdk.namespace', 'functions') + ->label('sdk.method', 'delete') + ->label('sdk.description', '/docs/references/functions/delete-function.md') + ->param('functionId', '', new UID(), 'Function unique ID.') + ->action(function ($functionId, $response, $projectDB, $deletes) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $deletes */ + + $function = $projectDB->getDocument($functionId); + + if (empty($function->getId()) || Database::SYSTEM_COLLECTION_FUNCTIONS != $function->getCollection()) { + throw new Exception('Function not found', 404); + } + + if (!$projectDB->deleteDocument($function->getId())) { + throw new Exception('Failed to remove function from DB', 500); + } + + $deletes + ->setParam('document', $function->getArrayCopy()) + ; + + $response->noContent(); + }, ['response', 'projectDB', 'deletes']); + +App::post('/v1/functions/:functionId/tags') + ->groups(['api', 'functions']) + ->desc('Create Tag') + ->label('scope', 'functions.write') + ->label('sdk.platform', [APP_PLATFORM_SERVER]) + ->label('sdk.namespace', 'functions') + ->label('sdk.method', 'createTag') + ->label('sdk.description', '/docs/references/functions/create-tag.md') + ->param('functionId', '', new UID(), 'Function unique ID.') + ->param('command', '', new Text('1028'), 'Code execution command.') + ->param('code', [], new File(), 'Gzip file containing your code.', false) + // ->param('code', '', new Text(128), 'Code package. Use the '.APP_NAME.' code packager to create a deployable package file.') + ->action(function ($functionId, $command, $code, $request, $response, $projectDB, $usage) { + $function = $projectDB->getDocument($functionId); + + if (empty($function->getId()) || Database::SYSTEM_COLLECTION_FUNCTIONS != $function->getCollection()) { + throw new Exception('Function not found', 404); + } + + $file = $request->getFiles('code'); + $device = Storage::getDevice('functions'); + $fileType = new FileType([FileType::FILE_TYPE_GZIP]); + $fileSize = new FileSize(App::getEnv('_APP_STORAGE_LIMIT', 0)); + $upload = new Upload(); + + if (empty($file)) { + throw new Exception('No file sent', 400); + } + + // Make sure we handle a single file and multiple files the same way + $file['name'] = (\is_array($file['name']) && isset($file['name'][0])) ? $file['name'][0] : $file['name']; + $file['tmp_name'] = (\is_array($file['tmp_name']) && isset($file['tmp_name'][0])) ? $file['tmp_name'][0] : $file['tmp_name']; + $file['size'] = (\is_array($file['size']) && isset($file['size'][0])) ? $file['size'][0] : $file['size']; + + // Check if file type is allowed (feature for project settings?) + // if (!$fileType->isValid($file['tmp_name'])) { + // throw new Exception('File type not allowed', 400); + // } + + if (!$fileSize->isValid($file['size'])) { // Check if file size is exceeding allowed limit + throw new Exception('File size not allowed', 400); + } + + if (!$upload->isValid($file['tmp_name'])) { + throw new Exception('Invalid file', 403); + } + + // Save to storage + $size = $device->getFileSize($file['tmp_name']); + $path = $device->getPath(\uniqid().'.'.\pathinfo($file['name'], PATHINFO_EXTENSION)); + + if (!$device->upload($file['tmp_name'], $path)) { // TODO deprecate 'upload' and replace with 'move' + throw new Exception('Failed moving file', 500); + } + + $tag = $projectDB->createDocument([ + '$collection' => Database::SYSTEM_COLLECTION_TAGS, + '$permissions' => [ + 'read' => [], + 'write' => [], + ], + 'functionId' => $function->getId(), + 'dateCreated' => time(), + 'command' => $command, + 'path' => $path, + 'size' => $size, + ]); + + if (false === $tag) { + throw new Exception('Failed saving tag to DB', 500); + } + + $usage + ->setParam('storage', $tag->getAttribute('size', 0)) + ; + + $response->setStatusCode(Response::STATUS_CODE_CREATED); + $response->dynamic($tag, Response::MODEL_TAG); + }, ['request', 'response', 'projectDB', 'usage']); + +App::get('/v1/functions/:functionId/tags') + ->groups(['api', 'functions']) + ->desc('List Tags') + ->label('scope', 'functions.read') + ->label('sdk.platform', [APP_PLATFORM_SERVER]) + ->label('sdk.namespace', 'functions') + ->label('sdk.method', 'listTags') + ->label('sdk.description', '/docs/references/functions/list-tags.md') + ->param('functionId', '', new UID(), 'Function unique ID.') + ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) + ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) + ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true) + ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true) + ->action(function ($functionId, $search, $limit, $offset, $orderType, $response, $projectDB) { + $function = $projectDB->getDocument($functionId); + + if (empty($function->getId()) || Database::SYSTEM_COLLECTION_FUNCTIONS != $function->getCollection()) { + throw new Exception('Function not found', 404); + } + + $results = $projectDB->getCollection([ + 'limit' => $limit, + 'offset' => $offset, + 'orderField' => 'dateCreated', + 'orderType' => $orderType, + 'orderCast' => 'int', + 'search' => $search, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_TAGS, + 'functionId='.$function->getId(), + ], + ]); + + $response->dynamic(new Document([ + 'sum' => $projectDB->getSum(), + 'tags' => $results + ]), Response::MODEL_TAG_LIST); + }, ['response', 'projectDB']); + +App::get('/v1/functions/:functionId/tags/:tagId') + ->groups(['api', 'functions']) + ->desc('Get Tag') + ->label('scope', 'functions.read') + ->label('sdk.platform', [APP_PLATFORM_SERVER]) + ->label('sdk.namespace', 'functions') + ->label('sdk.method', 'getTag') + ->label('sdk.description', '/docs/references/functions/get-tag.md') + ->param('functionId', '', new UID(), 'Function unique ID.') + ->param('tagId', '', new UID(), 'Tag unique ID.') + ->action(function ($functionId, $tagId, $response, $projectDB) { + $function = $projectDB->getDocument($functionId); + + if (empty($function->getId()) || Database::SYSTEM_COLLECTION_FUNCTIONS != $function->getCollection()) { + throw new Exception('Function not found', 404); + } + + $tag = $projectDB->getDocument($tagId); + + if($tag->getAttribute('functionId') !== $function->getId()) { + throw new Exception('Tag not found', 404); + } + + if (empty($tag->getId()) || Database::SYSTEM_COLLECTION_TAGS != $tag->getCollection()) { + throw new Exception('Tag not found', 404); + } + + $response->dynamic($tag, Response::MODEL_TAG); + }, ['response', 'projectDB']); + +App::delete('/v1/functions/:functionId/tags/:tagId') + ->groups(['api', 'functions']) + ->desc('Delete Tag') + ->label('scope', 'functions.write') + ->label('sdk.platform', [APP_PLATFORM_SERVER]) + ->label('sdk.namespace', 'functions') + ->label('sdk.method', 'deleteTag') + ->label('sdk.description', '/docs/references/functions/delete-tag.md') + ->param('functionId', '', new UID(), 'Function unique ID.') + ->param('tagId', '', new UID(), 'Tag unique ID.') + ->action(function ($functionId, $tagId, $response, $projectDB, $usage) { + $function = $projectDB->getDocument($functionId); + + if (empty($function->getId()) || Database::SYSTEM_COLLECTION_FUNCTIONS != $function->getCollection()) { + throw new Exception('Function not found', 404); + } + + $tag = $projectDB->getDocument($tagId); + + if($tag->getAttribute('functionId') !== $function->getId()) { + throw new Exception('Tag not found', 404); + } + + if (empty($tag->getId()) || Database::SYSTEM_COLLECTION_TAGS != $tag->getCollection()) { + throw new Exception('Tag not found', 404); + } + + $device = Storage::getDevice('functions'); + + if ($device->delete($tag->getAttribute('path', ''))) { + if (!$projectDB->deleteDocument($tag->getId())) { + throw new Exception('Failed to remove tag from DB', 500); + } + } + + if($function->getAttribute('tag') === $tag->getId()) { // Reset function tag + $function = $projectDB->updateDocument(array_merge($function->getArrayCopy(), [ + 'tag' => '', + ])); + + if (false === $function) { + throw new Exception('Failed saving function to DB', 500); + } + } + + $usage + ->setParam('storage', $tag->getAttribute('size', 0) * -1) + ; + + $response->noContent(); + }, ['response', 'projectDB', 'usage']); + +App::post('/v1/functions/:functionId/executions') + ->groups(['api', 'functions']) + ->desc('Create Execution') + ->label('scope', 'functions.write') + ->label('sdk.platform', [APP_PLATFORM_SERVER]) + ->label('sdk.namespace', 'functions') + ->label('sdk.method', 'createExecution') + ->label('sdk.description', '/docs/references/functions/create-execution.md') + ->param('functionId', '', new UID(), 'Function unique ID.') + // ->param('async', 1, new Range(0, 1), 'Execute code asynchronously. Pass 1 for true, 0 for false. Default value is 1.', true) + ->action(function ($functionId, /*$async,*/ $response, $project, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $project */ + /** @var Appwrite\Database\Database $projectDB */ + + $function = $projectDB->getDocument($functionId); + + if (empty($function->getId()) || Database::SYSTEM_COLLECTION_FUNCTIONS != $function->getCollection()) { + throw new Exception('Function not found', 404); + } + + $tag = $projectDB->getDocument($function->getAttribute('tag')); + + if($tag->getAttribute('functionId') !== $function->getId()) { + throw new Exception('Tag not found. Deploy tag before trying to execute a function', 404); + } + + if (empty($tag->getId()) || Database::SYSTEM_COLLECTION_TAGS != $tag->getCollection()) { + throw new Exception('Tag not found. Deploy tag before trying to execute a function', 404); + } + + $execution = $projectDB->createDocument([ + '$collection' => Database::SYSTEM_COLLECTION_EXECUTIONS, + '$permissions' => [ + 'read' => [], + 'write' => [], + ], + 'dateCreated' => time(), + 'functionId' => $function->getId(), + 'trigger' => 'http', // http / schedule / event + 'status' => 'waiting', // waiting / processing / completed / failed + 'exitCode' => 0, + 'stdout' => '', + 'stderr' => '', + 'time' => 0, + ]); + + if (false === $execution) { + throw new Exception('Failed saving execution to DB', 500); + } + + // Issue a TLS certificate when domain is verified + Resque::enqueue('v1-functions', 'FunctionsV1', [ + 'projectId' => $project->getId(), + 'functionId' => $function->getId(), + 'executionId' => $execution->getId(), + 'trigger' => 'http', + ]); + + $response->setStatusCode(Response::STATUS_CODE_CREATED); + $response->dynamic($execution, Response::MODEL_EXECUTION); + }, ['response', 'project', 'projectDB']); + +App::get('/v1/functions/:functionId/executions') + ->groups(['api', 'functions']) + ->desc('List Executions') + ->label('scope', 'functions.read') + ->label('sdk.platform', [APP_PLATFORM_SERVER]) + ->label('sdk.namespace', 'functions') + ->label('sdk.method', 'listExecutions') + ->label('sdk.description', '/docs/references/functions/list-executions.md') + ->param('functionId', '', new UID(), 'Function unique ID.') + ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) + ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) + ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true) + ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true) + ->action(function ($functionId, $search, $limit, $offset, $orderType, $response, $projectDB) { + $function = $projectDB->getDocument($functionId); + + if (empty($function->getId()) || Database::SYSTEM_COLLECTION_FUNCTIONS != $function->getCollection()) { + throw new Exception('Function not found', 404); + } + + $results = $projectDB->getCollection([ + 'limit' => $limit, + 'offset' => $offset, + 'orderField' => 'dateCreated', + 'orderType' => $orderType, + 'orderCast' => 'int', + 'search' => $search, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_EXECUTIONS, + 'functionId='.$function->getId(), + ], + ]); + + $response->dynamic(new Document([ + 'sum' => $projectDB->getSum(), + 'executions' => $results + ]), Response::MODEL_EXECUTION_LIST); + }, ['response', 'projectDB']); + +App::get('/v1/functions/:functionId/executions/:executionId') + ->groups(['api', 'functions']) + ->desc('Get Execution') + ->label('scope', 'functions.read') + ->label('sdk.platform', [APP_PLATFORM_SERVER]) + ->label('sdk.namespace', 'functions') + ->label('sdk.method', 'getExecution') + ->label('sdk.description', '/docs/references/functions/get-execution.md') + ->param('functionId', '', new UID(), 'Function unique ID.') + ->param('executionId', '', new UID(), 'Execution unique ID.') + ->action(function ($functionId, $executionId, $response, $projectDB) { + $function = $projectDB->getDocument($functionId); + + if (empty($function->getId()) || Database::SYSTEM_COLLECTION_FUNCTIONS != $function->getCollection()) { + throw new Exception('Function not found', 404); + } + + $execution = $projectDB->getDocument($executionId); + + if($execution->getAttribute('functionId') !== $function->getId()) { + throw new Exception('Execution not found', 404); + } + + if (empty($execution->getId()) || Database::SYSTEM_COLLECTION_EXECUTIONS != $execution->getCollection()) { + throw new Exception('Execution not found', 404); + } + + $response->dynamic($execution, Response::MODEL_EXECUTION); + }, ['response', 'projectDB']); \ No newline at end of file diff --git a/app/controllers/api/graphql.php b/app/controllers/api/graphql.php index 0eecb23e15..cf72731c6a 100644 --- a/app/controllers/api/graphql.php +++ b/app/controllers/api/graphql.php @@ -1,6 +1,6 @@ post('/v1/graphql') +App::post('/v1/graphql') ->desc('GraphQL Endpoint') ->groups(['api', 'graphql']) ->label('scope', 'public') diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 76727563ae..4caeda20d4 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -1,13 +1,12 @@ get('/v1/health') +App::get('/v1/health') ->desc('Get HTTP') ->groups(['api', 'health']) ->label('scope', 'health.read') @@ -15,23 +14,23 @@ $utopia->get('/v1/health') ->label('sdk.namespace', 'health') ->label('sdk.method', 'get') ->label('sdk.description', '/docs/references/health/get.md') - ->action( - function () use ($response) { - $response->json(['status' => 'OK']); - } - ); + ->action(function ($response) { + /** @var Appwrite\Utopia\Response $response */ -$utopia->get('/v1/health/version') + $response->json(['status' => 'OK']); + }, ['response']); + +App::get('/v1/health/version') ->desc('Get Version') ->groups(['api', 'health']) ->label('scope', 'public') - ->action( - function () use ($response) { - $response->json(['version' => APP_VERSION_STABLE]); - } - ); + ->action(function ($response) { + /** @var Appwrite\Utopia\Response $response */ -$utopia->get('/v1/health/db') + $response->json(['version' => APP_VERSION_STABLE]); + }, ['response']); + +App::get('/v1/health/db') ->desc('Get DB') ->groups(['api', 'health']) ->label('scope', 'health.read') @@ -39,15 +38,16 @@ $utopia->get('/v1/health/db') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getDB') ->label('sdk.description', '/docs/references/health/get-db.md') - ->action( - function () use ($response, $register) { - $register->get('db'); /* @var $db PDO */ + ->action(function ($response, $register) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Utopia\Registry\Registry $register */ - $response->json(['status' => 'OK']); - } - ); + $register->get('db'); /* @var $db PDO */ -$utopia->get('/v1/health/cache') + $response->json(['status' => 'OK']); + }, ['response', 'register']); + +App::get('/v1/health/cache') ->desc('Get Cache') ->groups(['api', 'health']) ->label('scope', 'health.read') @@ -55,15 +55,15 @@ $utopia->get('/v1/health/cache') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getCache') ->label('sdk.description', '/docs/references/health/get-cache.md') - ->action( - function () use ($response, $register) { - $register->get('cache'); /* @var $cache Predis\Client */ + ->action(function ($response, $register) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Utopia\Registry\Registry $register */ + $register->get('cache'); /* @var $cache Predis\Client */ - $response->json(['status' => 'OK']); - } - ); + $response->json(['status' => 'OK']); + }, ['response']); -$utopia->get('/v1/health/time') +App::get('/v1/health/time') ->desc('Get Time') ->groups(['api', 'health']) ->label('scope', 'health.read') @@ -71,47 +71,47 @@ $utopia->get('/v1/health/time') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getTime') ->label('sdk.description', '/docs/references/health/get-time.md') - ->action( - function () use ($response) { - /* - * Code from: @see https://www.beliefmedia.com.au/query-ntp-time-server - */ - $host = 'time.google.com'; // https://developers.google.com/time/ - $gap = 60; // Allow [X] seconds gap + ->action(function ($response) { + /** @var Appwrite\Utopia\Response $response */ - /* Create a socket and connect to NTP server */ - $sock = \socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); + /* + * Code from: @see https://www.beliefmedia.com.au/query-ntp-time-server + */ + $host = 'time.google.com'; // https://developers.google.com/time/ + $gap = 60; // Allow [X] seconds gap - \socket_connect($sock, $host, 123); + /* Create a socket and connect to NTP server */ + $sock = \socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); - /* Send request */ - $msg = "\010".\str_repeat("\0", 47); + \socket_connect($sock, $host, 123); - \socket_send($sock, $msg, \strlen($msg), 0); + /* Send request */ + $msg = "\010".\str_repeat("\0", 47); - /* Receive response and close socket */ - \socket_recv($sock, $recv, 48, MSG_WAITALL); - \socket_close($sock); + \socket_send($sock, $msg, \strlen($msg), 0); - /* Interpret response */ - $data = \unpack('N12', $recv); - $timestamp = \sprintf('%u', $data[9]); + /* Receive response and close socket */ + \socket_recv($sock, $recv, 48, MSG_WAITALL); + \socket_close($sock); - /* NTP is number of seconds since 0000 UT on 1 January 1900 - Unix time is seconds since 0000 UT on 1 January 1970 */ - $timestamp -= 2208988800; + /* Interpret response */ + $data = \unpack('N12', $recv); + $timestamp = \sprintf('%u', $data[9]); - $diff = ($timestamp - \time()); + /* NTP is number of seconds since 0000 UT on 1 January 1900 + Unix time is seconds since 0000 UT on 1 January 1970 */ + $timestamp -= 2208988800; - if ($diff > $gap || $diff < ($gap * -1)) { - throw new Exception('Server time gaps detected'); - } + $diff = ($timestamp - \time()); - $response->json(['remote' => $timestamp, 'local' => \time(), 'diff' => $diff]); + if ($diff > $gap || $diff < ($gap * -1)) { + throw new Exception('Server time gaps detected'); } - ); -$utopia->get('/v1/health/queue/webhooks') + $response->json(['remote' => $timestamp, 'local' => \time(), 'diff' => $diff]); + }, ['response']); + +App::get('/v1/health/queue/webhooks') ->desc('Get Webhooks Queue') ->groups(['api', 'health']) ->label('scope', 'health.read') @@ -119,13 +119,13 @@ $utopia->get('/v1/health/queue/webhooks') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getQueueWebhooks') ->label('sdk.description', '/docs/references/health/get-queue-webhooks.md') - ->action( - function () use ($response) { - $response->json(['size' => Resque::size('v1-webhooks')]); - } - ); + ->action(function ($response) { + /** @var Appwrite\Utopia\Response $response */ -$utopia->get('/v1/health/queue/tasks') + $response->json(['size' => Resque::size('v1-webhooks')]); + }, ['response']); + +App::get('/v1/health/queue/tasks') ->desc('Get Tasks Queue') ->groups(['api', 'health']) ->label('scope', 'health.read') @@ -133,13 +133,13 @@ $utopia->get('/v1/health/queue/tasks') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getQueueTasks') ->label('sdk.description', '/docs/references/health/get-queue-tasks.md') - ->action( - function () use ($response) { - $response->json(['size' => Resque::size('v1-tasks')]); - } - ); + ->action(function ($response) { + /** @var Appwrite\Utopia\Response $response */ -$utopia->get('/v1/health/queue/logs') + $response->json(['size' => Resque::size('v1-tasks')]); + }, ['response']); + +App::get('/v1/health/queue/logs') ->desc('Get Logs Queue') ->groups(['api', 'health']) ->label('scope', 'health.read') @@ -147,13 +147,13 @@ $utopia->get('/v1/health/queue/logs') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getQueueLogs') ->label('sdk.description', '/docs/references/health/get-queue-logs.md') - ->action( - function () use ($response) { - $response->json(['size' => Resque::size('v1-audit')]); - } - ); + ->action(function ($response) { + /** @var Appwrite\Utopia\Response $response */ -$utopia->get('/v1/health/queue/usage') + $response->json(['size' => Resque::size('v1-audit')]); + }, ['response']); + +App::get('/v1/health/queue/usage') ->desc('Get Usage Queue') ->groups(['api', 'health']) ->label('scope', 'health.read') @@ -161,13 +161,13 @@ $utopia->get('/v1/health/queue/usage') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getQueueUsage') ->label('sdk.description', '/docs/references/health/get-queue-usage.md') - ->action( - function () use ($response) { - $response->json(['size' => Resque::size('v1-usage')]); - } - ); + ->action(function ($response) { + /** @var Appwrite\Utopia\Response $response */ -$utopia->get('/v1/health/queue/certificates') + $response->json(['size' => Resque::size('v1-usage')]); + }, ['response']); + +App::get('/v1/health/queue/certificates') ->desc('Get Certificate Queue') ->groups(['api', 'health']) ->label('scope', 'health.read') @@ -175,13 +175,13 @@ $utopia->get('/v1/health/queue/certificates') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getQueueCertificates') ->label('sdk.description', '/docs/references/health/get-queue-certificates.md') - ->action( - function () use ($response) { - $response->json(['size' => Resque::size('v1-certificates')]); - } - ); + ->action(function ($response) { + /** @var Appwrite\Utopia\Response $response */ -$utopia->get('/v1/health/queue/functions') + $response->json(['size' => Resque::size('v1-certificates')]); + }, ['response']); + +App::get('/v1/health/queue/functions') ->desc('Get Functions Queue') ->groups(['api', 'health']) ->label('scope', 'health.read') @@ -189,13 +189,13 @@ $utopia->get('/v1/health/queue/functions') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getQueueFunctions') ->label('sdk.description', '/docs/references/health/get-queue-functions.md') - ->action( - function () use ($response) { - $response->json(['size' => Resque::size('v1-functions')]); - } - ); + ->action(function ($response) { + /** @var Appwrite\Utopia\Response $response */ -$utopia->get('/v1/health/storage/local') + $response->json(['size' => Resque::size('v1-functions')]); + }, ['response']); + +App::get('/v1/health/storage/local') ->desc('Get Local Storage') ->groups(['api', 'health']) ->label('scope', 'health.read') @@ -203,30 +203,30 @@ $utopia->get('/v1/health/storage/local') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getStorageLocal') ->label('sdk.description', '/docs/references/health/get-storage-local.md') - ->action( - function () use ($response) { - foreach ([ - 'Uploads' => APP_STORAGE_UPLOADS, - 'Cache' => APP_STORAGE_CACHE, - 'Config' => APP_STORAGE_CONFIG, - 'Certs' => APP_STORAGE_CERTIFICATES - ] as $key => $volume) { - $device = new Local($volume); + ->action(function ($response) { + /** @var Appwrite\Utopia\Response $response */ - if (!\is_readable($device->getRoot())) { - throw new Exception('Device '.$key.' dir is not readable'); - } + foreach ([ + 'Uploads' => APP_STORAGE_UPLOADS, + 'Cache' => APP_STORAGE_CACHE, + 'Config' => APP_STORAGE_CONFIG, + 'Certs' => APP_STORAGE_CERTIFICATES + ] as $key => $volume) { + $device = new Local($volume); - if (!\is_writable($device->getRoot())) { - throw new Exception('Device '.$key.' dir is not writable'); - } + if (!\is_readable($device->getRoot())) { + throw new Exception('Device '.$key.' dir is not readable'); } - $response->json(['status' => 'OK']); + if (!\is_writable($device->getRoot())) { + throw new Exception('Device '.$key.' dir is not writable'); + } } - ); -$utopia->get('/v1/health/anti-virus') + $response->json(['status' => 'OK']); + }, ['response']); + +App::get('/v1/health/anti-virus') ->desc('Get Anti virus') ->groups(['api', 'health']) ->label('scope', 'health.read') @@ -234,22 +234,22 @@ $utopia->get('/v1/health/anti-virus') ->label('sdk.namespace', 'health') ->label('sdk.method', 'getAntiVirus') ->label('sdk.description', '/docs/references/health/get-storage-anti-virus.md') - ->action( - function () use ($request, $response) { - if ($request->getServer('_APP_STORAGE_ANTIVIRUS') === 'disabled') { // Check if scans are enabled - throw new Exception('Anitvirus is disabled'); - } + ->action(function ($response) { + /** @var Appwrite\Utopia\Response $response */ - $antiVirus = new Network('clamav', 3310); - - $response->json([ - 'status' => (@$antiVirus->ping()) ? 'online' : 'offline', - 'version' => @$antiVirus->version(), - ]); + if (App::getEnv('_APP_STORAGE_ANTIVIRUS') === 'disabled') { // Check if scans are enabled + throw new Exception('Anitvirus is disabled'); } - ); -$utopia->get('/v1/health/stats') // Currently only used internally + $antiVirus = new Network('clamav', 3310); + + $response->json([ + 'status' => (@$antiVirus->ping()) ? 'online' : 'offline', + 'version' => @$antiVirus->version(), + ]); + }, ['response']); + +App::get('/v1/health/stats') // Currently only used internally ->desc('Get System Stats') ->groups(['api', 'health']) ->label('scope', 'god') @@ -257,34 +257,35 @@ $utopia->get('/v1/health/stats') // Currently only used internally // ->label('sdk.namespace', 'health') // ->label('sdk.method', 'getStats') ->label('docs', false) - ->action( - function () use ($response, $register) { - $device = Storage::getDevice('local'); - $cache = $register->get('cache'); + ->action(function ($response, $register) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Utopia\Registry\Registry $register */ - $cacheStats = $cache->info(); + $device = Storage::getDevice('files'); + $cache = $register->get('cache'); - $response - ->json([ - 'server' => [ - 'name' => 'nginx', - 'version' => \shell_exec('nginx -v 2>&1'), - ], - 'storage' => [ - 'used' => Storage::human($device->getDirectorySize($device->getRoot().'/')), - 'partitionTotal' => Storage::human($device->getPartitionTotalSpace()), - 'partitionFree' => Storage::human($device->getPartitionFreeSpace()), - ], - 'cache' => [ - 'uptime' => (isset($cacheStats['uptime_in_seconds'])) ? $cacheStats['uptime_in_seconds'] : 0, - 'clients' => (isset($cacheStats['connected_clients'])) ? $cacheStats['connected_clients'] : 0, - 'hits' => (isset($cacheStats['keyspace_hits'])) ? $cacheStats['keyspace_hits'] : 0, - 'misses' => (isset($cacheStats['keyspace_misses'])) ? $cacheStats['keyspace_misses'] : 0, - 'memory_used' => (isset($cacheStats['used_memory'])) ? $cacheStats['used_memory'] : 0, - 'memory_used_human' => (isset($cacheStats['used_memory_human'])) ? $cacheStats['used_memory_human'] : 0, - 'memory_used_peak' => (isset($cacheStats['used_memory_peak'])) ? $cacheStats['used_memory_peak'] : 0, - 'memory_used_peak_human' => (isset($cacheStats['used_memory_peak_human'])) ? $cacheStats['used_memory_peak_human'] : 0, - ], - ]); - } - ); + $cacheStats = $cache->info(); + + $response + ->json([ + 'server' => [ + 'name' => 'nginx', + 'version' => \shell_exec('nginx -v 2>&1'), + ], + 'storage' => [ + 'used' => Storage::human($device->getDirectorySize($device->getRoot().'/')), + 'partitionTotal' => Storage::human($device->getPartitionTotalSpace()), + 'partitionFree' => Storage::human($device->getPartitionFreeSpace()), + ], + 'cache' => [ + 'uptime' => (isset($cacheStats['uptime_in_seconds'])) ? $cacheStats['uptime_in_seconds'] : 0, + 'clients' => (isset($cacheStats['connected_clients'])) ? $cacheStats['connected_clients'] : 0, + 'hits' => (isset($cacheStats['keyspace_hits'])) ? $cacheStats['keyspace_hits'] : 0, + 'misses' => (isset($cacheStats['keyspace_misses'])) ? $cacheStats['keyspace_misses'] : 0, + 'memory_used' => (isset($cacheStats['used_memory'])) ? $cacheStats['used_memory'] : 0, + 'memory_used_human' => (isset($cacheStats['used_memory_human'])) ? $cacheStats['used_memory_human'] : 0, + 'memory_used_peak' => (isset($cacheStats['used_memory_peak'])) ? $cacheStats['used_memory_peak'] : 0, + 'memory_used_peak_human' => (isset($cacheStats['used_memory_peak_human'])) ? $cacheStats['used_memory_peak_human'] : 0, + ], + ]); + }, ['response', 'register']); diff --git a/app/controllers/api/locale.php b/app/controllers/api/locale.php index 148ee3e8e9..a33eea5d64 100644 --- a/app/controllers/api/locale.php +++ b/app/controllers/api/locale.php @@ -1,12 +1,11 @@ get('/v1/locale') +App::get('/v1/locale') ->desc('Get User Locale') ->groups(['api', 'locale']) ->label('scope', 'locale.read') @@ -14,58 +13,57 @@ $utopia->get('/v1/locale') ->label('sdk.namespace', 'locale') ->label('sdk.method', 'get') ->label('sdk.description', '/docs/references/locale/get-locale.md') - ->action( - function () use ($response, $request, $utopia) { - $eu = include __DIR__.'/../../config/eu.php'; - $currencies = include __DIR__.'/../../config/currencies.php'; - $reader = new Reader(__DIR__.'/../../db/DBIP/dbip-country-lite-2020-01.mmdb'); - $output = []; - $ip = $request->getIP(); - $time = (60 * 60 * 24 * 45); // 45 days cache - $countries = Locale::getText('countries'); - $continents = Locale::getText('continents'); + ->action(function ($request, $response, $locale, $geodb) { + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + /** @var Utopia\Locale\Locale $locale */ + /** @var GeoIp2\Database\Reader $geodb */ - if (App::MODE_TYPE_PRODUCTION !== $utopia->getMode()) { - $ip = '79.177.241.94'; - } + $eu = Config::getParam('locale-eu'); + $currencies = Config::getParam('locale-currencies'); + $output = []; + $ip = $request->getIP(); + $time = (60 * 60 * 24 * 45); // 45 days cache + $countries = $locale->getText('countries'); + $continents = $locale->getText('continents'); - $output['ip'] = $ip; + $output['ip'] = $ip; - $currency = null; + $currency = null; - try { - $record = $reader->country($ip); - $output['countryCode'] = $record->country->isoCode; - $output['country'] = (isset($countries[$record->country->isoCode])) ? $countries[$record->country->isoCode] : Locale::getText('locale.country.unknown'); - //$output['countryTimeZone'] = DateTimeZone::listIdentifiers(DateTimeZone::PER_COUNTRY, $record->country->isoCode); - $output['continent'] = (isset($continents[$record->continent->code])) ? $continents[$record->continent->code] : Locale::getText('locale.country.unknown'); - $output['continentCode'] = $record->continent->code; - $output['eu'] = (\in_array($record->country->isoCode, $eu)) ? true : false; + try { + $record = $geodb->country($ip); + $output['countryCode'] = $record->country->isoCode; + $output['country'] = (isset($countries[$record->country->isoCode])) ? $countries[$record->country->isoCode] : $locale->getText('locale.country.unknown'); + //$output['countryTimeZone'] = DateTimeZone::listIdentifiers(DateTimeZone::PER_COUNTRY, $record->country->isoCode); + $output['continent'] = (isset($continents[$record->continent->code])) ? $continents[$record->continent->code] : $locale->getText('locale.country.unknown'); + $output['continentCode'] = $record->continent->code; + $output['eu'] = (\in_array($record->country->isoCode, $eu)) ? true : false; - foreach ($currencies as $code => $element) { - if (isset($element['locations']) && isset($element['code']) && \in_array($record->country->isoCode, $element['locations'])) { - $currency = $element['code']; - } + foreach ($currencies as $code => $element) { + if (isset($element['locations']) && isset($element['code']) && \in_array($record->country->isoCode, $element['locations'])) { + $currency = $element['code']; } - - $output['currency'] = $currency; - } catch (\Exception $e) { - $output['countryCode'] = '--'; - $output['country'] = Locale::getText('locale.country.unknown'); - $output['continent'] = Locale::getText('locale.country.unknown'); - $output['continentCode'] = '--'; - $output['eu'] = false; - $output['currency'] = $currency; } - $response - ->addHeader('Cache-Control', 'public, max-age='.$time) - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + $time).' GMT') // 45 days cache - ->json($output); + $output['currency'] = $currency; + } catch (\Exception $e) { + $output['countryCode'] = '--'; + $output['country'] = $locale->getText('locale.country.unknown'); + $output['continent'] = $locale->getText('locale.country.unknown'); + $output['continentCode'] = '--'; + $output['eu'] = false; + $output['currency'] = $currency; } - ); -$utopia->get('/v1/locale/countries') + $response + ->addHeader('Cache-Control', 'public, max-age='.$time) + ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + $time).' GMT') // 45 days cache + ; + $response->dynamic(new Document($output), Response::MODEL_LOCALE); + }, ['request', 'response', 'locale', 'geodb']); + +App::get('/v1/locale/countries') ->desc('List Countries') ->groups(['api', 'locale']) ->label('scope', 'locale.read') @@ -73,17 +71,26 @@ $utopia->get('/v1/locale/countries') ->label('sdk.namespace', 'locale') ->label('sdk.method', 'getCountries') ->label('sdk.description', '/docs/references/locale/get-countries.md') - ->action( - function () use ($response) { - $list = Locale::getText('countries'); /* @var $list array */ + ->action(function ($response, $locale) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Utopia\Locale\Locale $locale */ - \asort($list); + $list = $locale->getText('countries'); /* @var $list array */ + $output = []; - $response->json($list); + \asort($list); // sort by abc per locale + + foreach ($list as $key => $value) { + $output[] = new Document([ + 'name' => $value, + 'code' => $key, + ]); } - ); -$utopia->get('/v1/locale/countries/eu') + $response->dynamic(new Document(['countries' => $output, 'sum' => \count($output)]), Response::MODEL_COUNTRY_LIST); + }, ['response', 'locale']); + +App::get('/v1/locale/countries/eu') ->desc('List EU Countries') ->groups(['api', 'locale']) ->label('scope', 'locale.read') @@ -91,25 +98,29 @@ $utopia->get('/v1/locale/countries/eu') ->label('sdk.namespace', 'locale') ->label('sdk.method', 'getCountriesEU') ->label('sdk.description', '/docs/references/locale/get-countries-eu.md') - ->action( - function () use ($response) { - $countries = Locale::getText('countries'); /* @var $countries array */ - $eu = include __DIR__.'/../../config/eu.php'; - $list = []; + ->action(function ($response, $locale) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Utopia\Locale\Locale $locale */ - foreach ($eu as $code) { - if (\array_key_exists($code, $countries)) { - $list[$code] = $countries[$code]; - } + $list = $locale->getText('countries'); /* @var $countries array */ + $eu = Config::getParam('locale-eu'); + $output = []; + + \asort($list); + + foreach ($eu as $code) { + if (\array_key_exists($code, $list)) { + $output[] = new Document([ + 'name' => $list[$code], + 'code' => $code, + ]); } - - \asort($list); - - $response->json($list); } - ); -$utopia->get('/v1/locale/countries/phones') + $response->dynamic(new Document(['countries' => $output, 'sum' => \count($output)]), Response::MODEL_COUNTRY_LIST); + }, ['response', 'locale']); + +App::get('/v1/locale/countries/phones') ->desc('List Countries Phone Codes') ->groups(['api', 'locale']) ->label('scope', 'locale.read') @@ -117,25 +128,30 @@ $utopia->get('/v1/locale/countries/phones') ->label('sdk.namespace', 'locale') ->label('sdk.method', 'getCountriesPhones') ->label('sdk.description', '/docs/references/locale/get-countries-phones.md') - ->action( - function () use ($response) { - $list = include __DIR__.'/../../config/phones.php'; /* @var $list array */ + ->action(function ($response, $locale) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Utopia\Locale\Locale $locale */ - $countries = Locale::getText('countries'); /* @var $countries array */ + $list = Config::getParam('locale-phones'); /* @var $list array */ + $countries = $locale->getText('countries'); /* @var $countries array */ + $output = []; + + \asort($list); - foreach ($list as $code => $name) { - if (\array_key_exists($code, $countries)) { - $list[$code] = '+'.$list[$code]; - } + foreach ($list as $code => $name) { + if (\array_key_exists($code, $countries)) { + $output[] = new Document([ + 'code' => '+'.$list[$code], + 'countryCode' => $code, + 'countryName' => $countries[$code], + ]); } - - \asort($list); - - $response->json($list); } - ); -$utopia->get('/v1/locale/continents') + $response->dynamic(new Document(['phones' => $output, 'sum' => \count($output)]), Response::MODEL_PHONE_LIST); + }, ['response', 'locale']); + +App::get('/v1/locale/continents') ->desc('List Continents') ->groups(['api', 'locale']) ->label('scope', 'locale.read') @@ -143,18 +159,25 @@ $utopia->get('/v1/locale/continents') ->label('sdk.namespace', 'locale') ->label('sdk.method', 'getContinents') ->label('sdk.description', '/docs/references/locale/get-continents.md') - ->action( - function () use ($response) { - $list = Locale::getText('continents'); /* @var $list array */ + ->action(function ($response, $locale) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Utopia\Locale\Locale $locale */ - \asort($list); + $list = $locale->getText('continents'); /* @var $list array */ - $response->json($list); + \asort($list); + + foreach ($list as $key => $value) { + $output[] = new Document([ + 'name' => $value, + 'code' => $key, + ]); } - ); + $response->dynamic(new Document(['continents' => $output, 'sum' => \count($output)]), Response::MODEL_CONTINENT_LIST); + }, ['response', 'locale']); -$utopia->get('/v1/locale/currencies') +App::get('/v1/locale/currencies') ->desc('List Currencies') ->groups(['api', 'locale']) ->label('scope', 'locale.read') @@ -162,16 +185,20 @@ $utopia->get('/v1/locale/currencies') ->label('sdk.namespace', 'locale') ->label('sdk.method', 'getCurrencies') ->label('sdk.description', '/docs/references/locale/get-currencies.md') - ->action( - function () use ($response) { - $currencies = include __DIR__.'/../../config/currencies.php'; + ->action(function ($response) { + /** @var Appwrite\Utopia\Response $response */ - $response->json($currencies); - } - ); + $list = Config::getParam('locale-currencies'); + + $list = array_map(function($node) { + return new Document($node); + }, $list); + + $response->dynamic(new Document(['currencies' => $list, 'sum' => \count($list)]), Response::MODEL_CURRENCY_LIST); + }, ['response']); -$utopia->get('/v1/locale/languages') +App::get('/v1/locale/languages') ->desc('List Languages') ->groups(['api', 'locale']) ->label('scope', 'locale.read') @@ -179,10 +206,14 @@ $utopia->get('/v1/locale/languages') ->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'; + ->action(function ($response) { + /** @var Appwrite\Utopia\Response $response */ - $response->json($languages); - } - ); \ No newline at end of file + $list = Config::getParam('locale-languages'); + + $list = array_map(function($node) { + return new Document($node); + }, $list); + + $response->dynamic(new Document(['languages' => $list, 'sum' => \count($list)]), Response::MODEL_LANGUAGE_LIST); + }, ['response']); \ No newline at end of file diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index cf81df66ba..6897456bf5 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -1,14 +1,13 @@ post('/v1/projects') +App::post('/v1/projects') ->desc('Create Project') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'create') - ->param('name', null, function () { return new Text(100); }, 'Project name.') - ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') - ->param('description', '', function () { return new Text(255); }, 'Project description.', true) - ->param('logo', '', function () { return new Text(1024); }, 'Project logo.', true) - ->param('url', '', function () { return new URL(); }, 'Project URL.', true) - ->param('legalName', '', function () { return new Text(256); }, 'Project legal Name.', true) - ->param('legalCountry', '', function () { return new Text(256); }, 'Project legal Country.', true) - ->param('legalState', '', function () { return new Text(256); }, 'Project legal State.', true) - ->param('legalCity', '', function () { return new Text(256); }, 'Project legal City.', true) - ->param('legalAddress', '', function () { return new Text(256); }, 'Project legal Address.', true) - ->param('legalTaxId', '', function () { return new Text(256); }, 'Project legal Tax ID.', true) - ->action( - function ($name, $teamId, $description, $logo, $url, $legalName, $legalCountry, $legalState, $legalCity, $legalAddress, $legalTaxId) use ($response, $user, $consoleDB, $projectDB) { - $team = $projectDB->getDocument($teamId); + ->param('name', null, new Text(128), 'Project name. Max length: 128 chars.') + ->param('teamId', '', new UID(), 'Team unique ID.') + ->param('description', '', new Text(256), 'Project description. Max length: 256 chars.', true) + ->param('logo', '', new Text(1024), 'Project logo.', true) + ->param('url', '', new URL(), 'Project URL.', true) + ->param('legalName', '', new Text(256), 'Project legal Name. Max length: 256 chars.', true) + ->param('legalCountry', '', new Text(256), 'Project legal Country. Max length: 256 chars.', true) + ->param('legalState', '', new Text(256), 'Project legal State. Max length: 256 chars.', true) + ->param('legalCity', '', new Text(256), 'Project legal City. Max length: 256 chars.', true) + ->param('legalAddress', '', new Text(256), 'Project legal Address. Max length: 256 chars.', true) + ->param('legalTaxId', '', new Text(256), 'Project legal Tax ID. Max length: 256 chars.', true) + ->action(function ($name, $teamId, $description, $logo, $url, $legalName, $legalCountry, $legalState, $legalCity, $legalAddress, $legalTaxId, $response, $consoleDB, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ + /** @var Appwrite\Database\Database $projectDB */ - if (empty($team->getId()) || Database::SYSTEM_COLLECTION_TEAMS != $team->getCollection()) { - throw new Exception('Team not found', 404); - } + $team = $projectDB->getDocument($teamId); - $project = $consoleDB->createDocument( - [ - '$collection' => Database::SYSTEM_COLLECTION_PROJECTS, - '$permissions' => [ - 'read' => ['team:'.$teamId], - 'write' => ['team:'.$teamId.'/owner', 'team:'.$teamId.'/developer'], - ], - 'name' => $name, - 'description' => $description, - 'logo' => $logo, - 'url' => $url, - 'legalName' => $legalName, - 'legalCountry' => $legalCountry, - 'legalState' => $legalState, - 'legalCity' => $legalCity, - 'legalAddress' => $legalAddress, - 'legalTaxId' => $legalTaxId, - 'teamId' => $team->getId(), - 'platforms' => [], - 'webhooks' => [], - 'keys' => [], - 'tasks' => [], - ] - ); - - if (false === $project) { - throw new Exception('Failed saving project to DB', 500); - } - - $consoleDB->createNamespace($project->getId()); - - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->json($project->getArrayCopy()) - ; + if (empty($team->getId()) || Database::SYSTEM_COLLECTION_TEAMS != $team->getCollection()) { + throw new Exception('Team not found', 404); } - ); -$utopia->get('/v1/projects') - ->desc('List Projects') - ->groups(['api', 'projects']) - ->label('scope', 'projects.read') - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'list') - ->action( - function () use ($request, $response, $consoleDB) { - $results = $consoleDB->getCollection([ - 'limit' => 20, - 'offset' => 0, - 'orderField' => 'name', - 'orderType' => 'ASC', - 'orderCast' => 'string', - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_PROJECTS, + $project = $consoleDB->createDocument( + [ + '$collection' => Database::SYSTEM_COLLECTION_PROJECTS, + '$permissions' => [ + 'read' => ['team:'.$teamId], + 'write' => ['team:'.$teamId.'/owner', 'team:'.$teamId.'/developer'], ], - ]); - - foreach ($results as $project) { - foreach (Config::getParam('providers') as $provider => $node) { - $secret = \json_decode($project->getAttribute('usersOauth2'.\ucfirst($provider).'Secret', '{}'), true); - - if (!empty($secret) && isset($secret['version'])) { - $key = $request->getServer('_APP_OPENSSL_KEY_V'.$secret['version']); - $project->setAttribute('usersOauth2'.\ucfirst($provider).'Secret', OpenSSL::decrypt($secret['data'], $secret['method'], $key, 0, \hex2bin($secret['iv']), \hex2bin($secret['tag']))); - } - } - } - - $response->json($results); - } - ); - -$utopia->get('/v1/projects/:projectId') - ->desc('Get Project') - ->groups(['api', 'projects']) - ->label('scope', 'projects.read') - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'get') - ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.') - ->action( - function ($projectId) use ($request, $response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); - - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } - - foreach (Config::getParam('providers') as $provider => $node) { - $secret = \json_decode($project->getAttribute('usersOauth2'.\ucfirst($provider).'Secret', '{}'), true); - - if (!empty($secret) && isset($secret['version'])) { - $key = $request->getServer('_APP_OPENSSL_KEY_V'.$secret['version']); - $project->setAttribute('usersOauth2'.\ucfirst($provider).'Secret', OpenSSL::decrypt($secret['data'], $secret['method'], $key, 0, \hex2bin($secret['iv']), \hex2bin($secret['tag']))); - } - } - - $response->json($project->getArrayCopy()); - } - ); - -$utopia->get('/v1/projects/:projectId/usage') - ->desc('Get Project') - ->groups(['api', 'projects']) - ->label('scope', 'projects.read') - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getUsage') - ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.') - ->param('range', 'last30', function () { return new WhiteList(['daily', 'monthly', 'last30', 'last90']); }, 'Date range.', true) - ->action( - function ($projectId, $range) use ($response, $consoleDB, $projectDB, $register) { - $project = $consoleDB->getDocument($projectId); - - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } - - $period = [ - 'daily' => [ - 'start' => DateTime::createFromFormat('U', \strtotime('today')), - 'end' => DateTime::createFromFormat('U', \strtotime('tomorrow')), - 'group' => '1m', - ], - 'monthly' => [ - 'start' => DateTime::createFromFormat('U', \strtotime('midnight first day of this month')), - 'end' => DateTime::createFromFormat('U', \strtotime('midnight last day of this month')), - 'group' => '1d', - ], - 'last30' => [ - 'start' => DateTime::createFromFormat('U', \strtotime('-30 days')), - 'end' => DateTime::createFromFormat('U', \strtotime('tomorrow')), - 'group' => '1d', - ], - 'last90' => [ - 'start' => DateTime::createFromFormat('U', \strtotime('-90 days')), - 'end' => DateTime::createFromFormat('U', \strtotime('today')), - 'group' => '1d', - ], - // 'yearly' => [ - // 'start' => DateTime::createFromFormat('U', strtotime('midnight first day of january')), - // 'end' => DateTime::createFromFormat('U', strtotime('midnight last day of december')), - // 'group' => '4w', - // ], - ]; - - $client = $register->get('influxdb'); - - $requests = []; - $network = []; - - if ($client) { - $start = $period[$range]['start']->format(DateTime::RFC3339); - $end = $period[$range]['end']->format(DateTime::RFC3339); - $database = $client->selectDB('telegraf'); - - // Requests - $result = $database->query('SELECT sum(value) AS "value" FROM "appwrite_usage_requests_all" WHERE time > \''.$start.'\' AND time < \''.$end.'\' AND "metric_type"=\'counter\' AND "project"=\''.$project->getId().'\' GROUP BY time('.$period[$range]['group'].') FILL(null)'); - $points = $result->getPoints(); - - foreach ($points as $point) { - $requests[] = [ - 'value' => (!empty($point['value'])) ? $point['value'] : 0, - 'date' => \strtotime($point['time']), - ]; - } - - // Network - $result = $database->query('SELECT sum(value) AS "value" FROM "appwrite_usage_network_all" WHERE time > \''.$start.'\' AND time < \''.$end.'\' AND "metric_type"=\'counter\' AND "project"=\''.$project->getId().'\' GROUP BY time('.$period[$range]['group'].') FILL(null)'); - $points = $result->getPoints(); - - foreach ($points as $point) { - $network[] = [ - 'value' => (!empty($point['value'])) ? $point['value'] : 0, - 'date' => \strtotime($point['time']), - ]; - } - } - - // Users - - $projectDB->getCollection([ - 'limit' => 0, - 'offset' => 0, - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_USERS, - ], - ]); - - $usersTotal = $projectDB->getSum(); - - // Documents - - $collections = $projectDB->getCollection([ - 'limit' => 100, - 'offset' => 0, - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_COLLECTIONS, - ], - ]); - - $collectionsTotal = $projectDB->getSum(); - - $documents = []; - - foreach ($collections as $collection) { - $result = $projectDB->getCollection([ - 'limit' => 0, - 'offset' => 0, - 'filters' => [ - '$collection='.$collection['$id'], - ], - ]); - - $documents[] = ['name' => $collection['name'], 'total' => $projectDB->getSum()]; - } - - // Tasks - $tasksTotal = \count($project->getAttribute('tasks', [])); - - $response->json([ - 'requests' => [ - 'data' => $requests, - 'total' => \array_sum(\array_map(function ($item) { - return $item['value']; - }, $requests)), - ], - 'network' => [ - 'data' => $network, - 'total' => \array_sum(\array_map(function ($item) { - return $item['value']; - }, $network)), - ], - 'collections' => [ - 'data' => $collections, - 'total' => $collectionsTotal, - ], - 'documents' => [ - 'data' => $documents, - 'total' => \array_sum(\array_map(function ($item) { - return $item['total']; - }, $documents)), - ], - 'users' => [ - 'data' => [], - 'total' => $usersTotal, - ], - 'tasks' => [ - 'data' => [], - 'total' => $tasksTotal, - ], - 'storage' => [ - 'total' => $projectDB->getCount( - [ - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_FILES, - ], - ] - ), - ], - ]); - } - ); - -$utopia->patch('/v1/projects/:projectId') - ->desc('Update Project') - ->groups(['api', 'projects']) - ->label('scope', 'projects.write') - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'update') - ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.') - ->param('name', null, function () { return new Text(100); }, 'Project name.') - ->param('description', '', function () { return new Text(255); }, 'Project description.', true) - ->param('logo', '', function () { return new Text(1024); }, 'Project logo.', true) - ->param('url', '', function () { return new URL(); }, 'Project URL.', true) - ->param('legalName', '', function () { return new Text(256); }, 'Project legal name.', true) - ->param('legalCountry', '', function () { return new Text(256); }, 'Project legal country..', true) - ->param('legalState', '', function () { return new Text(256); }, 'Project legal state.', true) - ->param('legalCity', '', function () { return new Text(256); }, 'Project legal city.', true) - ->param('legalAddress', '', function () { return new Text(256); }, 'Project legal address.', true) - ->param('legalTaxId', '', function () { return new Text(256); }, 'Project legal tax ID.', true) - ->action( - function ($projectId, $name, $description, $logo, $url, $legalName, $legalCountry, $legalState, $legalCity, $legalAddress, $legalTaxId) use ($response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); - - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } - - $project = $consoleDB->updateDocument(\array_merge($project->getArrayCopy(), [ 'name' => $name, 'description' => $description, 'logo' => $logo, @@ -346,1107 +65,1349 @@ $utopia->patch('/v1/projects/:projectId') 'legalCity' => $legalCity, 'legalAddress' => $legalAddress, 'legalTaxId' => $legalTaxId, - ])); + 'teamId' => $team->getId(), + 'platforms' => [], + 'webhooks' => [], + 'keys' => [], + 'tasks' => [], + 'domains' => [], + ] + ); - if (false === $project) { - throw new Exception('Failed saving project to DB', 500); + if (false === $project) { + throw new Exception('Failed saving project to DB', 500); + } + + $consoleDB->createNamespace($project->getId()); + + $response->setStatusCode(Response::STATUS_CODE_CREATED); + $response->dynamic($project, Response::MODEL_PROJECT); + }, ['response', 'consoleDB', 'projectDB']); + +App::get('/v1/projects') + ->desc('List Projects') + ->groups(['api', 'projects']) + ->label('scope', 'projects.read') + ->label('sdk.namespace', 'projects') + ->label('sdk.method', 'list') + ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) + ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) + ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true) + ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true) + ->action(function ($search, $limit, $offset, $orderType, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ + + $results = $consoleDB->getCollection([ + 'limit' => $limit, + 'offset' => $offset, + 'orderField' => 'registration', + 'orderType' => $orderType, + 'orderCast' => 'int', + 'search' => $search, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_PROJECTS, + ], + ]); + + $response->dynamic(new Document([ + 'sum' => $consoleDB->getSum(), + 'projects' => $results + ]), Response::MODEL_PROJECT_LIST); + }, ['response', 'consoleDB']); + +App::get('/v1/projects/:projectId') + ->desc('Get Project') + ->groups(['api', 'projects']) + ->label('scope', 'projects.read') + ->label('sdk.namespace', 'projects') + ->label('sdk.method', 'get') + ->param('projectId', '', new UID(), 'Project unique ID.') + ->action(function ($projectId, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ + + $project = $consoleDB->getDocument($projectId); + + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); + } + + $response->dynamic($project, Response::MODEL_PROJECT); + }, ['response', 'consoleDB']); + +App::get('/v1/projects/:projectId/usage') + ->desc('Get Project') + ->groups(['api', 'projects']) + ->label('scope', 'projects.read') + ->label('sdk.namespace', 'projects') + ->label('sdk.method', 'getUsage') + ->param('projectId', '', new UID(), 'Project unique ID.') + ->param('range', '30d', new WhiteList(['24h', '7d', '30d', '90d'], true), 'Date range.', true) + ->action(function ($projectId, $range, $response, $consoleDB, $projectDB, $register) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Utopia\Registry\Registry $register */ + + $project = $consoleDB->getDocument($projectId); + + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); + } + + $period = [ + '24h' => [ + 'start' => DateTime::createFromFormat('U', \strtotime('-24 hours')), + 'end' => DateTime::createFromFormat('U', \strtotime('+1 hour')), + 'group' => '30m', + ], + '7d' => [ + 'start' => DateTime::createFromFormat('U', \strtotime('-7 days')), + 'end' => DateTime::createFromFormat('U', \strtotime('now')), + 'group' => '1d', + ], + '30d' => [ + 'start' => DateTime::createFromFormat('U', \strtotime('-30 days')), + 'end' => DateTime::createFromFormat('U', \strtotime('now')), + 'group' => '1d', + ], + '90d' => [ + 'start' => DateTime::createFromFormat('U', \strtotime('-90 days')), + 'end' => DateTime::createFromFormat('U', \strtotime('now')), + 'group' => '1d', + ], + ]; + + $client = $register->get('influxdb'); + + $requests = []; + $network = []; + $functions = []; + + if ($client) { + $start = $period[$range]['start']->format(DateTime::RFC3339); + $end = $period[$range]['end']->format(DateTime::RFC3339); + $database = $client->selectDB('telegraf'); + + // Requests + $result = $database->query('SELECT sum(value) AS "value" FROM "appwrite_usage_requests_all" WHERE time > \''.$start.'\' AND time < \''.$end.'\' AND "metric_type"=\'counter\' AND "project"=\''.$project->getId().'\' GROUP BY time('.$period[$range]['group'].') FILL(null)'); + $points = $result->getPoints(); + + foreach ($points as $point) { + $requests[] = [ + 'value' => (!empty($point['value'])) ? $point['value'] : 0, + 'date' => \strtotime($point['time']), + ]; } - $response->json($project->getArrayCopy()); - } - ); + // Network + $result = $database->query('SELECT sum(value) AS "value" FROM "appwrite_usage_network_all" WHERE time > \''.$start.'\' AND time < \''.$end.'\' AND "metric_type"=\'counter\' AND "project"=\''.$project->getId().'\' GROUP BY time('.$period[$range]['group'].') FILL(null)'); + $points = $result->getPoints(); -$utopia->patch('/v1/projects/:projectId/oauth2') + foreach ($points as $point) { + $network[] = [ + 'value' => (!empty($point['value'])) ? $point['value'] : 0, + 'date' => \strtotime($point['time']), + ]; + } + + // Functions + $result = $database->query('SELECT sum(value) AS "value" FROM "appwrite_usage_executions_all" WHERE time > \''.$start.'\' AND time < \''.$end.'\' AND "metric_type"=\'counter\' AND "project"=\''.$project->getId().'\' GROUP BY time('.$period[$range]['group'].') FILL(null)'); + $points = $result->getPoints(); + + foreach ($points as $point) { + $functions[] = [ + 'value' => (!empty($point['value'])) ? $point['value'] : 0, + 'date' => \strtotime($point['time']), + ]; + } + } + + // Users + + $projectDB->getCollection([ + 'limit' => 0, + 'offset' => 0, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_USERS, + ], + ]); + + $usersTotal = $projectDB->getSum(); + + // Documents + + $collections = $projectDB->getCollection([ + 'limit' => 100, + 'offset' => 0, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_COLLECTIONS, + ], + ]); + + $collectionsTotal = $projectDB->getSum(); + + $documents = []; + + foreach ($collections as $collection) { + $result = $projectDB->getCollection([ + 'limit' => 0, + 'offset' => 0, + 'filters' => [ + '$collection='.$collection['$id'], + ], + ]); + + $documents[] = ['name' => $collection['name'], 'total' => $projectDB->getSum()]; + } + + // Tasks + $tasksTotal = \count($project->getAttribute('tasks', [])); + + $response->json([ + 'range' => $range, + 'requests' => [ + 'data' => $requests, + 'total' => \array_sum(\array_map(function ($item) { + return $item['value']; + }, $requests)), + ], + 'network' => [ + 'data' => \array_map(function ($value) {return ['value' => \round($value['value'] / 1000000, 2), 'date' => $value['date']];}, $network), // convert bytes to mb + 'total' => \array_sum(\array_map(function ($item) { + return $item['value']; + }, $network)), + ], + 'functions' => [ + 'data' => $functions, + 'total' => \array_sum(\array_map(function ($item) { + return $item['value']; + }, $functions)), + ], + 'collections' => [ + 'data' => $collections, + 'total' => $collectionsTotal, + ], + 'documents' => [ + 'data' => $documents, + 'total' => \array_sum(\array_map(function ($item) { + return $item['total']; + }, $documents)), + ], + 'users' => [ + 'data' => [], + 'total' => $usersTotal, + ], + 'tasks' => [ + 'data' => [], + 'total' => $tasksTotal, + ], + 'storage' => [ + 'total' => $projectDB->getCount( + [ + 'attribute' => 'sizeOriginal', + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_FILES, + ], + ] + ) + + $projectDB->getCount( + [ + 'attribute' => 'size', + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_TAGS, + ], + ] + ), + ], + ]); + }, ['response', 'consoleDB', 'projectDB', 'register']); + +App::patch('/v1/projects/:projectId') + ->desc('Update Project') + ->groups(['api', 'projects']) + ->label('scope', 'projects.write') + ->label('sdk.namespace', 'projects') + ->label('sdk.method', 'update') + ->param('projectId', '', new UID(), 'Project unique ID.') + ->param('name', null, new Text(128), 'Project name. Max length: 128 chars.') + ->param('description', '', new Text(256), 'Project description. Max length: 256 chars.', true) + ->param('logo', '', new Text(1024), 'Project logo.', true) + ->param('url', '', new URL(), 'Project URL.', true) + ->param('legalName', '', new Text(256), 'Project legal name. Max length: 256 chars.', true) + ->param('legalCountry', '', new Text(256), 'Project legal country. Max length: 256 chars.', true) + ->param('legalState', '', new Text(256), 'Project legal state. Max length: 256 chars.', true) + ->param('legalCity', '', new Text(256), 'Project legal city. Max length: 256 chars.', true) + ->param('legalAddress', '', new Text(256), 'Project legal address. Max length: 256 chars.', true) + ->param('legalTaxId', '', new Text(256), 'Project legal tax ID. Max length: 256 chars.', true) + ->action(function ($projectId, $name, $description, $logo, $url, $legalName, $legalCountry, $legalState, $legalCity, $legalAddress, $legalTaxId, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ + + $project = $consoleDB->getDocument($projectId); + + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); + } + + $project = $consoleDB->updateDocument(\array_merge($project->getArrayCopy(), [ + 'name' => $name, + 'description' => $description, + 'logo' => $logo, + 'url' => $url, + 'legalName' => $legalName, + 'legalCountry' => $legalCountry, + 'legalState' => $legalState, + 'legalCity' => $legalCity, + 'legalAddress' => $legalAddress, + 'legalTaxId' => $legalTaxId, + ])); + + if (false === $project) { + throw new Exception('Failed saving project to DB', 500); + } + + $response->dynamic($project, Response::MODEL_PROJECT); + }, ['response', 'consoleDB']); + +App::patch('/v1/projects/:projectId/oauth2') ->desc('Update Project OAuth2') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'updateOAuth2') - ->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(512); }, 'Provider secret key.', true) - ->action( - function ($projectId, $provider, $appId, $secret) use ($request, $response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', '', new UID(), 'Project unique ID.') + ->param('provider', '', new WhiteList(\array_keys(Config::getParam('providers')), true), 'Provider Name', false) + ->param('appId', '', new Text(256), 'Provider app ID. Max length: 256 chars.', true) + ->param('secret', '', new text(512), 'Provider secret key. Max length: 512 chars.', true) + ->action(function ($projectId, $provider, $appId, $secret, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $key = $request->getServer('_APP_OPENSSL_KEY_V1'); - $iv = OpenSSL::randomPseudoBytes(OpenSSL::cipherIVLength(OpenSSL::CIPHER_AES_128_GCM)); - $tag = null; - $secret = \json_encode([ - 'data' => OpenSSL::encrypt($secret, OpenSSL::CIPHER_AES_128_GCM, $key, 0, $iv, $tag), - 'method' => OpenSSL::CIPHER_AES_128_GCM, - 'iv' => \bin2hex($iv), - 'tag' => \bin2hex($tag), - 'version' => '1', - ]); - - $project = $consoleDB->updateDocument(\array_merge($project->getArrayCopy(), [ - 'usersOauth2'.\ucfirst($provider).'Appid' => $appId, - 'usersOauth2'.\ucfirst($provider).'Secret' => $secret, - ])); - - if (false === $project) { - throw new Exception('Failed saving project to DB', 500); - } - - $response->json($project->getArrayCopy()); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); -$utopia->delete('/v1/projects/:projectId') + $project = $consoleDB->updateDocument(\array_merge($project->getArrayCopy(), [ + 'usersOauth2'.\ucfirst($provider).'Appid' => $appId, + 'usersOauth2'.\ucfirst($provider).'Secret' => $secret, + ])); + + if (false === $project) { + throw new Exception('Failed saving project to DB', 500); + } + + $response->dynamic($project, Response::MODEL_PROJECT); + }, ['response', 'consoleDB']); + +App::delete('/v1/projects/:projectId') ->desc('Delete Project') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->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. Must be between 6 to 32 chars.') - ->action( - 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); - } + ->param('projectId', '', new UID(), 'Project unique ID.') + ->param('password', '', new UID(), 'Your user password for confirmation. Must be between 6 to 32 chars.') + ->action(function ($projectId, $password, $response, $user, $consoleDB, $deletes) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $user */ + /** @var Appwrite\Database\Database $consoleDB */ + /** @var Appwrite\Event\Event $deletes */ - $project = $consoleDB->getDocument($projectId); + if (!Auth::passwordVerify($password, $user->getAttribute('password'))) { // Double check user password + throw new Exception('Invalid credentials', 401); + } - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $deletes->setParam('document', $project->getArrayCopy()); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); + } - foreach (['keys', 'webhooks', 'tasks', 'platforms', 'domains'] as $key) { // Delete all children (keys, webhooks, tasks [stop tasks?], platforms) - $list = $project->getAttribute('webhooks', []); + $deletes->setParam('document', $project->getArrayCopy()); - foreach ($list as $document) { /* @var $document Document */ - if (!$consoleDB->deleteDocument($projectId)) { - throw new Exception('Failed to remove project document ('.$key.')] from DB', 500); - } + 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); - } - - $response->noContent(); } - ); + + 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); + } + + $response->noContent(); + }, ['response', 'user', 'consoleDB', 'deletes']); // Webhooks -$utopia->post('/v1/projects/:projectId/webhooks') +App::post('/v1/projects/:projectId/webhooks') ->desc('Create Webhook') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'createWebhook') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->param('name', null, function () { return new Text(256); }, 'Webhook name.') - ->param('events', null, function () { return new ArrayList(new Text(256)); }, 'Webhook events list.') - ->param('url', null, function () { return new Text(2000); }, 'Webhook URL.') - ->param('security', false, function () { return new Boolean(true); }, 'Certificate verification, false for disabled or true for enabled.') - ->param('httpUser', '', function () { return new Text(256); }, 'Webhook HTTP user.', true) - ->param('httpPass', '', function () { return new Text(256); }, 'Webhook HTTP password.', true) - ->action( - function ($projectId, $name, $events, $url, $security, $httpUser, $httpPass) use ($request, $response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->param('name', null, new Text(128), 'Webhook name. Max length: 128 chars.') + ->param('events', null, new ArrayList(new WhiteList(array_keys(Config::getParam('events'), true), true)), 'Events list.') + ->param('url', null, new URL(), 'Webhook URL.') + ->param('security', false, new Boolean(true), 'Certificate verification, false for disabled or true for enabled.') + ->param('httpUser', '', new Text(256), 'Webhook HTTP user. Max length: 256 chars.', true) + ->param('httpPass', '', new Text(256), 'Webhook HTTP password. Max length: 256 chars.', true) + ->action(function ($projectId, $name, $events, $url, $security, $httpUser, $httpPass, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $security = ($security === '1' || $security === 'true' || $security === 1 || $security === true); - $key = $request->getServer('_APP_OPENSSL_KEY_V1'); - $iv = OpenSSL::randomPseudoBytes(OpenSSL::cipherIVLength(OpenSSL::CIPHER_AES_128_GCM)); - $tag = null; - $httpPass = \json_encode([ - 'data' => OpenSSL::encrypt($httpPass, OpenSSL::CIPHER_AES_128_GCM, $key, 0, $iv, $tag), - 'method' => OpenSSL::CIPHER_AES_128_GCM, - 'iv' => \bin2hex($iv), - 'tag' => \bin2hex($tag), - 'version' => '1', - ]); - - $webhook = $consoleDB->createDocument([ - '$collection' => Database::SYSTEM_COLLECTION_WEBHOOKS, - '$permissions' => [ - 'read' => ['team:'.$project->getAttribute('teamId', null)], - 'write' => ['team:'.$project->getAttribute('teamId', null).'/owner', 'team:'.$project->getAttribute('teamId', null).'/developer'], - ], - 'name' => $name, - 'events' => $events, - 'url' => $url, - 'security' => (int) $security, - 'httpUser' => $httpUser, - 'httpPass' => $httpPass, - ]); - - if (false === $webhook) { - throw new Exception('Failed saving webhook to DB', 500); - } - - $project->setAttribute('webhooks', $webhook, Document::SET_TYPE_APPEND); - - $project = $consoleDB->updateDocument($project->getArrayCopy()); - - if (false === $project) { - throw new Exception('Failed saving project to DB', 500); - } - - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->json($webhook->getArrayCopy()) - ; + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); -$utopia->get('/v1/projects/:projectId/webhooks') + $security = ($security === '1' || $security === 'true' || $security === 1 || $security === true); + + $webhook = $consoleDB->createDocument([ + '$collection' => Database::SYSTEM_COLLECTION_WEBHOOKS, + '$permissions' => [ + 'read' => ['team:'.$project->getAttribute('teamId', null)], + 'write' => ['team:'.$project->getAttribute('teamId', null).'/owner', 'team:'.$project->getAttribute('teamId', null).'/developer'], + ], + 'name' => $name, + 'events' => $events, + 'url' => $url, + 'security' => $security, + 'httpUser' => $httpUser, + 'httpPass' => $httpPass, + ]); + + if (false === $webhook) { + throw new Exception('Failed saving webhook to DB', 500); + } + + $project->setAttribute('webhooks', $webhook, Document::SET_TYPE_APPEND); + + $project = $consoleDB->updateDocument($project->getArrayCopy()); + + if (false === $project) { + throw new Exception('Failed saving project to DB', 500); + } + + $response->setStatusCode(Response::STATUS_CODE_CREATED); + $response->dynamic($webhook, Response::MODEL_WEBHOOK); + }, ['response', 'consoleDB']); + +App::get('/v1/projects/:projectId/webhooks') ->desc('List Webhooks') ->groups(['api', 'projects']) ->label('scope', 'projects.read') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'listWebhooks') - ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.') - ->action( - function ($projectId) use ($request, $response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', '', new UID(), 'Project unique ID.') + ->action(function ($projectId, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $webhooks = $project->getAttribute('webhooks', []); - - foreach ($webhooks as $webhook) { /* @var $webhook Document */ - $httpPass = \json_decode($webhook->getAttribute('httpPass', '{}'), true); - - if (empty($httpPass) || !isset($httpPass['version'])) { - continue; - } - - $key = $request->getServer('_APP_OPENSSL_KEY_V'.$httpPass['version']); - - $webhook->setAttribute('httpPass', OpenSSL::decrypt($httpPass['data'], $httpPass['method'], $key, 0, \hex2bin($httpPass['iv']), \hex2bin($httpPass['tag']))); - } - - $response->json($webhooks); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); -$utopia->get('/v1/projects/:projectId/webhooks/:webhookId') + $webhooks = $project->getAttribute('webhooks', []); + + $response->dynamic(new Document([ + 'sum' => count($webhooks), + 'webhooks' => $webhooks + ]), Response::MODEL_WEBHOOK_LIST); + }, ['response', 'consoleDB']); + +App::get('/v1/projects/:projectId/webhooks/:webhookId') ->desc('Get Webhook') ->groups(['api', 'projects']) ->label('scope', 'projects.read') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'getWebhook') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->param('webhookId', null, function () { return new UID(); }, 'Webhook unique ID.') - ->action( - function ($projectId, $webhookId) use ($request, $response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->param('webhookId', null, new UID(), 'Webhook unique ID.') + ->action(function ($projectId, $webhookId, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $webhook = $project->search('$id', $webhookId, $project->getAttribute('webhooks', [])); - - if (empty($webhook) || !$webhook instanceof Document) { - throw new Exception('Webhook not found', 404); - } - - $httpPass = \json_decode($webhook->getAttribute('httpPass', '{}'), true); - - if (!empty($httpPass) && isset($httpPass['version'])) { - $key = $request->getServer('_APP_OPENSSL_KEY_V'.$httpPass['version']); - $webhook->setAttribute('httpPass', OpenSSL::decrypt($httpPass['data'], $httpPass['method'], $key, 0, \hex2bin($httpPass['iv']), \hex2bin($httpPass['tag']))); - } - - $response->json($webhook->getArrayCopy()); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); + $webhook = $project->search('$id', $webhookId, $project->getAttribute('webhooks', [])); -$utopia->put('/v1/projects/:projectId/webhooks/:webhookId') + if (empty($webhook) || !$webhook instanceof Document) { + throw new Exception('Webhook not found', 404); + } + + $response->dynamic($webhook, Response::MODEL_WEBHOOK); + }, ['response', 'consoleDB']); + +App::put('/v1/projects/:projectId/webhooks/:webhookId') ->desc('Update Webhook') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'updateWebhook') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->param('webhookId', null, function () { return new UID(); }, 'Webhook unique ID.') - ->param('name', null, function () { return new Text(256); }, 'Webhook name.') - ->param('events', null, function () { return new ArrayList(new Text(256)); }, 'Webhook events list.') - ->param('url', null, function () { return new Text(2000); }, 'Webhook URL.') - ->param('security', false, function () { return new Boolean(true); }, 'Certificate verification, false for disabled or true for enabled.') ->param('httpUser', '', function () { return new Text(256); }, 'Webhook HTTP user.', true) - ->param('httpPass', '', function () { return new Text(256); }, 'Webhook HTTP password.', true) - ->action( - function ($projectId, $webhookId, $name, $events, $url, $security, $httpUser, $httpPass) use ($request, $response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->param('webhookId', null, new UID(), 'Webhook unique ID.') + ->param('name', null, new Text(128), 'Webhook name. Max length: 128 chars.') + ->param('events', null, new ArrayList(new WhiteList(array_keys(Config::getParam('events'), true), true)), 'Events list.') + ->param('url', null, new URL(), 'Webhook URL.') + ->param('security', false, new Boolean(true), 'Certificate verification, false for disabled or true for enabled.') + ->param('httpUser', '', new Text(256), 'Webhook HTTP user. Max length: 256 chars.', true) + ->param('httpPass', '', new Text(256), 'Webhook HTTP password. Max length: 256 chars.', true) + ->action(function ($projectId, $webhookId, $name, $events, $url, $security, $httpUser, $httpPass, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $security = ($security === '1' || $security === 'true' || $security === 1 || $security === true); - $key = $request->getServer('_APP_OPENSSL_KEY_V1'); - $iv = OpenSSL::randomPseudoBytes(OpenSSL::cipherIVLength(OpenSSL::CIPHER_AES_128_GCM)); - $tag = null; - $httpPass = \json_encode([ - 'data' => OpenSSL::encrypt($httpPass, OpenSSL::CIPHER_AES_128_GCM, $key, 0, $iv, $tag), - 'method' => OpenSSL::CIPHER_AES_128_GCM, - 'iv' => \bin2hex($iv), - 'tag' => \bin2hex($tag), - 'version' => '1', - ]); - - $webhook = $project->search('$id', $webhookId, $project->getAttribute('webhooks', [])); - - if (empty($webhook) || !$webhook instanceof Document) { - throw new Exception('Webhook not found', 404); - } - - $webhook - ->setAttribute('name', $name) - ->setAttribute('events', $events) - ->setAttribute('url', $url) - ->setAttribute('security', (int) $security) - ->setAttribute('httpUser', $httpUser) - ->setAttribute('httpPass', $httpPass) - ; - - if (false === $consoleDB->updateDocument($webhook->getArrayCopy())) { - throw new Exception('Failed saving webhook to DB', 500); - } - - $response->json($webhook->getArrayCopy()); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); -$utopia->delete('/v1/projects/:projectId/webhooks/:webhookId') + $security = ($security === '1' || $security === 'true' || $security === 1 || $security === true); + + $webhook = $project->search('$id', $webhookId, $project->getAttribute('webhooks', [])); + + if (empty($webhook) || !$webhook instanceof Document) { + throw new Exception('Webhook not found', 404); + } + + $webhook + ->setAttribute('name', $name) + ->setAttribute('events', $events) + ->setAttribute('url', $url) + ->setAttribute('security', $security) + ->setAttribute('httpUser', $httpUser) + ->setAttribute('httpPass', $httpPass) + ; + + if (false === $consoleDB->updateDocument($webhook->getArrayCopy())) { + throw new Exception('Failed saving webhook to DB', 500); + } + + $response->dynamic($webhook, Response::MODEL_WEBHOOK); + }, ['response', 'consoleDB']); + +App::delete('/v1/projects/:projectId/webhooks/:webhookId') ->desc('Delete Webhook') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'deleteWebhook') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->param('webhookId', null, function () { return new UID(); }, 'Webhook unique ID.') - ->action( - function ($projectId, $webhookId) use ($response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->param('webhookId', null, new UID(), 'Webhook unique ID.') + ->action(function ($projectId, $webhookId, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $webhook = $project->search('$id', $webhookId, $project->getAttribute('webhooks', [])); - - if (empty($webhook) || !$webhook instanceof Document) { - throw new Exception('Webhook not found', 404); - } - - if (!$consoleDB->deleteDocument($webhook->getId())) { - throw new Exception('Failed to remove webhook from DB', 500); - } - - $response->noContent(); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); + + $webhook = $project->search('$id', $webhookId, $project->getAttribute('webhooks', [])); + + if (empty($webhook) || !$webhook instanceof Document) { + throw new Exception('Webhook not found', 404); + } + + if (!$consoleDB->deleteDocument($webhook->getId())) { + throw new Exception('Failed to remove webhook from DB', 500); + } + + $response->noContent(); + }, ['response', 'consoleDB']); // Keys -$utopia->post('/v1/projects/:projectId/keys') +App::post('/v1/projects/:projectId/keys') ->desc('Create Key') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'createKey') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->param('name', null, function () { return new Text(256); }, 'Key name.') - ->param('scopes', null, function () use ($scopes) { return new ArrayList(new WhiteList($scopes)); }, 'Key scopes list.') - ->action( - function ($projectId, $name, $scopes) use ($response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') + ->param('scopes', null, new ArrayList(new WhiteList(Config::getParam('scopes'), true)), 'Key scopes list.') + ->action(function ($projectId, $name, $scopes, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $key = $consoleDB->createDocument([ - '$collection' => Database::SYSTEM_COLLECTION_KEYS, - '$permissions' => [ - 'read' => ['team:'.$project->getAttribute('teamId', null)], - 'write' => ['team:'.$project->getAttribute('teamId', null).'/owner', 'team:'.$project->getAttribute('teamId', null).'/developer'], - ], - 'name' => $name, - 'scopes' => $scopes, - 'secret' => \bin2hex(\random_bytes(128)), - ]); - - if (false === $key) { - throw new Exception('Failed saving key to DB', 500); - } - - $project->setAttribute('keys', $key, Document::SET_TYPE_APPEND); - - $project = $consoleDB->updateDocument($project->getArrayCopy()); - - if (false === $project) { - throw new Exception('Failed saving project to DB', 500); - } - - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->json($key->getArrayCopy()) - ; + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); -$utopia->get('/v1/projects/:projectId/keys') + $key = $consoleDB->createDocument([ + '$collection' => Database::SYSTEM_COLLECTION_KEYS, + '$permissions' => [ + 'read' => ['team:'.$project->getAttribute('teamId', null)], + 'write' => ['team:'.$project->getAttribute('teamId', null).'/owner', 'team:'.$project->getAttribute('teamId', null).'/developer'], + ], + 'name' => $name, + 'scopes' => $scopes, + 'secret' => \bin2hex(\random_bytes(128)), + ]); + + if (false === $key) { + throw new Exception('Failed saving key to DB', 500); + } + + $project->setAttribute('keys', $key, Document::SET_TYPE_APPEND); + + $project = $consoleDB->updateDocument($project->getArrayCopy()); + + if (false === $project) { + throw new Exception('Failed saving project to DB', 500); + } + + $response->setStatusCode(Response::STATUS_CODE_CREATED); + $response->dynamic($key, Response::MODEL_KEY); + }, ['response', 'consoleDB']); + +App::get('/v1/projects/:projectId/keys') ->desc('List Keys') ->groups(['api', 'projects']) ->label('scope', 'projects.read') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'listKeys') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->action( - function ($projectId) use ($response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->action(function ($projectId, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ + + $project = $consoleDB->getDocument($projectId); - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } - - $response->json($project->getAttribute('keys', [])); //FIXME make sure array objects return correctly + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); -$utopia->get('/v1/projects/:projectId/keys/:keyId') + $keys = $project->getAttribute('keys', []); + + $response->dynamic(new Document([ + 'sum' => count($keys), + 'keys' => $keys + ]), Response::MODEL_KEY_LIST); + }, ['response', 'consoleDB']); + +App::get('/v1/projects/:projectId/keys/:keyId') ->desc('Get Key') ->groups(['api', 'projects']) ->label('scope', 'projects.read') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'getKey') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->param('keyId', null, function () { return new UID(); }, 'Key unique ID.') - ->action( - function ($projectId, $keyId) use ($response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->param('keyId', null, new UID(), 'Key unique ID.') + ->action(function ($projectId, $keyId, $response, $consoleDB) { + $project = $consoleDB->getDocument($projectId); - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } - - $key = $project->search('$id', $keyId, $project->getAttribute('keys', [])); - - if (empty($key) || !$key instanceof Document) { - throw new Exception('Key not found', 404); - } - - $response->json($key->getArrayCopy()); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); -$utopia->put('/v1/projects/:projectId/keys/:keyId') + $key = $project->search('$id', $keyId, $project->getAttribute('keys', [])); + + if (empty($key) || !$key instanceof Document) { + throw new Exception('Key not found', 404); + } + + $response->dynamic($key, Response::MODEL_KEY); + }, ['response', 'consoleDB']); + +App::put('/v1/projects/:projectId/keys/:keyId') ->desc('Update Key') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'updateKey') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->param('keyId', null, function () { return new UID(); }, 'Key unique ID.') - ->param('name', null, function () { return new Text(256); }, 'Key name.') - ->param('scopes', null, function () use ($scopes) { return new ArrayList(new WhiteList($scopes)); }, 'Key scopes list') - ->action( - function ($projectId, $keyId, $name, $scopes) use ($response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->param('keyId', null, new UID(), 'Key unique ID.') + ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') + ->param('scopes', null, new ArrayList(new WhiteList(Config::getParam('scopes'), true)), 'Key scopes list') + ->action(function ($projectId, $keyId, $name, $scopes, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $key = $project->search('$id', $keyId, $project->getAttribute('keys', [])); - - if (empty($key) || !$key instanceof Document) { - throw new Exception('Key not found', 404); - } - - $key - ->setAttribute('name', $name) - ->setAttribute('scopes', $scopes) - ; - - if (false === $consoleDB->updateDocument($key->getArrayCopy())) { - throw new Exception('Failed saving key to DB', 500); - } - - $response->json($key->getArrayCopy()); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); -$utopia->delete('/v1/projects/:projectId/keys/:keyId') + $key = $project->search('$id', $keyId, $project->getAttribute('keys', [])); + + if (empty($key) || !$key instanceof Document) { + throw new Exception('Key not found', 404); + } + + $key + ->setAttribute('name', $name) + ->setAttribute('scopes', $scopes) + ; + + if (false === $consoleDB->updateDocument($key->getArrayCopy())) { + throw new Exception('Failed saving key to DB', 500); + } + + $response->dynamic($key, Response::MODEL_KEY); + }, ['response', 'consoleDB']); + +App::delete('/v1/projects/:projectId/keys/:keyId') ->desc('Delete Key') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'deleteKey') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->param('keyId', null, function () { return new UID(); }, 'Key unique ID.') - ->action( - function ($projectId, $keyId) use ($response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->param('keyId', null, new UID(), 'Key unique ID.') + ->action(function ($projectId, $keyId, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $key = $project->search('$id', $keyId, $project->getAttribute('keys', [])); - - if (empty($key) || !$key instanceof Document) { - throw new Exception('Key not found', 404); - } - - if (!$consoleDB->deleteDocument($key->getId())) { - throw new Exception('Failed to remove key from DB', 500); - } - - $response->noContent(); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); + + $key = $project->search('$id', $keyId, $project->getAttribute('keys', [])); + + if (empty($key) || !$key instanceof Document) { + throw new Exception('Key not found', 404); + } + + if (!$consoleDB->deleteDocument($key->getId())) { + throw new Exception('Failed to remove key from DB', 500); + } + + $response->noContent(); + }, ['response', 'consoleDB']); // Tasks -$utopia->post('/v1/projects/:projectId/tasks') +App::post('/v1/projects/:projectId/tasks') ->desc('Create Task') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'createTask') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->param('name', null, function () { return new Text(256); }, 'Task name.') - ->param('status', null, function () { return new WhiteList(['play', 'pause']); }, 'Task status.') - ->param('schedule', null, function () { return new Cron(); }, 'Task schedule CRON syntax.') - ->param('security', false, function () { return new Boolean(true); }, 'Certificate verification, false for disabled or true for enabled.') ->param('httpMethod', '', function () { return new WhiteList(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT']); }, 'Task HTTP method.') - ->param('httpUrl', '', function () { return new URL(); }, 'Task HTTP URL') - ->param('httpHeaders', null, function () { return new ArrayList(new Text(256)); }, 'Task HTTP headers list.', true) - ->param('httpUser', '', function () { return new Text(256); }, 'Task HTTP user.', true) - ->param('httpPass', '', function () { return new Text(256); }, 'Task HTTP password.', true) - ->action( - function ($projectId, $name, $status, $schedule, $security, $httpMethod, $httpUrl, $httpHeaders, $httpUser, $httpPass) use ($request, $response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->param('name', null, new Text(128), 'Task name. Max length: 128 chars.') + ->param('status', null, new WhiteList(['play', 'pause'], true), 'Task status.') + ->param('schedule', null, new Cron(), 'Task schedule CRON syntax.') + ->param('security', false, new Boolean(true), 'Certificate verification, false for disabled or true for enabled.') + ->param('httpMethod', '', new WhiteList(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'], true), 'Task HTTP method.') + ->param('httpUrl', '', new URL(), 'Task HTTP URL') + ->param('httpHeaders', null, new ArrayList(new Text(256)), 'Task HTTP headers list.', true) + ->param('httpUser', '', new Text(256), 'Task HTTP user. Max length: 256 chars.', true) + ->param('httpPass', '', new Text(256), 'Task HTTP password. Max length: 256 chars.', true) + ->action(function ($projectId, $name, $status, $schedule, $security, $httpMethod, $httpUrl, $httpHeaders, $httpUser, $httpPass, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $cron = CronExpression::factory($schedule); - $next = ($status == 'play') ? $cron->getNextRunDate()->format('U') : null; - - $security = ($security === '1' || $security === 'true' || $security === 1 || $security === true); - $key = $request->getServer('_APP_OPENSSL_KEY_V1'); - $iv = OpenSSL::randomPseudoBytes(OpenSSL::cipherIVLength(OpenSSL::CIPHER_AES_128_GCM)); - $tag = null; - $httpPass = \json_encode([ - 'data' => OpenSSL::encrypt($httpPass, OpenSSL::CIPHER_AES_128_GCM, $key, 0, $iv, $tag), - 'method' => OpenSSL::CIPHER_AES_128_GCM, - 'iv' => \bin2hex($iv), - 'tag' => \bin2hex($tag), - 'version' => '1', - ]); - - $task = $consoleDB->createDocument([ - '$collection' => Database::SYSTEM_COLLECTION_TASKS, - '$permissions' => [ - 'read' => ['team:'.$project->getAttribute('teamId', null)], - 'write' => ['team:'.$project->getAttribute('teamId', null).'/owner', 'team:'.$project->getAttribute('teamId', null).'/developer'], - ], - 'name' => $name, - 'status' => $status, - 'schedule' => $schedule, - 'updated' => \time(), - 'previous' => null, - 'next' => $next, - 'security' => (int) $security, - 'httpMethod' => $httpMethod, - 'httpUrl' => $httpUrl, - 'httpHeaders' => $httpHeaders, - 'httpUser' => $httpUser, - 'httpPass' => $httpPass, - 'log' => '{}', - 'failures' => 0, - ]); - - if (false === $task) { - throw new Exception('Failed saving tasks to DB', 500); - } - - $project->setAttribute('tasks', $task, Document::SET_TYPE_APPEND); - - $project = $consoleDB->updateDocument($project->getArrayCopy()); - - if (false === $project) { - throw new Exception('Failed saving project to DB', 500); - } - - if ($next) { - ResqueScheduler::enqueueAt($next, 'v1-tasks', 'TasksV1', $task->getArrayCopy()); - } - - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->json($task->getArrayCopy()) - ; + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); -$utopia->get('/v1/projects/:projectId/tasks') + $cron = CronExpression::factory($schedule); + $next = ($status == 'play') ? $cron->getNextRunDate()->format('U') : null; + + $security = ($security === '1' || $security === 'true' || $security === 1 || $security === true); + + $task = $consoleDB->createDocument([ + '$collection' => Database::SYSTEM_COLLECTION_TASKS, + '$permissions' => [ + 'read' => ['team:'.$project->getAttribute('teamId', null)], + 'write' => ['team:'.$project->getAttribute('teamId', null).'/owner', 'team:'.$project->getAttribute('teamId', null).'/developer'], + ], + 'name' => $name, + 'status' => $status, + 'schedule' => $schedule, + 'updated' => \time(), + 'previous' => null, + 'next' => $next, + 'security' => $security, + 'httpMethod' => $httpMethod, + 'httpUrl' => $httpUrl, + 'httpHeaders' => $httpHeaders, + 'httpUser' => $httpUser, + 'httpPass' => $httpPass, + 'log' => '{}', + 'failures' => 0, + ]); + + if (false === $task) { + throw new Exception('Failed saving tasks to DB', 500); + } + + $project->setAttribute('tasks', $task, Document::SET_TYPE_APPEND); + + $project = $consoleDB->updateDocument($project->getArrayCopy()); + + if (false === $project) { + throw new Exception('Failed saving project to DB', 500); + } + + if ($next) { + ResqueScheduler::enqueueAt($next, 'v1-tasks', 'TasksV1', $task->getArrayCopy()); + } + + $response->setStatusCode(Response::STATUS_CODE_CREATED); + $response->dynamic($task, Response::MODEL_TASK); + }, ['response', 'consoleDB']); + +App::get('/v1/projects/:projectId/tasks') ->desc('List Tasks') ->groups(['api', 'projects']) ->label('scope', 'projects.read') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'listTasks') - ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.') - ->action( - function ($projectId) use ($request, $response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', '', new UID(), 'Project unique ID.') + ->action(function ($projectId, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $tasks = $project->getAttribute('tasks', []); - - foreach ($tasks as $task) { /* @var $task Document */ - $httpPass = \json_decode($task->getAttribute('httpPass', '{}'), true); - - if (empty($httpPass) || !isset($httpPass['version'])) { - continue; - } - - $key = $request->getServer('_APP_OPENSSL_KEY_V'.$httpPass['version']); - - $task->setAttribute('httpPass', OpenSSL::decrypt($httpPass['data'], $httpPass['method'], $key, 0, \hex2bin($httpPass['iv']), \hex2bin($httpPass['tag']))); - } - - $response->json($tasks); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); -$utopia->get('/v1/projects/:projectId/tasks/:taskId') + $tasks = $project->getAttribute('tasks', []); + + $response->dynamic(new Document([ + 'sum' => count($tasks), + 'tasks' => $tasks + ]), Response::MODEL_TASK_LIST); + + }, ['response', 'consoleDB']); + +App::get('/v1/projects/:projectId/tasks/:taskId') ->desc('Get Task') ->groups(['api', 'projects']) ->label('scope', 'projects.read') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'getTask') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->param('taskId', null, function () { return new UID(); }, 'Task unique ID.') - ->action( - function ($projectId, $taskId) use ($request, $response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->param('taskId', null, new UID(), 'Task unique ID.') + ->action(function ($projectId, $taskId, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $task = $project->search('$id', $taskId, $project->getAttribute('tasks', [])); - - if (empty($task) || !$task instanceof Document) { - throw new Exception('Task not found', 404); - } - - $httpPass = \json_decode($task->getAttribute('httpPass', '{}'), true); - - if (!empty($httpPass) && isset($httpPass['version'])) { - $key = $request->getServer('_APP_OPENSSL_KEY_V'.$httpPass['version']); - $task->setAttribute('httpPass', OpenSSL::decrypt($httpPass['data'], $httpPass['method'], $key, 0, \hex2bin($httpPass['iv']), \hex2bin($httpPass['tag']))); - } - - $response->json($task->getArrayCopy()); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); -$utopia->put('/v1/projects/:projectId/tasks/:taskId') + $task = $project->search('$id', $taskId, $project->getAttribute('tasks', [])); + + if (empty($task) || !$task instanceof Document) { + throw new Exception('Task not found', 404); + } + + $response->dynamic($task, Response::MODEL_TASK); + }, ['response', 'consoleDB']); + +App::put('/v1/projects/:projectId/tasks/:taskId') ->desc('Update Task') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'updateTask') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->param('taskId', null, function () { return new UID(); }, 'Task unique ID.') - ->param('name', null, function () { return new Text(256); }, 'Task name.') - ->param('status', null, function () { return new WhiteList(['play', 'pause']); }, 'Task status.') - ->param('schedule', null, function () { return new Cron(); }, 'Task schedule CRON syntax.') - ->param('security', false, function () { return new Boolean(true); }, 'Certificate verification, false for disabled or true for enabled.') - ->param('httpMethod', '', function () { return new WhiteList(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT']); }, 'Task HTTP method.') - ->param('httpUrl', '', function () { return new URL(); }, 'Task HTTP URL.') - ->param('httpHeaders', null, function () { return new ArrayList(new Text(256)); }, 'Task HTTP headers list.', true) - ->param('httpUser', '', function () { return new Text(256); }, 'Task HTTP user.', true) - ->param('httpPass', '', function () { return new Text(256); }, 'Task HTTP password.', true) - ->action( - function ($projectId, $taskId, $name, $status, $schedule, $security, $httpMethod, $httpUrl, $httpHeaders, $httpUser, $httpPass) use ($request, $response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->param('taskId', null, new UID(), 'Task unique ID.') + ->param('name', null, new Text(128), 'Task name. Max length: 128 chars.') + ->param('status', null, new WhiteList(['play', 'pause'], true), 'Task status.') + ->param('schedule', null, new Cron(), 'Task schedule CRON syntax.') + ->param('security', false, new Boolean(true), 'Certificate verification, false for disabled or true for enabled.') + ->param('httpMethod', '', new WhiteList(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'], true), 'Task HTTP method.') + ->param('httpUrl', '', new URL(), 'Task HTTP URL.') + ->param('httpHeaders', null, new ArrayList(new Text(256)), 'Task HTTP headers list.', true) + ->param('httpUser', '', new Text(256), 'Task HTTP user. Max length: 256 chars.', true) + ->param('httpPass', '', new Text(256), 'Task HTTP password. Max length: 256 chars.', true) + ->action(function ($projectId, $taskId, $name, $status, $schedule, $security, $httpMethod, $httpUrl, $httpHeaders, $httpUser, $httpPass, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $task = $project->search('$id', $taskId, $project->getAttribute('tasks', [])); - - if (empty($task) || !$task instanceof Document) { - throw new Exception('Task not found', 404); - } - - $cron = CronExpression::factory($schedule); - $next = ($status == 'play') ? $cron->getNextRunDate()->format('U') : null; - - $security = ($security === '1' || $security === 'true' || $security === 1 || $security === true); - $key = $request->getServer('_APP_OPENSSL_KEY_V1'); - $iv = OpenSSL::randomPseudoBytes(OpenSSL::cipherIVLength(OpenSSL::CIPHER_AES_128_GCM)); - $tag = null; - $httpPass = \json_encode([ - 'data' => OpenSSL::encrypt($httpPass, OpenSSL::CIPHER_AES_128_GCM, $key, 0, $iv, $tag), - 'method' => OpenSSL::CIPHER_AES_128_GCM, - 'iv' => \bin2hex($iv), - 'tag' => \bin2hex($tag), - 'version' => '1', - ]); - - $task - ->setAttribute('name', $name) - ->setAttribute('status', $status) - ->setAttribute('schedule', $schedule) - ->setAttribute('updated', \time()) - ->setAttribute('next', $next) - ->setAttribute('security', (int) $security) - ->setAttribute('httpMethod', $httpMethod) - ->setAttribute('httpUrl', $httpUrl) - ->setAttribute('httpHeaders', $httpHeaders) - ->setAttribute('httpUser', $httpUser) - ->setAttribute('httpPass', $httpPass) - ; - - if (false === $consoleDB->updateDocument($task->getArrayCopy())) { - throw new Exception('Failed saving tasks to DB', 500); - } - - if ($next) { - ResqueScheduler::enqueueAt($next, 'v1-tasks', 'TasksV1', $task->getArrayCopy()); - } - - $response->json($task->getArrayCopy()); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); -$utopia->delete('/v1/projects/:projectId/tasks/:taskId') + $task = $project->search('$id', $taskId, $project->getAttribute('tasks', [])); + + if (empty($task) || !$task instanceof Document) { + throw new Exception('Task not found', 404); + } + + $cron = CronExpression::factory($schedule); + $next = ($status == 'play') ? $cron->getNextRunDate()->format('U') : null; + + $security = ($security === '1' || $security === 'true' || $security === 1 || $security === true); + + $task + ->setAttribute('name', $name) + ->setAttribute('status', $status) + ->setAttribute('schedule', $schedule) + ->setAttribute('updated', \time()) + ->setAttribute('next', $next) + ->setAttribute('security', $security) + ->setAttribute('httpMethod', $httpMethod) + ->setAttribute('httpUrl', $httpUrl) + ->setAttribute('httpHeaders', $httpHeaders) + ->setAttribute('httpUser', $httpUser) + ->setAttribute('httpPass', $httpPass) + ; + + if (false === $consoleDB->updateDocument($task->getArrayCopy())) { + throw new Exception('Failed saving tasks to DB', 500); + } + + if ($next) { + ResqueScheduler::enqueueAt($next, 'v1-tasks', 'TasksV1', $task->getArrayCopy()); + } + + $response->dynamic($task, Response::MODEL_TASK); + }, ['response', 'consoleDB']); + +App::delete('/v1/projects/:projectId/tasks/:taskId') ->desc('Delete Task') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'deleteTask') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->param('taskId', null, function () { return new UID(); }, 'Task unique ID.') - ->action( - function ($projectId, $taskId) use ($response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->param('taskId', null, new UID(), 'Task unique ID.') + ->action(function ($projectId, $taskId, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $task = $project->search('$id', $taskId, $project->getAttribute('tasks', [])); - - if (empty($task) || !$task instanceof Document) { - throw new Exception('Task not found', 404); - } - - if (!$consoleDB->deleteDocument($task->getId())) { - throw new Exception('Failed to remove tasks from DB', 500); - } - - $response->noContent(); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); + + $task = $project->search('$id', $taskId, $project->getAttribute('tasks', [])); + + if (empty($task) || !$task instanceof Document) { + throw new Exception('Task not found', 404); + } + + if (!$consoleDB->deleteDocument($task->getId())) { + throw new Exception('Failed to remove tasks from DB', 500); + } + + $response->noContent(); + }, ['response', 'consoleDB']); // Platforms -$utopia->post('/v1/projects/:projectId/platforms') +App::post('/v1/projects/:projectId/platforms') ->desc('Create Platform') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'createPlatform') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->param('type', null, function () { return new WhiteList(['web', 'flutter-ios', 'flutter-android', 'ios', 'android', 'unity']); }, 'Platform type.') - ->param('name', null, function () { return new Text(256); }, 'Platform name.') - ->param('key', '', function () { return new Text(256); }, 'Package name for android or bundle ID for iOS.', true) - ->param('store', '', function () { return new Text(256); }, 'App store or Google Play store ID.', true) - ->param('hostname', '', function () { return new Text(256); }, 'Platform client hostname.', true) - ->action( - function ($projectId, $type, $name, $key, $store, $hostname) use ($response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->param('type', null, new WhiteList(['web', 'flutter-ios', 'flutter-android', 'ios', 'android', 'unity'], true), 'Platform type.') + ->param('name', null, new Text(128), 'Platform name. Max length: 128 chars.') + ->param('key', '', new Text(256), 'Package name for android or bundle ID for iOS. Max length: 256 chars.', true) + ->param('store', '', new Text(256), 'App store or Google Play store ID. Max length: 256 chars.', true) + ->param('hostname', '', new Text(256), 'Platform client hostname. Max length: 256 chars.', true) + ->action(function ($projectId, $type, $name, $key, $store, $hostname, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $platform = $consoleDB->createDocument([ - '$collection' => Database::SYSTEM_COLLECTION_PLATFORMS, - '$permissions' => [ - 'read' => ['team:'.$project->getAttribute('teamId', null)], - 'write' => ['team:'.$project->getAttribute('teamId', null).'/owner', 'team:'.$project->getAttribute('teamId', null).'/developer'], - ], - 'type' => $type, - 'name' => $name, - 'key' => $key, - 'store' => $store, - 'hostname' => $hostname, - 'dateCreated' => \time(), - 'dateUpdated' => \time(), - ]); - - if (false === $platform) { - throw new Exception('Failed saving platform to DB', 500); - } - - $project->setAttribute('platforms', $platform, Document::SET_TYPE_APPEND); - - $project = $consoleDB->updateDocument($project->getArrayCopy()); - - if (false === $project) { - throw new Exception('Failed saving project to DB', 500); - } - - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->json($platform->getArrayCopy()) - ; + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); + + $platform = $consoleDB->createDocument([ + '$collection' => Database::SYSTEM_COLLECTION_PLATFORMS, + '$permissions' => [ + 'read' => ['team:'.$project->getAttribute('teamId', null)], + 'write' => ['team:'.$project->getAttribute('teamId', null).'/owner', 'team:'.$project->getAttribute('teamId', null).'/developer'], + ], + 'type' => $type, + 'name' => $name, + 'key' => $key, + 'store' => $store, + 'hostname' => $hostname, + 'dateCreated' => \time(), + 'dateUpdated' => \time(), + ]); + + if (false === $platform) { + throw new Exception('Failed saving platform to DB', 500); + } + + $project->setAttribute('platforms', $platform, Document::SET_TYPE_APPEND); + + $project = $consoleDB->updateDocument($project->getArrayCopy()); + + if (false === $project) { + throw new Exception('Failed saving project to DB', 500); + } + + $response->setStatusCode(Response::STATUS_CODE_CREATED); + $response->dynamic($platform, Response::MODEL_PLATFORM); + }, ['response', 'consoleDB']); -$utopia->get('/v1/projects/:projectId/platforms') +App::get('/v1/projects/:projectId/platforms') ->desc('List Platforms') ->groups(['api', 'projects']) ->label('scope', 'projects.read') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'listPlatforms') - ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.') - ->action( - function ($projectId) use ($response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', '', new UID(), 'Project unique ID.') + ->action(function ($projectId, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $platforms = $project->getAttribute('platforms', []); - - $response->json($platforms); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); -$utopia->get('/v1/projects/:projectId/platforms/:platformId') + $platforms = $project->getAttribute('platforms', []); + + $response->dynamic(new Document([ + 'sum' => count($platforms), + 'platforms' => $platforms + ]), Response::MODEL_PLATFORM_LIST); + }, ['response', 'consoleDB']); + +App::get('/v1/projects/:projectId/platforms/:platformId') ->desc('Get Platform') ->groups(['api', 'projects']) ->label('scope', 'projects.read') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'getPlatform') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->param('platformId', null, function () { return new UID(); }, 'Platform unique ID.') - ->action( - function ($projectId, $platformId) use ($response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->param('platformId', null, new UID(), 'Platform unique ID.') + ->action(function ($projectId, $platformId, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $platform = $project->search('$id', $platformId, $project->getAttribute('platforms', [])); - - if (empty($platform) || !$platform instanceof Document) { - throw new Exception('Platform not found', 404); - } - - $response->json($platform->getArrayCopy()); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); -$utopia->put('/v1/projects/:projectId/platforms/:platformId') + $platform = $project->search('$id', $platformId, $project->getAttribute('platforms', [])); + + if (empty($platform) || !$platform instanceof Document) { + throw new Exception('Platform not found', 404); + } + + $response->dynamic($platform, Response::MODEL_PLATFORM); + }, ['response', 'consoleDB']); + +App::put('/v1/projects/:projectId/platforms/:platformId') ->desc('Update Platform') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'updatePlatform') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->param('platformId', null, function () { return new UID(); }, 'Platform unique ID.') - ->param('name', null, function () { return new Text(256); }, 'Platform name.') - ->param('key', '', function () { return new Text(256); }, 'Package name for android or bundle ID for iOS.', true) - ->param('store', '', function () { return new Text(256); }, 'App store or Google Play store ID.', true) - ->param('hostname', '', function () { return new Text(256); }, 'Platform client URL.', true) - ->action( - function ($projectId, $platformId, $name, $key, $store, $hostname) use ($response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->param('platformId', null, new UID(), 'Platform unique ID.') + ->param('name', null, new Text(128), 'Platform name. Max length: 128 chars.') + ->param('key', '', new Text(256), 'Package name for android or bundle ID for iOS. Max length: 256 chars.', true) + ->param('store', '', new Text(256), 'App store or Google Play store ID. Max length: 256 chars.', true) + ->param('hostname', '', new Text(256), 'Platform client URL. Max length: 256 chars.', true) + ->action(function ($projectId, $platformId, $name, $key, $store, $hostname, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $platform = $project->search('$id', $platformId, $project->getAttribute('platforms', [])); - - if (empty($platform) || !$platform instanceof Document) { - throw new Exception('Platform not found', 404); - } - - $platform - ->setAttribute('name', $name) - ->setAttribute('dateUpdated', \time()) - ->setAttribute('key', $key) - ->setAttribute('store', $store) - ->setAttribute('hostname', $hostname) - ; - - if (false === $consoleDB->updateDocument($platform->getArrayCopy())) { - throw new Exception('Failed saving platform to DB', 500); - } - - $response->json($platform->getArrayCopy()); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); -$utopia->delete('/v1/projects/:projectId/platforms/:platformId') + $platform = $project->search('$id', $platformId, $project->getAttribute('platforms', [])); + + if (empty($platform) || !$platform instanceof Document) { + throw new Exception('Platform not found', 404); + } + + $platform + ->setAttribute('name', $name) + ->setAttribute('dateUpdated', \time()) + ->setAttribute('key', $key) + ->setAttribute('store', $store) + ->setAttribute('hostname', $hostname) + ; + + if (false === $consoleDB->updateDocument($platform->getArrayCopy())) { + throw new Exception('Failed saving platform to DB', 500); + } + + $response->dynamic($platform, Response::MODEL_PLATFORM); + }, ['response', 'consoleDB']); + +App::delete('/v1/projects/:projectId/platforms/:platformId') ->desc('Delete Platform') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'deletePlatform') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->param('platformId', null, function () { return new UID(); }, 'Platform unique ID.') - ->action( - function ($projectId, $platformId) use ($response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->param('platformId', null, new UID(), 'Platform unique ID.') + ->action(function ($projectId, $platformId, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $platform = $project->search('$id', $platformId, $project->getAttribute('platforms', [])); - - if (empty($platform) || !$platform instanceof Document) { - throw new Exception('Platform not found', 404); - } - - if (!$consoleDB->deleteDocument($platform->getId())) { - throw new Exception('Failed to remove platform from DB', 500); - } - - $response->noContent(); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); + + $platform = $project->search('$id', $platformId, $project->getAttribute('platforms', [])); + + if (empty($platform) || !$platform instanceof Document) { + throw new Exception('Platform not found', 404); + } + + if (!$consoleDB->deleteDocument($platform->getId())) { + throw new Exception('Failed to remove platform from DB', 500); + } + + $response->noContent(); + }, ['response', 'consoleDB']); // Domains -$utopia->post('/v1/projects/:projectId/domains') +App::post('/v1/projects/:projectId/domains') ->desc('Create Domain') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'createDomain') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->param('domain', null, function () { return new DomainValidator(); }, 'Domain name.') - ->action( - function ($projectId, $domain) use ($request, $response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->param('domain', null, new DomainValidator(), 'Domain name.') + ->action(function ($projectId, $domain, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $document = $project->search('domain', $domain, $project->getAttribute('domains', [])); - - if (!empty($document)) { - throw new Exception('Domain already exists', 409); - } - - $target = new Domain($request->getServer('_APP_DOMAIN_TARGET', '')); - - if (!$target->isKnown() || $target->isTest()) { - throw new Exception('Unreachable CNAME target ('.$target->get().'), plesse use a domain with a public suffix.', 500); - } - - $domain = new Domain($domain); - - $domain = $consoleDB->createDocument([ - '$collection' => Database::SYSTEM_COLLECTION_DOMAINS, - '$permissions' => [ - 'read' => ['team:'.$project->getAttribute('teamId', null)], - 'write' => ['team:'.$project->getAttribute('teamId', null).'/owner', 'team:'.$project->getAttribute('teamId', null).'/developer'], - ], - 'updated' => \time(), - 'domain' => $domain->get(), - 'tld' => $domain->getSuffix(), - 'registerable' => $domain->getRegisterable(), - 'verification' => false, - 'certificateId' => null, - ]); - - if (false === $domain) { - throw new Exception('Failed saving domain to DB', 500); - } - - $project->setAttribute('domains', $domain, Document::SET_TYPE_APPEND); - - $project = $consoleDB->updateDocument($project->getArrayCopy()); - - if (false === $project) { - throw new Exception('Failed saving project to DB', 500); - } - - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->json($domain->getArrayCopy()) - ; + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); -$utopia->get('/v1/projects/:projectId/domains') + $document = $project->search('domain', $domain, $project->getAttribute('domains', [])); + + if (!empty($document)) { + throw new Exception('Domain already exists', 409); + } + + $target = new Domain(App::getEnv('_APP_DOMAIN_TARGET', '')); + + if (!$target->isKnown() || $target->isTest()) { + throw new Exception('Unreachable CNAME target ('.$target->get().'), plesse use a domain with a public suffix.', 500); + } + + $domain = new Domain($domain); + + $domain = $consoleDB->createDocument([ + '$collection' => Database::SYSTEM_COLLECTION_DOMAINS, + '$permissions' => [ + 'read' => ['team:'.$project->getAttribute('teamId', null)], + 'write' => ['team:'.$project->getAttribute('teamId', null).'/owner', 'team:'.$project->getAttribute('teamId', null).'/developer'], + ], + 'updated' => \time(), + 'domain' => $domain->get(), + 'tld' => $domain->getSuffix(), + 'registerable' => $domain->getRegisterable(), + 'verification' => false, + 'certificateId' => null, + ]); + + if (false === $domain) { + throw new Exception('Failed saving domain to DB', 500); + } + + $project->setAttribute('domains', $domain, Document::SET_TYPE_APPEND); + + $project = $consoleDB->updateDocument($project->getArrayCopy()); + + if (false === $project) { + throw new Exception('Failed saving project to DB', 500); + } + + $response->setStatusCode(Response::STATUS_CODE_CREATED); + $response->dynamic($domain, Response::MODEL_DOMAIN); + }, ['response', 'consoleDB']); + +App::get('/v1/projects/:projectId/domains') ->desc('List Domains') ->groups(['api', 'projects']) ->label('scope', 'projects.read') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'listDomains') - ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.') - ->action( - function ($projectId) use ($response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', '', new UID(), 'Project unique ID.') + ->action(function ($projectId, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $domains = $project->getAttribute('domains', []); - - $response->json($domains); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); -$utopia->get('/v1/projects/:projectId/domains/:domainId') + $domains = $project->getAttribute('domains', []); + + $response->dynamic(new Document([ + 'sum' => count($domains), + 'domains' => $domains + ]), Response::MODEL_DOMAIN_LIST); + }, ['response', 'consoleDB']); + +App::get('/v1/projects/:projectId/domains/:domainId') ->desc('Get Domain') ->groups(['api', 'projects']) ->label('scope', 'projects.read') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'getDomain') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->param('domainId', null, function () { return new UID(); }, 'Domain unique ID.') - ->action( - function ($projectId, $domainId) use ($response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->param('domainId', null, new UID(), 'Domain unique ID.') + ->action(function ($projectId, $domainId, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $domain = $project->search('$id', $domainId, $project->getAttribute('domains', [])); - - if (empty($domain) || !$domain instanceof Document) { - throw new Exception('Domain not found', 404); - } - - $response->json($domain->getArrayCopy()); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); -$utopia->patch('/v1/projects/:projectId/domains/:domainId/verification') + $domain = $project->search('$id', $domainId, $project->getAttribute('domains', [])); + + if (empty($domain) || !$domain instanceof Document) { + throw new Exception('Domain not found', 404); + } + + $response->dynamic($domain, Response::MODEL_DOMAIN); + }, ['response', 'consoleDB']); + +App::patch('/v1/projects/:projectId/domains/:domainId/verification') ->desc('Update Domain Verification Status') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'updateDomainVerification') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->param('domainId', null, function () { return new UID(); }, 'Domain unique ID.') - ->action( - function ($projectId, $domainId) use ($request, $response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->param('domainId', null, new UID(), 'Domain unique ID.') + ->action(function ($projectId, $domainId, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $domain = $project->search('$id', $domainId, $project->getAttribute('domains', [])); - - if (empty($domain) || !$domain instanceof Document) { - throw new Exception('Domain not found', 404); - } - - $target = new Domain($request->getServer('_APP_DOMAIN_TARGET', '')); - - if (!$target->isKnown() || $target->isTest()) { - throw new Exception('Unreachable CNAME target ('.$target->get().'), plesse use a domain with a public suffix.', 500); - } - - if ($domain->getAttribute('verification') === true) { - return $response->json($domain->getArrayCopy()); - } - - // Verify Domain with DNS records - $validator = new CNAME($target->get()); - - if (!$validator->isValid($domain->getAttribute('domain', ''))) { - throw new Exception('Failed to verify domain', 401); - } - - $domain - ->setAttribute('verification', true) - ; - - if (false === $consoleDB->updateDocument($domain->getArrayCopy())) { - throw new Exception('Failed saving domains to DB', 500); - } - - // Issue a TLS certificate when domain is verified - Resque::enqueue('v1-certificates', 'CertificatesV1', [ - 'document' => $domain->getArrayCopy(), - 'domain' => $domain->getAttribute('domain'), - ]); - - $response->json($domain->getArrayCopy()); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); -$utopia->delete('/v1/projects/:projectId/domains/:domainId') + $domain = $project->search('$id', $domainId, $project->getAttribute('domains', [])); + + if (empty($domain) || !$domain instanceof Document) { + throw new Exception('Domain not found', 404); + } + + $target = new Domain(App::getEnv('_APP_DOMAIN_TARGET', '')); + + if (!$target->isKnown() || $target->isTest()) { + throw new Exception('Unreachable CNAME target ('.$target->get().'), plesse use a domain with a public suffix.', 500); + } + + if ($domain->getAttribute('verification') === true) { + return $response->dynamic($domain, Response::MODEL_DOMAIN); + } + + // Verify Domain with DNS records + $validator = new CNAME($target->get()); + + if (!$validator->isValid($domain->getAttribute('domain', ''))) { + throw new Exception('Failed to verify domain', 401); + } + + $domain + ->setAttribute('verification', true) + ; + + if (false === $consoleDB->updateDocument($domain->getArrayCopy())) { + throw new Exception('Failed saving domains to DB', 500); + } + + // Issue a TLS certificate when domain is verified + Resque::enqueue('v1-certificates', 'CertificatesV1', [ + 'document' => $domain->getArrayCopy(), + 'domain' => $domain->getAttribute('domain'), + ]); + + $response->dynamic($domain, Response::MODEL_DOMAIN); + }, ['response', 'consoleDB']); + +App::delete('/v1/projects/:projectId/domains/:domainId') ->desc('Delete Domain') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'deleteDomain') - ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') - ->param('domainId', null, function () { return new UID(); }, 'Domain unique ID.') - ->action( - function ($projectId, $domainId) use ($response, $consoleDB) { - $project = $consoleDB->getDocument($projectId); + ->param('projectId', null, new UID(), 'Project unique ID.') + ->param('domainId', null, new UID(), 'Domain unique ID.') + ->action(function ($projectId, $domainId, $response, $consoleDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $consoleDB */ - if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { - throw new Exception('Project not found', 404); - } + $project = $consoleDB->getDocument($projectId); - $domain = $project->search('$id', $domainId, $project->getAttribute('domains', [])); - - if (empty($domain) || !$domain instanceof Document) { - throw new Exception('Domain not found', 404); - } - - if (!$consoleDB->deleteDocument($domain->getId())) { - throw new Exception('Failed to remove domains from DB', 500); - } - - $response->noContent(); + if (empty($project->getId()) || Database::SYSTEM_COLLECTION_PROJECTS != $project->getCollection()) { + throw new Exception('Project not found', 404); } - ); \ No newline at end of file + + $domain = $project->search('$id', $domainId, $project->getAttribute('domains', [])); + + if (empty($domain) || !$domain instanceof Document) { + throw new Exception('Domain not found', 404); + } + + if (!$consoleDB->deleteDocument($domain->getId())) { + throw new Exception('Failed to remove domains from DB', 500); + } + + $response->noContent(); + }, ['response', 'consoleDB']); \ No newline at end of file diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 9a12b56048..f9fe7c6618 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -1,9 +1,7 @@ getId())); - -$fileLogos = [ // Based on this list @see http://stackoverflow.com/a/4212908/2299554 - 'default' => __DIR__.'/../../config/files/none.png', - - // Video Files - 'video/mp4' => __DIR__.'/../../config/files/video.png', - 'video/x-flv' => __DIR__.'/../../config/files/video.png', - 'application/x-mpegURL' => __DIR__.'/../../config/files/video.png', - 'video/MP2T' => __DIR__.'/../../config/files/video.png', - 'video/3gpp' => __DIR__.'/../../config/files/video.png', - 'video/quicktime' => __DIR__.'/../../config/files/video.png', - 'video/x-msvideo' => __DIR__.'/../../config/files/video.png', - 'video/x-ms-wmv' => __DIR__.'/../../config/files/video.png', - - // // Microsoft Word - 'application/msword' => __DIR__.'/../../config/files/word.png', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => __DIR__.'/../../config/files/word.png', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => __DIR__.'/../../config/files/word.png', - 'application/vnd.ms-word.document.macroEnabled.12' => __DIR__.'/../../config/files/word.png', - - // // Microsoft Excel - 'application/vnd.ms-excel' => __DIR__.'/../../config/files/excel.png', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => __DIR__.'/../../config/files/excel.png', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => __DIR__.'/../../config/files/excel.png', - 'application/vnd.ms-excel.sheet.macroEnabled.12' => __DIR__.'/../../config/files/excel.png', - 'application/vnd.ms-excel.template.macroEnabled.12' => __DIR__.'/../../config/files/excel.png', - 'application/vnd.ms-excel.addin.macroEnabled.12' => __DIR__.'/../../config/files/excel.png', - 'application/vnd.ms-excel.sheet.binary.macroEnabled.12' => __DIR__.'/../../config/files/excel.png', - - // // Microsoft Power Point - 'application/vnd.ms-powerpoint' => __DIR__.'/../../config/files/ppt.png', - 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => __DIR__.'/../../config/files/ppt.png', - 'application/vnd.openxmlformats-officedocument.presentationml.template' => __DIR__.'/../../config/files/ppt.png', - 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => __DIR__.'/../../config/files/ppt.png', - 'application/vnd.ms-powerpoint.addin.macroEnabled.12' => __DIR__.'/../../config/files/ppt.png', - 'application/vnd.ms-powerpoint.presentation.macroEnabled.12' => __DIR__.'/../../config/files/ppt.png', - 'application/vnd.ms-powerpoint.template.macroEnabled.12' => __DIR__.'/../../config/files/ppt.png', - 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12' => __DIR__.'/../../config/files/ppt.png', - - // Adobe PDF - 'application/pdf' => __DIR__.'/../../config/files/pdf.png', -]; - -$inputs = [ - 'jpg' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'gif' => 'image/gif', - 'png' => 'image/png', -]; - -$outputs = [ - 'jpg' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'gif' => 'image/gif', - 'png' => 'image/png', - 'webp' => 'image/webp', -]; - -$mimes = [ - 'image/jpeg', - 'image/jpeg', - 'image/gif', - 'image/png', - 'image/webp', - - // Video Files - 'video/mp4', - 'video/x-flv', - 'application/x-mpegURL', - 'video/MP2T', - 'video/3gpp', - 'video/quicktime', - 'video/x-msvideo', - 'video/x-ms-wmv', - - // Microsoft Word - 'application/msword', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', - 'application/vnd.ms-word.document.macroEnabled.12', - - // Microsoft Excel - 'application/vnd.ms-excel', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', - 'application/vnd.ms-excel.sheet.macroEnabled.12', - 'application/vnd.ms-excel.template.macroEnabled.12', - 'application/vnd.ms-excel.addin.macroEnabled.12', - 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', - - // Microsoft Power Point - 'application/vnd.ms-powerpoint', - 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'application/vnd.openxmlformats-officedocument.presentationml.template', - 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', - 'application/vnd.ms-powerpoint.addin.macroEnabled.12', - 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', - 'application/vnd.ms-powerpoint.template.macroEnabled.12', - 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', - - // Microsoft Access - 'application/vnd.ms-access', - - // Adobe PDF - 'application/pdf', -]; - -$utopia->post('/v1/storage/files') +App::post('/v1/storage/files') ->desc('Create File') ->groups(['api', 'storage']) ->label('scope', 'files.write') - ->label('webhook', 'storage.files.create') + ->label('event', 'storage.files.create') ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'storage') ->label('sdk.method', 'createFile') ->label('sdk.description', '/docs/references/storage/create-file.md') ->label('sdk.consumes', 'multipart/form-data') ->label('sdk.methodType', 'upload') - ->param('file', [], function () { return new File(); }, 'Binary File.', false) - ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') - ->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') - // ->param('folderId', '', function () { return new UID(); }, 'Folder to associate files with.', true) - ->action( - function ($file, $read, $write, $folderId = '') use ($request, $response, $user, $projectDB, $webhook, $audit, $usage) { - $file = $request->getFiles('file'); - $read = (empty($read)) ? ['user:'.$user->getId()] : $read; - $write = (empty($write)) ? ['user:'.$user->getId()] : $write; + ->param('file', [], new File(), 'Binary file.', false) + ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') + ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') + ->action(function ($file, $read, $write, $request, $response, $user, $projectDB, $audits, $usage) { + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $user */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $audits */ + /** @var Appwrite\Event\Event $usage */ - /* - * Validators - */ - //$fileType = new FileType(array(FileType::FILE_TYPE_PNG, FileType::FILE_TYPE_GIF, FileType::FILE_TYPE_JPEG)); - $fileSize = new FileSize($request->getServer('_APP_STORAGE_LIMIT', 0)); - $upload = new Upload(); + $file = $request->getFiles('file'); + $read = (empty($read)) ? ['user:'.$user->getId()] : $read; + $write = (empty($write)) ? ['user:'.$user->getId()] : $write; - if (empty($file)) { - throw new Exception('No file sent', 400); - } + /* + * Validators + */ + //$fileType = new FileType(array(FileType::FILE_TYPE_PNG, FileType::FILE_TYPE_GIF, FileType::FILE_TYPE_JPEG)); + $fileSize = new FileSize(App::getEnv('_APP_STORAGE_LIMIT', 0)); + $upload = new Upload(); - // Make sure we handle a single file and multiple files the same way - $file['name'] = (\is_array($file['name']) && isset($file['name'][0])) ? $file['name'][0] : $file['name']; - $file['tmp_name'] = (\is_array($file['tmp_name']) && isset($file['tmp_name'][0])) ? $file['tmp_name'][0] : $file['tmp_name']; - $file['size'] = (\is_array($file['size']) && isset($file['size'][0])) ? $file['size'][0] : $file['size']; + if (empty($file)) { + throw new Exception('No file sent', 400); + } - // Check if file type is allowed (feature for project settings?) - //if (!$fileType->isValid($file['tmp_name'])) { - //throw new Exception('File type not allowed', 400); - //} + // Make sure we handle a single file and multiple files the same way + $file['name'] = (\is_array($file['name']) && isset($file['name'][0])) ? $file['name'][0] : $file['name']; + $file['tmp_name'] = (\is_array($file['tmp_name']) && isset($file['tmp_name'][0])) ? $file['tmp_name'][0] : $file['tmp_name']; + $file['size'] = (\is_array($file['size']) && isset($file['size'][0])) ? $file['size'][0] : $file['size']; - // Check if file size is exceeding allowed limit - if (!$fileSize->isValid($file['size'])) { - throw new Exception('File size not allowed', 400); - } + // Check if file type is allowed (feature for project settings?) + //if (!$fileType->isValid($file['tmp_name'])) { + //throw new Exception('File type not allowed', 400); + //} - /* - * Models - */ - $device = Storage::getDevice('local'); + if (!$fileSize->isValid($file['size'])) { // Check if file size is exceeding allowed limit + throw new Exception('File size not allowed', 400); + } - if (!$upload->isValid($file['tmp_name'])) { + $device = Storage::getDevice('files'); + + if (!$upload->isValid($file['tmp_name'])) { + throw new Exception('Invalid file', 403); + } + + // Save to storage + $size = $device->getFileSize($file['tmp_name']); + $path = $device->getPath(\uniqid().'.'.\pathinfo($file['name'], PATHINFO_EXTENSION)); + + if (!$device->upload($file['tmp_name'], $path)) { // TODO deprecate 'upload' and replace with 'move' + throw new Exception('Failed moving file', 500); + } + + $mimeType = $device->getFileMimeType($path); // Get mime-type before compression and encryption + + if (App::getEnv('_APP_STORAGE_ANTIVIRUS') === 'enabled') { // Check if scans are enabled + $antiVirus = new Network('clamav', 3310); + + if (!$antiVirus->fileScan($path)) { + $device->delete($path); throw new Exception('Invalid file', 403); } - - // Save to storage - $size = $device->getFileSize($file['tmp_name']); - $path = $device->getPath(\uniqid().'.'.\pathinfo($file['name'], PATHINFO_EXTENSION)); - - if (!$device->upload($file['tmp_name'], $path)) { // TODO deprecate 'upload' and replace with 'move' - throw new Exception('Failed moving file', 500); - } - - $mimeType = $device->getFileMimeType($path); // Get mime-type before compression and encryption - - 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 - $compressor = new GZIP(); - $data = $device->read($path); - $data = $compressor->compress($data); - $key = $request->getServer('_APP_OPENSSL_KEY_V1'); - $iv = OpenSSL::randomPseudoBytes(OpenSSL::cipherIVLength(OpenSSL::CIPHER_AES_128_GCM)); - $data = OpenSSL::encrypt($data, OpenSSL::CIPHER_AES_128_GCM, $key, 0, $iv, $tag); - - if (!$device->write($path, $data)) { - throw new Exception('Failed to save file', 500); - } - - $sizeActual = $device->getFileSize($path); - - $file = $projectDB->createDocument([ - '$collection' => Database::SYSTEM_COLLECTION_FILES, - '$permissions' => [ - 'read' => $read, - 'write' => $write, - ], - 'dateCreated' => \time(), - 'folderId' => $folderId, - 'name' => $file['name'], - 'path' => $path, - 'signature' => $device->getFileHash($path), - 'mimeType' => $mimeType, - 'sizeOriginal' => $size, - 'sizeActual' => $sizeActual, - 'algorithm' => $compressor->getName(), - 'token' => \bin2hex(\random_bytes(64)), - 'comment' => '', - 'fileOpenSSLVersion' => '1', - 'fileOpenSSLCipher' => OpenSSL::CIPHER_AES_128_GCM, - 'fileOpenSSLTag' => \bin2hex($tag), - 'fileOpenSSLIV' => \bin2hex($iv), - ]); - - if (false === $file) { - throw new Exception('Failed saving file to DB', 500); - } - - $webhook - ->setParam('payload', $file->getArrayCopy()) - ; - - $audit - ->setParam('event', 'storage.files.create') - ->setParam('resource', 'storage/files/'.$file->getId()) - ; - - $usage - ->setParam('storage', $sizeActual) - ; - - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->json($file->getArrayCopy()) - ; } - ); -$utopia->get('/v1/storage/files') + // Compression + $compressor = new GZIP(); + $data = $device->read($path); + $data = $compressor->compress($data); + $key = App::getEnv('_APP_OPENSSL_KEY_V1'); + $iv = OpenSSL::randomPseudoBytes(OpenSSL::cipherIVLength(OpenSSL::CIPHER_AES_128_GCM)); + $data = OpenSSL::encrypt($data, OpenSSL::CIPHER_AES_128_GCM, $key, 0, $iv, $tag); + + if (!$device->write($path, $data)) { + throw new Exception('Failed to save file', 500); + } + + $sizeActual = $device->getFileSize($path); + + $file = $projectDB->createDocument([ + '$collection' => Database::SYSTEM_COLLECTION_FILES, + '$permissions' => [ + 'read' => $read, + 'write' => $write, + ], + 'dateCreated' => \time(), + 'folderId' => '', + 'name' => $file['name'], + 'path' => $path, + 'signature' => $device->getFileHash($path), + 'mimeType' => $mimeType, + 'sizeOriginal' => $size, + 'sizeActual' => $sizeActual, + 'algorithm' => $compressor->getName(), + 'token' => \bin2hex(\random_bytes(64)), + 'comment' => '', + 'fileOpenSSLVersion' => '1', + 'fileOpenSSLCipher' => OpenSSL::CIPHER_AES_128_GCM, + 'fileOpenSSLTag' => \bin2hex($tag), + 'fileOpenSSLIV' => \bin2hex($iv), + ]); + + if (false === $file) { + throw new Exception('Failed saving file to DB', 500); + } + + $audits + ->setParam('event', 'storage.files.create') + ->setParam('resource', 'storage/files/'.$file->getId()) + ; + + $usage + ->setParam('storage', $sizeActual) + ; + + $response->setStatusCode(Response::STATUS_CODE_CREATED); + $response->dynamic($file, Response::MODEL_FILE); + }, ['request', 'response', 'user', 'projectDB', 'audits', 'usage']); + +App::get('/v1/storage/files') ->desc('List Files') ->groups(['api', 'storage']) ->label('scope', 'files.read') @@ -276,33 +161,33 @@ $utopia->get('/v1/storage/files') ->label('sdk.namespace', 'storage') ->label('sdk.method', 'listFiles') ->label('sdk.description', '/docs/references/storage/list-files.md') - ->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 ($search, $limit, $offset, $orderType) use ($response, $projectDB) { - $results = $projectDB->getCollection([ - 'limit' => $limit, - 'offset' => $offset, - 'orderField' => 'dateCreated', - 'orderType' => $orderType, - 'orderCast' => 'int', - 'search' => $search, - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_FILES, - ], - ]); + ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) + ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) + ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true) + ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true) + ->action(function ($search, $limit, $offset, $orderType, $response, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ - $results = \array_map(function ($value) { /* @var $value \Database\Document */ - return $value->getArrayCopy(['$id', '$permissions', 'name', 'dateCreated', 'signature', 'mimeType', 'sizeOriginal']); - }, $results); + $results = $projectDB->getCollection([ + 'limit' => $limit, + 'offset' => $offset, + 'orderField' => 'dateCreated', + 'orderType' => $orderType, + 'orderCast' => 'int', + 'search' => $search, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_FILES, + ], + ]); - $response->json(['sum' => $projectDB->getSum(), 'files' => $results]); - } - ); + $response->dynamic(new Document([ + 'sum' => $projectDB->getSum(), + 'files' => $results + ]), Response::MODEL_FILE_LIST); + }, ['response', 'projectDB']); -$utopia->get('/v1/storage/files/:fileId') +App::get('/v1/storage/files/:fileId') ->desc('Get File') ->groups(['api', 'storage']) ->label('scope', 'files.read') @@ -310,20 +195,21 @@ $utopia->get('/v1/storage/files/:fileId') ->label('sdk.namespace', 'storage') ->label('sdk.method', 'getFile') ->label('sdk.description', '/docs/references/storage/get-file.md') - ->param('fileId', '', function () { return new UID(); }, 'File unique ID.') - ->action( - function ($fileId) use ($response, $projectDB) { - $file = $projectDB->getDocument($fileId); + ->param('fileId', '', new UID(), 'File unique ID.') + ->action(function ($fileId, $response, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ - if (empty($file->getId()) || Database::SYSTEM_COLLECTION_FILES != $file->getCollection()) { - throw new Exception('File not found', 404); - } + $file = $projectDB->getDocument($fileId); - $response->json($file->getArrayCopy(['$id', '$permissions', 'name', 'dateCreated', 'signature', 'mimeType', 'sizeOriginal'])); + if (empty($file->getId()) || Database::SYSTEM_COLLECTION_FILES != $file->getCollection()) { + throw new Exception('File not found', 404); } - ); -$utopia->get('/v1/storage/files/:fileId/preview') + $response->dynamic($file, Response::MODEL_FILE); + }, ['response', 'projectDB']); + +App::get('/v1/storage/files/:fileId/preview') ->desc('Get File Preview') ->groups(['api', 'storage']) ->label('scope', 'files.read') @@ -333,120 +219,123 @@ $utopia->get('/v1/storage/files/:fileId/preview') ->label('sdk.description', '/docs/references/storage/get-file-preview.md') ->label('sdk.response.type', 'image/*') ->label('sdk.methodType', 'location') - ->param('fileId', '', function () { return new UID(); }, 'File unique ID') - ->param('width', 0, function () { return new Range(0, 4000); }, 'Resize preview image width, Pass an integer between 0 to 4000.', true) - ->param('height', 0, function () { return new Range(0, 4000); }, 'Resize preview image height, Pass an integer between 0 to 4000.', true) - ->param('quality', 100, function () { return new Range(0, 100); }, 'Preview image quality. Pass an integer between 0 to 100. Defaults to 100.', true) - ->param('background', '', function () { return new HexColor(); }, 'Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.', true) - ->param('output', null, function () use ($outputs) { return new WhiteList(\array_merge(\array_keys($outputs), [null])); }, 'Output format type (jpeg, jpg, png, gif and webp).', true) - ->action( - function ($fileId, $width, $height, $quality, $background, $output) use ($request, $response, $projectDB, $project, $inputs, $outputs, $fileLogos) { - $storage = 'local'; + ->param('fileId', '', new UID(), 'File unique ID') + ->param('width', 0, new Range(0, 4000), 'Resize preview image width, Pass an integer between 0 to 4000.', true) + ->param('height', 0, new Range(0, 4000), 'Resize preview image height, Pass an integer between 0 to 4000.', true) + ->param('quality', 100, new Range(0, 100), 'Preview image quality. Pass an integer between 0 to 100. Defaults to 100.', true) + ->param('background', '', new HexColor(), 'Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.', true) + ->param('output', '', new WhiteList(\array_keys(Config::getParam('storage-outputs')), true), 'Output format type (jpeg, jpg, png, gif and webp).', true) + ->action(function ($fileId, $width, $height, $quality, $background, $output, $request, $response, $project, $projectDB) { + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $project */ + /** @var Appwrite\Database\Database $projectDB */ - if (!\extension_loaded('imagick')) { - throw new Exception('Imagick extension is missing', 500); - } + $storage = 'files'; - if (!Storage::exists($storage)) { - throw new Exception('No such storage device', 400); - } + if (!\extension_loaded('imagick')) { + throw new Exception('Imagick extension is missing', 500); + } - if ((\strpos($request->getServer('HTTP_ACCEPT'), 'image/webp') === false) && ('webp' == $output)) { // Fallback webp to jpeg when no browser support - $output = 'jpg'; - } + if (!Storage::exists($storage)) { + throw new Exception('No such storage device', 400); + } - $date = \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)).' GMT'; // 45 days cache - $key = \md5($fileId.$width.$height.$quality.$background.$storage.$output); + if ((\strpos($request->getAccept(), 'image/webp') === false) && ('webp' == $output)) { // Fallback webp to jpeg when no browser support + $output = 'jpg'; + } - $file = $projectDB->getDocument($fileId); + $inputs = Config::getParam('storage-inputs'); + $outputs = Config::getParam('storage-outputs'); + $fileLogos = Config::getParam('storage-logos'); - if (empty($file->getId()) || Database::SYSTEM_COLLECTION_FILES != $file->getCollection()) { - throw new Exception('File not found', 404); - } + $date = \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)).' GMT'; // 45 days cache + $key = \md5($fileId.$width.$height.$quality.$background.$storage.$output); - $path = $file->getAttribute('path'); + $file = $projectDB->getDocument($fileId); + + if (empty($file->getId()) || Database::SYSTEM_COLLECTION_FILES != $file->getCollection()) { + throw new Exception('File not found', 404); + } + + $path = $file->getAttribute('path'); + $type = \strtolower(\pathinfo($path, PATHINFO_EXTENSION)); + $algorithm = $file->getAttribute('algorithm'); + $cipher = $file->getAttribute('fileOpenSSLCipher'); + $mime = $file->getAttribute('mimeType'); + + if (!\in_array($mime, $inputs)) { + $path = (\array_key_exists($mime, $fileLogos)) ? $fileLogos[$mime] : $fileLogos['default']; + $algorithm = null; + $cipher = null; + $background = (empty($background)) ? 'eceff1' : $background; $type = \strtolower(\pathinfo($path, PATHINFO_EXTENSION)); - $algorithm = $file->getAttribute('algorithm'); - $cipher = $file->getAttribute('fileOpenSSLCipher'); - $mime = $file->getAttribute('mimeType'); + $key = \md5($path.$width.$height.$quality.$background.$storage.$output); + } - if (!\in_array($mime, $inputs)) { - $path = (\array_key_exists($mime, $fileLogos)) ? $fileLogos[$mime] : $fileLogos['default']; - $algorithm = null; - $cipher = null; - $background = (empty($background)) ? 'eceff1' : $background; - $type = \strtolower(\pathinfo($path, PATHINFO_EXTENSION)); - $key = \md5($path.$width.$height.$quality.$background.$storage.$output); - } + $compressor = new GZIP(); + $device = Storage::getDevice('files'); - $compressor = new GZIP(); - $device = Storage::getDevice('local'); + if (!\file_exists($path)) { + throw new Exception('File not found', 404); + } - if (!\file_exists($path)) { - throw new Exception('File not found', 404); - } - - $cache = new Cache(new Filesystem(APP_STORAGE_CACHE.'/app-'.$project->getId())); // Limit file number or size - $data = $cache->load($key, 60 * 60 * 24 * 30 * 3 /* 3 months */); - - if ($data) { - $output = (empty($output)) ? $type : $output; - - $response - ->setContentType((\in_array($output, $outputs)) ? $outputs[$output] : $outputs['jpg']) - ->addHeader('Expires', $date) - ->addHeader('X-Appwrite-Cache', 'hit') - ->send($data) - ; - - return; - } - - $source = $device->read($path); - - if (!empty($cipher)) { // 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($algorithm)) { - $source = $compressor->decompress($source); - } - - $resize = new Resize($source); - - $resize->crop((int) $width, (int) $height); - - if (!empty($background)) { - $resize->setBackground('#'.$background); - } + $cache = new Cache(new Filesystem(APP_STORAGE_CACHE.'/app-'.$project->getId())); // Limit file number or size + $data = $cache->load($key, 60 * 60 * 24 * 30 * 3 /* 3 months */); + if ($data) { $output = (empty($output)) ? $type : $output; - $response - ->setContentType($outputs[$output]) + return $response + ->setContentType((\array_key_exists($output, $outputs)) ? $outputs[$output] : $outputs['jpg']) ->addHeader('Expires', $date) - ->addHeader('X-Appwrite-Cache', 'miss') - ->send('') + ->addHeader('X-Appwrite-Cache', 'hit') + ->send($data) ; - - $data = $resize->output($output, $quality); - - $cache->save($key, $data); - - echo $data; - - unset($resize); } - ); -$utopia->get('/v1/storage/files/:fileId/download') + $source = $device->read($path); + + if (!empty($cipher)) { // Decrypt + $source = OpenSSL::decrypt( + $source, + $file->getAttribute('fileOpenSSLCipher'), + App::getEnv('_APP_OPENSSL_KEY_V'.$file->getAttribute('fileOpenSSLVersion')), + 0, + \hex2bin($file->getAttribute('fileOpenSSLIV')), + \hex2bin($file->getAttribute('fileOpenSSLTag')) + ); + } + + if (!empty($algorithm)) { + $source = $compressor->decompress($source); + } + + $resize = new Resize($source); + + $resize->crop((int) $width, (int) $height); + + if (!empty($background)) { + $resize->setBackground('#'.$background); + } + + $output = (empty($output)) ? $type : $output; + + $data = $resize->output($output, $quality); + + $cache->save($key, $data); + + $response + ->setContentType($outputs[$output]) + ->addHeader('Expires', $date) + ->addHeader('X-Appwrite-Cache', 'miss') + ->send($data) + ; + + unset($resize); + }, ['request', 'response', 'project', 'projectDB']); + +App::get('/v1/storage/files/:fileId/download') ->desc('Get File for Download') ->groups(['api', 'storage']) ->label('scope', 'files.read') @@ -456,51 +345,52 @@ $utopia->get('/v1/storage/files/:fileId/download') ->label('sdk.description', '/docs/references/storage/get-file-download.md') ->label('sdk.response.type', '*') ->label('sdk.methodType', 'location') - ->param('fileId', '', function () { return new UID(); }, 'File unique ID.') - ->action( - function ($fileId) use ($response, $request, $projectDB) { - $file = $projectDB->getDocument($fileId); + ->param('fileId', '', new UID(), 'File unique ID.') + ->action(function ($fileId, $response, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ - if (empty($file->getId()) || Database::SYSTEM_COLLECTION_FILES != $file->getCollection()) { - throw new Exception('File not found', 404); - } + $file = $projectDB->getDocument($fileId); - $path = $file->getAttribute('path', ''); - - if (!\file_exists($path)) { - throw new Exception('File not found in '.$path, 404); - } - - $compressor = new GZIP(); - $device = Storage::getDevice('local'); - - $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')) - ); - } - - $source = $compressor->decompress($source); - - // Response - $response - ->setContentType($file->getAttribute('mimeType')) - ->addHeader('Content-Disposition', 'attachment; filename="'.$file->getAttribute('name', '').'"') - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)).' GMT') // 45 days cache - ->addHeader('X-Peak', \memory_get_peak_usage()) - ->send($source) - ; + if (empty($file->getId()) || Database::SYSTEM_COLLECTION_FILES != $file->getCollection()) { + throw new Exception('File not found', 404); } - ); -$utopia->get('/v1/storage/files/:fileId/view') + $path = $file->getAttribute('path', ''); + + if (!\file_exists($path)) { + throw new Exception('File not found in '.$path, 404); + } + + $compressor = new GZIP(); + $device = Storage::getDevice('files'); + + $source = $device->read($path); + + if (!empty($file->getAttribute('fileOpenSSLCipher'))) { // Decrypt + $source = OpenSSL::decrypt( + $source, + $file->getAttribute('fileOpenSSLCipher'), + App::getEnv('_APP_OPENSSL_KEY_V'.$file->getAttribute('fileOpenSSLVersion')), + 0, + \hex2bin($file->getAttribute('fileOpenSSLIV')), + \hex2bin($file->getAttribute('fileOpenSSLTag')) + ); + } + + $source = $compressor->decompress($source); + + // Response + $response + ->setContentType($file->getAttribute('mimeType')) + ->addHeader('Content-Disposition', 'attachment; filename="'.$file->getAttribute('name', '').'"') + ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)).' GMT') // 45 days cache + ->addHeader('X-Peak', \memory_get_peak_usage()) + ->send($source) + ; + }, ['response', 'projectDB']); + +App::get('/v1/storage/files/:fileId/view') ->desc('Get File for View') ->groups(['api', 'storage']) ->label('scope', 'files.read') @@ -510,157 +400,160 @@ $utopia->get('/v1/storage/files/:fileId/view') ->label('sdk.description', '/docs/references/storage/get-file-view.md') ->label('sdk.response.type', '*') ->label('sdk.methodType', 'location') - ->param('fileId', '', function () { return new UID(); }, 'File unique ID.') - ->param('as', '', function () { return new WhiteList(['pdf', /*'html',*/ 'text']); }, 'Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.', true) - ->action( - function ($fileId, $as) use ($response, $request, $projectDB, $mimes) { - $file = $projectDB->getDocument($fileId); + ->param('fileId', '', new UID(), 'File unique ID.') + ->param('as', '', new WhiteList(['pdf', /*'html',*/ 'text'], true), 'Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.', true) + ->action(function ($fileId, $as, $response, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ - if (empty($file->getId()) || Database::SYSTEM_COLLECTION_FILES != $file->getCollection()) { - throw new Exception('File not found', 404); - } + $file = $projectDB->getDocument($fileId); + $mimes = Config::getParam('storage-mimes'); - $path = $file->getAttribute('path', ''); - - if (!\file_exists($path)) { - throw new Exception('File not found in '.$path, 404); - } - - $compressor = new GZIP(); - $device = Storage::getDevice('local'); - - $contentType = 'text/plain'; - - if (\in_array($file->getAttribute('mimeType'), $mimes)) { - $contentType = $file->getAttribute('mimeType'); - } - - $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')) - ); - } - - $output = $compressor->decompress($source); - $fileName = $file->getAttribute('name', ''); - - $contentTypes = [ - 'pdf' => 'application/pdf', - 'text' => 'text/plain', - ]; - - $contentType = (\array_key_exists($as, $contentTypes)) ? $contentTypes[$as] : $contentType; - - // Response - $response - ->setContentType($contentType) - ->addHeader('Content-Security-Policy', 'script-src none;') - ->addHeader('X-Content-Type-Options', 'nosniff') - ->addHeader('Content-Disposition', 'inline; filename="'.$fileName.'"') - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)).' GMT') // 45 days cache - ->addHeader('X-Peak', \memory_get_peak_usage()) - ->send($output) - ; + if (empty($file->getId()) || Database::SYSTEM_COLLECTION_FILES != $file->getCollection()) { + throw new Exception('File not found', 404); } - ); -$utopia->put('/v1/storage/files/:fileId') + $path = $file->getAttribute('path', ''); + + if (!\file_exists($path)) { + throw new Exception('File not found in '.$path, 404); + } + + $compressor = new GZIP(); + $device = Storage::getDevice('files'); + + $contentType = 'text/plain'; + + if (\in_array($file->getAttribute('mimeType'), $mimes)) { + $contentType = $file->getAttribute('mimeType'); + } + + $source = $device->read($path); + + if (!empty($file->getAttribute('fileOpenSSLCipher'))) { // Decrypt + $source = OpenSSL::decrypt( + $source, + $file->getAttribute('fileOpenSSLCipher'), + App::getEnv('_APP_OPENSSL_KEY_V'.$file->getAttribute('fileOpenSSLVersion')), + 0, + \hex2bin($file->getAttribute('fileOpenSSLIV')), + \hex2bin($file->getAttribute('fileOpenSSLTag')) + ); + } + + $output = $compressor->decompress($source); + $fileName = $file->getAttribute('name', ''); + + $contentTypes = [ + 'pdf' => 'application/pdf', + 'text' => 'text/plain', + ]; + + $contentType = (\array_key_exists($as, $contentTypes)) ? $contentTypes[$as] : $contentType; + + // Response + $response + ->setContentType($contentType) + ->addHeader('Content-Security-Policy', 'script-src none;') + ->addHeader('X-Content-Type-Options', 'nosniff') + ->addHeader('Content-Disposition', 'inline; filename="'.$fileName.'"') + ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)).' GMT') // 45 days cache + ->addHeader('X-Peak', \memory_get_peak_usage()) + ->send($output) + ; + }, ['response', 'projectDB']); + +App::put('/v1/storage/files/:fileId') ->desc('Update File') ->groups(['api', 'storage']) ->label('scope', 'files.write') - ->label('webhook', 'storage.files.update') + ->label('event', 'storage.files.update') ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'storage') ->label('sdk.method', 'updateFile') ->label('sdk.description', '/docs/references/storage/update-file.md') - ->param('fileId', '', function () { return new UID(); }, 'File unique ID.') - ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') - ->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') - //->param('folderId', '', function () { return new UID(); }, 'Folder to associate files with.', true) - ->action( - function ($fileId, $read, $write, $folderId = '') use ($response, $projectDB, $audit, $webhook) { - $file = $projectDB->getDocument($fileId); + ->param('fileId', '', new UID(), 'File unique ID.') + ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') + ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.') + ->action(function ($fileId, $read, $write, $response, $projectDB, $audits) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $audits */ - if (empty($file->getId()) || Database::SYSTEM_COLLECTION_FILES != $file->getCollection()) { - throw new Exception('File not found', 404); - } + $file = $projectDB->getDocument($fileId); - $file = $projectDB->updateDocument(\array_merge($file->getArrayCopy(), [ - '$permissions' => [ - 'read' => $read, - 'write' => $write, - ], - 'folderId' => $folderId, - ])); - - if (false === $file) { - throw new Exception('Failed saving file to DB', 500); - } - - $webhook - ->setParam('payload', $file->getArrayCopy()) - ; - - $audit - ->setParam('event', 'storage.files.update') - ->setParam('resource', 'storage/files/'.$file->getId()) - ; - - $response->json($file->getArrayCopy()); + if (empty($file->getId()) || Database::SYSTEM_COLLECTION_FILES != $file->getCollection()) { + throw new Exception('File not found', 404); } - ); -$utopia->delete('/v1/storage/files/:fileId') + $file = $projectDB->updateDocument(\array_merge($file->getArrayCopy(), [ + '$permissions' => [ + 'read' => $read, + 'write' => $write, + ], + 'folderId' => '', + ])); + + if (false === $file) { + throw new Exception('Failed saving file to DB', 500); + } + + $audits + ->setParam('event', 'storage.files.update') + ->setParam('resource', 'storage/files/'.$file->getId()) + ; + + $response->dynamic($file, Response::MODEL_FILE); + }, ['response', 'projectDB', 'webhooks', 'audits']); + +App::delete('/v1/storage/files/:fileId') ->desc('Delete File') ->groups(['api', 'storage']) ->label('scope', 'files.write') - ->label('webhook', 'storage.files.delete') + ->label('event', 'storage.files.delete') ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'storage') ->label('sdk.method', 'deleteFile') ->label('sdk.description', '/docs/references/storage/delete-file.md') - ->param('fileId', '', function () { return new UID(); }, 'File unique ID.') - ->action( - function ($fileId) use ($response, $projectDB, $webhook, $audit, $usage) { - $file = $projectDB->getDocument($fileId); + ->param('fileId', '', new UID(), 'File unique ID.') + ->action(function ($fileId, $response, $projectDB, $webhooks, $audits, $usage) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $webhooks */ + /** @var Appwrite\Event\Event $audits */ + /** @var Appwrite\Event\Event $usage */ + + $file = $projectDB->getDocument($fileId); - if (empty($file->getId()) || Database::SYSTEM_COLLECTION_FILES != $file->getCollection()) { - throw new Exception('File not found', 404); - } - - $device = Storage::getDevice('local'); - - if ($device->delete($file->getAttribute('path', ''))) { - if (!$projectDB->deleteDocument($fileId)) { - throw new Exception('Failed to remove file from DB', 500); - } - } - - $webhook - ->setParam('payload', $file->getArrayCopy()) - ; - - $audit - ->setParam('event', 'storage.files.delete') - ->setParam('resource', 'storage/files/'.$file->getId()) - ; - - $usage - ->setParam('storage', $file->getAttribute('size', 0) * -1) - ; - - $response->noContent(); + if (empty($file->getId()) || Database::SYSTEM_COLLECTION_FILES != $file->getCollection()) { + throw new Exception('File not found', 404); } - ); -// $utopia->get('/v1/storage/files/:fileId/scan') + $device = Storage::getDevice('files'); + + if ($device->delete($file->getAttribute('path', ''))) { + if (!$projectDB->deleteDocument($fileId)) { + throw new Exception('Failed to remove file from DB', 500); + } + } + + $audits + ->setParam('event', 'storage.files.delete') + ->setParam('resource', 'storage/files/'.$file->getId()) + ; + + $usage + ->setParam('storage', $file->getAttribute('size', 0) * -1) + ; + + $webhooks + ->setParam('payload', $response->output($file, Response::MODEL_FILE)) + ; + + $response->noContent(); + }, ['response', 'projectDB', 'webhooks', 'audits', 'usage']); + +// App::get('/v1/storage/files/:fileId/scan') // ->desc('Scan Storage') // ->groups(['api', 'storage']) // ->label('scope', 'god') @@ -668,8 +561,8 @@ $utopia->delete('/v1/storage/files/:fileId') // ->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']);}) +// ->param('fileId', '', new UID(), 'File unique ID.') +// ->param('storage', 'files', new WhiteList(['files']);}) // ->action( // function ($fileId, $storage) use ($response, $request, $projectDB) { // $file = $projectDB->getDocument($fileId); @@ -693,7 +586,7 @@ $utopia->delete('/v1/storage/files/:fileId') // $source = OpenSSL::decrypt( // $source, // $file->getAttribute('fileOpenSSLCipher'), -// $request->getServer('_APP_OPENSSL_KEY_V'.$file->getAttribute('fileOpenSSLVersion')), +// App::getEnv('_APP_OPENSSL_KEY_V'.$file->getAttribute('fileOpenSSLVersion')), // 0, // hex2bin($file->getAttribute('fileOpenSSLIV')), // hex2bin($file->getAttribute('fileOpenSSLTag')) @@ -708,6 +601,5 @@ $utopia->delete('/v1/storage/files/:fileId') // //var_dump($antiVirus->version()); // //var_dump($antiVirus->fileScan('/storage/uploads/app-1/5/9/f/e/59fecaed49645.pdf')); -// //$response->json($antiVirus->continueScan($device->getRoot())); // } // ); diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index d2e8cda0ea..deb3b03aad 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -1,9 +1,7 @@ post('/v1/teams') +App::post('/v1/teams') ->desc('Create Team') ->groups(['api', 'teams']) ->label('scope', 'teams.write') @@ -29,63 +28,64 @@ $utopia->post('/v1/teams') ->label('sdk.namespace', 'teams') ->label('sdk.method', 'create') ->label('sdk.description', '/docs/references/teams/create-team.md') - ->param('name', null, function () { return new Text(100); }, 'Team name.') - ->param('roles', ['owner'], function () { return new ArrayList(new Key()); }, 'Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Max length for each role is 32 chars.') - ->action( - function ($name, $roles) use ($response, $projectDB, $user, $mode) { - Authorization::disable(); + ->param('name', null, new Text(128), 'Team name. Max length: 128 chars.') + ->param('roles', ['owner'], new ArrayList(new Key()), 'Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Max length for each role is 32 chars.', true) + ->action(function ($name, $roles, $response, $user, $projectDB, $mode) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $user */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var bool $mode */ - $team = $projectDB->createDocument([ - '$collection' => Database::SYSTEM_COLLECTION_TEAMS, + Authorization::disable(); + + $team = $projectDB->createDocument([ + '$collection' => Database::SYSTEM_COLLECTION_TEAMS, + '$permissions' => [ + 'read' => ['team:{self}'], + 'write' => ['team:{self}/owner'], + ], + 'name' => $name, + 'sum' => ($mode !== APP_MODE_ADMIN && $user->getId()) ? 1 : 0, + 'dateCreated' => \time(), + ]); + + Authorization::reset(); + + if (false === $team) { + throw new Exception('Failed saving team to DB', 500); + } + + if ($mode !== APP_MODE_ADMIN && $user->getId()) { // Don't add user on server mode + $membership = new Document([ + '$collection' => Database::SYSTEM_COLLECTION_MEMBERSHIPS, '$permissions' => [ - 'read' => ['team:{self}'], - 'write' => ['team:{self}/owner'], + 'read' => ['user:'.$user->getId(), 'team:'.$team->getId()], + 'write' => ['user:'.$user->getId(), 'team:'.$team->getId().'/owner'], ], - 'name' => $name, - 'sum' => ($mode !== APP_MODE_ADMIN && $user->getId()) ? 1 : 0, - 'dateCreated' => \time(), + 'userId' => $user->getId(), + 'teamId' => $team->getId(), + 'roles' => $roles, + 'invited' => \time(), + 'joined' => \time(), + 'confirm' => true, + 'secret' => '', ]); - Authorization::reset(); + // Attach user to team + $user->setAttribute('memberships', $membership, Document::SET_TYPE_APPEND); - if (false === $team) { - throw new Exception('Failed saving team to DB', 500); + $user = $projectDB->updateDocument($user->getArrayCopy()); + + if (false === $user) { + throw new Exception('Failed saving user to DB', 500); } - - if ($mode !== APP_MODE_ADMIN && $user->getId()) { // Don't add user on app/server mode - $membership = new Document([ - '$collection' => Database::SYSTEM_COLLECTION_MEMBERSHIPS, - '$permissions' => [ - 'read' => ['user:'.$user->getId(), 'team:'.$team->getId()], - 'write' => ['user:'.$user->getId(), 'team:'.$team->getId().'/owner'], - ], - 'userId' => $user->getId(), - 'teamId' => $team->getId(), - 'roles' => $roles, - 'invited' => \time(), - 'joined' => \time(), - 'confirm' => true, - 'secret' => '', - ]); - - // Attach user to team - $user->setAttribute('memberships', $membership, Document::SET_TYPE_APPEND); - - $user = $projectDB->updateDocument($user->getArrayCopy()); - - if (false === $user) { - throw new Exception('Failed saving user to DB', 500); - } - } - - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->json($team->getArrayCopy()) - ; } - ); -$utopia->get('/v1/teams') + $response->setStatusCode(Response::STATUS_CODE_CREATED); + $response->dynamic($team, Response::MODEL_TEAM); + }, ['response', 'user', 'projectDB', 'mode']); + +App::get('/v1/teams') ->desc('List Teams') ->groups(['api', 'teams']) ->label('scope', 'teams.read') @@ -93,29 +93,33 @@ $utopia->get('/v1/teams') ->label('sdk.namespace', 'teams') ->label('sdk.method', 'list') ->label('sdk.description', '/docs/references/teams/list-teams.md') - ->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 ($search, $limit, $offset, $orderType) use ($response, $projectDB) { - $results = $projectDB->getCollection([ - 'limit' => $limit, - 'offset' => $offset, - 'orderField' => 'dateCreated', - 'orderType' => $orderType, - 'orderCast' => 'int', - 'search' => $search, - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_TEAMS, - ], - ]); + ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) + ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) + ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true) + ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true) + ->action(function ($search, $limit, $offset, $orderType, $response, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ - $response->json(['sum' => $projectDB->getSum(), 'teams' => $results]); - } - ); + $results = $projectDB->getCollection([ + 'limit' => $limit, + 'offset' => $offset, + 'orderField' => 'dateCreated', + 'orderType' => $orderType, + 'orderCast' => 'int', + 'search' => $search, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_TEAMS, + ], + ]); -$utopia->get('/v1/teams/:teamId') + $response->dynamic(new Document([ + 'sum' => $projectDB->getSum(), + 'teams' => $results + ]), Response::MODEL_TEAM_LIST); + }, ['response', 'projectDB']); + +App::get('/v1/teams/:teamId') ->desc('Get Team') ->groups(['api', 'teams']) ->label('scope', 'teams.read') @@ -123,20 +127,21 @@ $utopia->get('/v1/teams/:teamId') ->label('sdk.namespace', 'teams') ->label('sdk.method', 'get') ->label('sdk.description', '/docs/references/teams/get-team.md') - ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') - ->action( - function ($teamId) use ($response, $projectDB) { - $team = $projectDB->getDocument($teamId); + ->param('teamId', '', new UID(), 'Team unique ID.') + ->action(function ($teamId, $response, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ - if (empty($team->getId()) || Database::SYSTEM_COLLECTION_TEAMS != $team->getCollection()) { - throw new Exception('Team not found', 404); - } + $team = $projectDB->getDocument($teamId); - $response->json($team->getArrayCopy([])); + if (empty($team->getId()) || Database::SYSTEM_COLLECTION_TEAMS != $team->getCollection()) { + throw new Exception('Team not found', 404); } - ); -$utopia->put('/v1/teams/:teamId') + $response->dynamic($team, Response::MODEL_TEAM); + }, ['response', 'projectDB']); + +App::put('/v1/teams/:teamId') ->desc('Update Team') ->groups(['api', 'teams']) ->label('scope', 'teams.write') @@ -144,29 +149,30 @@ $utopia->put('/v1/teams/:teamId') ->label('sdk.namespace', 'teams') ->label('sdk.method', 'update') ->label('sdk.description', '/docs/references/teams/update-team.md') - ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') - ->param('name', null, function () { return new Text(100); }, 'Team name.') - ->action( - function ($teamId, $name) use ($response, $projectDB) { - $team = $projectDB->getDocument($teamId); + ->param('teamId', '', new UID(), 'Team unique ID.') + ->param('name', null, new Text(128), 'Team name. Max length: 128 chars.') + ->action(function ($teamId, $name, $response, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ - if (empty($team->getId()) || Database::SYSTEM_COLLECTION_TEAMS != $team->getCollection()) { - throw new Exception('Team not found', 404); - } + $team = $projectDB->getDocument($teamId); - $team = $projectDB->updateDocument(\array_merge($team->getArrayCopy(), [ - 'name' => $name, - ])); - - if (false === $team) { - throw new Exception('Failed saving team to DB', 500); - } - - $response->json($team->getArrayCopy()); + if (empty($team->getId()) || Database::SYSTEM_COLLECTION_TEAMS != $team->getCollection()) { + throw new Exception('Team not found', 404); } - ); -$utopia->delete('/v1/teams/:teamId') + $team = $projectDB->updateDocument(\array_merge($team->getArrayCopy(), [ + 'name' => $name, + ])); + + if (false === $team) { + throw new Exception('Failed saving team to DB', 500); + } + + $response->dynamic($team, Response::MODEL_TEAM); + }, ['response', 'projectDB']); + +App::delete('/v1/teams/:teamId') ->desc('Delete Team') ->groups(['api', 'teams']) ->label('scope', 'teams.write') @@ -174,39 +180,40 @@ $utopia->delete('/v1/teams/:teamId') ->label('sdk.namespace', 'teams') ->label('sdk.method', 'delete') ->label('sdk.description', '/docs/references/teams/delete-team.md') - ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') - ->action( - function ($teamId) use ($response, $projectDB) { - $team = $projectDB->getDocument($teamId); + ->param('teamId', '', new UID(), 'Team unique ID.') + ->action(function ($teamId, $response, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ - if (empty($team->getId()) || Database::SYSTEM_COLLECTION_TEAMS != $team->getCollection()) { - throw new Exception('Team not found', 404); - } + $team = $projectDB->getDocument($teamId); - $memberships = $projectDB->getCollection([ - 'limit' => 2000, // TODO add members limit - 'offset' => 0, - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_MEMBERSHIPS, - 'teamId='.$teamId, - ], - ]); - - foreach ($memberships as $member) { - if (!$projectDB->deleteDocument($member->getId())) { - throw new Exception('Failed to remove membership for team from DB', 500); - } - } - - if (!$projectDB->deleteDocument($teamId)) { - throw new Exception('Failed to remove team from DB', 500); - } - - $response->noContent(); + if (empty($team->getId()) || Database::SYSTEM_COLLECTION_TEAMS != $team->getCollection()) { + throw new Exception('Team not found', 404); } - ); -$utopia->post('/v1/teams/:teamId/memberships') + $memberships = $projectDB->getCollection([ + 'limit' => 2000, // TODO add members limit + 'offset' => 0, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_MEMBERSHIPS, + 'teamId='.$teamId, + ], + ]); + + foreach ($memberships as $member) { + if (!$projectDB->deleteDocument($member->getId())) { + throw new Exception('Failed to remove membership for team from DB', 500); + } + } + + if (!$projectDB->deleteDocument($teamId)) { + throw new Exception('Failed to remove team from DB', 500); + } + + $response->noContent(); + }, ['response', 'projectDB']); + +App::post('/v1/teams/:teamId/memberships') ->desc('Create Team Membership') ->groups(['api', 'teams']) ->label('scope', 'teams.write') @@ -214,189 +221,187 @@ $utopia->post('/v1/teams/:teamId/memberships') ->label('sdk.namespace', 'teams') ->label('sdk.method', 'createMembership') ->label('sdk.description', '/docs/references/teams/create-team-membership.md') - ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') - ->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 Key()); }, 'Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Max length for each role is 32 chars.') - ->param('url', '', function () 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, $mail, $project, $user, $audit, $projectDB, &$mode) { - $name = (empty($name)) ? $email : $name; - $team = $projectDB->getDocument($teamId); + ->param('teamId', '', new UID(), 'Team unique ID.') + ->param('email', '', new Email(), 'New team member email.') + ->param('name', '', new Text(128), 'New team member name. Max length: 128 chars.', true) + ->param('roles', [], new ArrayList(new Key()), 'Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Max length for each role is 32 chars.') + ->param('url', '', function ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['clients']) // TODO add our own built-in confirm page + ->action(function ($teamId, $email, $name, $roles, $url, $response, $project, $user, $projectDB, $locale, $audits, $mails, $mode) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $project */ + /** @var Appwrite\Database\Document $user */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $audits */ + /** @var Appwrite\Event\Event $mails */ + /** @var bool $mode */ - if (empty($team->getId()) || Database::SYSTEM_COLLECTION_TEAMS != $team->getCollection()) { - throw new Exception('Team not found', 404); - } + $name = (empty($name)) ? $email : $name; + $team = $projectDB->getDocument($teamId); - $memberships = $projectDB->getCollection([ - 'limit' => 50, - 'offset' => 0, - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_MEMBERSHIPS, - 'teamId='.$team->getId(), - ], - ]); + if (empty($team->getId()) || Database::SYSTEM_COLLECTION_TEAMS != $team->getCollection()) { + throw new Exception('Team not found', 404); + } - $invitee = $projectDB->getCollectionFirst([ // Get user by email address - 'limit' => 1, - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_USERS, - 'email='.$email, - ], - ]); + $memberships = $projectDB->getCollection([ + 'limit' => 50, + 'offset' => 0, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_MEMBERSHIPS, + 'teamId='.$team->getId(), + ], + ]); - if (empty($invitee)) { // Create new user if no user with same email found + $invitee = $projectDB->getCollectionFirst([ // Get user by email address + 'limit' => 1, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_USERS, + 'email='.$email, + ], + ]); - Authorization::disable(); + if (empty($invitee)) { // Create new user if no user with same email found - try { - $invitee = $projectDB->createDocument([ - '$collection' => Database::SYSTEM_COLLECTION_USERS, - '$permissions' => [ - 'read' => ['user:{self}', '*'], - 'write' => ['user:{self}'], - ], - 'email' => $email, - 'emailVerification' => false, - 'status' => Auth::USER_STATUS_UNACTIVATED, - 'password' => Auth::passwordHash(Auth::passwordGenerator()), - 'password-update' => \time(), - 'registration' => \time(), - 'reset' => false, - 'name' => $name, - 'tokens' => [], - ], ['email' => $email]); - } catch (Duplicate $th) { - throw new Exception('Account already exists', 409); - } + Authorization::disable(); - Authorization::reset(); - - if (false === $invitee) { - throw new Exception('Failed saving user to DB', 500); - } - } - - $isOwner = false; - - foreach ($memberships as $member) { - if ($member->getAttribute('userId') == $invitee->getId()) { - throw new Exception('User has already been invited or is already a member of this team', 409); - } - - if ($member->getAttribute('userId') == $user->getId() && \in_array('owner', $member->getAttribute('roles', []))) { - $isOwner = true; - } - } - - if (!$isOwner && APP_MODE_ADMIN !== $mode && $user->getId()) { // Not owner, not admin, not app (server) - throw new Exception('User is not allowed to send invitations for this team', 401); - } - - $secret = Auth::tokenGenerator(); - - $membership = new Document([ - '$collection' => Database::SYSTEM_COLLECTION_MEMBERSHIPS, - '$permissions' => [ - 'read' => ['*'], - 'write' => ['user:'.$invitee->getId(), 'team:'.$team->getId().'/owner'], - ], - 'userId' => $invitee->getId(), - 'teamId' => $team->getId(), - 'roles' => $roles, - 'invited' => \time(), - 'joined' => (APP_MODE_ADMIN === $mode || !$user->getId()) ? \time() : 0, - 'confirm' => (APP_MODE_ADMIN === $mode || !$user->getId()), - 'secret' => Auth::hash($secret), - ]); - - if (APP_MODE_ADMIN === $mode || !$user->getId()) { // Allow admin to create membership - Authorization::disable(); - $membership = $projectDB->createDocument($membership->getArrayCopy()); - - $team = $projectDB->updateDocument(\array_merge($team->getArrayCopy(), [ - 'sum' => $team->getAttribute('sum', 0) + 1, - ])); - - // Attach user to team - $invitee->setAttribute('memberships', $membership, Document::SET_TYPE_APPEND); - - $invitee = $projectDB->updateDocument($invitee->getArrayCopy()); - - if (false === $invitee) { - throw new Exception('Failed saving user to DB', 500); - } - - Authorization::reset(); - } else { - $membership = $projectDB->createDocument($membership->getArrayCopy()); - } - - if (false === $membership) { - throw new Exception('Failed saving membership to DB', 500); - } - - $url = Template::parseURL($url); - $url['query'] = Template::mergeQuery(((isset($url['query'])) ? $url['query'] : ''), ['inviteId' => $membership->getId(), 'teamId' => $team->getId(), 'userId' => $invitee->getId(), 'secret' => $secret, 'teamId' => $teamId]); - $url = Template::unParseURL($url); - - $body = new Template(__DIR__.'/../../config/locales/templates/_base.tpl'); - $content = new Template(__DIR__.'/../../config/locales/templates/'.Locale::getText('account.emails.invitation.body')); - $cta = new Template(__DIR__.'/../../config/locales/templates/_cta.tpl'); - - $body - ->setParam('{{content}}', $content->render()) - ->setParam('{{cta}}', $cta->render()) - ->setParam('{{title}}', Locale::getText('account.emails.invitation.title')) - ->setParam('{{direction}}', Locale::getText('settings.direction')) - ->setParam('{{project}}', $project->getAttribute('name', ['[APP-NAME]'])) - ->setParam('{{team}}', $team->getAttribute('name', '[TEAM-NAME]')) - ->setParam('{{owner}}', $user->getAttribute('name', '')) - ->setParam('{{redirect}}', $url) - ->setParam('{{bg-body}}', '#f6f6f6') - ->setParam('{{bg-content}}', '#ffffff') - ->setParam('{{bg-cta}}', '#3498db') - ->setParam('{{bg-cta-hover}}', '#34495e') - ->setParam('{{text-content}}', '#000000') - ->setParam('{{text-cta}}', '#ffffff') - ; - - if (APP_MODE_ADMIN !== $mode && $user->getId()) { // No need in comfirmation when in admin or app mode - $mail - ->setParam('event', 'teams.membership.create') - ->setParam('recipient', $email) - ->setParam('name', $name) - ->setParam('subject', \sprintf(Locale::getText('account.emails.invitation.title'), $team->getAttribute('name', '[TEAM-NAME]'), $project->getAttribute('name', ['[APP-NAME]']))) - ->setParam('body', $body->render()) - ->trigger(); - ; - } - - $audit - ->setParam('userId', $invitee->getId()) - ->setParam('event', 'teams.membership.create') - ->setParam('resource', 'teams/'.$teamId) - ; - - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) // TODO change response of this endpoint - ->json(\array_merge($membership->getArrayCopy([ - '$id', - 'userId', - 'teamId', - 'roles', - 'invited', - 'joined', - 'confirm', - ]), [ + try { + $invitee = $projectDB->createDocument([ + '$collection' => Database::SYSTEM_COLLECTION_USERS, + '$permissions' => [ + 'read' => ['user:{self}', '*'], + 'write' => ['user:{self}'], + ], 'email' => $email, + 'emailVerification' => false, + 'status' => Auth::USER_STATUS_UNACTIVATED, + 'password' => Auth::passwordHash(Auth::passwordGenerator()), + 'password-update' => \time(), + 'registration' => \time(), + 'reset' => false, 'name' => $name, - ])) + 'tokens' => [], + ], ['email' => $email]); + } catch (Duplicate $th) { + throw new Exception('Account already exists', 409); + } + + Authorization::reset(); + + if (false === $invitee) { + throw new Exception('Failed saving user to DB', 500); + } + } + + $isOwner = false; + + foreach ($memberships as $member) { + if ($member->getAttribute('userId') == $invitee->getId()) { + throw new Exception('User has already been invited or is already a member of this team', 409); + } + + if ($member->getAttribute('userId') == $user->getId() && \in_array('owner', $member->getAttribute('roles', []))) { + $isOwner = true; + } + } + + if (!$isOwner && APP_MODE_ADMIN !== $mode && $user->getId()) { // Not owner, not admin, not app (server) + throw new Exception('User is not allowed to send invitations for this team', 401); + } + + $secret = Auth::tokenGenerator(); + + $membership = new Document([ + '$collection' => Database::SYSTEM_COLLECTION_MEMBERSHIPS, + '$permissions' => [ + 'read' => ['*'], + 'write' => ['user:'.$invitee->getId(), 'team:'.$team->getId().'/owner'], + ], + 'userId' => $invitee->getId(), + 'teamId' => $team->getId(), + 'roles' => $roles, + 'invited' => \time(), + 'joined' => (APP_MODE_ADMIN === $mode || !$user->getId()) ? \time() : 0, + 'confirm' => (APP_MODE_ADMIN === $mode || !$user->getId()), + 'secret' => Auth::hash($secret), + ]); + + if (APP_MODE_ADMIN === $mode || !$user->getId()) { // Allow admin to create membership + Authorization::disable(); + $membership = $projectDB->createDocument($membership->getArrayCopy()); + + $team = $projectDB->updateDocument(\array_merge($team->getArrayCopy(), [ + 'sum' => $team->getAttribute('sum', 0) + 1, + ])); + + // Attach user to team + $invitee->setAttribute('memberships', $membership, Document::SET_TYPE_APPEND); + + $invitee = $projectDB->updateDocument($invitee->getArrayCopy()); + + if (false === $invitee) { + throw new Exception('Failed saving user to DB', 500); + } + + Authorization::reset(); + } else { + $membership = $projectDB->createDocument($membership->getArrayCopy()); + } + + if (false === $membership) { + throw new Exception('Failed saving membership to DB', 500); + } + + $url = Template::parseURL($url); + $url['query'] = Template::mergeQuery(((isset($url['query'])) ? $url['query'] : ''), ['inviteId' => $membership->getId(), 'teamId' => $team->getId(), 'userId' => $invitee->getId(), 'secret' => $secret, 'teamId' => $teamId]); + $url = Template::unParseURL($url); + + $body = new Template(__DIR__.'/../../config/locale/templates/email-base.tpl'); + $content = new Template(__DIR__.'/../../config/locale/translations/templates/'.$locale->getText('account.emails.invitation.body')); + $cta = new Template(__DIR__.'/../../config/locale/templates/email-cta.tpl'); + + $body + ->setParam('{{content}}', $content->render()) + ->setParam('{{cta}}', $cta->render()) + ->setParam('{{title}}', $locale->getText('account.emails.invitation.title')) + ->setParam('{{direction}}', $locale->getText('settings.direction')) + ->setParam('{{project}}', $project->getAttribute('name', ['[APP-NAME]'])) + ->setParam('{{team}}', $team->getAttribute('name', '[TEAM-NAME]')) + ->setParam('{{owner}}', $user->getAttribute('name', '')) + ->setParam('{{redirect}}', $url) + ->setParam('{{bg-body}}', '#f6f6f6') + ->setParam('{{bg-content}}', '#ffffff') + ->setParam('{{bg-cta}}', '#3498db') + ->setParam('{{bg-cta-hover}}', '#34495e') + ->setParam('{{text-content}}', '#000000') + ->setParam('{{text-cta}}', '#ffffff') + ; + + if (APP_MODE_ADMIN !== $mode && $user->getId()) { // No need in comfirmation when in admin or app mode + $mails + ->setParam('event', 'teams.membership.create') + ->setParam('from', ($project->getId() === 'console') ? '' : \sprintf($locale->getText('account.emails.team'), $project->getAttribute('name'))) + ->setParam('recipient', $email) + ->setParam('name', $name) + ->setParam('subject', \sprintf($locale->getText('account.emails.invitation.title'), $team->getAttribute('name', '[TEAM-NAME]'), $project->getAttribute('name', ['[APP-NAME]']))) + ->setParam('body', $body->render()) + ->trigger(); ; } - ); -$utopia->get('/v1/teams/:teamId/memberships') + $audits + ->setParam('userId', $invitee->getId()) + ->setParam('event', 'teams.membership.create') + ->setParam('resource', 'teams/'.$teamId) + ; + + $response->setStatusCode(Response::STATUS_CODE_CREATED); + + $response->dynamic(new Document(\array_merge($membership->getArrayCopy(), [ + 'email' => $email, + 'name' => $name, + ])), Response::MODEL_MEMBERSHIP); + }, ['response', 'project', 'user', 'projectDB', 'locale', 'audits', 'mails', 'mode']); + +App::get('/v1/teams/:teamId/memberships') ->desc('Get Team Memberships') ->groups(['api', 'teams']) ->label('scope', 'teams.read') @@ -404,57 +409,49 @@ $utopia->get('/v1/teams/:teamId/memberships') ->label('sdk.namespace', 'teams') ->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, $search, $limit, $offset, $orderType) use ($response, $projectDB) { - $team = $projectDB->getDocument($teamId); + ->param('teamId', '', new UID(), 'Team unique ID.') + ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) + ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) + ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true) + ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true) + ->action(function ($teamId, $search, $limit, $offset, $orderType, $response, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ - if (empty($team->getId()) || Database::SYSTEM_COLLECTION_TEAMS != $team->getCollection()) { - throw new Exception('Team not found', 404); - } + $team = $projectDB->getDocument($teamId); - $memberships = $projectDB->getCollection([ - 'limit' => $limit, - 'offset' => $offset, - 'orderField' => 'joined', - 'orderType' => $orderType, - 'orderCast' => 'int', - 'search' => $search, - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_MEMBERSHIPS, - 'teamId='.$teamId, - ], - ]); - - $users = []; - - foreach ($memberships as $membership) { - if (empty($membership->getAttribute('userId', null))) { - continue; - } - - $temp = $projectDB->getDocument($membership->getAttribute('userId', null))->getArrayCopy(['email', 'name']); - - $users[] = \array_merge($temp, $membership->getArrayCopy([ - '$id', - 'userId', - 'teamId', - 'roles', - 'invited', - 'joined', - 'confirm', - ])); - } - - $response->json(['sum' => $projectDB->getSum(), 'memberships' => $users]); + if (empty($team->getId()) || Database::SYSTEM_COLLECTION_TEAMS != $team->getCollection()) { + throw new Exception('Team not found', 404); } - ); -$utopia->patch('/v1/teams/:teamId/memberships/:inviteId/status') + $memberships = $projectDB->getCollection([ + 'limit' => $limit, + 'offset' => $offset, + 'orderField' => 'joined', + 'orderType' => $orderType, + 'orderCast' => 'int', + 'search' => $search, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_MEMBERSHIPS, + 'teamId='.$teamId, + ], + ]); + $users = []; + + foreach ($memberships as $membership) { + if (empty($membership->getAttribute('userId', null))) { + continue; + } + + $temp = $projectDB->getDocument($membership->getAttribute('userId', null))->getArrayCopy(['email', 'name']); + + $users[] = new Document(\array_merge($temp, $membership->getArrayCopy())); + } + + $response->dynamic(new Document(['sum' => $projectDB->getSum(), 'memberships' => $users]), Response::MODEL_MEMBERSHIP_LIST); + }, ['response', 'projectDB']); + +App::patch('/v1/teams/:teamId/memberships/:inviteId/status') ->desc('Update Team Membership Status') ->groups(['api', 'teams']) ->label('scope', 'public') @@ -462,131 +459,173 @@ $utopia->patch('/v1/teams/:teamId/memberships/:inviteId/status') ->label('sdk.namespace', 'teams') ->label('sdk.method', 'updateMembershipStatus') ->label('sdk.description', '/docs/references/teams/update-team-membership-status.md') - ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') - ->param('inviteId', '', function () { return new UID(); }, 'Invite unique ID.') - ->param('userId', '', function () { return new UID(); }, 'User unique ID.') - ->param('secret', '', function () { return new Text(256); }, 'Secret key.') - ->action( - function ($teamId, $inviteId, $userId, $secret) use ($response, $request, $user, $audit, $projectDB) { - $protocol = Config::getParam('protocol'); - $membership = $projectDB->getDocument($inviteId); + ->param('teamId', '', new UID(), 'Team unique ID.') + ->param('inviteId', '', new UID(), 'Invite unique ID.') + ->param('userId', '', new UID(), 'User unique ID.') + ->param('secret', '', new Text(256), 'Secret key.') + ->action(function ($teamId, $inviteId, $userId, $secret, $request, $response, $user, $projectDB, $geodb, $audits) { + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $user */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var GeoIp2\Database\Reader $geodb */ + /** @var Appwrite\Event\Event $audits */ - if (empty($membership->getId()) || Database::SYSTEM_COLLECTION_MEMBERSHIPS != $membership->getCollection()) { - throw new Exception('Invite not found', 404); - } + $protocol = $request->getProtocol(); + $membership = $projectDB->getDocument($inviteId); - if ($membership->getAttribute('teamId') !== $teamId) { - throw new Exception('Team IDs don\'t match', 404); - } + if (empty($membership->getId()) || Database::SYSTEM_COLLECTION_MEMBERSHIPS != $membership->getCollection()) { + throw new Exception('Invite not found', 404); + } - Authorization::disable(); + if ($membership->getAttribute('teamId') !== $teamId) { + throw new Exception('Team IDs don\'t match', 404); + } - $team = $projectDB->getDocument($teamId); - - Authorization::reset(); + Authorization::disable(); - if (empty($team->getId()) || Database::SYSTEM_COLLECTION_TEAMS != $team->getCollection()) { - throw new Exception('Team not found', 404); - } + $team = $projectDB->getDocument($teamId); + + Authorization::reset(); - if (Auth::hash($secret) !== $membership->getAttribute('secret')) { - throw new Exception('Secret key not valid', 401); - } + if (empty($team->getId()) || Database::SYSTEM_COLLECTION_TEAMS != $team->getCollection()) { + throw new Exception('Team not found', 404); + } - if ($userId != $membership->getAttribute('userId')) { - throw new Exception('Invite not belong to current user ('.$user->getAttribute('email').')', 401); - } + if (Auth::hash($secret) !== $membership->getAttribute('secret')) { + throw new Exception('Secret key not valid', 401); + } - if (empty($user->getId())) { - $user = $projectDB->getCollectionFirst([ // Get user - 'limit' => 1, - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_USERS, - '$id='.$userId, - ], - ]); - } + if ($userId != $membership->getAttribute('userId')) { + throw new Exception('Invite not belong to current user ('.$user->getAttribute('email').')', 401); + } - if ($membership->getAttribute('userId') !== $user->getId()) { - throw new Exception('Invite not belong to current user ('.$user->getAttribute('email').')', 401); - } + if (empty($user->getId())) { + $user = $projectDB->getCollectionFirst([ // Get user + 'limit' => 1, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_USERS, + '$id='.$userId, + ], + ]); + } - $membership // Attach user to team - ->setAttribute('joined', \time()) - ->setAttribute('confirm', true) + if ($membership->getAttribute('userId') !== $user->getId()) { + throw new Exception('Invite not belong to current user ('.$user->getAttribute('email').')', 401); + } + + $membership // Attach user to team + ->setAttribute('joined', \time()) + ->setAttribute('confirm', true) + ; + + $user + ->setAttribute('emailVerification', true) + ->setAttribute('memberships', $membership, Document::SET_TYPE_APPEND) + ; + + // Log user in + + $dd = new DeviceDetector($request->getUserAgent('UNKNOWN')); + + $dd->parse(); + + $os = $dd->getOs(); + $osCode = (isset($os['short_name'])) ? $os['short_name'] : ''; + $osName = (isset($os['name'])) ? $os['name'] : ''; + $osVersion = (isset($os['version'])) ? $os['version'] : ''; + + $client = $dd->getClient(); + $clientType = (isset($client['type'])) ? $client['type'] : ''; + $clientCode = (isset($client['short_name'])) ? $client['short_name'] : ''; + $clientName = (isset($client['name'])) ? $client['name'] : ''; + $clientVersion = (isset($client['version'])) ? $client['version'] : ''; + $clientEngine = (isset($client['engine'])) ? $client['engine'] : ''; + $clientEngineVersion = (isset($client['engine_version'])) ? $client['engine_version'] : ''; + + $expiry = \time() + Auth::TOKEN_EXPIRATION_LOGIN_LONG; + $secret = Auth::tokenGenerator(); + + $session = new Document([ + '$collection' => Database::SYSTEM_COLLECTION_TOKENS, + '$permissions' => ['read' => ['user:'.$user->getId()], 'write' => ['user:'.$user->getId()]], + 'type' => Auth::TOKEN_TYPE_LOGIN, + 'secret' => Auth::hash($secret), // On way hash encryption to protect DB leak + 'expire' => $expiry, + 'userAgent' => $request->getUserAgent('UNKNOWN'), + 'ip' => $request->getIP(), + + 'osCode' => $osCode, + 'osName' => $osName, + 'osVersion' => $osVersion, + 'clientType' => $clientType, + 'clientCode' => $clientCode, + 'clientName' => $clientName, + 'clientVersion' => $clientVersion, + 'clientEngine' => $clientEngine, + 'clientEngineVersion' => $clientEngineVersion, + 'deviceName' => $dd->getDeviceName(), + 'deviceBrand' => $dd->getBrandName(), + 'deviceModel' => $dd->getModel(), + ]); + + try { + $record = $geodb->country($request->getIP()); + $session + ->setAttribute('countryCode', \strtolower($record->country->isoCode)) ; - - $user - ->setAttribute('emailVerification', true) - ->setAttribute('memberships', $membership, Document::SET_TYPE_APPEND) - ; - - // Log user in - $expiry = \time() + Auth::TOKEN_EXPIRATION_LOGIN_LONG; - $secret = Auth::tokenGenerator(); - - $user->setAttribute('tokens', new Document([ - '$collection' => Database::SYSTEM_COLLECTION_TOKENS, - '$permissions' => ['read' => ['user:'.$user->getId()], 'write' => ['user:'.$user->getId()]], - 'type' => Auth::TOKEN_TYPE_LOGIN, - 'secret' => Auth::hash($secret), // On way hash encryption to protect DB leak - 'expire' => $expiry, - 'userAgent' => $request->getServer('HTTP_USER_AGENT', 'UNKNOWN'), - 'ip' => $request->getIP(), - ]), Document::SET_TYPE_APPEND); - - Authorization::setRole('user:'.$userId); - - $user = $projectDB->updateDocument($user->getArrayCopy()); - - if (false === $user) { - throw new Exception('Failed saving user to DB', 500); - } - - Authorization::disable(); - - $team = $projectDB->updateDocument(\array_merge($team->getArrayCopy(), [ - 'sum' => $team->getAttribute('sum', 0) + 1, - ])); - - Authorization::reset(); - - if (false === $team) { - throw new Exception('Failed saving team to DB', 500); - } - - $audit - ->setParam('userId', $user->getId()) - ->setParam('event', 'teams.membership.update') - ->setParam('resource', 'teams/'.$teamId) - ; - - if (!Config::getParam('domainVerification')) { - $response - ->addHeader('X-Fallback-Cookies', \json_encode([Auth::$cookieName => Auth::encodeSession($user->getId(), $secret)])) - ; - } - - $response - ->addCookie(Auth::$cookieName.'_legacy', Auth::encodeSession($user->getId(), $secret), $expiry, '/', COOKIE_DOMAIN, ('https' == $protocol), true, null) - ->addCookie(Auth::$cookieName, Auth::encodeSession($user->getId(), $secret), $expiry, '/', COOKIE_DOMAIN, ('https' == $protocol), true, COOKIE_SAMESITE) - ->json(\array_merge($membership->getArrayCopy([ - '$id', - 'userId', - 'teamId', - 'roles', - 'invited', - 'joined', - 'confirm', - ]), [ - 'email' => $user->getAttribute('email'), - 'name' => $user->getAttribute('name'), - ])) + } catch (\Exception $e) { + $session + ->setAttribute('countryCode', '--') ; } - ); -$utopia->delete('/v1/teams/:teamId/memberships/:inviteId') + $user->setAttribute('tokens', $session, Document::SET_TYPE_APPEND); + + Authorization::setRole('user:'.$userId); + + $user = $projectDB->updateDocument($user->getArrayCopy()); + + if (false === $user) { + throw new Exception('Failed saving user to DB', 500); + } + + Authorization::disable(); + + $team = $projectDB->updateDocument(\array_merge($team->getArrayCopy(), [ + 'sum' => $team->getAttribute('sum', 0) + 1, + ])); + + Authorization::reset(); + + if (false === $team) { + throw new Exception('Failed saving team to DB', 500); + } + + $audits + ->setParam('userId', $user->getId()) + ->setParam('event', 'teams.membership.update') + ->setParam('resource', 'teams/'.$teamId) + ; + + if (!Config::getParam('domainVerification')) { + $response + ->addHeader('X-Fallback-Cookies', \json_encode([Auth::$cookieName => Auth::encodeSession($user->getId(), $secret)])) + ; + } + + $response + ->addCookie(Auth::$cookieName.'_legacy', Auth::encodeSession($user->getId(), $secret), $expiry, '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, null) + ->addCookie(Auth::$cookieName, Auth::encodeSession($user->getId(), $secret), $expiry, '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, Config::getParam('cookieSamesite')) + ; + + $response->dynamic(new Document(\array_merge($membership->getArrayCopy(), [ + 'email' => $user->getAttribute('email'), + 'name' => $user->getAttribute('name'), + ])), Response::MODEL_MEMBERSHIP); + }, ['request', 'response', 'user', 'projectDB', 'geodb', 'audits']); + +App::delete('/v1/teams/:teamId/memberships/:inviteId') ->desc('Delete Team Membership') ->groups(['api', 'teams']) ->label('scope', 'teams.write') @@ -594,46 +633,48 @@ $utopia->delete('/v1/teams/:teamId/memberships/:inviteId') ->label('sdk.namespace', 'teams') ->label('sdk.method', 'deleteMembership') ->label('sdk.description', '/docs/references/teams/delete-team-membership.md') - ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') - ->param('inviteId', '', function () { return new UID(); }, 'Invite unique ID.') - ->action( - function ($teamId, $inviteId) use ($response, $projectDB, $audit) { - $membership = $projectDB->getDocument($inviteId); + ->param('teamId', '', new UID(), 'Team unique ID.') + ->param('inviteId', '', new UID(), 'Invite unique ID.') + ->action(function ($teamId, $inviteId, $response, $projectDB, $audits) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $audits */ - if (empty($membership->getId()) || Database::SYSTEM_COLLECTION_MEMBERSHIPS != $membership->getCollection()) { - throw new Exception('Invite not found', 404); - } + $membership = $projectDB->getDocument($inviteId); - if ($membership->getAttribute('teamId') !== $teamId) { - throw new Exception('Team IDs don\'t match', 404); - } - - $team = $projectDB->getDocument($teamId); - - if (empty($team->getId()) || Database::SYSTEM_COLLECTION_TEAMS != $team->getCollection()) { - throw new Exception('Team not found', 404); - } - - if (!$projectDB->deleteDocument($membership->getId())) { - throw new Exception('Failed to remove membership from DB', 500); - } - - 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); - } - - $audit - ->setParam('userId', $membership->getAttribute('userId')) - ->setParam('event', 'teams.membership.delete') - ->setParam('resource', 'teams/'.$teamId) - ; - - $response->noContent(); + if (empty($membership->getId()) || Database::SYSTEM_COLLECTION_MEMBERSHIPS != $membership->getCollection()) { + throw new Exception('Invite not found', 404); } - ); + + if ($membership->getAttribute('teamId') !== $teamId) { + throw new Exception('Team IDs don\'t match', 404); + } + + $team = $projectDB->getDocument($teamId); + + if (empty($team->getId()) || Database::SYSTEM_COLLECTION_TEAMS != $team->getCollection()) { + throw new Exception('Team not found', 404); + } + + if (!$projectDB->deleteDocument($membership->getId())) { + throw new Exception('Failed to remove membership from DB', 500); + } + + 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); + } + + $audits + ->setParam('userId', $membership->getAttribute('userId')) + ->setParam('event', 'teams.membership.delete') + ->setParam('resource', 'teams/'.$teamId) + ; + + $response->noContent(); + }, ['response', 'projectDB', 'audits']); diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 74a257d299..6701d0756e 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -1,9 +1,7 @@ post('/v1/users') +App::post('/v1/users') ->desc('Create User') ->groups(['api', 'users']) + ->label('event', 'users.create') ->label('scope', 'users.write') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.namespace', '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. 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) { - $profile = $projectDB->getCollectionFirst([ // Get user by email address - 'limit' => 1, - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_USERS, - 'email='.$email, - ], - ]); + ->param('email', '', new Email(), 'User email.') + ->param('password', '', new Password(), 'User password. Must be between 6 to 32 chars.') + ->param('name', '', new Text(128), 'User name. Max length: 128 chars.', true) + ->action(function ($email, $password, $name, $response, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ - if (!empty($profile)) { - throw new Exception('User already registered', 409); - } + $profile = $projectDB->getCollectionFirst([ // Get user by email address + 'limit' => 1, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_USERS, + 'email='.$email, + ], + ]); - try { - $user = $projectDB->createDocument([ - '$collection' => Database::SYSTEM_COLLECTION_USERS, - '$permissions' => [ - 'read' => ['*'], - 'write' => ['user:{self}'], - ], - 'email' => $email, - 'emailVerification' => false, - 'status' => Auth::USER_STATUS_UNACTIVATED, - 'password' => Auth::passwordHash($password), - 'password-update' => \time(), - 'registration' => \time(), - 'reset' => false, - 'name' => $name, - ], ['email' => $email]); - } catch (Duplicate $th) { - throw new Exception('Account already exists', 409); - } - - $oauth2Keys = []; - - foreach (Config::getParam('providers') as $key => $provider) { - if (!$provider['enabled']) { - continue; - } - - $oauth2Keys[] = 'oauth2'.\ucfirst($key); - $oauth2Keys[] = 'oauth2'.\ucfirst($key).'AccessToken'; - } - - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->json(\array_merge($user->getArrayCopy(\array_merge([ - '$id', - 'status', - 'email', - 'registration', - 'emailVerification', - 'name', - ], $oauth2Keys)), ['roles' => []])); + if (!empty($profile)) { + throw new Exception('User already registered', 409); } - ); - -$utopia->get('/v1/users') + + try { + $user = $projectDB->createDocument([ + '$collection' => Database::SYSTEM_COLLECTION_USERS, + '$permissions' => [ + 'read' => ['*'], + 'write' => ['user:{self}'], + ], + 'email' => $email, + 'emailVerification' => false, + 'status' => Auth::USER_STATUS_UNACTIVATED, + 'password' => Auth::passwordHash($password), + 'password-update' => \time(), + 'registration' => \time(), + 'reset' => false, + 'name' => $name, + ], ['email' => $email]); + } catch (Duplicate $th) { + throw new Exception('Account already exists', 409); + } + + $response->setStatusCode(Response::STATUS_CODE_CREATED); + $response->dynamic($user, Response::MODEL_USER); + }, ['response', 'projectDB']); + +App::get('/v1/users') ->desc('List Users') ->groups(['api', 'users']) ->label('scope', 'users.read') @@ -98,54 +78,33 @@ $utopia->get('/v1/users') ->label('sdk.namespace', 'users') ->label('sdk.method', 'list') ->label('sdk.description', '/docs/references/users/list-users.md') - ->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 ($search, $limit, $offset, $orderType) use ($response, $projectDB) { - $results = $projectDB->getCollection([ - 'limit' => $limit, - 'offset' => $offset, - 'orderField' => 'registration', - 'orderType' => $orderType, - 'orderCast' => 'int', - 'search' => $search, - 'filters' => [ - '$collection='.Database::SYSTEM_COLLECTION_USERS, - ], - ]); + ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) + ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) + ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true) + ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true) + ->action(function ($search, $limit, $offset, $orderType, $response, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ - $oauth2Keys = []; + $results = $projectDB->getCollection([ + 'limit' => $limit, + 'offset' => $offset, + 'orderField' => 'registration', + 'orderType' => $orderType, + 'orderCast' => 'int', + 'search' => $search, + 'filters' => [ + '$collection='.Database::SYSTEM_COLLECTION_USERS, + ], + ]); - foreach (Config::getParam('providers') as $key => $provider) { - if (!$provider['enabled']) { - continue; - } + $response->dynamic(new Document([ + 'sum' => $projectDB->getSum(), + 'users' => $results + ]), Response::MODEL_USER_LIST); + }, ['response', 'projectDB']); - $oauth2Keys[] = 'oauth2'.\ucfirst($key); - $oauth2Keys[] = 'oauth2'.\ucfirst($key).'AccessToken'; - } - - $results = \array_map(function ($value) use ($oauth2Keys) { /* @var $value \Database\Document */ - return $value->getArrayCopy(\array_merge( - [ - '$id', - 'status', - 'email', - 'registration', - 'emailVerification', - 'name', - ], - $oauth2Keys - )); - }, $results); - - $response->json(['sum' => $projectDB->getSum(), 'users' => $results]); - } - ); - -$utopia->get('/v1/users/:userId') +App::get('/v1/users/:userId') ->desc('Get User') ->groups(['api', 'users']) ->label('scope', 'users.read') @@ -153,41 +112,21 @@ $utopia->get('/v1/users/:userId') ->label('sdk.namespace', 'users') ->label('sdk.method', 'get') ->label('sdk.description', '/docs/references/users/get-user.md') - ->param('userId', '', function () { return new UID(); }, 'User unique ID.') - ->action( - function ($userId) use ($response, $projectDB) { - $user = $projectDB->getDocument($userId); + ->param('userId', '', new UID(), 'User unique ID.') + ->action(function ($userId, $response, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ - if (empty($user->getId()) || Database::SYSTEM_COLLECTION_USERS != $user->getCollection()) { - throw new Exception('User not found', 404); - } + $user = $projectDB->getDocument($userId); - $oauth2Keys = []; - - foreach (Config::getParam('providers') as $key => $provider) { - if (!$provider['enabled']) { - continue; - } - - $oauth2Keys[] = 'oauth2'.\ucfirst($key); - $oauth2Keys[] = 'oauth2'.\ucfirst($key).'AccessToken'; - } - - $response->json(\array_merge($user->getArrayCopy(\array_merge( - [ - '$id', - 'status', - 'email', - 'registration', - 'emailVerification', - 'name', - ], - $oauth2Keys - )), ['roles' => []])); + if (empty($user->getId()) || Database::SYSTEM_COLLECTION_USERS != $user->getCollection()) { + throw new Exception('User not found', 404); } - ); -$utopia->get('/v1/users/:userId/prefs') + $response->dynamic($user, Response::MODEL_USER); + }, ['response', 'projectDB']); + +App::get('/v1/users/:userId/prefs') ->desc('Get User Preferences') ->groups(['api', 'users']) ->label('scope', 'users.read') @@ -195,29 +134,23 @@ $utopia->get('/v1/users/:userId/prefs') ->label('sdk.namespace', 'users') ->label('sdk.method', 'getPrefs') ->label('sdk.description', '/docs/references/users/get-user-prefs.md') - ->param('userId', '', function () { return new UID(); }, 'User unique ID.') - ->action( - function ($userId) use ($response, $projectDB) { - $user = $projectDB->getDocument($userId); + ->param('userId', '', new UID(), 'User unique ID.') + ->action(function ($userId, $response, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ - if (empty($user->getId()) || Database::SYSTEM_COLLECTION_USERS != $user->getCollection()) { - throw new Exception('User not found', 404); - } + $user = $projectDB->getDocument($userId); - $prefs = $user->getAttribute('prefs', ''); - - try { - $prefs = \json_decode($prefs, true); - $prefs = ($prefs) ? $prefs : []; - } catch (\Exception $error) { - throw new Exception('Failed to parse prefs', 500); - } - - $response->json($prefs); + if (empty($user->getId()) || Database::SYSTEM_COLLECTION_USERS != $user->getCollection()) { + throw new Exception('User not found', 404); } - ); -$utopia->get('/v1/users/:userId/sessions') + $prefs = $user->getAttribute('prefs', ''); + + $response->json($prefs); + }, ['response', 'projectDB']); + +App::get('/v1/users/:userId/sessions') ->desc('Get User Sessions') ->groups(['api', 'users']) ->label('scope', 'users.read') @@ -225,63 +158,42 @@ $utopia->get('/v1/users/:userId/sessions') ->label('sdk.namespace', 'users') ->label('sdk.method', 'getSessions') ->label('sdk.description', '/docs/references/users/get-user-sessions.md') - ->param('userId', '', function () { return new UID(); }, 'User unique ID.') - ->action( - function ($userId) use ($response, $projectDB) { - $user = $projectDB->getDocument($userId); + ->param('userId', '', new UID(), 'User unique ID.') + ->action(function ($userId, $response, $projectDB, $locale) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Utopia\Locale\Locale $locale */ - if (empty($user->getId()) || Database::SYSTEM_COLLECTION_USERS != $user->getCollection()) { - throw new Exception('User not found', 404); - } + $user = $projectDB->getDocument($userId); - $tokens = $user->getAttribute('tokens', []); - $reader = new Reader(__DIR__.'/../../db/DBIP/dbip-country-lite-2020-01.mmdb'); - $sessions = []; - $index = 0; - $countries = Locale::getText('countries'); - - foreach ($tokens as $token) { /* @var $token Document */ - if (Auth::TOKEN_TYPE_LOGIN != $token->getAttribute('type')) { - continue; - } - - $userAgent = (!empty($token->getAttribute('userAgent'))) ? $token->getAttribute('userAgent') : 'UNKNOWN'; - - $dd = new DeviceDetector($userAgent); - - // OPTIONAL: If called, bot detection will completely be skipped (bots will be detected as regular devices then) - // $dd->skipBotDetection(); - - $dd->parse(); - - $sessions[$index] = [ - '$id' => $token->getId(), - 'OS' => $dd->getOs(), - 'client' => $dd->getClient(), - 'device' => $dd->getDevice(), - 'brand' => $dd->getBrand(), - 'model' => $dd->getModel(), - 'ip' => $token->getAttribute('ip', ''), - 'geo' => [], - ]; - - try { - $record = $reader->country($token->getAttribute('ip', '')); - $sessions[$index]['geo']['isoCode'] = \strtolower($record->country->isoCode); - $sessions[$index]['geo']['country'] = (isset($countries[$record->country->isoCode])) ? $countries[$record->country->isoCode] : Locale::getText('locale.country.unknown'); - } catch (\Exception $e) { - $sessions[$index]['geo']['isoCode'] = '--'; - $sessions[$index]['geo']['country'] = Locale::getText('locale.country.unknown'); - } - - ++$index; - } - - $response->json($sessions); + if (empty($user->getId()) || Database::SYSTEM_COLLECTION_USERS != $user->getCollection()) { + throw new Exception('User not found', 404); } - ); -$utopia->get('/v1/users/:userId/logs') + $tokens = $user->getAttribute('tokens', []); + $sessions = []; + $countries = $locale->getText('countries'); + + foreach ($tokens as $token) { /* @var $token Document */ + if (Auth::TOKEN_TYPE_LOGIN != $token->getAttribute('type')) { + continue; + } + + $token->setAttribute('countryName', (isset($countries[$token->getAttribute('contryCode')])) + ? $countries[$token->getAttribute('contryCode')] + : $locale->getText('locale.country.unknown')); + $token->setAttribute('current', false); + + $sessions[] = $token; + } + + $response->dynamic(new Document([ + 'sum' => count($sessions), + 'sessions' => $sessions + ]), Response::MODEL_SESSION_LIST); + }, ['response', 'projectDB', 'locale']); + +App::get('/v1/users/:userId/logs') ->desc('Get User Logs') ->groups(['api', 'users']) ->label('scope', 'users.read') @@ -289,129 +201,135 @@ $utopia->get('/v1/users/:userId/logs') ->label('sdk.namespace', 'users') ->label('sdk.method', 'getLogs') ->label('sdk.description', '/docs/references/users/get-user-logs.md') - ->param('userId', '', function () { return new UID(); }, 'User unique ID.') - ->action( - function ($userId) use ($response, $register, $projectDB, $project) { - $user = $projectDB->getDocument($userId); + ->param('userId', '', new UID(), 'User unique ID.') + ->action(function ($userId, $response, $register, $project, $projectDB, $locale, $geodb) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Utopia\Registry\Registry $register */ + /** @var Appwrite\Database\Document $project */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Utopia\Locale\Locale $locale */ + /** @var GeoIp2\Database\Reader $geodb */ + + $user = $projectDB->getDocument($userId); - if (empty($user->getId()) || Database::SYSTEM_COLLECTION_USERS != $user->getCollection()) { - throw new Exception('User not found', 404); - } + if (empty($user->getId()) || Database::SYSTEM_COLLECTION_USERS != $user->getCollection()) { + throw new Exception('User not found', 404); + } - $adapter = new AuditAdapter($register->get('db')); - $adapter->setNamespace('app_'.$project->getId()); + $adapter = new AuditAdapter($register->get('db')); + $adapter->setNamespace('app_'.$project->getId()); - $audit = new Audit($adapter); - - $countries = Locale::getText('countries'); + $audit = new Audit($adapter); + + $countries = $locale->getText('countries'); - $logs = $audit->getLogsByUserAndActions($user->getId(), [ - 'account.create', - 'account.delete', - 'account.update.name', - 'account.update.email', - 'account.update.password', - 'account.update.prefs', - 'account.sessions.create', - 'account.sessions.delete', - 'account.recovery.create', - 'account.recovery.update', - 'account.verification.create', - 'account.verification.update', - 'teams.membership.create', - 'teams.membership.update', - 'teams.membership.delete', + $logs = $audit->getLogsByUserAndActions($user->getId(), [ + 'account.create', + 'account.delete', + 'account.update.name', + 'account.update.email', + 'account.update.password', + 'account.update.prefs', + 'account.sessions.create', + 'account.sessions.delete', + 'account.recovery.create', + 'account.recovery.update', + 'account.verification.create', + 'account.verification.update', + 'teams.membership.create', + 'teams.membership.update', + 'teams.membership.delete', + ]); + + $output = []; + + foreach ($logs as $i => &$log) { + $log['userAgent'] = (!empty($log['userAgent'])) ? $log['userAgent'] : 'UNKNOWN'; + + $dd = new DeviceDetector($log['userAgent']); + + $dd->skipBotDetection(); // OPTIONAL: If called, bot detection will completely be skipped (bots will be detected as regular devices then) + + $dd->parse(); + + $os = $dd->getOs(); + $osCode = (isset($os['short_name'])) ? $os['short_name'] : ''; + $osName = (isset($os['name'])) ? $os['name'] : ''; + $osVersion = (isset($os['version'])) ? $os['version'] : ''; + + $client = $dd->getClient(); + $clientType = (isset($client['type'])) ? $client['type'] : ''; + $clientCode = (isset($client['short_name'])) ? $client['short_name'] : ''; + $clientName = (isset($client['name'])) ? $client['name'] : ''; + $clientVersion = (isset($client['version'])) ? $client['version'] : ''; + $clientEngine = (isset($client['engine'])) ? $client['engine'] : ''; + $clientEngineVersion = (isset($client['engine_version'])) ? $client['engine_version'] : ''; + + $output[$i] = new Document([ + 'event' => $log['event'], + 'ip' => $log['ip'], + 'time' => \strtotime($log['time']), + + 'osCode' => $osCode, + 'osName' => $osName, + 'osVersion' => $osVersion, + 'clientType' => $clientType, + 'clientCode' => $clientCode, + 'clientName' => $clientName, + 'clientVersion' => $clientVersion, + 'clientEngine' => $clientEngine, + 'clientEngineVersion' => $clientEngineVersion, + 'deviceName' => $dd->getDeviceName(), + 'deviceBrand' => $dd->getBrandName(), + 'deviceModel' => $dd->getModel(), ]); - $reader = new Reader(__DIR__.'/../../db/DBIP/dbip-country-lite-2020-01.mmdb'); - $output = []; - - foreach ($logs as $i => &$log) { - $log['userAgent'] = (!empty($log['userAgent'])) ? $log['userAgent'] : 'UNKNOWN'; - - $dd = new DeviceDetector($log['userAgent']); - - $dd->skipBotDetection(); // OPTIONAL: If called, bot detection will completely be skipped (bots will be detected as regular devices then) - - $dd->parse(); - - $output[$i] = [ - 'event' => $log['event'], - 'ip' => $log['ip'], - 'time' => \strtotime($log['time']), - 'OS' => $dd->getOs(), - 'client' => $dd->getClient(), - 'device' => $dd->getDevice(), - 'brand' => $dd->getBrand(), - 'model' => $dd->getModel(), - 'geo' => [], - ]; - - try { - $record = $reader->country($log['ip']); - $output[$i]['geo']['isoCode'] = \strtolower($record->country->isoCode); - $output[$i]['geo']['country'] = $record->country->name; - $output[$i]['geo']['country'] = (isset($countries[$record->country->isoCode])) ? $countries[$record->country->isoCode] : Locale::getText('locale.country.unknown'); - } catch (\Exception $e) { - $output[$i]['geo']['isoCode'] = '--'; - $output[$i]['geo']['country'] = Locale::getText('locale.country.unknown'); - } + try { + $record = $geodb->country($log['ip']); + $output[$i]->setAttribute('countryCode', \strtolower($record->country->isoCode)); + $output[$i]->setAttribute('countryName', (isset($countries[$record->country->isoCode])) ? $countries[$record->country->isoCode] : $locale->getText('locale.country.unknown')); + } catch (\Exception $e) { + $output[$i]->setAttribute('countryCode', '--'); + $output[$i]->setAttribute('countryName', $locale->getText('locale.country.unknown')); } - - $response->json($output); } - ); -$utopia->patch('/v1/users/:userId/status') + $response->dynamic(new Document(['logs' => $output]), Response::MODEL_LOG_LIST); + }, ['response', 'register', 'project', 'projectDB', 'locale', 'geodb']); + +App::patch('/v1/users/:userId/status') ->desc('Update User Status') ->groups(['api', 'users']) + ->label('event', 'users.update.status') ->label('scope', 'users.write') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'users') ->label('sdk.method', 'updateStatus') ->label('sdk.description', '/docs/references/users/update-user-status.md') - ->param('userId', '', function () { return new UID(); }, 'User unique ID.') - ->param('status', '', function () { return new WhiteList([Auth::USER_STATUS_ACTIVATED, Auth::USER_STATUS_BLOCKED, Auth::USER_STATUS_UNACTIVATED]); }, 'User Status code. To activate the user pass '.Auth::USER_STATUS_ACTIVATED.', to block the user pass '.Auth::USER_STATUS_BLOCKED.' and for disabling the user pass '.Auth::USER_STATUS_UNACTIVATED) - ->action( - function ($userId, $status) use ($response, $projectDB) { - $user = $projectDB->getDocument($userId); + ->param('userId', '', new UID(), 'User unique ID.') + ->param('status', '', new WhiteList([Auth::USER_STATUS_ACTIVATED, Auth::USER_STATUS_BLOCKED, Auth::USER_STATUS_UNACTIVATED], true), 'User Status code. To activate the user pass '.Auth::USER_STATUS_ACTIVATED.', to block the user pass '.Auth::USER_STATUS_BLOCKED.' and for disabling the user pass '.Auth::USER_STATUS_UNACTIVATED) + ->action(function ($userId, $status, $response, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ - if (empty($user->getId()) || Database::SYSTEM_COLLECTION_USERS != $user->getCollection()) { - throw new Exception('User not found', 404); - } + $user = $projectDB->getDocument($userId); - $user = $projectDB->updateDocument(\array_merge($user->getArrayCopy(), [ - 'status' => (int)$status, - ])); - - if (false === $user) { - throw new Exception('Failed saving user to DB', 500); - } - - $oauth2Keys = []; - - foreach (Config::getParam('providers') as $key => $provider) { - if (!$provider['enabled']) { - continue; - } - - $oauth2Keys[] = 'oauth2'.\ucfirst($key); - $oauth2Keys[] = 'oauth2'.\ucfirst($key).'AccessToken'; - } - - $response - ->json(\array_merge($user->getArrayCopy(\array_merge([ - '$id', - 'status', - 'email', - 'registration', - 'emailVerification', - 'name', - ], $oauth2Keys)), ['roles' => []])); + if (empty($user->getId()) || Database::SYSTEM_COLLECTION_USERS != $user->getCollection()) { + throw new Exception('User not found', 404); } - ); -$utopia->patch('/v1/users/:userId/prefs') + $user = $projectDB->updateDocument(\array_merge($user->getArrayCopy(), [ + 'status' => (int)$status, + ])); + + if (false === $user) { + throw new Exception('Failed saving user to DB', 500); + } + + $response->dynamic($user, Response::MODEL_USER); + }, ['response', 'projectDB']); + +App::patch('/v1/users/:userId/prefs') ->desc('Update User Preferences') ->groups(['api', 'users']) ->label('scope', 'users.write') @@ -419,100 +337,155 @@ $utopia->patch('/v1/users/:userId/prefs') ->label('sdk.namespace', 'users') ->label('sdk.method', 'updatePrefs') ->label('sdk.description', '/docs/references/users/update-user-prefs.md') - ->param('userId', '', function () { return new UID(); }, 'User unique ID.') - ->param('prefs', '', function () { return new Assoc();}, 'Prefs key-value JSON object.') - ->action( - function ($userId, $prefs) use ($response, $projectDB) { - $user = $projectDB->getDocument($userId); + ->param('userId', '', new UID(), 'User unique ID.') + ->param('prefs', '', new Assoc(), 'Prefs key-value JSON object.') + ->action(function ($userId, $prefs, $response, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ - if (empty($user->getId()) || Database::SYSTEM_COLLECTION_USERS != $user->getCollection()) { - throw new Exception('User not found', 404); - } + $user = $projectDB->getDocument($userId); - $old = \json_decode($user->getAttribute('prefs', '{}'), true); - $old = ($old) ? $old : []; - - $user = $projectDB->updateDocument(\array_merge($user->getArrayCopy(), [ - 'prefs' => \json_encode(\array_merge($old, $prefs)), - ])); - - if (false === $user) { - throw new Exception('Failed saving user to DB', 500); - } - - $prefs = $user->getAttribute('prefs', ''); - - try { - $prefs = \json_decode($prefs, true); - $prefs = ($prefs) ? $prefs : []; - } catch (\Exception $error) { - throw new Exception('Failed to parse prefs', 500); - } - - $response->json($prefs); + if (empty($user->getId()) || Database::SYSTEM_COLLECTION_USERS != $user->getCollection()) { + throw new Exception('User not found', 404); } - ); + $user = $projectDB->updateDocument(\array_merge($user->getArrayCopy(), [ + 'prefs' => $prefs, + ])); -$utopia->delete('/v1/users/:userId/sessions/:sessionId') + if (false === $user) { + throw new Exception('Failed saving user to DB', 500); + } + + $response->json($prefs); + }, ['response', 'projectDB']); + +App::delete('/v1/users/:userId/sessions/:sessionId') ->desc('Delete User Session') ->groups(['api', 'users']) + ->label('event', 'users.sessions.delete') ->label('scope', 'users.write') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'users') ->label('sdk.method', 'deleteSession') ->label('sdk.description', '/docs/references/users/delete-user-session.md') ->label('abuse-limit', 100) - ->param('userId', '', function () { return new UID(); }, 'User unique ID.') - ->param('sessionId', null, function () { return new UID(); }, 'User unique session ID.') - ->action( - function ($userId, $sessionId) use ($response, $request, $projectDB) { - $user = $projectDB->getDocument($userId); + ->param('userId', '', new UID(), 'User unique ID.') + ->param('sessionId', null, new UID(), 'User unique session ID.') + ->action(function ($userId, $sessionId, $response, $projectDB, $webhooks) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $webhooks */ - if (empty($user->getId()) || Database::SYSTEM_COLLECTION_USERS != $user->getCollection()) { - throw new Exception('User not found', 404); - } + $user = $projectDB->getDocument($userId); - $tokens = $user->getAttribute('tokens', []); - - foreach ($tokens as $token) { /* @var $token Document */ - if ($sessionId == $token->getId()) { - if (!$projectDB->deleteDocument($token->getId())) { - throw new Exception('Failed to remove token from DB', 500); - } - } - } - - $response->json(array('result' => 'success')); + if (empty($user->getId()) || Database::SYSTEM_COLLECTION_USERS != $user->getCollection()) { + throw new Exception('User not found', 404); } - ); -$utopia->delete('/v1/users/:userId/sessions') + $tokens = $user->getAttribute('tokens', []); + + foreach ($tokens as $token) { /* @var $token Document */ + if ($sessionId == $token->getId()) { + if (!$projectDB->deleteDocument($token->getId())) { + throw new Exception('Failed to remove token from DB', 500); + } + + $webhooks + ->setParam('payload', $response->output($user, Response::MODEL_USER)) + ; + } + } + + $response->noContent(); + }, ['response', 'projectDB', 'webhooks']); + +App::delete('/v1/users/:userId/sessions') ->desc('Delete User Sessions') ->groups(['api', 'users']) + ->label('event', 'users.sessions.delete') ->label('scope', 'users.write') ->label('sdk.platform', [APP_PLATFORM_SERVER]) ->label('sdk.namespace', 'users') ->label('sdk.method', 'deleteSessions') ->label('sdk.description', '/docs/references/users/delete-user-sessions.md') ->label('abuse-limit', 100) - ->param('userId', '', function () { return new UID(); }, 'User unique ID.') - ->action( - function ($userId) use ($response, $request, $projectDB) { - $user = $projectDB->getDocument($userId); + ->param('userId', '', new UID(), 'User unique ID.') + ->action(function ($userId, $response, $projectDB, $webhooks) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $webhooks */ - if (empty($user->getId()) || Database::SYSTEM_COLLECTION_USERS != $user->getCollection()) { - throw new Exception('User not found', 404); - } + $user = $projectDB->getDocument($userId); - $tokens = $user->getAttribute('tokens', []); - - foreach ($tokens as $token) { /* @var $token Document */ - if (!$projectDB->deleteDocument($token->getId())) { - throw new Exception('Failed to remove token from DB', 500); - } - } - - $response->json(array('result' => 'success')); + if (empty($user->getId()) || Database::SYSTEM_COLLECTION_USERS != $user->getCollection()) { + throw new Exception('User not found', 404); } - ); + + $tokens = $user->getAttribute('tokens', []); + + foreach ($tokens as $token) { /* @var $token Document */ + if (!$projectDB->deleteDocument($token->getId())) { + throw new Exception('Failed to remove token from DB', 500); + } + } + + $webhooks + ->setParam('payload', $response->output($user, Response::MODEL_USER)) + ; + + $response->noContent(); + }, ['response', 'projectDB', 'webhooks']); + +App::delete('/v1/users/:userId') + ->desc('Delete User') + ->groups(['api', 'users']) + ->label('event', 'users.delete') + ->label('scope', 'users.write') + ->label('sdk.platform', [APP_PLATFORM_SERVER]) + ->label('sdk.namespace', 'users') + ->label('sdk.method', 'deleteUser') + ->label('sdk.description', '/docs/references/users/delete-user.md') + ->label('abuse-limit', 100) + ->param('userId', '', function () {return new UID();}, 'User unique ID.') + ->action(function ($userId, $response, $projectDB, $webhooks, $deletes) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var Appwrite\Event\Event $webhooks */ + /** @var Appwrite\Event\Event $deletes */ + + $user = $projectDB->getDocument($userId); + + if (empty($user->getId()) || Database::SYSTEM_COLLECTION_USERS != $user->getCollection()) { + throw new Exception('User not found', 404); + } + if (!$projectDB->deleteDocument($userId)) { + throw new Exception('Failed to remove user from DB', 500); + } + + if (!$projectDB->deleteUniqueKey(md5('users:email='.$user->getAttribute('email', null)))) { + throw new Exception('Failed to remove unique key from DB', 500); + } + + $reservedId = $projectDB->createDocument([ + '$collection' => Database::SYSTEM_COLLECTION_RESERVED, + '$id' => $userId, + '$permissions' => [ + 'read' => ['*'], + ], + ]); + + if (false === $reservedId) { + throw new Exception('Failed saving reserved id to DB', 500); + } + + $deletes + ->setParam('document', $user) + ; + + $webhooks + ->setParam('payload', $response->output($user, Response::MODEL_USER)) + ; + + $response->noContent(); + }, ['response', 'projectDB', 'webhooks', 'deletes']); diff --git a/app/app.php b/app/controllers/general.php similarity index 50% rename from app/app.php rename to app/controllers/general.php index e92660b5a0..9db6c0f2f1 100644 --- a/app/app.php +++ b/app/controllers/general.php @@ -1,11 +1,10 @@ getAttribute('platforms', []), function ($node) { - if (isset($node['type']) && $node['type'] === 'web' && isset($node['hostname']) && !empty($node['hostname'])) { - return true; - } - - return false; - })); - -$clients = \array_unique(\array_merge($clientsConsole, \array_map(function ($node) { - return $node['hostname']; - }, \array_filter($project->getAttribute('platforms', []), function ($node) { - if (isset($node['type']) && $node['type'] === 'web' && isset($node['hostname']) && !empty($node['hostname'])) { - return true; - } - - return false; - })))); - -$utopia->init(function () use ($utopia, $request, $response, &$user, $project, $console, $webhook, $mail, $audit, $usage, $clients) { +App::init(function ($utopia, $request, $response, $console, $project, $user, $locale, $webhooks, $audits, $usage, $deletes, $functions, $clients) { + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $console */ + /** @var Appwrite\Database\Document $project */ + /** @var Appwrite\Database\Document $user */ + /** @var Utopia\Locale\Locale $locale */ + /** @var Appwrite\Event\Event $webhooks */ + /** @var Appwrite\Event\Event $audits */ + /** @var Appwrite\Event\Event $usage */ + /** @var Appwrite\Event\Event $deletes */ + /** @var Appwrite\Event\Event $functions */ + /** @var bool $mode */ + /** @var array $clients */ + Authorization::$roles = ['*']; + + $localeParam = (string)$request->getParam('locale', $request->getHeader('x-appwrite-locale', '')); + + if (\in_array($localeParam, Config::getParam('locale-codes'))) { + $locale->setDefault($localeParam); + }; + $route = $utopia->match($request); if(!empty($route->getLabel('sdk.platform', [])) && empty($project->getId()) && ($route->getLabel('scope', '') !== 'public')) { throw new Exception('Missing or unknown project ID', 400); } - $referrer = $request->getServer('HTTP_REFERER', ''); - $origin = \parse_url($request->getServer('HTTP_ORIGIN', $referrer), PHP_URL_HOST); - $protocol = \parse_url($request->getServer('HTTP_ORIGIN', $referrer), PHP_URL_SCHEME); - $port = \parse_url($request->getServer('HTTP_ORIGIN', $referrer), PHP_URL_PORT); + $console->setAttribute('platforms', [ // Allways allow current host + '$collection' => Database::SYSTEM_COLLECTION_PLATFORMS, + 'name' => 'Current Host', + 'type' => 'web', + 'hostname' => $request->getHostname(), + ], Document::SET_TYPE_APPEND); - $refDomain = $protocol.'://'.((\in_array($origin, $clients)) + $referrer = $request->getReferer(); + $origin = \parse_url($request->getOrigin($referrer), PHP_URL_HOST); + $protocol = \parse_url($request->getOrigin($referrer), PHP_URL_SCHEME); + $port = \parse_url($request->getOrigin($referrer), PHP_URL_PORT); + + $refDomain = (!empty($protocol) ? $protocol : $request->getProtocol()).'://'.((\in_array($origin, $clients)) ? $origin : 'localhost') . (!empty($port) ? ':'.$port : ''); - $selfDomain = new Domain(Config::getParam('hostname')); + $selfDomain = new Domain($request->getHostname()); $endDomain = new Domain($origin); + // var_dump('referer', $referrer); + // var_dump('origin', $origin); + // var_dump('port', $request->getPort()); + // var_dump('hostname', $request->getHostname()); + // var_dump('protocol', $request->getProtocol()); + // var_dump('method', $request->getMethod()); + // var_dump('ip', $request->getIP()); + // var_dump('-----------------'); + // var_dump($request->debug()); + Config::setParam('domainVerification', ($selfDomain->getRegisterable() === $endDomain->getRegisterable()) && $endDomain->getRegisterable() !== ''); + Config::setParam('cookieDomain', ( + $request->getHostname() === 'localhost' || + $request->getHostname() === 'localhost:'.$request->getPort() || + (\filter_var($request->getHostname(), FILTER_VALIDATE_IP) !== false) + ) + ? null + : '.'.$request->getHostname() + ); + + Storage::setDevice('files', new Local(APP_STORAGE_UPLOADS.'/app-'.$project->getId())); + Storage::setDevice('functions', new Local(APP_STORAGE_FUNCTIONS.'/app-'.$project->getId())); + /* * Security Headers * * As recommended at: * @see https://www.owasp.org/index.php/List_of_useful_HTTP_headers */ - if ($utopia->getEnv('_APP_OPTIONS_FORCE_HTTPS', 'disabled') === 'enabled') { // Force HTTPS - if(Config::getParam('protocol') !== 'https') { - return $response->redirect('https://' . Config::getParam('domain').$request->getServer('REQUEST_URI')); + if (App::getEnv('_APP_OPTIONS_FORCE_HTTPS', 'disabled') === 'enabled') { // Force HTTPS + if($request->getProtocol() !== 'https') { + return $response->redirect('https://'.$request->getHostname().$request->getURI()); } $response->addHeader('Strict-Transport-Security', 'max-age='.(60 * 60 * 24 * 126)); // 126 days @@ -89,7 +110,7 @@ $utopia->init(function () use ($utopia, $request, $response, &$user, $project, $ $response ->addHeader('Server', 'Appwrite') - ->addHeader('X-XSS-Protection', '1; mode=block; report=/v1/xss?url='.\urlencode($request->getServer('REQUEST_URI'))) + ->addHeader('X-XSS-Protection', '1; mode=block; report=/v1/xss?url='.\urlencode($request->getURI())) //->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') @@ -104,13 +125,13 @@ $utopia->init(function () use ($utopia, $request, $response, &$user, $project, $ * Adding Appwrite API domains to allow XDOMAIN communication * Skip this check for non-web platforms which are not requiredto send an origin header */ - $origin = $request->getServer('HTTP_ORIGIN', $request->getServer('HTTP_REFERER', '')); + $origin = $request->getOrigin($request->getReferer('')); $originValidator = new Origin(\array_merge($project->getAttribute('platforms', []), $console->getAttribute('platforms', []))); 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', ''))) { + && empty($request->getHeader('x-appwrite-key', ''))) { throw new Exception($originValidator->getDescription(), 403); } @@ -143,7 +164,7 @@ $utopia->init(function () use ($utopia, $request, $response, &$user, $project, $ $scopes = $roles[$role]['scopes']; // Allowed scopes for user role // Check if given key match project API keys - $key = $project->search('secret', $request->getHeader('X-Appwrite-Key', ''), $project->getAttribute('keys', [])); + $key = $project->search('secret', $request->getHeader('x-appwrite-key', ''), $project->getAttribute('keys', [])); /* * Try app auth when we have project key and no user @@ -153,7 +174,7 @@ $utopia->init(function () use ($utopia, $request, $response, &$user, $project, $ $user = new Document([ '$id' => 0, 'status' => Auth::USER_STATUS_ACTIVATED, - 'email' => 'app.'.$project->getId().'@service.'.Config::getParam('domain'), + 'email' => 'app.'.$project->getId().'@service.'.$request->getHostname(), 'password' => '', 'name' => $project->getAttribute('name', 'Untitled'), ]); @@ -164,7 +185,9 @@ $utopia->init(function () use ($utopia, $request, $response, &$user, $project, $ Authorization::setDefaultStatus(false); // Cancel security segmentation for API keys. } - Authorization::setRole('user:'.$user->getId()); + if($user->getId()) { + Authorization::setRole('user:'.$user->getId()); + } Authorization::setRole('role:'.$role); \array_map(function ($node) { @@ -198,43 +221,76 @@ $utopia->init(function () use ($utopia, $request, $response, &$user, $project, $ /* * Background Jobs */ - $webhook + $functions ->setParam('projectId', $project->getId()) - ->setParam('event', $route->getLabel('webhook', '')) + ->setParam('event', $route->getLabel('event', '')) + ->setParam('payload', []) + ->setParam('functionId', null) + ->setParam('executionId', null) + ->setParam('trigger', 'event') + ; + + $webhooks + ->setParam('projectId', $project->getId()) + ->setParam('event', $route->getLabel('event', '')) ->setParam('payload', []) ; - $audit + $audits ->setParam('projectId', $project->getId()) ->setParam('userId', $user->getId()) ->setParam('event', '') ->setParam('resource', '') - ->setParam('userAgent', $request->getServer('HTTP_USER_AGENT', '')) + ->setParam('userAgent', $request->getUserAgent('')) ->setParam('ip', $request->getIP()) ->setParam('data', []) ; $usage ->setParam('projectId', $project->getId()) - ->setParam('url', $request->getServer('HTTP_HOST', '').$request->getServer('REQUEST_URI', '')) - ->setParam('method', $request->getServer('REQUEST_METHOD', 'UNKNOWN')) - ->setParam('request', 0) - ->setParam('response', 0) + ->setParam('httpRequest', 1) + ->setParam('httpUrl', $request->getHostname().$request->getURI()) + ->setParam('httpMethod', $request->getMethod()) + ->setParam('networkRequestSize', 0) + ->setParam('networkResponseSize', 0) ->setParam('storage', 0) ; -}); + + $deletes + ->setParam('projectId', $project->getId()) + ; +}, ['utopia', 'request', 'response', 'console', 'project', 'user', 'locale', 'webhooks', 'audits', 'usage', 'deletes', 'functions', 'clients']); -$utopia->shutdown(function () use ($response, $request, $webhook, $audit, $usage, $deletes, $mode, $project, $utopia) { +App::shutdown(function ($utopia, $request, $response, $project, $webhooks, $audits, $usage, $deletes, $functions, $mode) { + /** @var Utopia\App $utopia */ + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $project */ + /** @var Appwrite\Event\Event $webhooks */ + /** @var Appwrite\Event\Event $audits */ + /** @var Appwrite\Event\Event $usage */ + /** @var Appwrite\Event\Event $deletes */ + /** @var Appwrite\Event\Event $functions */ + /** @var bool $mode */ - /* - * Trigger events for background workers - */ - if (!empty($webhook->getParam('event'))) { - $webhook->trigger(); + if (!empty($functions->getParam('event'))) { + if(empty($functions->getParam('payload'))) { + $functions->setParam('payload', $response->getPayload()); + } + + $functions->trigger(); + } + + if (!empty($webhooks->getParam('event'))) { + if(empty($webhooks->getParam('payload'))) { + $webhooks->setParam('payload', $response->getPayload()); + } + + $webhooks->trigger(); } - if (!empty($audit->getParam('event'))) { - $audit->trigger(); + if (!empty($audits->getParam('event'))) { + $audits->trigger(); } if (!empty($deletes->getParam('document'))) { @@ -246,29 +302,52 @@ $utopia->shutdown(function () use ($response, $request, $webhook, $audit, $usage 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() + $usage->getParam('storage')) - ->setParam('response', $response->getSize()) + ->setParam('networkRequestSize', $request->getSize() + $usage->getParam('storage')) + ->setParam('networkResponseSize', $response->getSize()) ->trigger() ; } -}); +}, ['utopia', 'request', 'response', 'project', 'webhooks', 'audits', 'usage', 'deletes', 'functions', 'mode']); -$utopia->options(function () use ($request, $response) { - $origin = $request->getServer('HTTP_ORIGIN'); +App::options(function ($request, $response) { + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + + $origin = $request->getOrigin(); $response + ->addHeader('Server', 'Appwrite') ->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, 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') ->send(); -}); +}, ['request', 'response']); -$utopia->error(function ($error /* @var $error Exception */) use ($request, $response, $utopia, $project) { - $env = Config::getParam('env'); - $version = Config::getParam('version'); +App::error(function ($error, $utopia, $request, $response, $layout, $project) { + /** @var Exception $error */ + /** @var Utopia\App $utopia */ + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + /** @var Utopia\View $layout */ + /** @var Appwrite\Database\Document $project */ + + $route = $utopia->match($request); + $template = ($route) ? $route->getLabel('error', null) : null; + + if(php_sapi_name() === 'cli') { + var_dump($route->getMethod()); + var_dump($route->getURL()); + var_dump(get_class($error)); + var_dump($error->getMessage()); + var_dump($error->getFile()); + var_dump($error->getLine()); + } + + $version = App::getEnv('_APP_VERSION', 'UNKNOWN'); switch ($error->getCode()) { case 400: // Error allowed publicly @@ -287,9 +366,9 @@ $utopia->error(function ($error /* @var $error Exception */) use ($request, $res $message = 'Server Error'; } - $_SERVER = []; // Reset before reporting to error log to avoid keys being compromised + //$_SERVER = []; // Reset before reporting to error log to avoid keys being compromised - $output = ((App::MODE_TYPE_DEVELOPMENT == $env)) ? [ + $output = ((App::isDevelopment())) ? [ 'message' => $error->getMessage(), 'code' => $error->getCode(), 'file' => $error->getFile(), @@ -309,11 +388,7 @@ $utopia->error(function ($error /* @var $error Exception */) use ($request, $res ->setStatusCode($code) ; - $route = $utopia->match($request); - $template = ($route) ? $route->getLabel('error', null) : null; - if ($template) { - $layout = new View(__DIR__.'/views/layouts/default.phtml'); $comp = new View($template); $comp @@ -331,103 +406,95 @@ $utopia->error(function ($error /* @var $error Exception */) use ($request, $res ->setParam('litespeed', false) ; - $response->send($layout->render()); + $response->html($layout->render()); } - $response - ->json($output) - ; -}); + $response->dynamic(new Document($output), + $utopia->isDevelopment() ? Response::MODEL_ERROR_DEV : Response::MODEL_LOCALE); + +}, ['error', 'utopia', 'request', 'response', 'layout', 'project']); -$utopia->get('/manifest.json') +App::get('/manifest.json') ->desc('Progressive app manifest file') ->label('scope', 'public') ->label('docs', false) - ->action( - function () use ($response) { - $response->json([ - 'name' => APP_NAME, - 'short_name' => APP_NAME, - 'start_url' => '.', - 'url' => 'https://appwrite.io/', - 'display' => 'standalone', - 'background_color' => '#fff', - 'theme_color' => '#f02e65', - 'description' => 'End to end backend server for frontend and mobile apps. 👩‍💻👨‍💻', - 'icons' => [ - [ - 'src' => 'images/favicon.png', - 'sizes' => '256x256', - 'type' => 'image/png', - ], - ], - ]); - } - ); + ->action(function ($response) { + /** @var Appwrite\Utopia\Response $response */ -$utopia->get('/robots.txt') + $response->json([ + 'name' => APP_NAME, + 'short_name' => APP_NAME, + 'start_url' => '.', + 'url' => 'https://appwrite.io/', + 'display' => 'standalone', + 'background_color' => '#fff', + 'theme_color' => '#f02e65', + 'description' => 'End to end backend server for frontend and mobile apps. 👩‍💻👨‍💻', + 'icons' => [ + [ + 'src' => 'images/favicon.png', + 'sizes' => '256x256', + 'type' => 'image/png', + ], + ], + ]); + }, ['response']); + +App::get('/robots.txt') ->desc('Robots.txt File') ->label('scope', 'public') ->label('docs', false) - ->action( - function () use ($response) { - $template = new View(__DIR__.'/views/general/robots.phtml'); - $response->text($template->render(false)); - } - ); + ->action(function ($response) { + $template = new View(__DIR__.'/../views/general/robots.phtml'); + $response->text($template->render(false)); + }, ['response']); -$utopia->get('/humans.txt') +App::get('/humans.txt') ->desc('Humans.txt File') ->label('scope', 'public') ->label('docs', false) - ->action( - function () use ($response) { - $template = new View(__DIR__.'/views/general/humans.phtml'); - $response->text($template->render(false)); - } - ); + ->action(function ($response) { + $template = new View(__DIR__.'/../views/general/humans.phtml'); + $response->text($template->render(false)); + }, ['response']); -$utopia->get('/.well-known/acme-challenge') +App::get('/.well-known/acme-challenge') ->desc('SSL Verification') ->label('scope', 'public') ->label('docs', false) - ->action( - function () use ($request, $response) { - $base = \realpath(APP_STORAGE_CERTIFICATES); - $path = \str_replace('/.well-known/acme-challenge/', '', $request->getParam('q')); - $absolute = \realpath($base.'/.well-known/acme-challenge/'.$path); + ->action(function ($request, $response) { + $base = \realpath(APP_STORAGE_CERTIFICATES); + $path = \str_replace('/.well-known/acme-challenge/', '', $request->getParam('q')); + $absolute = \realpath($base.'/.well-known/acme-challenge/'.$path); - if(!$base) { - throw new Exception('Storage error', 500); - } - - if(!$absolute) { - throw new Exception('Unknown path', 404); - } - - if(!\substr($absolute, 0, \strlen($base)) === $base) { - throw new Exception('Invalid path', 401); - } - - if(!\file_exists($absolute)) { - throw new Exception('Unknown path', 404); - } - - $content = @\file_get_contents($absolute); - - if(!$content) { - throw new Exception('Failed to get contents', 500); - } - - $response->text($content); + if(!$base) { + throw new Exception('Storage error', 500); } - ); -include_once __DIR__ . '/controllers/shared/api.php'; -include_once __DIR__ . '/controllers/shared/web.php'; + if(!$absolute) { + throw new Exception('Unknown path', 404); + } + + if(!\substr($absolute, 0, \strlen($base)) === $base) { + throw new Exception('Invalid path', 401); + } + + if(!\file_exists($absolute)) { + throw new Exception('Unknown path', 404); + } + + $content = @\file_get_contents($absolute); + + if(!$content) { + throw new Exception('Failed to get contents', 500); + } + + $response->text($content); + }, ['request', 'response']); + +include_once __DIR__ . '/shared/api.php'; +include_once __DIR__ . '/shared/web.php'; foreach(Config::getParam('services', []) as $service) { include_once $service['controller']; -} - -$utopia->run($request, $response); \ No newline at end of file +} \ No newline at end of file diff --git a/app/controllers/mock.php b/app/controllers/mock.php index 097501fbba..3f36a2238f 100644 --- a/app/controllers/mock.php +++ b/app/controllers/mock.php @@ -2,339 +2,360 @@ global $utopia, $request, $response; +use Utopia\App; +use Utopia\Response; use Utopia\Validator\Numeric; use Utopia\Validator\Text; use Utopia\Validator\ArrayList; -use Utopia\Response; use Utopia\Validator\Host; use Appwrite\Storage\Validator\File; -$result = []; - -$utopia->get('/v1/mock/tests/foo') +App::get('/v1/mock/tests/foo') ->desc('Mock a get request for SDK tests') + ->groups(['mock']) ->label('scope', 'public') ->label('sdk.namespace', 'foo') ->label('sdk.method', 'get') ->label('sdk.description', 'Mock a get request for SDK tests') - ->param('x', '', function () { return new Text(100); }, 'Sample string param') - ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param') - ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param') - ->action( - function ($x, $y, $z) { - } - ); + ->label('sdk.mock', true) + ->param('x', '', new Text(100), 'Sample string param') + ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') + ->action(function ($x, $y, $z) { + }); -$utopia->post('/v1/mock/tests/foo') +App::post('/v1/mock/tests/foo') ->desc('Mock a post request for SDK tests') + ->groups(['mock']) ->label('scope', 'public') ->label('sdk.namespace', 'foo') ->label('sdk.method', 'post') ->label('sdk.description', 'Mock a post request for SDK tests') - ->param('x', '', function () { return new Text(100); }, 'Sample string param') - ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param') - ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param') - ->action( - function ($x, $y, $z) { - } - ); + ->label('sdk.mock', true) + ->param('x', '', new Text(100), 'Sample string param') + ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') + ->action(function ($x, $y, $z) { + }); -$utopia->patch('/v1/mock/tests/foo') +App::patch('/v1/mock/tests/foo') ->desc('Mock a patch request for SDK tests') + ->groups(['mock']) ->label('scope', 'public') ->label('sdk.namespace', 'foo') ->label('sdk.method', 'patch') ->label('sdk.description', 'Mock a get request for SDK tests') - ->param('x', '', function () { return new Text(100); }, 'Sample string param') - ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param') - ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param') - ->action( - function ($x, $y, $z) { - } - ); + ->label('sdk.mock', true) + ->param('x', '', new Text(100), 'Sample string param') + ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') + ->action(function ($x, $y, $z) { + }); -$utopia->put('/v1/mock/tests/foo') +App::put('/v1/mock/tests/foo') ->desc('Mock a put request for SDK tests') + ->groups(['mock']) ->label('scope', 'public') ->label('sdk.namespace', 'foo') ->label('sdk.method', 'put') ->label('sdk.description', 'Mock a put request for SDK tests') - ->param('x', '', function () { return new Text(100); }, 'Sample string param') - ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param') - ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param') - ->action( - function ($x, $y, $z) { - } - ); + ->label('sdk.mock', true) + ->param('x', '', new Text(100), 'Sample string param') + ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') + ->action(function ($x, $y, $z) { + }); -$utopia->delete('/v1/mock/tests/foo') +App::delete('/v1/mock/tests/foo') ->desc('Mock a delete request for SDK tests') + ->groups(['mock']) ->label('scope', 'public') ->label('sdk.namespace', 'foo') ->label('sdk.method', 'delete') ->label('sdk.description', 'Mock a delete request for SDK tests') - ->param('x', '', function () { return new Text(100); }, 'Sample string param') - ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param') - ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param') - ->action( - function ($x, $y, $z) { - } - ); + ->label('sdk.mock', true) + ->param('x', '', new Text(100), 'Sample string param') + ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') + ->action(function ($x, $y, $z) { + }); -$utopia->get('/v1/mock/tests/bar') +App::get('/v1/mock/tests/bar') ->desc('Mock a get request for SDK tests') + ->groups(['mock']) ->label('scope', 'public') ->label('sdk.namespace', 'bar') ->label('sdk.method', 'get') ->label('sdk.description', 'Mock a get request for SDK tests') - ->param('x', '', function () { return new Text(100); }, 'Sample string param') - ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param') - ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param') - ->action( - function ($x, $y, $z) { - } - ); + ->label('sdk.mock', true) + ->param('x', '', new Text(100), 'Sample string param') + ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') + ->action(function ($x, $y, $z) { + }); -$utopia->post('/v1/mock/tests/bar') +App::post('/v1/mock/tests/bar') ->desc('Mock a post request for SDK tests') + ->groups(['mock']) ->label('scope', 'public') ->label('sdk.namespace', 'bar') ->label('sdk.method', 'post') ->label('sdk.description', 'Mock a post request for SDK tests') - ->param('x', '', function () { return new Text(100); }, 'Sample string param') - ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param') - ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param') - ->action( - function ($x, $y, $z) { - } - ); + ->label('sdk.mock', true) + ->param('x', '', new Text(100), 'Sample string param') + ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') + ->action(function ($x, $y, $z) { + }); -$utopia->patch('/v1/mock/tests/bar') +App::patch('/v1/mock/tests/bar') ->desc('Mock a patch request for SDK tests') + ->groups(['mock']) ->label('scope', 'public') ->label('sdk.namespace', 'bar') ->label('sdk.method', 'patch') ->label('sdk.description', 'Mock a get request for SDK tests') - ->param('x', '', function () { return new Text(100); }, 'Sample string param') - ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param') - ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param') - ->action( - function ($x, $y, $z) { - } - ); + ->label('sdk.mock', true) + ->param('x', '', new Text(100), 'Sample string param') + ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') + ->action(function ($x, $y, $z) { + }); -$utopia->put('/v1/mock/tests/bar') +App::put('/v1/mock/tests/bar') ->desc('Mock a put request for SDK tests') + ->groups(['mock']) ->label('scope', 'public') ->label('sdk.namespace', 'bar') ->label('sdk.method', 'put') ->label('sdk.description', 'Mock a put request for SDK tests') - ->param('x', '', function () { return new Text(100); }, 'Sample string param') - ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param') - ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param') - ->action( - function ($x, $y, $z) { - } - ); + ->label('sdk.mock', true) + ->param('x', '', new Text(100), 'Sample string param') + ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') + ->action(function ($x, $y, $z) { + }); -$utopia->delete('/v1/mock/tests/bar') +App::delete('/v1/mock/tests/bar') ->desc('Mock a delete request for SDK tests') + ->groups(['mock']) ->label('scope', 'public') ->label('sdk.namespace', 'bar') ->label('sdk.method', 'delete') ->label('sdk.description', 'Mock a delete request for SDK tests') - ->param('x', '', function () { return new Text(100); }, 'Sample string param') - ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param') - ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param') - ->action( - function ($x, $y, $z) { - } - ); + ->label('sdk.mock', true) + ->param('x', '', new Text(100), 'Sample string param') + ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') + ->action(function ($x, $y, $z) { + }); -$utopia->post('/v1/mock/tests/general/upload') +App::post('/v1/mock/tests/general/upload') ->desc('Mock a post request for SDK tests') + ->groups(['mock']) ->label('scope', 'public') ->label('sdk.namespace', 'general') ->label('sdk.method', 'upload') ->label('sdk.description', 'Mock a delete request for SDK tests') ->label('sdk.consumes', 'multipart/form-data') - ->param('x', '', function () { return new Text(100); }, 'Sample string param') - ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param') - ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param') - ->param('file', [], function () { return new File(); }, 'Sample file param', false) - ->action( - function ($x, $y, $z, $file) use ($request) { - $file = $request->getFiles('file'); - $file['tmp_name'] = (\is_array($file['tmp_name'])) ? $file['tmp_name'] : [$file['tmp_name']]; - $file['name'] = (\is_array($file['name'])) ? $file['name'] : [$file['name']]; - $file['size'] = (\is_array($file['size'])) ? $file['size'] : [$file['size']]; + ->label('sdk.mock', true) + ->param('x', '', new Text(100), 'Sample string param') + ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') + ->param('file', [], new File(), 'Sample file param', false) + ->action(function ($x, $y, $z, $file, $request) { + /** @var Utopia\Swoole\Request $request */ + + $file = $request->getFiles('file'); + $file['tmp_name'] = (\is_array($file['tmp_name'])) ? $file['tmp_name'] : [$file['tmp_name']]; + $file['name'] = (\is_array($file['name'])) ? $file['name'] : [$file['name']]; + $file['size'] = (\is_array($file['size'])) ? $file['size'] : [$file['size']]; - foreach ($file['name'] as $i => $name) { - if ($name !== 'file.png') { - throw new Exception('Wrong file name', 400); - } - } - - foreach ($file['size'] as $i => $size) { - if ($size !== 38756) { - throw new Exception('Wrong file size', 400); - } - } - - foreach ($file['tmp_name'] as $i => $tmpName) { - if (\md5(\file_get_contents($tmpName)) !== 'd80e7e6999a3eb2ae0d631a96fe135a4') { - throw new Exception('Wrong file uploaded', 400); - } + foreach ($file['name'] as $i => $name) { + if ($name !== 'file.png') { + throw new Exception('Wrong file name', 400); } } - ); -$utopia->get('/v1/mock/tests/general/redirect') + foreach ($file['size'] as $i => $size) { + if ($size !== 38756) { + throw new Exception('Wrong file size', 400); + } + } + + foreach ($file['tmp_name'] as $i => $tmpName) { + if (\md5(\file_get_contents($tmpName)) !== 'd80e7e6999a3eb2ae0d631a96fe135a4') { + throw new Exception('Wrong file uploaded', 400); + } + } + }, ['request']); + +App::get('/v1/mock/tests/general/redirect') ->desc('Mock a post request for SDK tests') + ->groups(['mock']) ->label('scope', 'public') ->label('sdk.namespace', 'general') ->label('sdk.method', 'redirect') ->label('sdk.description', 'Mock a redirect request for SDK tests') - ->action( - function () use ($response) { - $response->redirect('/v1/mock/tests/general/redirected'); - } - ); + ->label('sdk.mock', true) + ->action(function ($response) { + /** @var Appwrite\Utopia\Response $response */ -$utopia->get('/v1/mock/tests/general/redirected') + $response->redirect('/v1/mock/tests/general/redirected'); + }, ['response']); + +App::get('/v1/mock/tests/general/redirected') ->desc('Mock a post request for SDK tests') + ->groups(['mock']) ->label('scope', 'public') ->label('sdk.namespace', 'general') ->label('sdk.method', 'redirected') ->label('sdk.description', 'Mock a redirected request for SDK tests') - ->action( - function () { - } - ); + ->label('sdk.mock', true) + ->action(function () { + }); -$utopia->get('/v1/mock/tests/general/set-cookie') +App::get('/v1/mock/tests/general/set-cookie') ->desc('Mock a cookie request for SDK tests') + ->groups(['mock']) ->label('scope', 'public') ->label('sdk.namespace', 'general') ->label('sdk.method', 'setCookie') ->label('sdk.description', 'Mock a set cookie request for SDK tests') - ->action( - function () use ($response) { - $response->addCookie('cookieName', 'cookieValue', \time() + 31536000, '/', 'localhost', true, true); - } - ); + ->label('sdk.mock', true) + ->action(function ($response) { + /** @var Appwrite\Utopia\Response $response */ -$utopia->get('/v1/mock/tests/general/get-cookie') + $response->addCookie('cookieName', 'cookieValue', \time() + 31536000, '/', 'localhost', true, true); + }, ['response']); + +App::get('/v1/mock/tests/general/get-cookie') ->desc('Mock a cookie request for SDK tests') + ->groups(['mock']) ->label('scope', 'public') ->label('sdk.namespace', 'general') ->label('sdk.method', 'getCookie') ->label('sdk.description', 'Mock a get cookie request for SDK tests') - ->action( - function () use ($request) { - if ($request->getCookie('cookieName', '') !== 'cookieValue') { - throw new Exception('Missing cookie value', 400); - } - } - ); + ->label('sdk.mock', true) + ->action(function ($request) { + /** @var Utopia\Swoole\Request $request */ -$utopia->get('/v1/mock/tests/general/empty') + if ($request->getCookie('cookieName', '') !== 'cookieValue') { + throw new Exception('Missing cookie value', 400); + } + }, ['request']); + +App::get('/v1/mock/tests/general/empty') ->desc('Mock a post request for SDK tests') + ->groups(['mock']) ->label('scope', 'public') ->label('sdk.namespace', 'general') ->label('sdk.method', 'empty') ->label('sdk.description', 'Mock a redirected request for SDK tests') - ->action( - function () use ($response) { - $response->noContent(); - exit(); - } - ); + ->label('sdk.mock', true) + ->action(function ($response) { + /** @var Appwrite\Utopia\Response $response */ -$utopia->get('/v1/mock/tests/general/oauth2') + $response->noContent(); + exit(); + }, ['response']); + +App::get('/v1/mock/tests/general/oauth2') ->desc('Mock an OAuth2 login route') + ->groups(['mock']) ->label('scope', 'public') ->label('docs', false) - ->param('client_id', '', function () { return new Text(100); }, 'OAuth2 Client ID.') - ->param('redirect_uri', '', function () { return new Host(['localhost']); }, 'OAuth2 Redirect URI.') // Important to deny an open redirect attack - ->param('scope', '', function () { return new Text(100); }, 'OAuth2 scope list.') - ->param('state', '', function () { return new Text(1024); }, 'OAuth2 state.') - ->action( - function ($clientId, $redirectURI, $scope, $state) use ($response) { - $response->redirect($redirectURI.'?'.\http_build_query(['code' => 'abcdef', 'state' => $state])); - } - ); + ->label('sdk.mock', true) + ->param('client_id', '', new Text(100), 'OAuth2 Client ID.') + ->param('redirect_uri', '', new Host(['localhost']), 'OAuth2 Redirect URI.') // Important to deny an open redirect attack + ->param('scope', '', new Text(100), 'OAuth2 scope list.') + ->param('state', '', new Text(1024), 'OAuth2 state.') + ->action(function ($clientId, $redirectURI, $scope, $state, $response) { + /** @var Appwrite\Utopia\Response $response */ -$utopia->get('/v1/mock/tests/general/oauth2/token') + $response->redirect($redirectURI.'?'.\http_build_query(['code' => 'abcdef', 'state' => $state])); + }, ['response']); + +App::get('/v1/mock/tests/general/oauth2/token') ->desc('Mock an OAuth2 login route') + ->groups(['mock']) ->label('scope', 'public') ->label('docs', false) - ->param('client_id', '', function () { return new Text(100); }, 'OAuth2 Client ID.') - ->param('redirect_uri', '', function () { return new Host(['localhost']); }, 'OAuth2 Redirect URI.') - ->param('client_secret', '', function () { return new Text(100); }, 'OAuth2 scope list.') - ->param('code', '', function () { return new Text(100); }, 'OAuth2 state.') - ->action( - function ($clientId, $redirectURI, $clientSecret, $code) use ($response) { - if ($clientId != '1') { - throw new Exception('Invalid client ID'); - } + ->label('sdk.mock', true) + ->param('client_id', '', new Text(100), 'OAuth2 Client ID.') + ->param('redirect_uri', '', new Host(['localhost']), 'OAuth2 Redirect URI.') + ->param('client_secret', '', new Text(100), 'OAuth2 scope list.') + ->param('code', '', new Text(100), 'OAuth2 state.') + ->action(function ($clientId, $redirectURI, $clientSecret, $code, $response) { + /** @var Appwrite\Utopia\Response $response */ - if ($clientSecret != '123456') { - throw new Exception('Invalid client secret'); - } - - if ($code != 'abcdef') { - throw new Exception('Invalid token'); - } - - $response->json(['access_token' => '123456']); + if ($clientId != '1') { + throw new Exception('Invalid client ID'); } - ); -$utopia->get('/v1/mock/tests/general/oauth2/user') + if ($clientSecret != '123456') { + throw new Exception('Invalid client secret'); + } + + if ($code != 'abcdef') { + throw new Exception('Invalid token'); + } + + $response->json(['access_token' => '123456']); + }, ['response']); + +App::get('/v1/mock/tests/general/oauth2/user') ->desc('Mock an OAuth2 user route') + ->groups(['mock']) ->label('scope', 'public') ->label('docs', false) - ->param('token', '', function () { return new Text(100); }, 'OAuth2 Access Token.') - ->action( - function ($token) use ($response) { - if ($token != '123456') { - throw new Exception('Invalid token'); - } + ->param('token', '', new Text(100), 'OAuth2 Access Token.') + ->action(function ($token, $response) { + /** @var Appwrite\Utopia\Response $response */ - $response->json([ - 'id' => 1, - 'name' => 'User Name', - 'email' => 'user@localhost.test', + if ($token != '123456') { + throw new Exception('Invalid token'); + } + + $response->json([ + 'id' => 1, + 'name' => 'User Name', + 'email' => 'user@localhost.test', + ]); + }, ['response']); + +App::get('/v1/mock/tests/general/oauth2/success') + ->label('scope', 'public') + ->groups(['mock']) + ->label('docs', false) + ->action(function ($response) { + /** @var Appwrite\Utopia\Response $response */ + + $response->json([ + 'result' => 'success', + ]); + }, ['response']); + +App::get('/v1/mock/tests/general/oauth2/failure') + ->groups(['mock']) + ->label('scope', 'public') + ->label('docs', false) + ->action(function ($response) { + /** @var Appwrite\Utopia\Response $response */ + + $response + ->setStatusCode(Response::STATUS_CODE_BAD_REQUEST) + ->json([ + 'result' => 'failure', ]); - } - ); + }, ['response']); -$utopia->get('/v1/mock/tests/general/oauth2/success') - ->label('scope', 'public') - ->label('docs', false) - ->action( - function () use ($response) { - $response->json([ - 'result' => 'success', - ]); - } - ); +App::shutdown(function($utopia, $response, $request) { + /** @var Utopia\App $utopia */ + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ -$utopia->get('/v1/mock/tests/general/oauth2/failure') - ->label('scope', 'public') - ->label('docs', false) - ->action( - function () use ($response) { - $response - ->setStatusCode(Response::STATUS_CODE_BAD_REQUEST) - ->json([ - 'result' => 'failure', - ]); - } - ); - -$utopia->shutdown(function() use ($response, $request, &$result, $utopia) { + $result = []; $route = $utopia->match($request); $path = APP_STORAGE_CACHE.'/tests.json'; $tests = (\file_exists($path)) ? \json_decode(\file_get_contents($path), true) : []; @@ -352,4 +373,4 @@ $utopia->shutdown(function() use ($response, $request, &$result, $utopia) { } $response->json(['result' => $route->getMethod() . ':' . $route->getURL() . ':passed']); -}, 'mock'); \ No newline at end of file +}, ['utopia', 'response', 'request'], 'mock'); \ No newline at end of file diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index e911c2c556..d64c46a2cd 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -1,12 +1,18 @@ init(function () use ($utopia, $request, $response, $register, $user, $project) { $route = $utopia->match($request); if (empty($project->getId()) && $route->getLabel('abuse-limit', 0) > 0) { // Abuse limit requires an active project scope @@ -22,9 +28,9 @@ $utopia->init(function () use ($utopia, $request, $response, $register, $user, $ $timeLimit->setNamespace('app_'.$project->getId()); $timeLimit ->setParam('{userId}', $user->getId()) - ->setParam('{userAgent}', $request->getServer('HTTP_USER_AGENT', '')) + ->setParam('{userAgent}', $request->getUserAgent('')) ->setParam('{ip}', $request->getIP()) - ->setParam('{url}', $request->getServer('HTTP_HOST', '').$route->getURL()) + ->setParam('{url}', $request->getHostname().$route->getURL()) ; //TODO make sure we get array here @@ -43,7 +49,7 @@ $utopia->init(function () use ($utopia, $request, $response, $register, $user, $ ; } - if ($abuse->check() && $request->getServer('_APP_OPTIONS_ABUSE', 'enabled') !== 'disabled') { + if ($abuse->check() && App::getEnv('_APP_OPTIONS_ABUSE', 'enabled') !== 'disabled') { throw new Exception('Too many requests', 429); } -}, 'api'); \ No newline at end of file +}, ['utopia', 'request', 'response', 'project', 'user', 'register'], 'api'); \ No newline at end of file diff --git a/app/controllers/shared/web.php b/app/controllers/shared/web.php index a2f85bcb0a..42d2a18c55 100644 --- a/app/controllers/shared/web.php +++ b/app/controllers/shared/web.php @@ -1,22 +1,25 @@ init(function () use ($utopia, $response, $request, $layout) { +App::init(function ($utopia, $request, $response, $layout) { + /** @var Utopia\App $utopia */ + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + /** @var Utopia\View $layout */ /* AJAX check */ if (!empty($request->getQuery('version', ''))) { $layout->setPath(__DIR__.'/../../views/layouts/empty.phtml'); } + $layout ->setParam('title', APP_NAME) - ->setParam('protocol', Config::getParam('protocol')) - ->setParam('domain', Config::getParam('domain')) - ->setParam('home', $request->getServer('_APP_HOME')) - ->setParam('setup', $request->getServer('_APP_SETUP')) + ->setParam('protocol', $request->getProtocol()) + ->setParam('domain', $request->getHostname()) + ->setParam('home', App::getEnv('_APP_HOME')) + ->setParam('setup', App::getEnv('_APP_SETUP')) ->setParam('class', 'unknown') ->setParam('icon', '/images/favicon.png') ->setParam('roles', [ @@ -24,22 +27,24 @@ $utopia->init(function () use ($utopia, $response, $request, $layout) { ['type' => 'developer', 'label' => 'Developer'], ['type' => 'admin', 'label' => 'Admin'], ]) - ->setParam('env', $utopia->getMode()) + ->setParam('environments', Config::getParam('environments')) + ->setParam('mode', App::getMode()) ; $time = (60 * 60 * 24 * 45); // 45 days cache - $isDev = (\Utopia\App::MODE_TYPE_DEVELOPMENT == Config::getParam('env')); $response ->addHeader('Cache-Control', 'public, max-age='.$time) ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + $time).' GMT') // 45 days cache - ->addHeader('X-UA-Compatible', 'IE=Edge'); // Deny IE browsers from going into quirks mode + ->addHeader('X-Frame-Options', 'SAMEORIGIN') // Avoid console and homepage from showing in iframes + ->addHeader('X-UA-Compatible', 'IE=Edge') // Deny IE browsers from going into quirks mode + ; $route = $utopia->match($request); $scope = $route->getLabel('scope', ''); $layout - ->setParam('version', Config::getParam('version')) - ->setParam('isDev', $isDev) + ->setParam('version', App::getEnv('_APP_VERSION', 'UNKNOWN')) + ->setParam('isDev', App::isDevelopment()) ->setParam('class', $scope) ; -}, 'web'); +}, ['utopia', 'request', 'response', 'layout'], 'web'); diff --git a/app/controllers/web/console.php b/app/controllers/web/console.php index 595d36d33a..47e1848a6f 100644 --- a/app/controllers/web/console.php +++ b/app/controllers/web/console.php @@ -1,7 +1,6 @@ init(function () use ($layout) { +App::init(function ($layout) { + /** @var Utopia\View $layout */ + $layout ->setParam('description', 'Appwrite Console allows you to easily manage, monitor, and control your entire backend API and tools.') ->setParam('analytics', 'UA-26264668-5') ; -}, 'console'); +}, ['layout'], 'console'); + +App::shutdown(function ($response, $layout) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Utopia\View $layout */ -$utopia->shutdown(function () use ($response, $request, $layout) { $header = new View(__DIR__.'/../../views/console/comps/header.phtml'); $footer = new View(__DIR__.'/../../views/console/comps/footer.phtml'); $footer - ->setParam('home', $request->getServer('_APP_HOME', '')) - ->setParam('version', Config::getParam('version')) + ->setParam('home', App::getEnv('_APP_HOME', '')) + ->setParam('version', App::getEnv('_APP_VERSION', 'UNKNOWN')) ; $layout @@ -31,15 +35,17 @@ $utopia->shutdown(function () use ($response, $request, $layout) { ->setParam('footer', [$footer]) ; - $response->send($layout->render()); -}, 'console'); + $response->html($layout->render()); +}, ['response', 'layout'], 'console'); -$utopia->get('/error/:code') +App::get('/error/:code') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'home') ->param('code', null, new \Utopia\Validator\Numeric(), 'Valid status code number', false) - ->action(function ($code) use ($layout) { + ->action(function ($code, $layout) { + /** @var Utopia\View $layout */ + $page = new View(__DIR__.'/../../views/error.phtml'); $page @@ -49,29 +55,33 @@ $utopia->get('/error/:code') $layout ->setParam('title', APP_NAME.' - Error') ->setParam('body', $page); - }); + }, ['layout']); -$utopia->get('/console') +App::get('/console') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') - ->action(function () use ($layout, $request) { + ->action(function ($layout) { + /** @var Utopia\View $layout */ + $page = new View(__DIR__.'/../../views/console/index.phtml'); $page - ->setParam('home', $request->getServer('_APP_HOME', '')) + ->setParam('home', App::getEnv('_APP_HOME', '')) ; $layout ->setParam('title', APP_NAME.' - Console') ->setParam('body', $page); - }); + }, ['layout']); -$utopia->get('/console/account') +App::get('/console/account') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') - ->action(function () use ($layout) { + ->action(function ($layout) { + /** @var Utopia\View $layout */ + $page = new View(__DIR__.'/../../views/console/account/index.phtml'); $cc = new View(__DIR__.'/../../views/console/forms/credit-card.phtml'); @@ -83,38 +93,44 @@ $utopia->get('/console/account') $layout ->setParam('title', 'Account - '.APP_NAME) ->setParam('body', $page); - }); + }, ['layout']); -$utopia->get('/console/notifications') +App::get('/console/notifications') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') - ->action(function () use ($layout) { + ->action(function ($layout) { + /** @var Utopia\View $layout */ + $page = new View(__DIR__.'/../../views/v1/console/notifications/index.phtml'); $layout ->setParam('title', APP_NAME.' - Notifications') ->setParam('body', $page); - }); + }, ['layout']); -$utopia->get('/console/home') +App::get('/console/home') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') - ->action(function () use ($layout) { + ->action(function ($layout) { + /** @var Utopia\View $layout */ + $page = new View(__DIR__.'/../../views/console/home/index.phtml'); $layout ->setParam('title', APP_NAME.' - Console') ->setParam('body', $page); - }); + }, ['layout']); -$utopia->get('/console/settings') +App::get('/console/settings') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') - ->action(function () use ($request, $layout) { - $target = new Domain($request->getServer('_APP_DOMAIN_TARGET', '')); + ->action(function ($layout) { + /** @var Utopia\View $layout */ + + $target = new Domain(App::getEnv('_APP_DOMAIN_TARGET', '')); $page = new View(__DIR__.'/../../views/console/settings/index.phtml'); @@ -126,15 +142,17 @@ $utopia->get('/console/settings') $layout ->setParam('title', APP_NAME.' - Settings') ->setParam('body', $page); - }); + }, ['layout']); -$utopia->get('/console/webhooks') +App::get('/console/webhooks') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') - ->action(function () use ($layout) { + ->action(function ($layout) { + /** @var Utopia\View $layout */ + $page = new View(__DIR__.'/../../views/console/webhooks/index.phtml'); - + $page ->setParam('events', Config::getParam('events', [])) ; @@ -142,14 +160,16 @@ $utopia->get('/console/webhooks') $layout ->setParam('title', APP_NAME.' - Webhooks') ->setParam('body', $page); - }); + }, ['layout']); -$utopia->get('/console/keys') +App::get('/console/keys') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') - ->action(function () use ($layout) { - $scopes = include __DIR__.'/../../../app/config/scopes.php'; + ->action(function ($layout) { + /** @var Utopia\View $layout */ + + $scopes = Config::getParam('scopes'); $page = new View(__DIR__.'/../../views/console/keys/index.phtml'); $page->setParam('scopes', $scopes); @@ -157,38 +177,46 @@ $utopia->get('/console/keys') $layout ->setParam('title', APP_NAME.' - API Keys') ->setParam('body', $page); - }); + }, ['layout']); -$utopia->get('/console/tasks') +App::get('/console/tasks') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') - ->action(function () use ($layout) { + ->action(function ($layout) { + /** @var Utopia\View $layout */ + $page = new View(__DIR__.'/../../views/console/tasks/index.phtml'); $layout ->setParam('title', APP_NAME.' - Tasks') ->setParam('body', $page); - }); + }, ['layout']); -$utopia->get('/console/database') +App::get('/console/database') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') - ->action(function () use ($layout) { + ->action(function ($layout) { + /** @var Utopia\View $layout */ + $page = new View(__DIR__.'/../../views/console/database/index.phtml'); $layout ->setParam('title', APP_NAME.' - Database') ->setParam('body', $page); - }); + }, ['layout']); -$utopia->get('/console/database/collection') +App::get('/console/database/collection') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') - ->param('id', '', function () { return new UID(); }, 'Collection unique ID.') - ->action(function ($id) use ($response, $layout, $projectDB) { + ->param('id', '', new UID(), 'Collection unique ID.') + ->action(function ($id, $response, $layout, $projectDB) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Utopia\View $layout */ + /** @var Appwrite\Database\Database $projectDB */ + Authorization::disable(); $collection = $projectDB->getDocument($id, false); Authorization::reset(); @@ -213,14 +241,17 @@ $utopia->get('/console/database/collection') ->addHeader('Expires', 0) ->addHeader('Pragma', 'no-cache') ; - }); + }, ['response', 'layout', 'projectDB']); -$utopia->get('/console/database/document') +App::get('/console/database/document') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') - ->param('collection', '', function () { return new UID(); }, 'Collection unique ID.') - ->action(function ($collection) use ($layout, $projectDB) { + ->param('collection', '', new UID(), 'Collection unique ID.') + ->action(function ($collection, $layout, $projectDB) { + /** @var Utopia\View $layout */ + /** @var Appwrite\Database\Database $projectDB */ + Authorization::disable(); $collection = $projectDB->getDocument($collection, false); Authorization::reset(); @@ -243,31 +274,34 @@ $utopia->get('/console/database/document') $layout ->setParam('title', APP_NAME.' - Database Document') ->setParam('body', $page); - }); + }, ['layout', 'projectDB']); -$utopia->get('/console/storage') +App::get('/console/storage') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') - ->action(function () use ($request, $layout) { + ->action(function ($layout) { + /** @var Utopia\View $layout */ $page = new View(__DIR__.'/../../views/console/storage/index.phtml'); $page - ->setParam('home', $request->getServer('_APP_HOME', 0)) - ->setParam('fileLimit', $request->getServer('_APP_STORAGE_LIMIT', 0)) - ->setParam('fileLimitHuman', Storage::human($request->getServer('_APP_STORAGE_LIMIT', 0))) + ->setParam('home', App::getEnv('_APP_HOME', 0)) + ->setParam('fileLimit', App::getEnv('_APP_STORAGE_LIMIT', 0)) + ->setParam('fileLimitHuman', Storage::human(App::getEnv('_APP_STORAGE_LIMIT', 0))) ; $layout ->setParam('title', APP_NAME.' - Storage') ->setParam('body', $page); - }); + }, ['layout']); -$utopia->get('/console/users') +App::get('/console/users') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') - ->action(function () use ($layout) { + ->action(function ($layout) { + /** @var Utopia\View $layout */ + $page = new View(__DIR__.'/../../views/console/users/index.phtml'); $page->setParam('providers', Config::getParam('providers')); @@ -275,28 +309,89 @@ $utopia->get('/console/users') $layout ->setParam('title', APP_NAME.' - Users') ->setParam('body', $page); - }); + }, ['layout']); -$utopia->get('/console/users/user') +App::get('/console/users/user') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') - ->action(function () use ($layout) { + ->action(function ($layout) { + /** @var Utopia\View $layout */ + $page = new View(__DIR__.'/../../views/console/users/user.phtml'); $layout ->setParam('title', APP_NAME.' - User') ->setParam('body', $page); - }); + }, ['layout']); -$utopia->get('/console/users/teams/team') +App::get('/console/users/teams/team') ->groups(['web', 'console']) ->label('permission', 'public') ->label('scope', 'console') - ->action(function () use ($layout) { + ->action(function ($layout) { + /** @var Utopia\View $layout */ + $page = new View(__DIR__.'/../../views/console/users/team.phtml'); $layout ->setParam('title', APP_NAME.' - Team') ->setParam('body', $page); - }); + }, ['layout']); + +App::get('/console/functions') + ->groups(['web', 'console']) + ->desc('Platform console project functions') + ->label('permission', 'public') + ->label('scope', 'console') + ->action(function ($layout) { + $page = new View(__DIR__.'/../../views/console/functions/index.phtml'); + + $page + ->setParam('environments', Config::getParam('environments')) + ; + + $layout + ->setParam('title', APP_NAME.' - Functions') + ->setParam('body', $page); + }, ['layout']); + +App::get('/console/functions/function') + ->groups(['web', 'console']) + ->desc('Platform console project function') + ->label('permission', 'public') + ->label('scope', 'console') + ->action(function ($layout) { + $page = new View(__DIR__.'/../../views/console/functions/function.phtml'); + + $page + ->setParam('events', Config::getParam('events', [])) + ->setParam('fileLimit', App::getEnv('_APP_STORAGE_LIMIT', 0)) + ->setParam('fileLimitHuman', Storage::human(App::getEnv('_APP_STORAGE_LIMIT', 0))) + ->setParam('timeout', (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900)) + ; + + $layout + ->setParam('title', APP_NAME.' - Function') + ->setParam('body', $page); + }, ['layout']); + +App::get('/console/version') + ->groups(['web', 'console']) + ->desc('Check for new version') + ->label('permission', 'public') + ->label('scope', 'console') + ->action(function ($response) { + try { + $version = \json_decode(@\file_get_contents(App::getEnv('_APP_HOME', 'http://localhost').'/v1/health/version'), true); + + if($version && isset($version['version'])) { + return $response->json(['version' => $version['version']]); + } + else { + throw new Exception('Failed to check for a newer version', 500); + } + } catch (\Throwable $th) { + throw new Exception('Failed to check for a newer version', 500); + } + }, ['response']); \ No newline at end of file diff --git a/app/controllers/web/home.php b/app/controllers/web/home.php index 5d8a7aefc2..7f7f419708 100644 --- a/app/controllers/web/home.php +++ b/app/controllers/web/home.php @@ -1,18 +1,20 @@ init(function () use ($layout) { +App::init(function ($layout) { + /** @var Utopia\View $layout */ + $header = new View(__DIR__.'/../../views/home/comps/header.phtml'); $footer = new View(__DIR__.'/../../views/home/comps/footer.phtml'); $footer - ->setParam('version', Config::getParam('version')) + ->setParam('version', App::getEnv('_APP_VERSION', 'UNKNOWN')) ; $layout @@ -23,100 +25,115 @@ $utopia->init(function () use ($layout) { ->setParam('header', [$header]) ->setParam('footer', [$footer]) ; -}, 'home'); +}, ['layout'], 'home'); -$utopia->shutdown(function () use ($response, $layout) { - $response->send($layout->render()); -}, 'home'); +App::shutdown(function ($response, $layout) { + /** @var Appwrite\Utopia\Response $response */ + /** @var Utopia\View $layout */ -$utopia->get('/') + $response->html($layout->render()); +}, ['response', 'layout'], 'home'); + +App::get('/') ->groups(['web', 'home']) ->label('permission', 'public') ->label('scope', 'home') - ->action( - function () use ($response) { - $response->redirect('/auth/signin'); - } - ); + ->action(function ($response) { + /** @var Appwrite\Utopia\Response $response */ -$utopia->get('/auth/signin') + $response->redirect('/auth/signin'); + }, ['response']); + +App::get('/auth/signin') ->groups(['web', 'home']) ->label('permission', 'public') ->label('scope', 'home') - ->action(function () use ($layout) { + ->action(function ($layout) { + /** @var Utopia\View $layout */ + $page = new View(__DIR__.'/../../views/home/auth/signin.phtml'); $layout ->setParam('title', 'Sign In - '.APP_NAME) ->setParam('body', $page); - }); + }, ['layout']); -$utopia->get('/auth/signup') +App::get('/auth/signup') ->groups(['web', 'home']) ->label('permission', 'public') ->label('scope', 'home') - ->action(function () use ($layout) { + ->action(function ($layout) { + /** @var Utopia\View $layout */ $page = new View(__DIR__.'/../../views/home/auth/signup.phtml'); $layout ->setParam('title', 'Sign Up - '.APP_NAME) ->setParam('body', $page); - }); + }, ['layout']); -$utopia->get('/auth/recovery') +App::get('/auth/recovery') ->groups(['web', 'home']) ->label('permission', 'public') ->label('scope', 'home') - ->action(function () use ($request, $layout) { + ->action(function ($layout) { + /** @var Utopia\View $layout */ + $page = new View(__DIR__.'/../../views/home/auth/recovery.phtml'); $layout ->setParam('title', 'Password Recovery - '.APP_NAME) ->setParam('body', $page); - }); + }, ['layout']); -$utopia->get('/auth/confirm') +App::get('/auth/confirm') ->groups(['web', 'home']) ->label('permission', 'public') ->label('scope', 'home') - ->action(function () use ($layout) { + ->action(function ($layout) { + /** @var Utopia\View $layout */ + $page = new View(__DIR__.'/../../views/home/auth/confirm.phtml'); $layout ->setParam('title', 'Account Confirmation - '.APP_NAME) ->setParam('body', $page); - }); + }, ['layout']); -$utopia->get('/auth/join') +App::get('/auth/join') ->groups(['web', 'home']) ->label('permission', 'public') ->label('scope', 'home') - ->action(function () use ($layout) { + ->action(function ($layout) { + /** @var Utopia\View $layout */ + $page = new View(__DIR__.'/../../views/home/auth/join.phtml'); $layout ->setParam('title', 'Invitation - '.APP_NAME) ->setParam('body', $page); - }); + }, ['layout']); -$utopia->get('/auth/recovery/reset') +App::get('/auth/recovery/reset') ->groups(['web', 'home']) ->label('permission', 'public') ->label('scope', 'home') - ->action(function () use ($layout) { + ->action(function ($layout) { + /** @var Utopia\View $layout */ + $page = new View(__DIR__.'/../../views/home/auth/recovery/reset.phtml'); $layout ->setParam('title', 'Password Reset - '.APP_NAME) ->setParam('body', $page); - }); + }, ['layout']); - -$utopia->get('/auth/oauth2/success') +App::get('/auth/oauth2/success') ->groups(['web', 'home']) ->label('permission', 'public') ->label('scope', 'home') - ->action(function () use ($layout) { + ->action(function ($layout) { + /** @var Utopia\View $layout */ + $page = new View(__DIR__.'/../../views/home/auth/oauth2.phtml'); $layout @@ -125,13 +142,15 @@ $utopia->get('/auth/oauth2/success') ->setParam('header', []) ->setParam('footer', []) ; - }); + }, ['layout']); -$utopia->get('/auth/oauth2/failure') +App::get('/auth/oauth2/failure') ->groups(['web', 'home']) ->label('permission', 'public') ->label('scope', 'home') - ->action(function () use ($layout) { + ->action(function ($layout) { + /** @var Utopia\View $layout */ + $page = new View(__DIR__.'/../../views/home/auth/oauth2.phtml'); $layout @@ -140,14 +159,16 @@ $utopia->get('/auth/oauth2/failure') ->setParam('header', []) ->setParam('footer', []) ; - }); + }, ['layout']); -$utopia->get('/error/:code') +App::get('/error/:code') ->groups(['web', 'home']) ->label('permission', 'public') ->label('scope', 'home') ->param('code', null, new \Utopia\Validator\Numeric(), 'Valid status code number', false) - ->action(function ($code) use ($layout) { + ->action(function ($code, $layout) { + /** @var Utopia\View $layout */ + $page = new View(__DIR__.'/../../views/error.phtml'); $page @@ -157,410 +178,381 @@ $utopia->get('/error/:code') $layout ->setParam('title', 'Error'.' - '.APP_NAME) ->setParam('body', $page); - }); + }, ['layout']); -$utopia->get('/open-api-2.json') +App::get('/open-api-2.json') ->groups(['web', 'home']) ->label('scope', 'public') ->label('docs', false) - ->param('platform', APP_PLATFORM_CLIENT, function () {return new WhiteList([APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER, APP_PLATFORM_CONSOLE]);}, 'Choose target platform.', true) - ->param('extensions', 0, function () {return new Range(0, 1);}, 'Show extra data.', true) - ->param('tests', 0, function () {return new Range(0, 1);}, 'Include only test services.', true) - ->action( - function ($platform, $extensions, $tests) use ($response, $request, $utopia) { - $services = Config::getParam('services', []); + ->param('platform', APP_PLATFORM_CLIENT, new WhiteList([APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER, APP_PLATFORM_CONSOLE], true), 'Choose target platform.', true) + ->param('extensions', 0, new Range(0, 1), 'Show extra data.', true) + ->param('tests', 0, new Range(0, 1), 'Include only test services.', true) + ->action(function ($platform, $extensions, $tests, $utopia, $request, $response) { + /** @var Utopia\App $utopia */ + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + + $security = [ + APP_PLATFORM_CLIENT => ['Project' => []], + APP_PLATFORM_SERVER => ['Project' => [], 'Key' => []], + APP_PLATFORM_CONSOLE => ['Project' => [], 'Key' => []], + ]; + + $platforms = [ + 'client' => APP_PLATFORM_CLIENT, + 'server' => APP_PLATFORM_SERVER, + 'all' => APP_PLATFORM_CONSOLE, + ]; + + $keys = [ + APP_PLATFORM_CLIENT => [ + 'Project' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Project', + 'description' => 'Your project ID', + 'in' => 'header', + ], + 'Locale' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Locale', + 'description' => '', + 'in' => 'header', + ], + ], + APP_PLATFORM_SERVER => [ + 'Project' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Project', + 'description' => 'Your project ID', + 'in' => 'header', + ], + 'Key' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Key', + 'description' => 'Your secret API key', + 'in' => 'header', + ], + 'Locale' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Locale', + 'description' => '', + 'in' => 'header', + ], + ], + APP_PLATFORM_CONSOLE => [ + 'Project' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Project', + 'description' => 'Your project ID', + 'in' => 'header', + ], + 'Key' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Key', + 'description' => 'Your secret API key', + 'in' => 'header', + ], + 'Locale' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Locale', + 'description' => '', + 'in' => 'header', + ], + 'Mode' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Mode', + 'description' => '', + 'in' => 'header', + ], + ], + ]; + + /* + * Specifications (v3.0.0): + * https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md + */ + $output = [ + 'swagger' => '2.0', + 'info' => [ + 'version' => APP_VERSION_STABLE, + 'title' => APP_NAME, + 'description' => 'Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)', + 'termsOfService' => 'https://appwrite.io/policy/terms', + 'contact' => [ + 'name' => 'Appwrite Team', + 'url' => 'https://appwrite.io/support', + 'email' => App::getEnv('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM), + ], + 'license' => [ + 'name' => 'BSD-3-Clause', + 'url' => 'https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE', + ], + ], + 'host' => \parse_url(App::getEnv('_APP_HOME', $request->getHostname()), PHP_URL_HOST), + 'basePath' => '/v1', + 'schemes' => ['https'], + 'consumes' => ['application/json', 'multipart/form-data'], + 'produces' => ['application/json'], + 'securityDefinitions' => $keys[$platform], + 'paths' => [], + 'definitions' => [ + // 'Pet' => [ + // 'required' => ['id', 'name'], + // 'properties' => [ + // 'id' => [ + // 'type' => 'integer', + // 'format' => 'int64', + // ], + // 'name' => [ + // 'type' => 'string', + // ], + // 'tag' => [ + // 'type' => 'string', + // ], + // ], + // ], + // 'Pets' => array( + // 'type' => 'array', + // 'items' => array( + // '$ref' => '#/definitions/Pet', + // ), + // ), + 'Error' => array( + 'required' => array( + 0 => 'code', + 1 => 'message', + ), + 'properties' => array( + 'code' => array( + 'type' => 'integer', + 'format' => 'int32', + ), + 'message' => array( + 'type' => 'string', + ), + ), + ), + ], + 'externalDocs' => [ + 'description' => 'Full API docs, specs and tutorials', + 'url' => $request->getProtocol().'://'.$request->getHostname().'/docs', + ], + ]; + + if ($extensions) { + if (isset($output['securityDefinitions']['Project'])) { + $output['securityDefinitions']['Project']['extensions'] = ['demo' => '5df5acd0d48c2']; + } - function fromCamelCase($input) - { - \preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $input, $matches); - $ret = $matches[0]; - foreach ($ret as &$match) { - $match = $match == \strtoupper($match) ? \strtolower($match) : \lcfirst($match); - } - - return \implode('_', $ret); + if (isset($output['securityDefinitions']['Key'])) { + $output['securityDefinitions']['Key']['extensions'] = ['demo' => '919c2d18fb5d4...a2ae413da83346ad2']; + } + + if (isset($output['securityDefinitions']['Locale'])) { + $output['securityDefinitions']['Locale']['extensions'] = ['demo' => 'en']; } - function fromCamelCaseToDash($input) - { - return \str_replace([' ', '_'], '-', \strtolower(\preg_replace('/([a-zA-Z])(?=[A-Z])/', '$1-', $input))); + if (isset($output['securityDefinitions']['Mode'])) { + $output['securityDefinitions']['Mode']['extensions'] = ['demo' => '']; } + } - foreach ($services as $service) { /* @noinspection PhpIncludeInspection */ - if ($tests && !isset($service['tests'])) { + foreach ($utopia->getRoutes() as $key => $method) { + foreach ($method as $route) { /* @var $route \Utopia\Route */ + if (!$route->getLabel('docs', true)) { continue; } - if ($tests && !$service['tests']) { + if ($route->getLabel('sdk.mock', false)) { continue; } - - if (!$tests && !$service['sdk']) { + + if (empty($route->getLabel('sdk.namespace', null))) { continue; } - - /** @noinspection PhpIncludeInspection */ - include_once \realpath(__DIR__.'/../../'.$service['controller']); - } - $security = [ - APP_PLATFORM_CLIENT => ['Project' => []], - APP_PLATFORM_SERVER => ['Project' => [], 'Key' => []], - APP_PLATFORM_CONSOLE => ['Project' => [], 'Key' => []], - ]; + if ($platform !== APP_PLATFORM_CONSOLE && !\in_array($platforms[$platform], $route->getLabel('sdk.platform', []))) { + continue; + } - $platforms = [ - 'client' => APP_PLATFORM_CLIENT, - 'server' => APP_PLATFORM_SERVER, - 'all' => APP_PLATFORM_CONSOLE, - ]; + $url = \str_replace('/v1', '', $route->getURL()); + $scope = $route->getLabel('scope', ''); + $hide = $route->getLabel('sdk.hide', false); + $consumes = ['application/json']; - $keys = [ - APP_PLATFORM_CLIENT => [ - 'Project' => [ - 'type' => 'apiKey', - 'name' => 'X-Appwrite-Project', - 'description' => 'Your project ID', - 'in' => 'header', - ], - 'Locale' => [ - 'type' => 'apiKey', - 'name' => 'X-Appwrite-Locale', - 'description' => '', - 'in' => 'header', - ], - ], - APP_PLATFORM_SERVER => [ - 'Project' => [ - 'type' => 'apiKey', - 'name' => 'X-Appwrite-Project', - 'description' => 'Your project ID', - 'in' => 'header', - ], - 'Key' => [ - 'type' => 'apiKey', - 'name' => 'X-Appwrite-Key', - 'description' => 'Your secret API key', - 'in' => 'header', - ], - 'Locale' => [ - 'type' => 'apiKey', - 'name' => 'X-Appwrite-Locale', - 'description' => '', - 'in' => 'header', - ], - ], - APP_PLATFORM_CONSOLE => [ - 'Project' => [ - 'type' => 'apiKey', - 'name' => 'X-Appwrite-Project', - 'description' => 'Your project ID', - 'in' => 'header', - ], - 'Key' => [ - 'type' => 'apiKey', - 'name' => 'X-Appwrite-Key', - 'description' => 'Your secret API key', - 'in' => 'header', - ], - 'Locale' => [ - 'type' => 'apiKey', - 'name' => 'X-Appwrite-Locale', - 'description' => '', - 'in' => 'header', - ], - 'Mode' => [ - 'type' => 'apiKey', - 'name' => 'X-Appwrite-Mode', - 'description' => '', - 'in' => 'header', - ], - ], - ]; + if ($hide) { + continue; + } - /* - * Specifications (v3.0.0): - * https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md - */ - $output = [ - 'swagger' => '2.0', - 'info' => [ - 'version' => APP_VERSION_STABLE, - 'title' => APP_NAME, - 'description' => 'Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)', - 'termsOfService' => 'https://appwrite.io/policy/terms', - 'contact' => [ - 'name' => 'Appwrite Team', - 'url' => 'https://appwrite.io/support', - 'email' => $request->getServer('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM), - ], - 'license' => [ - 'name' => 'BSD-3-Clause', - 'url' => 'https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE', - ], - ], - 'host' => \parse_url($request->getServer('_APP_HOME', Config::getParam('domain')), PHP_URL_HOST), - 'basePath' => '/v1', - 'schemes' => ['https'], - 'consumes' => ['application/json', 'multipart/form-data'], - 'produces' => ['application/json'], - 'securityDefinitions' => $keys[$platform], - 'paths' => [], - 'definitions' => [ - // 'Pet' => [ - // 'required' => ['id', 'name'], - // 'properties' => [ - // 'id' => [ - // 'type' => 'integer', - // 'format' => 'int64', - // ], - // 'name' => [ - // 'type' => 'string', - // ], - // 'tag' => [ - // 'type' => 'string', + $desc = (!empty($route->getLabel('sdk.description', ''))) ? \realpath(__DIR__.'/../../../'.$route->getLabel('sdk.description', '')) : null; + + $temp = [ + 'summary' => $route->getDesc(), + 'operationId' => $route->getLabel('sdk.method', \uniqid()), + 'consumes' => [], + 'tags' => [$route->getLabel('sdk.namespace', 'default')], + 'description' => ($desc) ? \file_get_contents($desc) : '', + + // 'responses' => [ + // 200 => [ + // 'description' => 'An paged array of pets', + // 'schema' => [ + // '$ref' => '#/definitions/Pet', // ], // ], // ], - // 'Pets' => array( - // 'type' => 'array', - // 'items' => array( - // '$ref' => '#/definitions/Pet', - // ), - // ), - 'Error' => array( - 'required' => array( - 0 => 'code', - 1 => 'message', - ), - 'properties' => array( - 'code' => array( - 'type' => 'integer', - 'format' => 'int32', - ), - 'message' => array( - 'type' => 'string', - ), - ), - ), - ], - 'externalDocs' => [ - 'description' => 'Full API docs, specs and tutorials', - 'url' => Config::getParam('protocol').'://'.Config::getParam('domain').'/docs', - ], - ]; + ]; - if ($extensions) { - if (isset($output['securityDefinitions']['Project'])) { - $output['securityDefinitions']['Project']['extensions'] = ['demo' => '5df5acd0d48c2']; - } - - if (isset($output['securityDefinitions']['Key'])) { - $output['securityDefinitions']['Key']['extensions'] = ['demo' => '919c2d18fb5d4...a2ae413da83346ad2']; - } - - if (isset($output['securityDefinitions']['Locale'])) { - $output['securityDefinitions']['Locale']['extensions'] = ['demo' => 'en']; - } + if ($extensions) { + $platformList = $route->getLabel('sdk.platform', []); - if (isset($output['securityDefinitions']['Mode'])) { - $output['securityDefinitions']['Mode']['extensions'] = ['demo' => '']; - } - } - - foreach ($utopia->getRoutes() as $key => $method) { - foreach ($method as $route) { /* @var $route \Utopia\Route */ - if (!$route->getLabel('docs', true)) { - continue; - } - - if (empty($route->getLabel('sdk.namespace', null))) { - continue; - } - - if ($platform !== APP_PLATFORM_CONSOLE && !\in_array($platforms[$platform], $route->getLabel('sdk.platform', []))) { - continue; - } - - $url = \str_replace('/v1', '', $route->getURL()); - $scope = $route->getLabel('scope', ''); - $hide = $route->getLabel('sdk.hide', false); - $consumes = ['application/json']; - - if ($hide) { - continue; - } - - $desc = (!empty($route->getLabel('sdk.description', ''))) ? \realpath('../'.$route->getLabel('sdk.description', '')) : null; - - $temp = [ - 'summary' => $route->getDesc(), - 'operationId' => $route->getLabel('sdk.method', \uniqid()), - 'consumes' => [], - 'tags' => [$route->getLabel('sdk.namespace', 'default')], - 'description' => ($desc) ? \file_get_contents($desc) : '', - - // 'responses' => [ - // 200 => [ - // 'description' => 'An paged array of pets', - // 'schema' => [ - // '$ref' => '#/definitions/Pet', - // ], - // ], - // ], + $temp['extensions'] = [ + 'weight' => $route->getOrder(), + 'cookies' => $route->getLabel('sdk.cookies', false), + 'type' => $route->getLabel('sdk.methodType', ''), + 'demo' => 'docs/examples/'. Template::fromCamelCaseToDash($route->getLabel('sdk.namespace', 'default')).'/'.Template::fromCamelCaseToDash($temp['operationId']).'.md', + 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $route->getLabel('sdk.description', ''), + 'rate-limit' => $route->getLabel('abuse-limit', 0), + 'rate-time' => $route->getLabel('abuse-time', 3600), + 'rate-key' => $route->getLabel('abuse-key', 'url:{url},ip:{ip}'), + 'scope' => $route->getLabel('scope', ''), + 'platforms' => $platformList, ]; + } - if ($extensions) { - $platformList = $route->getLabel('sdk.platform', []); + if ((!empty($scope))) { // && 'public' != $scope + $temp['security'][] = $route->getLabel('sdk.security', $security[$platform]); + } - $temp['extensions'] = [ - 'weight' => $route->getOrder(), - 'cookies' => $route->getLabel('sdk.cookies', false), - 'type' => $route->getLabel('sdk.methodType', ''), - 'demo' => 'docs/examples/'.fromCamelCaseToDash($route->getLabel('sdk.namespace', 'default')).'/'.fromCamelCaseToDash($temp['operationId']).'.md', - 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $route->getLabel('sdk.description', ''), - 'rate-limit' => $route->getLabel('abuse-limit', 0), - 'rate-time' => $route->getLabel('abuse-time', 3600), - 'rate-key' => $route->getLabel('abuse-key', 'url:{url},ip:{ip}'), - 'scope' => $route->getLabel('scope', ''), - 'platforms' => $platformList, - ]; - } - - if ((!empty($scope))) { // && 'public' != $scope - $temp['security'][] = $route->getLabel('sdk.security', $security[$platform]); - } - - $requestBody = [ - 'content' => [ - 'application/x-www-form-urlencoded' => [ - 'schema' => [ - 'type' => 'object', - 'properties' => [], - ], - 'required' => [], + $requestBody = [ + 'content' => [ + 'application/x-www-form-urlencoded' => [ + 'schema' => [ + 'type' => 'object', + 'properties' => [], ], + 'required' => [], ], + ], + ]; + + foreach ($route->getParams() as $name => $param) { + $validator = (\is_callable($param['validator'])) ? call_user_func_array($param['validator'], $utopia->getResources($param['resources'])) : $param['validator']; /* @var $validator \Utopia\Validator */ + + $node = [ + 'name' => $name, + 'description' => $param['description'], + 'required' => !$param['optional'], ]; - foreach ($route->getParams() as $name => $param) { - $validator = (\is_callable($param['validator'])) ? $param['validator']() : $param['validator']; /* @var $validator \Utopia\Validator */ - - $node = [ - 'name' => $name, - 'description' => $param['description'], - 'required' => !$param['optional'], - ]; - - switch ((!empty($validator)) ? \get_class($validator) : '') { - case 'Utopia\Validator\Text': - $node['type'] = 'string'; - $node['x-example'] = '['.\strtoupper(fromCamelCase($node['name'])).']'; - break; - case 'Utopia\Validator\Boolean': - $node['type'] = 'boolean'; - $node['x-example'] = false; - break; - case 'Appwrite\Database\Validator\UID': - $node['type'] = 'string'; - $node['x-example'] = '['.\strtoupper(fromCamelCase($node['name'])).']'; - break; - case 'Utopia\Validator\Email': - $node['type'] = 'string'; - $node['format'] = 'email'; - $node['x-example'] = 'email@example.com'; - break; - case 'Utopia\Validator\URL': - $node['type'] = 'string'; - $node['format'] = 'url'; - $node['x-example'] = 'https://example.com'; - break; - case 'Utopia\Validator\JSON': - case 'Utopia\Validator\Mock': - case 'Utopia\Validator\Assoc': - $node['type'] = 'object'; - $node['type'] = 'object'; - $node['x-example'] = '{}'; - //$node['format'] = 'json'; - break; - case 'Appwrite\Storage\Validator\File': - $consumes = ['multipart/form-data']; - $node['type'] = 'file'; - break; - case 'Utopia\Validator\ArrayList': - $node['type'] = 'array'; - $node['collectionFormat'] = 'multi'; - $node['items'] = [ - 'type' => 'string', - ]; - break; - case 'Appwrite\Auth\Validator\Password': - $node['type'] = 'string'; - $node['format'] = 'format'; - $node['x-example'] = 'password'; - break; - case 'Utopia\Validator\Range': /* @var $validator \Utopia\Validator\Range */ - $node['type'] = 'integer'; - $node['format'] = 'int32'; - $node['x-example'] = $validator->getMin(); - break; - case 'Utopia\Validator\Numeric': - $node['type'] = 'integer'; - $node['format'] = 'int32'; - break; - case 'Utopia\Validator\Length': - $node['type'] = 'string'; - break; - case 'Utopia\Validator\Host': - $node['type'] = 'string'; - $node['format'] = 'url'; - $node['x-example'] = 'https://example.com'; - break; - case 'Utopia\Validator\WhiteList': /* @var $validator \Utopia\Validator\WhiteList */ - $node['type'] = 'string'; - $node['x-example'] = $validator->getList()[0]; - break; - default: - $node['type'] = 'string'; - break; - } - - if ($param['optional'] && !\is_null($param['default'])) { // Param has default value - $node['default'] = $param['default']; - } - - if (false !== \strpos($url, ':'.$name)) { // Param is in URL path - $node['in'] = 'path'; - $temp['parameters'][] = $node; - } elseif ($key == 'GET') { // Param is in query - $node['in'] = 'query'; - $temp['parameters'][] = $node; - } else { // Param is in payload - $node['in'] = 'formData'; - $temp['parameters'][] = $node; - $requestBody['content']['application/x-www-form-urlencoded']['schema']['properties'][] = $node; - - if (!$param['optional']) { - $requestBody['content']['application/x-www-form-urlencoded']['required'][] = $name; - } - } - - $url = \str_replace(':'.$name, '{'.$name.'}', $url); + switch ((!empty($validator)) ? \get_class($validator) : '') { + case 'Utopia\Validator\Text': + $node['type'] = 'string'; + $node['x-example'] = '['.\strtoupper(Template::fromCamelCaseToSnake($node['name'])).']'; + break; + case 'Utopia\Validator\Boolean': + $node['type'] = 'boolean'; + $node['x-example'] = false; + break; + case 'Appwrite\Database\Validator\UID': + $node['type'] = 'string'; + $node['x-example'] = '['.\strtoupper(Template::fromCamelCaseToSnake($node['name'])).']'; + break; + case 'Utopia\Validator\Email': + $node['type'] = 'string'; + $node['format'] = 'email'; + $node['x-example'] = 'email@example.com'; + break; + case 'Utopia\Validator\URL': + $node['type'] = 'string'; + $node['format'] = 'url'; + $node['x-example'] = 'https://example.com'; + break; + case 'Utopia\Validator\JSON': + case 'Utopia\Validator\Mock': + case 'Utopia\Validator\Assoc': + $node['type'] = 'object'; + $node['type'] = 'object'; + $node['x-example'] = '{}'; + //$node['format'] = 'json'; + break; + case 'Appwrite\Storage\Validator\File': + $consumes = ['multipart/form-data']; + $node['type'] = 'file'; + break; + case 'Utopia\Validator\ArrayList': + $node['type'] = 'array'; + $node['collectionFormat'] = 'multi'; + $node['items'] = [ + 'type' => 'string', + ]; + break; + case 'Appwrite\Auth\Validator\Password': + $node['type'] = 'string'; + $node['format'] = 'format'; + $node['x-example'] = 'password'; + break; + case 'Utopia\Validator\Range': /* @var $validator \Utopia\Validator\Range */ + $node['type'] = 'integer'; + $node['format'] = 'int32'; + $node['x-example'] = $validator->getMin(); + break; + case 'Utopia\Validator\Numeric': + $node['type'] = 'integer'; + $node['format'] = 'int32'; + break; + case 'Utopia\Validator\Length': + $node['type'] = 'string'; + break; + case 'Utopia\Validator\Host': + $node['type'] = 'string'; + $node['format'] = 'url'; + $node['x-example'] = 'https://example.com'; + break; + case 'Utopia\Validator\WhiteList': /* @var $validator \Utopia\Validator\WhiteList */ + $node['type'] = 'string'; + $node['x-example'] = $validator->getList()[0]; + break; + default: + $node['type'] = 'string'; + break; } - $temp['consumes'] = $consumes; + if ($param['optional'] && !\is_null($param['default'])) { // Param has default value + $node['default'] = $param['default']; + } - $output['paths'][$url][\strtolower($route->getMethod())] = $temp; + if (false !== \strpos($url, ':'.$name)) { // Param is in URL path + $node['in'] = 'path'; + $temp['parameters'][] = $node; + } elseif ($key == 'GET') { // Param is in query + $node['in'] = 'query'; + $temp['parameters'][] = $node; + } else { // Param is in payload + $node['in'] = 'formData'; + $temp['parameters'][] = $node; + $requestBody['content']['application/x-www-form-urlencoded']['schema']['properties'][] = $node; + + if (!$param['optional']) { + $requestBody['content']['application/x-www-form-urlencoded']['required'][] = $name; + } + } + + $url = \str_replace(':'.$name, '{'.$name.'}', $url); } + + $temp['consumes'] = $consumes; + + $output['paths'][$url][\strtolower($route->getMethod())] = $temp; } - - /*foreach ($consoleDB->getMocks() as $mock) { - var_dump($mock['name']); - }*/ - - \ksort($output['paths']); - - $response - ->json($output); } - ); \ No newline at end of file + + /*foreach ($consoleDB->getMocks() as $mock) { + var_dump($mock['name']); + }*/ + + \ksort($output['paths']); + + $response + ->json($output); + }, ['utopia', 'request', 'response']); \ No newline at end of file diff --git a/app/http.php b/app/http.php new file mode 100644 index 0000000000..805ea0cb8a --- /dev/null +++ b/app/http.php @@ -0,0 +1,114 @@ +set([ + 'open_http2_protocol' => true, + // 'document_root' => __DIR__.'/../public', + // 'enable_static_handler' => true, + 'timeout' => 7, + 'http_compression' => true, + 'http_compression_level' => 6, + 'package_max_length' => $payloadSize, + ]) +; + +$http->on('WorkerStart', function($serv, $workerId) { + Console::success('Worker '.++$workerId.' started succefully'); +}); + +$http->on('BeforeReload', function($serv, $workerId) { + Console::success('Starting reload...'); +}); + +$http->on('AfterReload', function($serv, $workerId) { + Console::success('Reload completed...'); +}); + +$http->on('start', function (Server $http) use ($payloadSize) { + Console::success('Server started succefully (max payload is '.number_format($payloadSize).' bytes)'); + + Console::info("Master pid {$http->master_pid}, manager pid {$http->manager_pid}"); + + // listen ctrl + c + Process::signal(2, function () use ($http) { + Console::log('Stop by Ctrl+C'); + $http->shutdown(); + }); +}); + +Files::load(__DIR__ . '/../public'); + +include __DIR__ . '/controllers/general.php'; + +$domain = App::getEnv('_APP_DOMAIN', ''); + +Console::info('Issuing a TLS certificate for the master domain ('.$domain.') in 30 seconds. + Make sure your domain points to your server IP or restart your Appwrite server to try again.'); // TODO move this to installation script + +ResqueScheduler::enqueueAt(\time() + 30, 'v1-certificates', 'CertificatesV1', [ + 'document' => [], + 'domain' => $domain, + 'validateTarget' => false, + 'validateCNAME' => false, +]); + +$http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swooleResponse) { + $request = new Request($swooleRequest); + $response = new Response($swooleResponse); + + if(Files::isFileLoaded($request->getURI())) { + $time = (60 * 60 * 24 * 365 * 2); // 45 days cache + + $response + ->setContentType(Files::getFileMimeType($request->getURI())) + ->addHeader('Cache-Control', 'public, max-age='.$time) + ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + $time).' GMT') // 45 days cache + ->send(Files::getFileContents($request->getURI())) + ; + + return; + } + + $app = new App('Asia/Tel_Aviv'); + + try { + $app->run($request, $response); + } catch (\Throwable $th) { + if(App::isDevelopment()) { + var_dump(get_class($th)); + var_dump($th->getMessage()); + var_dump($th->getFile()); + var_dump($th->getLine()); + $swooleResponse->end('error: '.$th->getMessage()); + } + + $swooleResponse->end('500: Server Error'); + } +}); + +$http->start(); diff --git a/app/init.php b/app/init.php index 327bfbab67..9b4f1edc90 100644 --- a/app/init.php +++ b/app/init.php @@ -11,19 +11,23 @@ if (\file_exists(__DIR__.'/../vendor/autoload.php')) { require_once __DIR__.'/../vendor/autoload.php'; } +use Appwrite\Auth\Auth; +use Appwrite\Database\Database; +use Appwrite\Database\Adapter\MySQL as MySQLAdapter; +use Appwrite\Database\Adapter\Redis as RedisAdapter; +use Appwrite\Database\Document; +use Appwrite\Database\Validator\Authorization; +use Appwrite\Event\Event; +use Appwrite\Extend\PDO; +use Appwrite\OpenSSL\OpenSSL; use Utopia\App; -use Utopia\Request; -use Utopia\Response; +use Utopia\View; use Utopia\Config\Config; use Utopia\Locale\Locale; use Utopia\Registry\Registry; -use Appwrite\Auth\Auth; -use Appwrite\Database\Database; -use Appwrite\Database\Document; -use Appwrite\Database\Validator\Authorization; -use Appwrite\Database\Adapter\MySQL as MySQLAdapter; -use Appwrite\Database\Adapter\Redis as RedisAdapter; +use GeoIp2\Database\Reader; use PHPMailer\PHPMailer\PHPMailer; +use PDO as PDONative; const APP_NAME = 'Appwrite'; const APP_DOMAIN = 'appwrite.io'; @@ -31,10 +35,11 @@ const APP_EMAIL_TEAM = 'team@localhost.test'; // Default email address const APP_EMAIL_SECURITY = 'security@localhost.test'; // Default security email address 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.2'; +const APP_PAGING_LIMIT = 12; +const APP_CACHE_BUSTER = 138; +const APP_VERSION_STABLE = '0.7.0'; const APP_STORAGE_UPLOADS = '/storage/uploads'; +const APP_STORAGE_FUNCTIONS = '/storage/functions'; const APP_STORAGE_CACHE = '/storage/cache'; const APP_STORAGE_CERTIFICATES = '/storage/certificates'; const APP_STORAGE_CONFIG = '/storage/config'; @@ -44,72 +49,103 @@ const APP_SOCIAL_FACEBOOK = 'https://www.facebook.com/appwrite.io'; const APP_SOCIAL_LINKEDIN = 'https://www.linkedin.com/company/appwrite'; const APP_SOCIAL_INSTAGRAM = 'https://www.instagram.com/appwrite.io'; const APP_SOCIAL_GITHUB = 'https://github.com/appwrite'; -const APP_SOCIAL_DISCORD = 'https://discord.gg/GSeTUeA'; +const APP_SOCIAL_DISCORD = 'https://appwrite.io/discord'; const APP_SOCIAL_DEV = 'https://dev.to/appwrite'; +const APP_SOCIAL_STACKSHARE = 'https://stackshare.io/appwrite'; $register = new Registry(); -$request = new Request(); -$response = new Response(); -$utopia = new App('Asia/Tel_Aviv'); -$utopia->setMode($utopia->getEnv('_APP_ENV', App::MODE_TYPE_PRODUCTION)); +App::setMode(App::getEnv('_APP_ENV', App::MODE_TYPE_PRODUCTION)); /* * ENV vars */ -Config::load('events', __DIR__.'/../app/config/events.php'); -Config::load('providers', __DIR__.'/../app/config/providers.php'); -Config::load('platforms', __DIR__.'/../app/config/platforms.php'); -Config::load('locales', __DIR__.'/../app/config/locales.php'); -Config::load('collections', __DIR__.'/../app/config/collections.php'); -Config::load('roles', __DIR__.'/../app/config/roles.php'); // User roles and scopes -Config::load('services', __DIR__.'/../app/config/services.php'); // List of services +Config::load('events', __DIR__.'/config/events.php'); +Config::load('providers', __DIR__.'/config/providers.php'); +Config::load('platforms', __DIR__.'/config/platforms.php'); +Config::load('collections', __DIR__.'/config/collections.php'); +Config::load('environments', __DIR__.'/config/environments.php'); +Config::load('roles', __DIR__.'/config/roles.php'); // User roles and scopes +Config::load('scopes', __DIR__.'/config/scopes.php'); // User roles and scopes +Config::load('services', __DIR__.'/config/services.php'); // List of services +Config::load('variables', __DIR__.'/config/variables.php'); // List of env variables +Config::load('avatar-browsers', __DIR__.'/config/avatars/browsers.php'); +Config::load('avatar-credit-cards', __DIR__.'/config/avatars/credit-cards.php'); +Config::load('avatar-flags', __DIR__.'/config/avatars/flags.php'); +Config::load('locale-codes', __DIR__.'/config/locale/codes.php'); +Config::load('locale-currencies', __DIR__.'/config/locale/currencies.php'); +Config::load('locale-eu', __DIR__.'/config/locale/eu.php'); +Config::load('locale-languages', __DIR__.'/config/locale/languages.php'); +Config::load('locale-phones', __DIR__.'/config/locale/phones.php'); +Config::load('storage-logos', __DIR__.'/config/storage/logos.php'); +Config::load('storage-mimes', __DIR__.'/config/storage/mimes.php'); +Config::load('storage-inputs', __DIR__.'/config/storage/inputs.php'); +Config::load('storage-outputs', __DIR__.'/config/storage/outputs.php'); -Config::setParam('env', $utopia->getMode()); -Config::setParam('domain', $request->getServer('HTTP_HOST', '')); -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)); +Resque::setBackend(App::getEnv('_APP_REDIS_HOST', '') + .':'.App::getEnv('_APP_REDIS_PORT', '')); -Resque::setBackend($request->getServer('_APP_REDIS_HOST', '') - .':'.$request->getServer('_APP_REDIS_PORT', '')); +/** + * DB Filters + */ +Database::addFilter('json', + function($value) { + if(!is_array($value)) { + return $value; + } + return json_encode($value); + }, + function($value) { + return json_decode($value, true); + } +); -\define('COOKIE_DOMAIN', - ( - $request->getServer('HTTP_HOST', null) === 'localhost' || - $request->getServer('HTTP_HOST', null) === 'localhost:'.Config::getParam('port') || - (\filter_var(Config::getParam('hostname'), FILTER_VALIDATE_IP) !== false) - ) - ? null - : '.'.Config::getParam('hostname') - ); -\define('COOKIE_SAMESITE', Response::COOKIE_SAMESITE_NONE); +Database::addFilter('encrypt', + function($value) { + $key = App::getEnv('_APP_OPENSSL_KEY_V1'); + $iv = OpenSSL::randomPseudoBytes(OpenSSL::cipherIVLength(OpenSSL::CIPHER_AES_128_GCM)); + $tag = null; + + return json_encode([ + 'data' => OpenSSL::encrypt($value, OpenSSL::CIPHER_AES_128_GCM, $key, 0, $iv, $tag), + 'method' => OpenSSL::CIPHER_AES_128_GCM, + 'iv' => bin2hex($iv), + 'tag' => bin2hex($tag), + 'version' => '1', + ]); + }, + function($value) { + $value = json_decode($value, true); + $key = App::getEnv('_APP_OPENSSL_KEY_V'.$value['version']); + + return OpenSSL::decrypt($value['data'], $value['method'], $key, 0, hex2bin($value['iv']), hex2bin($value['tag'])); + } +); /* * Registry */ -$register->set('db', function () use ($request) { // Register DB connection - $dbHost = $request->getServer('_APP_DB_HOST', ''); - $dbUser = $request->getServer('_APP_DB_USER', ''); - $dbPass = $request->getServer('_APP_DB_PASS', ''); - $dbScheme = $request->getServer('_APP_DB_SCHEMA', ''); +$register->set('db', function () { // Register DB connection + $dbHost = App::getEnv('_APP_DB_HOST', ''); + $dbUser = App::getEnv('_APP_DB_USER', ''); + $dbPass = App::getEnv('_APP_DB_PASS', ''); + $dbScheme = App::getEnv('_APP_DB_SCHEMA', ''); $pdo = new PDO("mysql:host={$dbHost};dbname={$dbScheme};charset=utf8mb4", $dbUser, $dbPass, array( - PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4', - PDO::ATTR_TIMEOUT => 5, // Seconds + PDONative::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4', + PDONative::ATTR_TIMEOUT => 3, // Seconds + PDONative::ATTR_PERSISTENT => true )); // Connection settings - $pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); // Return arrays - $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Handle all errors with exceptions + $pdo->setAttribute(PDONative::ATTR_DEFAULT_FETCH_MODE, PDONative::FETCH_ASSOC); // Return arrays + $pdo->setAttribute(PDONative::ATTR_ERRMODE, PDONative::ERRMODE_EXCEPTION); // Handle all errors with exceptions return $pdo; }); -$register->set('influxdb', function () use ($request) { // Register DB connection - $host = $request->getServer('_APP_INFLUXDB_HOST', ''); - $port = $request->getServer('_APP_INFLUXDB_PORT', ''); +$register->set('influxdb', function () { // Register DB connection + $host = App::getEnv('_APP_INFLUXDB_HOST', ''); + $port = App::getEnv('_APP_INFLUXDB_PORT', ''); if (empty($host) || empty($port)) { return; @@ -119,43 +155,42 @@ $register->set('influxdb', function () use ($request) { // Register DB connectio return $client; }); -$register->set('statsd', function () use ($request) { // Register DB connection - $host = $request->getServer('_APP_STATSD_HOST', 'telegraf'); - $port = $request->getServer('_APP_STATSD_PORT', 8125); +$register->set('statsd', function () { // Register DB connection + $host = App::getEnv('_APP_STATSD_HOST', 'telegraf'); + $port = App::getEnv('_APP_STATSD_PORT', 8125); $connection = new \Domnikl\Statsd\Connection\UdpSocket($host, $port); $statsd = new \Domnikl\Statsd\Client($connection); return $statsd; }); -$register->set('cache', function () use ($request) { // Register cache connection +$register->set('cache', function () { // Register cache connection $redis = new Redis(); - - $redis->connect($request->getServer('_APP_REDIS_HOST', ''), - $request->getServer('_APP_REDIS_PORT', '')); + $redis->pconnect(App::getEnv('_APP_REDIS_HOST', '', 2.5), + App::getEnv('_APP_REDIS_PORT', '')); return $redis; }); -$register->set('smtp', function () use ($request) { +$register->set('smtp', function () { $mail = new PHPMailer(true); $mail->isSMTP(); - $username = $request->getServer('_APP_SMTP_USERNAME', null); - $password = $request->getServer('_APP_SMTP_PASSWORD', null); + $username = App::getEnv('_APP_SMTP_USERNAME', null); + $password = App::getEnv('_APP_SMTP_PASSWORD', null); $mail->XMailer = 'Appwrite Mailer'; - $mail->Host = $request->getServer('_APP_SMTP_HOST', 'smtp'); - $mail->Port = $request->getServer('_APP_SMTP_PORT', 25); + $mail->Host = App::getEnv('_APP_SMTP_HOST', 'smtp'); + $mail->Port = App::getEnv('_APP_SMTP_PORT', 25); $mail->SMTPAuth = (!empty($username) && !empty($password)); $mail->Username = $username; $mail->Password = $password; - $mail->SMTPSecure = $request->getServer('_APP_SMTP_SECURE', false); + $mail->SMTPSecure = App::getEnv('_APP_SMTP_SECURE', false); $mail->SMTPAutoTLS = false; $mail->CharSet = 'UTF-8'; - $from = \urldecode($request->getServer('_APP_SYSTEM_EMAIL_NAME', APP_NAME.' Server')); - $email = $request->getServer('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM); + $from = \urldecode(App::getEnv('_APP_SYSTEM_EMAIL_NAME', APP_NAME.' Server')); + $email = App::getEnv('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM); $mail->setFrom($email, $from); $mail->addReplyTo($email, $from); @@ -164,154 +199,262 @@ $register->set('smtp', function () use ($request) { return $mail; }); +$register->set('geodb', function () { + return new Reader(__DIR__.'/db/DBIP/dbip-country-lite-2020-01.mmdb'); +}); +$register->set('queue-webhooks', function () { + return new Event('v1-webhooks', 'WebhooksV1'); +}); +$register->set('queue-audits', function () { + return new Event('v1-audits', 'AuditsV1'); +}); +$register->set('queue-usage', function () { + return new Event('v1-usage', 'UsageV1'); +}); +$register->set('queue-mails', function () { + return new Event('v1-mails', 'MailsV1'); +}); +$register->set('queue-deletes', function () { + return new Event('v1-deletes', 'DeletesV1'); +}); +$register->set('queue-functions', function () { + return new Event('v1-functions', 'FunctionsV1'); +}); /* * Localization */ -$locale = $request->getParam('locale', $request->getHeader('X-Appwrite-Locale', '')); - Locale::$exceptions = false; - -Locale::setLanguage('af', include __DIR__.'/config/locales/af.php'); -Locale::setLanguage('ar', include __DIR__.'/config/locales/ar.php'); -Locale::setLanguage('bn', include __DIR__.'/config/locales/bn.php'); -Locale::setLanguage('cat', include __DIR__.'/config/locales/cat.php'); -Locale::setLanguage('cz', include __DIR__.'/config/locales/cz.php'); -Locale::setLanguage('de', include __DIR__.'/config/locales/de.php'); -Locale::setLanguage('en', include __DIR__.'/config/locales/en.php'); -Locale::setLanguage('es', include __DIR__.'/config/locales/es.php'); -Locale::setLanguage('fi', include __DIR__.'/config/locales/fi.php'); -Locale::setLanguage('fo', include __DIR__.'/config/locales/fo.php'); -Locale::setLanguage('fr', include __DIR__.'/config/locales/fr.php'); -Locale::setLanguage('gr', include __DIR__.'/config/locales/gr.php'); -Locale::setLanguage('he', include __DIR__.'/config/locales/he.php'); -Locale::setLanguage('hi', include __DIR__.'/config/locales/hi.php'); -Locale::setLanguage('hu', include __DIR__.'/config/locales/hu.php'); -Locale::setLanguage('hy', include __DIR__.'/config/locales/hy.php'); -Locale::setLanguage('id', include __DIR__.'/config/locales/id.php'); -Locale::setLanguage('is', include __DIR__.'/config/locales/is.php'); -Locale::setLanguage('it', include __DIR__.'/config/locales/it.php'); -Locale::setLanguage('ja', include __DIR__.'/config/locales/ja.php'); -Locale::setLanguage('jv', include __DIR__.'/config/locales/jv.php'); -Locale::setLanguage('km', include __DIR__.'/config/locales/km.php'); -Locale::setLanguage('ko', include __DIR__.'/config/locales/ko.php'); -Locale::setLanguage('lt', include __DIR__.'/config/locales/lt.php'); -Locale::setLanguage('ml', include __DIR__.'/config/locales/ml.php'); -Locale::setLanguage('ms', include __DIR__.'/config/locales/ms.php'); -Locale::setLanguage('nl', include __DIR__.'/config/locales/nl.php'); -Locale::setLanguage('no', include __DIR__.'/config/locales/no.php'); -Locale::setLanguage('ph', include __DIR__.'/config/locales/ph.php'); -Locale::setLanguage('pl', include __DIR__.'/config/locales/pl.php'); -Locale::setLanguage('pt-br', include __DIR__.'/config/locales/pt-br.php'); -Locale::setLanguage('pt-pt', include __DIR__.'/config/locales/pt-pt.php'); -Locale::setLanguage('ro', include __DIR__.'/config/locales/ro.php'); -Locale::setLanguage('ru', include __DIR__ . '/config/locales/ru.php'); -Locale::setLanguage('si', include __DIR__ . '/config/locales/si.php'); -Locale::setLanguage('sl', include __DIR__ . '/config/locales/sl.php'); -Locale::setLanguage('sq', include __DIR__ . '/config/locales/sq.php'); -Locale::setLanguage('sv', include __DIR__ . '/config/locales/sv.php'); -Locale::setLanguage('ta', include __DIR__ . '/config/locales/ta.php'); -Locale::setLanguage('th', include __DIR__.'/config/locales/th.php'); -Locale::setLanguage('tr', include __DIR__.'/config/locales/tr.php'); -Locale::setLanguage('ua', include __DIR__.'/config/locales/ua.php'); -Locale::setLanguage('vi', include __DIR__.'/config/locales/vi.php'); -Locale::setLanguage('zh-cn', include __DIR__.'/config/locales/zh-cn.php'); -Locale::setLanguage('zh-tw', include __DIR__.'/config/locales/zh-tw.php'); - -Locale::setDefault('en'); - -if (\in_array($locale, Config::getParam('locales'))) { - Locale::setDefault($locale); -} +Locale::setLanguage('af', include __DIR__.'/config/locale/translations/af.php'); +Locale::setLanguage('ar', include __DIR__.'/config/locale/translations/ar.php'); +Locale::setLanguage('bn', include __DIR__.'/config/locale/translations/bn.php'); +Locale::setLanguage('cat', include __DIR__.'/config/locale/translations/cat.php'); +Locale::setLanguage('cz', include __DIR__.'/config/locale/translations/cz.php'); +Locale::setLanguage('de', include __DIR__.'/config/locale/translations/de.php'); +Locale::setLanguage('en', include __DIR__.'/config/locale/translations/en.php'); +Locale::setLanguage('es', include __DIR__.'/config/locale/translations/es.php'); +Locale::setLanguage('fi', include __DIR__.'/config/locale/translations/fi.php'); +Locale::setLanguage('fo', include __DIR__.'/config/locale/translations/fo.php'); +Locale::setLanguage('fr', include __DIR__.'/config/locale/translations/fr.php'); +Locale::setLanguage('gr', include __DIR__.'/config/locale/translations/gr.php'); +Locale::setLanguage('he', include __DIR__.'/config/locale/translations/he.php'); +Locale::setLanguage('hi', include __DIR__.'/config/locale/translations/hi.php'); +Locale::setLanguage('hu', include __DIR__.'/config/locale/translations/hu.php'); +Locale::setLanguage('hy', include __DIR__.'/config/locale/translations/hy.php'); +Locale::setLanguage('id', include __DIR__.'/config/locale/translations/id.php'); +Locale::setLanguage('is', include __DIR__.'/config/locale/translations/is.php'); +Locale::setLanguage('it', include __DIR__.'/config/locale/translations/it.php'); +Locale::setLanguage('ja', include __DIR__.'/config/locale/translations/ja.php'); +Locale::setLanguage('jv', include __DIR__.'/config/locale/translations/jv.php'); +Locale::setLanguage('km', include __DIR__.'/config/locale/translations/km.php'); +Locale::setLanguage('ko', include __DIR__.'/config/locale/translations/ko.php'); +Locale::setLanguage('lt', include __DIR__.'/config/locale/translations/lt.php'); +Locale::setLanguage('ml', include __DIR__.'/config/locale/translations/ml.php'); +Locale::setLanguage('ms', include __DIR__.'/config/locale/translations/ms.php'); +Locale::setLanguage('nl', include __DIR__.'/config/locale/translations/nl.php'); +Locale::setLanguage('no', include __DIR__.'/config/locale/translations/no.php'); +Locale::setLanguage('ph', include __DIR__.'/config/locale/translations/ph.php'); +Locale::setLanguage('pl', include __DIR__.'/config/locale/translations/pl.php'); +Locale::setLanguage('pt-br', include __DIR__.'/config/locale/translations/pt-br.php'); +Locale::setLanguage('pt-pt', include __DIR__.'/config/locale/translations/pt-pt.php'); +Locale::setLanguage('ro', include __DIR__.'/config/locale/translations/ro.php'); +Locale::setLanguage('ru', include __DIR__ . '/config/locale/translations/ru.php'); +Locale::setLanguage('si', include __DIR__ . '/config/locale/translations/si.php'); +Locale::setLanguage('sl', include __DIR__ . '/config/locale/translations/sl.php'); +Locale::setLanguage('sq', include __DIR__ . '/config/locale/translations/sq.php'); +Locale::setLanguage('sv', include __DIR__ . '/config/locale/translations/sv.php'); +Locale::setLanguage('ta', include __DIR__ . '/config/locale/translations/ta.php'); +Locale::setLanguage('th', include __DIR__.'/config/locale/translations/th.php'); +Locale::setLanguage('tr', include __DIR__.'/config/locale/translations/tr.php'); +Locale::setLanguage('ua', include __DIR__.'/config/locale/translations/ua.php'); +Locale::setLanguage('vi', include __DIR__.'/config/locale/translations/vi.php'); +Locale::setLanguage('zh-cn', include __DIR__.'/config/locale/translations/zh-cn.php'); +Locale::setLanguage('zh-tw', include __DIR__.'/config/locale/translations/zh-tw.php'); \stream_context_set_default([ // Set global user agent and http settings 'http' => [ 'method' => 'GET', 'user_agent' => \sprintf(APP_USERAGENT, - Config::getParam('version'), - $request->getServer('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS', APP_EMAIL_SECURITY)), + App::getEnv('_APP_VERSION', 'UNKNOWN'), + App::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS', APP_EMAIL_SECURITY)), 'timeout' => 2, ], ]); -/* - * Auth & Project Scope - */ -$consoleDB = new Database(); -$consoleDB->setAdapter(new RedisAdapter(new MySQLAdapter($register), $register)); -$consoleDB->setNamespace('app_console'); // Should be replaced with param if we want to have parent projects +// Runtime Execution -$consoleDB->setMocks(Config::getParam('collections', [])); -Authorization::disable(); +App::setResource('register', function() use ($register) { + return $register; +}); -$project = $consoleDB->getDocument($request->getParam('project', $request->getHeader('X-Appwrite-Project', ''))); +App::setResource('layout', function($locale) { + $layout = new View(__DIR__.'/views/layouts/default.phtml'); + $layout->setParam('locale', $locale); -Authorization::enable(); + return $layout; +}, ['locale']); -$console = $consoleDB->getDocument('console'); +App::setResource('locale', function() { + return new Locale('en'); +}); -$mode = $request->getParam('mode', $request->getHeader('X-Appwrite-Mode', 'default')); +// Queues +App::setResource('webhooks', function($register) { + return $register->get('queue-webhooks'); +}, ['register']); -Auth::setCookieName('a_session_'.$project->getId()); +App::setResource('audits', function($register) { + return $register->get('queue-audits'); +}, ['register']); -if (APP_MODE_ADMIN === $mode) { - Auth::setCookieName('a_session_'.$console->getId()); -} +App::setResource('usage', function($register) { + return $register->get('queue-usage'); +}, ['register']); -$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 +App::setResource('mails', function($register) { + return $register->get('queue-mails'); +}, ['register']); -// Get fallback session from clients who block 3rd-party cookies -$response->addHeader('X-Debug-Fallback', 'false'); +App::setResource('deletes', function($register) { + return $register->get('queue-deletes'); +}, ['register']); -if(empty($session['id']) && empty($session['secret'])) { - $response->addHeader('X-Debug-Fallback', 'true'); - $fallback = $request->getHeader('X-Fallback-Cookies', ''); - $fallback = \json_decode($fallback, true); - $session = Auth::decodeSession(((isset($fallback[Auth::$cookieName])) ? $fallback[Auth::$cookieName] : '')); -} +App::setResource('functions', function($register) { + return $register->get('queue-functions'); +}, ['register']); -Auth::$unique = $session['id']; -Auth::$secret = $session['secret']; +// Test Mock +App::setResource('clients', function($console, $project) { + /** + * Get All verified client URLs for both console and current projects + * + Filter for duplicated entries + */ + $clientsConsole = \array_map(function ($node) { + return $node['hostname']; + }, \array_filter($console->getAttribute('platforms', []), function ($node) { + if (isset($node['type']) && $node['type'] === 'web' && isset($node['hostname']) && !empty($node['hostname'])) { + return true; + } -$projectDB = new Database(); -$projectDB->setAdapter(new RedisAdapter(new MySQLAdapter($register), $register)); -$projectDB->setNamespace('app_'.$project->getId()); -$projectDB->setMocks(Config::getParam('collections', [])); + return false; + })); -if (APP_MODE_ADMIN !== $mode) { - $user = $projectDB->getDocument(Auth::$unique); -} -else { - $user = $consoleDB->getDocument(Auth::$unique); + $clients = \array_unique(\array_merge($clientsConsole, \array_map(function ($node) { + return $node['hostname']; + }, \array_filter($project->getAttribute('platforms', []), function ($node) { + if (isset($node['type']) && $node['type'] === 'web' && isset($node['hostname']) && !empty($node['hostname'])) { + return true; + } - $user - ->setAttribute('$id', 'admin-'.$user->getAttribute('$id')) - ; -} + return false; + })))); -if (empty($user->getId()) // Check a document has been found in the DB - || Database::SYSTEM_COLLECTION_USERS !== $user->getCollection() // Validate returned document is really a user document - || !Auth::tokenVerify($user->getAttribute('tokens', []), Auth::TOKEN_TYPE_LOGIN, Auth::$secret)) { // Validate user has valid login token - $user = new Document(['$id' => '', '$collection' => Database::SYSTEM_COLLECTION_USERS]); -} + return $clients; +}, ['console', 'project']); -if (APP_MODE_ADMIN === $mode) { - if (!empty($user->search('teamId', $project->getAttribute('teamId'), $user->getAttribute('memberships')))) { - Authorization::disable(); - } else { +App::setResource('user', function($mode, $project, $console, $request, $response, $projectDB, $consoleDB) { + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Utopia\Response $response */ + /** @var Appwrite\Database\Document $project */ + /** @var Appwrite\Database\Database $consoleDB */ + /** @var Appwrite\Database\Database $projectDB */ + /** @var bool $mode */ + + Authorization::setDefaultStatus(true); + + Auth::setCookieName('a_session_'.$project->getId()); + + if (APP_MODE_ADMIN === $mode) { + Auth::setCookieName('a_session_'.$console->getId()); + } + + $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 + + // Get fallback session from clients who block 3rd-party cookies + $response->addHeader('X-Debug-Fallback', 'false'); + + if(empty($session['id']) && empty($session['secret'])) { + $response->addHeader('X-Debug-Fallback', 'true'); + $fallback = $request->getHeader('x-fallback-cookies', ''); + $fallback = \json_decode($fallback, true); + $session = Auth::decodeSession(((isset($fallback[Auth::$cookieName])) ? $fallback[Auth::$cookieName] : '')); + } + + Auth::$unique = $session['id']; + Auth::$secret = $session['secret']; + + if (APP_MODE_ADMIN !== $mode) { + $user = $projectDB->getDocument(Auth::$unique); + } + else { + $user = $consoleDB->getDocument(Auth::$unique); + + $user + ->setAttribute('$id', 'admin-'.$user->getAttribute('$id')) + ; + } + + if (empty($user->getId()) // Check a document has been found in the DB + || Database::SYSTEM_COLLECTION_USERS !== $user->getCollection() // Validate returned document is really a user document + || !Auth::tokenVerify($user->getAttribute('tokens', []), Auth::TOKEN_TYPE_LOGIN, Auth::$secret)) { // Validate user has valid login token $user = new Document(['$id' => '', '$collection' => Database::SYSTEM_COLLECTION_USERS]); } -} -// Set project mail -$register->get('smtp') - ->setFrom( - $request->getServer('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM), - ($project->getId() === 'console') - ? \urldecode($request->getServer('_APP_SYSTEM_EMAIL_NAME', APP_NAME.' Server')) - : \sprintf(Locale::getText('account.emails.team'), $project->getAttribute('name') - ) - ); + if (APP_MODE_ADMIN === $mode) { + if (!empty($user->search('teamId', $project->getAttribute('teamId'), $user->getAttribute('memberships')))) { + Authorization::setDefaultStatus(false); // Cancel security segmentation for admin users. + } else { + $user = new Document(['$id' => '', '$collection' => Database::SYSTEM_COLLECTION_USERS]); + } + } + + return $user; +}, ['mode', 'project', 'console', 'request', 'response', 'projectDB', 'consoleDB']); + +App::setResource('project', function($consoleDB, $request) { + /** @var Utopia\Swoole\Request $request */ + /** @var Appwrite\Database\Database $consoleDB */ + + Authorization::disable(); + + $project = $consoleDB->getDocument($request->getParam('project', + $request->getHeader('x-appwrite-project', ''))); + + Authorization::reset(); + + return $project; +}, ['consoleDB', 'request']); + +App::setResource('console', function($consoleDB) { + return $consoleDB->getDocument('console'); +}, ['consoleDB']); + +App::setResource('consoleDB', function($register) { + $consoleDB = new Database(); + $consoleDB->setAdapter(new RedisAdapter(new MySQLAdapter($register), $register)); + $consoleDB->setNamespace('app_console'); // Should be replaced with param if we want to have parent projects + $consoleDB->setMocks(Config::getParam('collections', [])); + + return $consoleDB; +}, ['register']); + +App::setResource('projectDB', function($register, $project) { + $projectDB = new Database(); + $projectDB->setAdapter(new RedisAdapter(new MySQLAdapter($register), $register)); + $projectDB->setNamespace('app_'.$project->getId()); + $projectDB->setMocks(Config::getParam('collections', [])); + + return $projectDB; +}, ['register', 'project']); + +App::setResource('mode', function($request) { + /** @var Utopia\Swoole\Request $request */ + return $request->getParam('mode', $request->getHeader('x-appwrite-mode', 'default')); +}, ['request']); + +App::setResource('geodb', function($register) { + return $register->get('geodb'); +}, ['register']); diff --git a/app/preload.php b/app/preload.php new file mode 100644 index 0000000000..89eafa8ee6 --- /dev/null +++ b/app/preload.php @@ -0,0 +1,38 @@ +paths(realpath(__DIR__ . '/../app/config')) + ->paths(realpath(__DIR__ . '/../app/controllers')) + ->paths(realpath(__DIR__ . '/../src')) + ->ignore(realpath(__DIR__ . '/../vendor/twig/twig')) + ->ignore(realpath(__DIR__ . '/../vendor/guzzlehttp/guzzle')) + ->ignore(realpath(__DIR__ . '/../vendor/geoip2')) + ->ignore(realpath(__DIR__ . '/../vendor/maxmind')) + ->ignore(realpath(__DIR__ . '/../vendor/maxmind-db')) + ->ignore(realpath(__DIR__ . '/../vendor/psr/log')) + ->ignore(realpath(__DIR__ . '/../vendor/piwik')) + ->ignore(realpath(__DIR__ . '/../vendor/symfony')) + ->load(); + +echo 'Loaded '.$preloader->getCount()." file\n"; \ No newline at end of file diff --git a/app/sdks/client-flutter/CHANGELOG.md b/app/sdks/client-flutter/CHANGELOG.md index 638d0882d2..a584ad8b9a 100644 --- a/app/sdks/client-flutter/CHANGELOG.md +++ b/app/sdks/client-flutter/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.0-dev.2 + +- Fix for an error when using a self-signed certificate for Web + ## 0.3.0-dev.1 - Updated package dependencies (@lohanidamodar) diff --git a/app/sdks/client-flutter/README.md b/app/sdks/client-flutter/README.md index 95cdeae642..d272426ee3 100644 --- a/app/sdks/client-flutter/README.md +++ b/app/sdks/client-flutter/README.md @@ -20,7 +20,7 @@ Add this to your package's `pubspec.yaml` file: ```yml dependencies: - appwrite: ^0.3.0-dev.1 + appwrite: ^0.3.0-dev.2 ``` You can install packages from the command line: diff --git a/app/sdks/client-flutter/lib/client.dart b/app/sdks/client-flutter/lib/client.dart index 1cf3ac8f0d..ee55d8ba18 100644 --- a/app/sdks/client-flutter/lib/client.dart +++ b/app/sdks/client-flutter/lib/client.dart @@ -35,7 +35,7 @@ class Client { this.headers = { 'content-type': 'application/json', - 'x-sdk-version': 'appwrite:flutter:0.3.0-dev.1', + 'x-sdk-version': 'appwrite:flutter:0.3.0-dev.2', }; this.config = {}; @@ -101,7 +101,7 @@ class Client { } Future call(HttpMethod method, {String path = '', Map headers = const {}, Map params = const {}}) async { - if(selfSigned) { + if(selfSigned && !kIsWeb) { // Allow self signed requests (http.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (HttpClient client) { client.badCertificateCallback = (X509Certificate cert, String host, int port) => true; diff --git a/app/sdks/client-flutter/lib/services/account.dart b/app/sdks/client-flutter/lib/services/account.dart index 617ea83b98..890303a9d6 100644 --- a/app/sdks/client-flutter/lib/services/account.dart +++ b/app/sdks/client-flutter/lib/services/account.dart @@ -1,8 +1,10 @@ import 'dart:io'; +import 'package:universal_html/html.dart' as html; import 'package:dio/dio.dart'; import 'package:meta/meta.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter_web_auth/flutter_web_auth.dart'; import "../client.dart"; @@ -337,19 +339,26 @@ class Account extends Service { query: query.join('&') ); - return FlutterWebAuth.authenticate( - url: url.toString(), - callbackUrlScheme: "appwrite-callback-" + client.config['project'] - ).then((value) async { - Uri url = Uri.parse(value); - Cookie cookie = new Cookie(url.queryParameters['key'], url.queryParameters['secret']); - cookie.domain = Uri.parse(client.endPoint).host; - cookie.httpOnly = true; - cookie.path = '/'; - List cookies = [cookie]; - await client.init(); - client.cookieJar.saveFromResponse(Uri.parse(client.endPoint), cookies); - }); + if(kIsWeb) { + html.window.location.href = url.toString(); + return null; + }else{ + + return FlutterWebAuth.authenticate( + url: url.toString(), + callbackUrlScheme: "appwrite-callback-" + client.config['project'] + ).then((value) async { + Uri url = Uri.parse(value); + Cookie cookie = new Cookie(url.queryParameters['key'], url.queryParameters['secret']); + cookie.domain = Uri.parse(client.endPoint).host; + cookie.httpOnly = true; + cookie.path = '/'; + List cookies = [cookie]; + await client.init(); + client.cookieJar.saveFromResponse(Uri.parse(client.endPoint), cookies); + }); + } + } /// Delete Account Session @@ -376,16 +385,17 @@ class Account extends Service { /// Use this endpoint to send a verification message to your user email address /// to confirm they are the valid owners of that address. Both the **userId** /// and **secret** arguments will be passed as query parameters to the URL you - /// have provider to be attached to the verification email. The provided URL - /// should redirect the user back for your app and allow you to complete the + /// have provided to be attached to the verification email. The provided URL + /// should redirect the user back to your app and allow you to complete the /// verification process by verifying both the **userId** and **secret** /// parameters. Learn more about how to [complete the verification /// process](/docs/client/account#updateAccountVerification). /// /// Please note that in order to avoid a [Redirect - /// Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) + /// Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), /// the only valid redirect URLs are the ones from domains you have set when /// adding your platforms in the console interface. + /// /// Future createVerification({@required String url}) { final String path = '/account/verification'; diff --git a/app/sdks/client-flutter/lib/services/avatars.dart b/app/sdks/client-flutter/lib/services/avatars.dart index a57b3b564c..b7fa6393ef 100644 --- a/app/sdks/client-flutter/lib/services/avatars.dart +++ b/app/sdks/client-flutter/lib/services/avatars.dart @@ -190,6 +190,10 @@ class Avatars extends Service { 'project': client.config['project'], }; + params.keys.forEach((key) {if (params[key] is int || params[key] is double) { + params[key] = params[key].toString(); + }}); + Uri endpoint = Uri.parse(client.endPoint); Uri location = new Uri(scheme: endpoint.scheme, host: endpoint.host, @@ -206,7 +210,7 @@ class Avatars extends Service { /// Converts a given plain text to a QR code image. You can use the query /// parameters to change the size and style of the resulting image. /// - String getQR({@required String text, int size = 400, int margin = 1, int download = 0}) { + String getQR({@required String text, int size = 400, int margin = 1, bool download = false}) { final String path = '/avatars/qr'; final Map params = { diff --git a/app/sdks/client-flutter/lib/services/database.dart b/app/sdks/client-flutter/lib/services/database.dart index 88082feef7..0fec1fb4d6 100644 --- a/app/sdks/client-flutter/lib/services/database.dart +++ b/app/sdks/client-flutter/lib/services/database.dart @@ -17,7 +17,7 @@ class Database extends Service { /// of the project documents. [Learn more about different API /// modes](/docs/admin). /// - Future listDocuments({@required String collectionId, List filters = const [], int offset = 0, int limit = 50, String orderField = '\$id', OrderType orderType = OrderType.asc, String orderCast = 'string', String search = '', int first = 0, int last = 0}) { + Future listDocuments({@required String collectionId, List filters = const [], int offset = 0, int limit = 50, String orderField = '\$id', OrderType orderType = OrderType.asc, String orderCast = 'string', String search = ''}) { final String path = '/database/collections/{collectionId}/documents'.replaceAll(RegExp('{collectionId}'), collectionId); final Map params = { @@ -28,8 +28,6 @@ class Database extends Service { 'orderType': orderType.name(), 'orderCast': orderCast, 'search': search, - 'first': first, - 'last': last, }; final Map headers = { diff --git a/app/sdks/client-flutter/pubspec.yaml b/app/sdks/client-flutter/pubspec.yaml index 2d0c2fe412..cabc271c5e 100644 --- a/app/sdks/client-flutter/pubspec.yaml +++ b/app/sdks/client-flutter/pubspec.yaml @@ -1,5 +1,5 @@ name: appwrite -version: 0.3.0-dev.1 +version: 0.3.0-dev.2 description: Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API homepage: https://appwrite.io repository: https://github.com/appwrite/sdk-for-flutter @@ -15,6 +15,7 @@ dependencies: cookie_jar: ^1.0.1 dio_cookie_manager: ^1.0.0 flutter_web_auth: ^0.2.4 + universal_html: ^1.2.3 flutter: sdk: flutter diff --git a/app/sdks/client-swift/CHANGELOG.md b/app/sdks/client-swift/CHANGELOG.md new file mode 100644 index 0000000000..fa4d35e687 --- /dev/null +++ b/app/sdks/client-swift/CHANGELOG.md @@ -0,0 +1 @@ +# Change Log \ No newline at end of file diff --git a/app/sdks/client-swift/LICENSE b/app/sdks/client-swift/LICENSE new file mode 100644 index 0000000000..fc7c051a91 --- /dev/null +++ b/app/sdks/client-swift/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/client-swift/Package.swift b/app/sdks/client-swift/Package.swift new file mode 100644 index 0000000000..5bea7f1c50 --- /dev/null +++ b/app/sdks/client-swift/Package.swift @@ -0,0 +1,35 @@ +// swift-tools-version:5.1 +// The swift-tools-version declares the minimum version of Swift required to build this package. +// +// Created by Armino +// GitHub: https://github.com/armino-dev/sdk-generator +// + +import PackageDescription + +let package = Package( + name: "Appwrite", + products: [ + // Products define the executables and libraries produced by a package, + // and make them visible to other packages. + .library( + name: "Appwrite", + targets: ["Appwrite"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. + // A target can define a module or a test suite. + // Targets can depend on other targets in this package, + // and on products in packages which this package depends on. + .target( + name: "Appwrite", + dependencies: []), + .testTarget( + name: "AppwriteTests", + dependencies: [Appwrite]), + ] +) diff --git a/app/sdks/client-swift/README.md b/app/sdks/client-swift/README.md new file mode 100644 index 0000000000..d46757f068 --- /dev/null +++ b/app/sdks/client-swift/README.md @@ -0,0 +1,24 @@ +# Appwrite Swift SDK + +![License](https://img.shields.io/github/license/appwrite/sdk-for-swift.svg?v=1) +![Version](https://img.shields.io/badge/api%20version-0.7.0-blue.svg?v=1) + +Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. + Use the Swift SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. + For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) + + + +![Appwrite](https://appwrite.io/images/github.png) + +## Installation + +``` + git clone appwrite/sdk-for-swift + cd sdk-for-swift + swift run +``` + +## License + +Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. diff --git a/app/sdks/client-swift/Sources/Appwrite/Client.swift b/app/sdks/client-swift/Sources/Appwrite/Client.swift new file mode 100644 index 0000000000..8748fbc0f9 --- /dev/null +++ b/app/sdks/client-swift/Sources/Appwrite/Client.swift @@ -0,0 +1,231 @@ +// +// Client.swift +// +// Created by Armino +// GitHub: https://github.com/armino-dev/sdk-generator +// + +import Foundation + +open class Client { + + // MARK: Properties + + open var selfSigned = false + + open var endpoint = "https://appwrite.io/v1" + + open var headers: [String: String] = [ + "content-type": "", + "x-sdk-version": "appwrite:swift:" + ] + + + // MARK: Methods + + // default constructor + public init() { + + } + + /// + /// Set Project + /// + /// Your project ID + /// + /// @param String value + /// + /// @return Client + /// + open func setProject(value: String) -> Client { + + self.addHeader(key: "X-Appwrite-Project", value: value) + return self + } + + /// + /// Set Locale + /// + /// @param String value + /// + /// @return Client + /// + open func setLocale(value: String) -> Client { + + self.addHeader(key: "X-Appwrite-Locale", value: value) + return self + } + + + /// + /// @param Bool status + /// @return Client + /// + open func setSelfSigned(status: Bool = true) -> Client { + + self.selfSigned = status + return self + } + + /// + /// @param String endpoint + /// @return Client + /// + open func setEndpoint(endpoint: String) -> Client { + + self.endpoint = endpoint + return self + } + + /// + /// @param String key + /// @param String value + /// + open func addHeader(key: String, value: String) -> Client { + + self.headers[key.lowercased()] = value.lowercased() + + return self + } + + /// + open func httpBuildQuery(params: [String: Any], prefix: String = "") -> String { + var output: String = "" + for (key, value) in params { + let finalKey: String = prefix.isEmpty ? key : (prefix + "[" + key + "]") + if (value is AnyCollection) { + output += self.httpBuildQuery(params: value as! [String : Any], prefix: finalKey) + } else { + output += "\(value)" + } + output += "&" + } + return output + } + + /// + /// Make an API call + /// + /// @param String method + /// @param String path + /// @param Array params + /// @param Array headers + /// @return Array|String + /// @throws Exception + /// + func call(method:String, path:String = "", headers:[String: String] = [:], params:[String: Any] = [:]) -> Any { + + self.headers.merge(headers){(_, new) in new} + let targetURL:URL = URL(string: self.endpoint + path + (( method == HTTPMethod.get.rawValue && !params.isEmpty ) ? "?" + httpBuildQuery(params: params) : ""))! + + var query: String = "" + + var responseStatus: Int = HTTPStatus.unknown.rawValue + var responseType: String = "" + var responseBody: Any = "" + + switch (self.headers["content-type"]) { + case "application/json": + do { + let json = try JSONSerialization.data(withJSONObject:params, options: []) + query = String( data: json, encoding: String.Encoding.utf8)! + } catch { + print("Failed to parse json: \(error.localizedDescription)") + } + break + default: + query = self.httpBuildQuery(params: params) + break + } + + var request = URLRequest(url: targetURL) + let session = URLSession.shared + + for (key, value) in self.headers { + request.setValue(value, forHTTPHeaderField: key) + } + + request.httpMethod = method + if (method.uppercased() == "POST") { + request.httpBody = query.data(using: .utf8) + } + + let semaphore = DispatchSemaphore(value: 0) + + session.dataTask(with: request) { data, response, error in + if (error != nil) { + print(error!) + return + } + do { + let httpResponse = response as! HTTPURLResponse + responseStatus = httpResponse.statusCode + + if (responseStatus == HTTPStatus.internalServerError.rawValue) { + print(responseStatus) + return + } + + responseType = httpResponse.mimeType ?? "" + + if (responseType == "application/json") { + let json = try JSONSerialization.jsonObject(with: data!, options: []) + responseBody = json + } else { + responseBody = String(data: data!, encoding: String.Encoding.utf8)! + } + } catch { + print(error) + } + + semaphore.signal() + }.resume() + + _ = semaphore.wait(wallTimeout: .distantFuture) + + return responseBody + } + +} + +extension Client { + + public enum HTTPStatus: Int { + case unknown = -1 + + case ok = 200 + case created = 201 + case accepted = 202 + + case movedPermanently = 301 + case found = 302 + + case badRequest = 400 + case notAuthorized = 401 + case paymentRequired = 402 + case forbidden = 403 + case notFound = 404 + case methodNotAllowed = 405 + case notAcceptable = 406 + + case internalServerError = 500 + case notImplemented = 501 + } + + public enum HTTPMethod: String { + case get + + case post + case put + case patch + + case delete + + case head + case options + case connect + case trace + } + + +} diff --git a/app/sdks/client-swift/Sources/Appwrite/Service.swift b/app/sdks/client-swift/Sources/Appwrite/Service.swift new file mode 100644 index 0000000000..b11a067a5d --- /dev/null +++ b/app/sdks/client-swift/Sources/Appwrite/Service.swift @@ -0,0 +1,16 @@ +// +// Service.swift +// +// Created by Armino +// GitHub: https://github.com/armino-dev/sdk-generator +// + +open class Service { + + open var client: Client; + + public init(client: Client) + { + self.client = client + } +} diff --git a/app/sdks/client-swift/Sources/Appwrite/Services/Account.swift b/app/sdks/client-swift/Sources/Appwrite/Services/Account.swift new file mode 100644 index 0000000000..0ffb74df52 --- /dev/null +++ b/app/sdks/client-swift/Sources/Appwrite/Services/Account.swift @@ -0,0 +1,491 @@ + + +class Account: Service +{ + /** + * Get Account + * + * Get currently logged in user data as JSON object. + * + * @throws Exception + * @return array + */ + + func get() -> Array { + let path: String = "/account" + + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Create Account + * + * Use this endpoint to allow a new user to register a new account in your + * project. After the user registration completes successfully, you can use + * the [/account/verfication](/docs/client/account#createVerification) route + * to start verifying the user email address. To allow your new user to login + * to his new account, you need to create a new [account + * session](/docs/client/account#createSession). + * + * @param String _email + * @param String _password + * @param String _name + * @throws Exception + * @return array + */ + + func create(_email: String, _password: String, _name: String = "") -> Array { + let path: String = "/account" + + + var params: [String: Any] = [:] + + params["email"] = _email + params["password"] = _password + params["name"] = _name + + return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Delete Account + * + * Delete a currently logged in user account. Behind the scene, the user + * record is not deleted but permanently blocked from any access. This is done + * to avoid deleted accounts being overtaken by new users with the same email + * address. Any user-related resources like documents or storage files should + * be deleted separately. + * + * @throws Exception + * @return array + */ + + func delete() -> Array { + let path: String = "/account" + + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Update Account Email + * + * Update currently logged in user account email address. After changing user + * address, user confirmation status is being reset and a new confirmation + * mail is sent. For security measures, user password is required to complete + * this request. + * + * @param String _email + * @param String _password + * @throws Exception + * @return array + */ + + func updateEmail(_email: String, _password: String) -> Array { + let path: String = "/account/email" + + + var params: [String: Any] = [:] + + params["email"] = _email + params["password"] = _password + + return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Get Account Logs + * + * Get currently logged in user list of latest security activity logs. Each + * log returns user IP address, location and date and time of log. + * + * @throws Exception + * @return array + */ + + func getLogs() -> Array { + let path: String = "/account/logs" + + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Update Account Name + * + * Update currently logged in user account name. + * + * @param String _name + * @throws Exception + * @return array + */ + + func updateName(_name: String) -> Array { + let path: String = "/account/name" + + + var params: [String: Any] = [:] + + params["name"] = _name + + return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Update Account Password + * + * Update currently logged in user password. For validation, user is required + * to pass the password twice. + * + * @param String _password + * @param String _oldPassword + * @throws Exception + * @return array + */ + + func updatePassword(_password: String, _oldPassword: String) -> Array { + let path: String = "/account/password" + + + var params: [String: Any] = [:] + + params["password"] = _password + params["oldPassword"] = _oldPassword + + return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Get Account Preferences + * + * Get currently logged in user preferences as a key-value object. + * + * @throws Exception + * @return array + */ + + func getPrefs() -> Array { + let path: String = "/account/prefs" + + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Update Account Preferences + * + * Update currently logged in user account preferences. You can pass only the + * specific settings you wish to update. + * + * @param object _prefs + * @throws Exception + * @return array + */ + + func updatePrefs(_prefs: object) -> Array { + let path: String = "/account/prefs" + + + var params: [String: Any] = [:] + + params["prefs"] = _prefs + + return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Create Password Recovery + * + * Sends the user an email with a temporary secret key for password reset. + * When the user clicks the confirmation link he is redirected back to your + * app password reset URL with the secret key and email address values + * attached to the URL query string. Use the query string params to submit a + * request to the [PUT /account/recovery](/docs/client/account#updateRecovery) + * endpoint to complete the process. + * + * @param String _email + * @param String _url + * @throws Exception + * @return array + */ + + func createRecovery(_email: String, _url: String) -> Array { + let path: String = "/account/recovery" + + + var params: [String: Any] = [:] + + params["email"] = _email + params["url"] = _url + + return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Complete Password Recovery + * + * Use this endpoint to complete the user account password reset. Both the + * **userId** and **secret** arguments will be passed as query parameters to + * the redirect URL you have provided when sending your request to the [POST + * /account/recovery](/docs/client/account#createRecovery) endpoint. + * + * Please note that in order to avoid a [Redirect + * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) + * the only valid redirect URLs are the ones from domains you have set when + * adding your platforms in the console interface. + * + * @param String _userId + * @param String _secret + * @param String _password + * @param String _passwordAgain + * @throws Exception + * @return array + */ + + func updateRecovery(_userId: String, _secret: String, _password: String, _passwordAgain: String) -> Array { + let path: String = "/account/recovery" + + + var params: [String: Any] = [:] + + params["userId"] = _userId + params["secret"] = _secret + params["password"] = _password + params["passwordAgain"] = _passwordAgain + + return [self.client.call(method: Client.HTTPMethod.put.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Get Account Sessions + * + * Get currently logged in user list of active sessions across different + * devices. + * + * @throws Exception + * @return array + */ + + func getSessions() -> Array { + let path: String = "/account/sessions" + + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Create Account Session + * + * Allow the user to login into his account by providing a valid email and + * password combination. This route will create a new session for the user. + * + * @param String _email + * @param String _password + * @throws Exception + * @return array + */ + + func createSession(_email: String, _password: String) -> Array { + let path: String = "/account/sessions" + + + var params: [String: Any] = [:] + + params["email"] = _email + params["password"] = _password + + return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Delete All Account Sessions + * + * Delete all sessions from the user account and remove any sessions cookies + * from the end client. + * + * @throws Exception + * @return array + */ + + func deleteSessions() -> Array { + let path: String = "/account/sessions" + + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Create Account Session with OAuth2 + * + * Allow the user to login to his account using the OAuth2 provider of his + * choice. Each OAuth2 provider should be enabled from the Appwrite console + * first. Use the success and failure arguments to provide a redirect URL's + * back to your app when login is completed. + * + * @param String _provider + * @param String _success + * @param String _failure + * @param Array _scopes + * @throws Exception + * @return array + */ + + func createOAuth2Session(_provider: String, _success: String = "https://appwrite.io/auth/oauth2/success", _failure: String = "https://appwrite.io/auth/oauth2/failure", _scopes: Array = []) -> Array { + var path: String = "/account/sessions/oauth2/{provider}" + + path = path.replacingOccurrences( + of: "{provider}", + with: _provider + ) + + var params: [String: Any] = [:] + + params["success"] = _success + params["failure"] = _failure + params["scopes"] = _scopes + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Delete Account Session + * + * Use this endpoint to log out the currently logged in user from all his + * account sessions across all his different devices. When using the option id + * argument, only the session unique ID provider will be deleted. + * + * @param String _sessionId + * @throws Exception + * @return array + */ + + func deleteSession(_sessionId: String) -> Array { + var path: String = "/account/sessions/{sessionId}" + + path = path.replacingOccurrences( + of: "{sessionId}", + with: _sessionId + ) + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Create Email Verification + * + * Use this endpoint to send a verification message to your user email address + * to confirm they are the valid owners of that address. Both the **userId** + * and **secret** arguments will be passed as query parameters to the URL you + * have provided to be attached to the verification email. The provided URL + * should redirect the user back to your app and allow you to complete the + * verification process by verifying both the **userId** and **secret** + * parameters. Learn more about how to [complete the verification + * process](/docs/client/account#updateAccountVerification). + * + * Please note that in order to avoid a [Redirect + * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), + * the only valid redirect URLs are the ones from domains you have set when + * adding your platforms in the console interface. + * + * + * @param String _url + * @throws Exception + * @return array + */ + + func createVerification(_url: String) -> Array { + let path: String = "/account/verification" + + + var params: [String: Any] = [:] + + params["url"] = _url + + return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Complete Email Verification + * + * Use this endpoint to complete the user email verification process. Use both + * the **userId** and **secret** parameters that were attached to your app URL + * to verify the user email ownership. If confirmed this route will return a + * 200 status code. + * + * @param String _userId + * @param String _secret + * @throws Exception + * @return array + */ + + func updateVerification(_userId: String, _secret: String) -> Array { + let path: String = "/account/verification" + + + var params: [String: Any] = [:] + + params["userId"] = _userId + params["secret"] = _secret + + return [self.client.call(method: Client.HTTPMethod.put.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + +} diff --git a/app/sdks/client-swift/Sources/Appwrite/Services/Avatars.swift b/app/sdks/client-swift/Sources/Appwrite/Services/Avatars.swift new file mode 100644 index 0000000000..867841bafd --- /dev/null +++ b/app/sdks/client-swift/Sources/Appwrite/Services/Avatars.swift @@ -0,0 +1,233 @@ + + +class Avatars: Service +{ + /** + * Get Browser Icon + * + * You can use this endpoint to show different browser icons to your users. + * The code argument receives the browser code as it appears in your user + * /account/sessions endpoint. Use width, height and quality arguments to + * change the output settings. + * + * @param String _code + * @param Int _width + * @param Int _height + * @param Int _quality + * @throws Exception + * @return array + */ + + func getBrowser(_code: String, _width: Int = 100, _height: Int = 100, _quality: Int = 100) -> Array { + var path: String = "/avatars/browsers/{code}" + + path = path.replacingOccurrences( + of: "{code}", + with: _code + ) + + var params: [String: Any] = [:] + + params["width"] = _width + params["height"] = _height + params["quality"] = _quality + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Get Credit Card Icon + * + * Need to display your users with your billing method or their payment + * methods? The credit card endpoint will return you the icon of the credit + * card provider you need. Use width, height and quality arguments to change + * the output settings. + * + * @param String _code + * @param Int _width + * @param Int _height + * @param Int _quality + * @throws Exception + * @return array + */ + + func getCreditCard(_code: String, _width: Int = 100, _height: Int = 100, _quality: Int = 100) -> Array { + var path: String = "/avatars/credit-cards/{code}" + + path = path.replacingOccurrences( + of: "{code}", + with: _code + ) + + var params: [String: Any] = [:] + + params["width"] = _width + params["height"] = _height + params["quality"] = _quality + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Get Favicon + * + * Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote + * website URL. + * + * @param String _url + * @throws Exception + * @return array + */ + + func getFavicon(_url: String) -> Array { + let path: String = "/avatars/favicon" + + + var params: [String: Any] = [:] + + params["url"] = _url + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Get Country Flag + * + * You can use this endpoint to show different country flags icons to your + * users. The code argument receives the 2 letter country code. Use width, + * height and quality arguments to change the output settings. + * + * @param String _code + * @param Int _width + * @param Int _height + * @param Int _quality + * @throws Exception + * @return array + */ + + func getFlag(_code: String, _width: Int = 100, _height: Int = 100, _quality: Int = 100) -> Array { + var path: String = "/avatars/flags/{code}" + + path = path.replacingOccurrences( + of: "{code}", + with: _code + ) + + var params: [String: Any] = [:] + + params["width"] = _width + params["height"] = _height + params["quality"] = _quality + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Get Image from URL + * + * Use this endpoint to fetch a remote image URL and crop it to any image size + * you want. This endpoint is very useful if you need to crop and display + * remote images in your app or in case you want to make sure a 3rd party + * image is properly served using a TLS protocol. + * + * @param String _url + * @param Int _width + * @param Int _height + * @throws Exception + * @return array + */ + + func getImage(_url: String, _width: Int = 400, _height: Int = 400) -> Array { + let path: String = "/avatars/image" + + + var params: [String: Any] = [:] + + params["url"] = _url + params["width"] = _width + params["height"] = _height + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Get User Initials + * + * Use this endpoint to show your user initials avatar icon on your website or + * app. By default, this route will try to print your logged-in user name or + * email initials. You can also overwrite the user name if you pass the 'name' + * parameter. If no name is given and no user is logged, an empty avatar will + * be returned. + * + * You can use the color and background params to change the avatar colors. By + * default, a random theme will be selected. The random theme will persist for + * the user's initials when reloading the same theme will always return for + * the same initials. + * + * @param String _name + * @param Int _width + * @param Int _height + * @param String _color + * @param String _background + * @throws Exception + * @return array + */ + + func getInitials(_name: String = "", _width: Int = 500, _height: Int = 500, _color: String = "", _background: String = "") -> Array { + let path: String = "/avatars/initials" + + + var params: [String: Any] = [:] + + params["name"] = _name + params["width"] = _width + params["height"] = _height + params["color"] = _color + params["background"] = _background + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Get QR Code + * + * Converts a given plain text to a QR code image. You can use the query + * parameters to change the size and style of the resulting image. + * + * @param String _text + * @param Int _size + * @param Int _margin + * @param Bool _download + * @throws Exception + * @return array + */ + + func getQR(_text: String, _size: Int = 400, _margin: Int = 1, _download: Bool = false) -> Array { + let path: String = "/avatars/qr" + + + var params: [String: Any] = [:] + + params["text"] = _text + params["size"] = _size + params["margin"] = _margin + params["download"] = _download + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + +} diff --git a/app/sdks/client-swift/Sources/Appwrite/Services/Database.swift b/app/sdks/client-swift/Sources/Appwrite/Services/Database.swift new file mode 100644 index 0000000000..8436985582 --- /dev/null +++ b/app/sdks/client-swift/Sources/Appwrite/Services/Database.swift @@ -0,0 +1,183 @@ + + +class Database: Service +{ + /** + * List Documents + * + * Get a list of all the user documents. You can use the query params to + * filter your results. On admin mode, this endpoint will return a list of all + * of the project documents. [Learn more about different API + * modes](/docs/admin). + * + * @param String _collectionId + * @param Array _filters + * @param Int _limit + * @param Int _offset + * @param String _orderField + * @param String _orderType + * @param String _orderCast + * @param String _search + * @throws Exception + * @return array + */ + + func listDocuments(_collectionId: String, _filters: Array = [], _limit: Int = 25, _offset: Int = 0, _orderField: String = "$id", _orderType: String = "ASC", _orderCast: String = "string", _search: String = "") -> Array { + var path: String = "/database/collections/{collectionId}/documents" + + path = path.replacingOccurrences( + of: "{collectionId}", + with: _collectionId + ) + + var params: [String: Any] = [:] + + params["filters"] = _filters + params["limit"] = _limit + params["offset"] = _offset + params["orderField"] = _orderField + params["orderType"] = _orderType + params["orderCast"] = _orderCast + params["search"] = _search + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Create Document + * + * Create a new Document. Before using this route, you should create a new + * collection resource using either a [server + * integration](/docs/server/database?sdk=nodejs#createCollection) API or + * directly from your database console. + * + * @param String _collectionId + * @param object _data + * @param Array _read + * @param Array _write + * @throws Exception + * @return array + */ + + func createDocument(_collectionId: String, _data: object, _read: Array, _write: Array) -> Array { + var path: String = "/database/collections/{collectionId}/documents" + + path = path.replacingOccurrences( + of: "{collectionId}", + with: _collectionId + ) + + var params: [String: Any] = [:] + + params["data"] = _data + params["read"] = _read + params["write"] = _write + + return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Get Document + * + * Get document by its unique ID. This endpoint response returns a JSON object + * with the document data. + * + * @param String _collectionId + * @param String _documentId + * @throws Exception + * @return array + */ + + func getDocument(_collectionId: String, _documentId: String) -> Array { + var path: String = "/database/collections/{collectionId}/documents/{documentId}" + + path = path.replacingOccurrences( + of: "{collectionId}", + with: _collectionId + ) + path = path.replacingOccurrences( + of: "{documentId}", + with: _documentId + ) + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Update Document + * + * @param String _collectionId + * @param String _documentId + * @param object _data + * @param Array _read + * @param Array _write + * @throws Exception + * @return array + */ + + func updateDocument(_collectionId: String, _documentId: String, _data: object, _read: Array, _write: Array) -> Array { + var path: String = "/database/collections/{collectionId}/documents/{documentId}" + + path = path.replacingOccurrences( + of: "{collectionId}", + with: _collectionId + ) + path = path.replacingOccurrences( + of: "{documentId}", + with: _documentId + ) + + var params: [String: Any] = [:] + + params["data"] = _data + params["read"] = _read + params["write"] = _write + + return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Delete Document + * + * Delete document by its unique ID. This endpoint deletes only the parent + * documents, his attributes and relations to other documents. Child documents + * **will not** be deleted. + * + * @param String _collectionId + * @param String _documentId + * @throws Exception + * @return array + */ + + func deleteDocument(_collectionId: String, _documentId: String) -> Array { + var path: String = "/database/collections/{collectionId}/documents/{documentId}" + + path = path.replacingOccurrences( + of: "{collectionId}", + with: _collectionId + ) + path = path.replacingOccurrences( + of: "{documentId}", + with: _documentId + ) + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + +} diff --git a/app/sdks/client-swift/Sources/Appwrite/Services/Locale.swift b/app/sdks/client-swift/Sources/Appwrite/Services/Locale.swift new file mode 100644 index 0000000000..ef21554cbc --- /dev/null +++ b/app/sdks/client-swift/Sources/Appwrite/Services/Locale.swift @@ -0,0 +1,164 @@ + + +class Locale: Service +{ + /** + * Get User Locale + * + * Get the current user location based on IP. Returns an object with user + * country code, country name, continent name, continent code, ip address and + * suggested currency. You can use the locale header to get the data in a + * supported language. + * + * ([IP Geolocation by DB-IP](https://db-ip.com)) + * + * @throws Exception + * @return array + */ + + func get() -> Array { + let path: String = "/locale" + + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * List Continents + * + * List of all continents. You can use the locale header to get the data in a + * supported language. + * + * @throws Exception + * @return array + */ + + func getContinents() -> Array { + let path: String = "/locale/continents" + + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * List Countries + * + * List of all countries. You can use the locale header to get the data in a + * supported language. + * + * @throws Exception + * @return array + */ + + func getCountries() -> Array { + let path: String = "/locale/countries" + + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * List EU Countries + * + * List of all countries that are currently members of the EU. You can use the + * locale header to get the data in a supported language. + * + * @throws Exception + * @return array + */ + + func getCountriesEU() -> Array { + let path: String = "/locale/countries/eu" + + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * List Countries Phone Codes + * + * List of all countries phone codes. You can use the locale header to get the + * data in a supported language. + * + * @throws Exception + * @return array + */ + + func getCountriesPhones() -> Array { + let path: String = "/locale/countries/phones" + + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * List Currencies + * + * List of all currencies, including currency symbol, name, plural, and + * decimal digits for all major and minor currencies. You can use the locale + * header to get the data in a supported language. + * + * @throws Exception + * @return array + */ + + func getCurrencies() -> Array { + let path: String = "/locale/currencies" + + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * List Languages + * + * List of all languages classified by ISO 639-1 including 2-letter code, name + * in English, and name in the respective language. + * + * @throws Exception + * @return array + */ + + func getLanguages() -> Array { + let path: String = "/locale/languages" + + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + +} diff --git a/app/sdks/client-swift/Sources/Appwrite/Services/Storage.swift b/app/sdks/client-swift/Sources/Appwrite/Services/Storage.swift new file mode 100644 index 0000000000..b6e98145f7 --- /dev/null +++ b/app/sdks/client-swift/Sources/Appwrite/Services/Storage.swift @@ -0,0 +1,246 @@ + + +class Storage: Service +{ + /** + * List Files + * + * Get a list of all the user files. You can use the query params to filter + * your results. On admin mode, this endpoint will return a list of all of the + * project files. [Learn more about different API modes](/docs/admin). + * + * @param String _search + * @param Int _limit + * @param Int _offset + * @param String _orderType + * @throws Exception + * @return array + */ + + func listFiles(_search: String = "", _limit: Int = 25, _offset: Int = 0, _orderType: String = "ASC") -> Array { + let path: String = "/storage/files" + + + var params: [String: Any] = [:] + + params["search"] = _search + params["limit"] = _limit + params["offset"] = _offset + params["orderType"] = _orderType + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Create File + * + * Create a new file. The user who creates the file will automatically be + * assigned to read and write access unless he has passed custom values for + * read and write arguments. + * + * @param Array _file + * @param Array _read + * @param Array _write + * @throws Exception + * @return array + */ + + func createFile(_file: Array, _read: Array, _write: Array) -> Array { + let path: String = "/storage/files" + + + var params: [String: Any] = [:] + + params["file"] = _file + params["read"] = _read + params["write"] = _write + + return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [ + "content-type": "multipart/form-data", + ], params: params)]; + } + + /** + * Get File + * + * Get file by its unique ID. This endpoint response returns a JSON object + * with the file metadata. + * + * @param String _fileId + * @throws Exception + * @return array + */ + + func getFile(_fileId: String) -> Array { + var path: String = "/storage/files/{fileId}" + + path = path.replacingOccurrences( + of: "{fileId}", + with: _fileId + ) + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Update File + * + * Update file by its unique ID. Only users with write permissions have access + * to update this resource. + * + * @param String _fileId + * @param Array _read + * @param Array _write + * @throws Exception + * @return array + */ + + func updateFile(_fileId: String, _read: Array, _write: Array) -> Array { + var path: String = "/storage/files/{fileId}" + + path = path.replacingOccurrences( + of: "{fileId}", + with: _fileId + ) + + var params: [String: Any] = [:] + + params["read"] = _read + params["write"] = _write + + return [self.client.call(method: Client.HTTPMethod.put.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Delete File + * + * Delete a file by its unique ID. Only users with write permissions have + * access to delete this resource. + * + * @param String _fileId + * @throws Exception + * @return array + */ + + func deleteFile(_fileId: String) -> Array { + var path: String = "/storage/files/{fileId}" + + path = path.replacingOccurrences( + of: "{fileId}", + with: _fileId + ) + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Get File for Download + * + * Get file content by its unique ID. The endpoint response return with a + * 'Content-Disposition: attachment' header that tells the browser to start + * downloading the file to user downloads directory. + * + * @param String _fileId + * @throws Exception + * @return array + */ + + func getFileDownload(_fileId: String) -> Array { + var path: String = "/storage/files/{fileId}/download" + + path = path.replacingOccurrences( + of: "{fileId}", + with: _fileId + ) + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Get File Preview + * + * Get a file preview image. Currently, this method supports preview for image + * files (jpg, png, and gif), other supported formats, like pdf, docs, slides, + * and spreadsheets, will return the file icon image. You can also pass query + * string arguments for cutting and resizing your preview image. + * + * @param String _fileId + * @param Int _width + * @param Int _height + * @param Int _quality + * @param String _background + * @param String _output + * @throws Exception + * @return array + */ + + func getFilePreview(_fileId: String, _width: Int = 0, _height: Int = 0, _quality: Int = 100, _background: String = "", _output: String = "") -> Array { + var path: String = "/storage/files/{fileId}/preview" + + path = path.replacingOccurrences( + of: "{fileId}", + with: _fileId + ) + + var params: [String: Any] = [:] + + params["width"] = _width + params["height"] = _height + params["quality"] = _quality + params["background"] = _background + params["output"] = _output + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Get File for View + * + * Get file content by its unique ID. This endpoint is similar to the download + * method but returns with no 'Content-Disposition: attachment' header. + * + * @param String _fileId + * @param String _as + * @throws Exception + * @return array + */ + + func getFileView(_fileId: String, _as: String = "") -> Array { + var path: String = "/storage/files/{fileId}/view" + + path = path.replacingOccurrences( + of: "{fileId}", + with: _fileId + ) + + var params: [String: Any] = [:] + + params["as"] = _as + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + +} diff --git a/app/sdks/client-swift/Sources/Appwrite/Services/Teams.swift b/app/sdks/client-swift/Sources/Appwrite/Services/Teams.swift new file mode 100644 index 0000000000..50bee60273 --- /dev/null +++ b/app/sdks/client-swift/Sources/Appwrite/Services/Teams.swift @@ -0,0 +1,298 @@ + + +class Teams: Service +{ + /** + * List Teams + * + * Get a list of all the current user teams. You can use the query params to + * filter your results. On admin mode, this endpoint will return a list of all + * of the project teams. [Learn more about different API modes](/docs/admin). + * + * @param String _search + * @param Int _limit + * @param Int _offset + * @param String _orderType + * @throws Exception + * @return array + */ + + func list(_search: String = "", _limit: Int = 25, _offset: Int = 0, _orderType: String = "ASC") -> Array { + let path: String = "/teams" + + + var params: [String: Any] = [:] + + params["search"] = _search + params["limit"] = _limit + params["offset"] = _offset + params["orderType"] = _orderType + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Create Team + * + * Create a new team. The user who creates the team will automatically be + * assigned as the owner of the team. The team owner can invite new members, + * who will be able add new owners and update or delete the team from your + * project. + * + * @param String _name + * @param Array _roles + * @throws Exception + * @return array + */ + + func create(_name: String, _roles: Array = ["owner"]) -> Array { + let path: String = "/teams" + + + var params: [String: Any] = [:] + + params["name"] = _name + params["roles"] = _roles + + return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Get Team + * + * Get team by its unique ID. All team members have read access for this + * resource. + * + * @param String _teamId + * @throws Exception + * @return array + */ + + func get(_teamId: String) -> Array { + var path: String = "/teams/{teamId}" + + path = path.replacingOccurrences( + of: "{teamId}", + with: _teamId + ) + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Update Team + * + * Update team by its unique ID. Only team owners have write access for this + * resource. + * + * @param String _teamId + * @param String _name + * @throws Exception + * @return array + */ + + func update(_teamId: String, _name: String) -> Array { + var path: String = "/teams/{teamId}" + + path = path.replacingOccurrences( + of: "{teamId}", + with: _teamId + ) + + var params: [String: Any] = [:] + + params["name"] = _name + + return [self.client.call(method: Client.HTTPMethod.put.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Delete Team + * + * Delete team by its unique ID. Only team owners have write access for this + * resource. + * + * @param String _teamId + * @throws Exception + * @return array + */ + + func delete(_teamId: String) -> Array { + var path: String = "/teams/{teamId}" + + path = path.replacingOccurrences( + of: "{teamId}", + with: _teamId + ) + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Get Team Memberships + * + * Get team members by the team unique ID. All team members have read access + * for this list of resources. + * + * @param String _teamId + * @param String _search + * @param Int _limit + * @param Int _offset + * @param String _orderType + * @throws Exception + * @return array + */ + + func getMemberships(_teamId: String, _search: String = "", _limit: Int = 25, _offset: Int = 0, _orderType: String = "ASC") -> Array { + var path: String = "/teams/{teamId}/memberships" + + path = path.replacingOccurrences( + of: "{teamId}", + with: _teamId + ) + + var params: [String: Any] = [:] + + params["search"] = _search + params["limit"] = _limit + params["offset"] = _offset + params["orderType"] = _orderType + + return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Create Team Membership + * + * Use this endpoint to invite a new member to join your team. An email with a + * link to join the team will be sent to the new member email address if the + * member doesn't exist in the project it will be created automatically. + * + * Use the 'URL' parameter to redirect the user from the invitation email back + * to your app. When the user is redirected, use the [Update Team Membership + * Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the + * user to accept the invitation to the team. + * + * Please note that in order to avoid a [Redirect + * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) + * the only valid redirect URL's are the once from domains you have set when + * added your platforms in the console interface. + * + * @param String _teamId + * @param String _email + * @param Array _roles + * @param String _url + * @param String _name + * @throws Exception + * @return array + */ + + func createMembership(_teamId: String, _email: String, _roles: Array, _url: String, _name: String = "") -> Array { + var path: String = "/teams/{teamId}/memberships" + + path = path.replacingOccurrences( + of: "{teamId}", + with: _teamId + ) + + var params: [String: Any] = [:] + + params["email"] = _email + params["name"] = _name + params["roles"] = _roles + params["url"] = _url + + return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Delete Team Membership + * + * This endpoint allows a user to leave a team or for a team owner to delete + * the membership of any other team member. You can also use this endpoint to + * delete a user membership even if he didn't accept it. + * + * @param String _teamId + * @param String _inviteId + * @throws Exception + * @return array + */ + + func deleteMembership(_teamId: String, _inviteId: String) -> Array { + var path: String = "/teams/{teamId}/memberships/{inviteId}" + + path = path.replacingOccurrences( + of: "{teamId}", + with: _teamId + ) + path = path.replacingOccurrences( + of: "{inviteId}", + with: _inviteId + ) + + let params: [String: Any] = [:] + + + return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + + /** + * Update Team Membership Status + * + * Use this endpoint to allow a user to accept an invitation to join a team + * after he is being redirected back to your app from the invitation email he + * was sent. + * + * @param String _teamId + * @param String _inviteId + * @param String _userId + * @param String _secret + * @throws Exception + * @return array + */ + + func updateMembershipStatus(_teamId: String, _inviteId: String, _userId: String, _secret: String) -> Array { + var path: String = "/teams/{teamId}/memberships/{inviteId}/status" + + path = path.replacingOccurrences( + of: "{teamId}", + with: _teamId + ) + path = path.replacingOccurrences( + of: "{inviteId}", + with: _inviteId + ) + + var params: [String: Any] = [:] + + params["userId"] = _userId + params["secret"] = _secret + + return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [ + "content-type": "application/json", + ], params: params)]; + } + +} diff --git a/app/sdks/client-swift/docs/account.md b/app/sdks/client-swift/docs/account.md new file mode 100644 index 0000000000..48bc91d213 --- /dev/null +++ b/app/sdks/client-swift/docs/account.md @@ -0,0 +1,240 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + +# Account Service + +## Get Account + +```http request +GET https://appwrite.io/v1/account +``` + +** Get currently logged in user data as JSON object. ** + +## Create Account + +```http request +POST https://appwrite.io/v1/account +``` + +** Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](/docs/client/account#createVerification) route to start verifying the user email address. To allow your new user to login to his new account, you need to create a new [account session](/docs/client/account#createSession). ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| email | string | User email. | | +| password | string | User password. Must be between 6 to 32 chars. | | +| name | string | User name. | | + +## Delete Account + +```http request +DELETE https://appwrite.io/v1/account +``` + +** Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately. ** + +## Update Account Email + +```http request +PATCH https://appwrite.io/v1/account/email +``` + +** Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| email | string | User email. | | +| password | string | User password. Must be between 6 to 32 chars. | | + +## Get Account Logs + +```http request +GET https://appwrite.io/v1/account/logs +``` + +** Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log. ** + +## Update Account Name + +```http request +PATCH https://appwrite.io/v1/account/name +``` + +** Update currently logged in user account name. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| name | string | User name. | | + +## Update Account Password + +```http request +PATCH https://appwrite.io/v1/account/password +``` + +** Update currently logged in user password. For validation, user is required to pass the password twice. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| password | string | New user password. Must be between 6 to 32 chars. | | +| oldPassword | string | Old user password. Must be between 6 to 32 chars. | | + +## Get Account Preferences + +```http request +GET https://appwrite.io/v1/account/prefs +``` + +** Get currently logged in user preferences as a key-value object. ** + +## Update Account Preferences + +```http request +PATCH https://appwrite.io/v1/account/prefs +``` + +** Update currently logged in user account preferences. You can pass only the specific settings you wish to update. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| prefs | object | Prefs key-value JSON object. | | + +## Create Password Recovery + +```http request +POST https://appwrite.io/v1/account/recovery +``` + +** Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](/docs/client/account#updateRecovery) endpoint to complete the process. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| email | string | User email. | | +| url | string | URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | | + +## Complete Password Recovery + +```http request +PUT https://appwrite.io/v1/account/recovery +``` + +** Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](/docs/client/account#createRecovery) endpoint. + +Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| userId | string | User account UID address. | | +| secret | string | Valid reset token. | | +| password | string | New password. Must be between 6 to 32 chars. | | +| passwordAgain | string | New password again. Must be between 6 to 32 chars. | | + +## Get Account Sessions + +```http request +GET https://appwrite.io/v1/account/sessions +``` + +** Get currently logged in user list of active sessions across different devices. ** + +## Create Account Session + +```http request +POST https://appwrite.io/v1/account/sessions +``` + +** Allow the user to login into his account by providing a valid email and password combination. This route will create a new session for the user. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| email | string | User email. | | +| password | string | User password. Must be between 6 to 32 chars. | | + +## Delete All Account Sessions + +```http request +DELETE https://appwrite.io/v1/account/sessions +``` + +** Delete all sessions from the user account and remove any sessions cookies from the end client. ** + +## Create Account Session with OAuth2 + +```http request +GET https://appwrite.io/v1/account/sessions/oauth2/{provider} +``` + +** Allow the user to login to his account using the OAuth2 provider of his choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| provider | string | **Required** OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, twitch, vk, yahoo, yandex. | | +| success | string | URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | https://appwrite.io/auth/oauth2/success | +| failure | string | URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | https://appwrite.io/auth/oauth2/failure | +| scopes | array | A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. | [] | + +## Delete Account Session + +```http request +DELETE https://appwrite.io/v1/account/sessions/{sessionId} +``` + +** Use this endpoint to log out the currently logged in user from all his account sessions across all his different devices. When using the option id argument, only the session unique ID provider will be deleted. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| sessionId | string | **Required** Session unique ID. Use the string 'current' to delete the current device session. | | + +## Create Email Verification + +```http request +POST https://appwrite.io/v1/account/verification +``` + +** Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](/docs/client/account#updateAccountVerification). + +Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. + ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| url | string | URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | | + +## Complete Email Verification + +```http request +PUT https://appwrite.io/v1/account/verification +``` + +** Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| userId | string | User unique ID. | | +| secret | string | Valid verification token. | | + diff --git a/app/sdks/client-swift/docs/avatars.md b/app/sdks/client-swift/docs/avatars.md new file mode 100644 index 0000000000..1e17a8e14a --- /dev/null +++ b/app/sdks/client-swift/docs/avatars.md @@ -0,0 +1,124 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + +# Avatars Service + +## Get Browser Icon + +```http request +GET https://appwrite.io/v1/avatars/browsers/{code} +``` + +** You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user /account/sessions endpoint. Use width, height and quality arguments to change the output settings. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| code | string | **Required** Browser Code. | | +| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 | +| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 | +| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 | + +## Get Credit Card Icon + +```http request +GET https://appwrite.io/v1/avatars/credit-cards/{code} +``` + +** Need to display your users with your billing method or their payment methods? The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| code | string | **Required** Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa. | | +| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 | +| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 | +| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 | + +## Get Favicon + +```http request +GET https://appwrite.io/v1/avatars/favicon +``` + +** Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| url | string | **Required** Website URL which you want to fetch the favicon from. | | + +## Get Country Flag + +```http request +GET https://appwrite.io/v1/avatars/flags/{code} +``` + +** You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| code | string | **Required** Country Code. ISO Alpha-2 country code format. | | +| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 | +| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 | +| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 | + +## Get Image from URL + +```http request +GET https://appwrite.io/v1/avatars/image +``` + +** Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| url | string | **Required** Image URL which you want to crop. | | +| width | integer | Resize preview image width, Pass an integer between 0 to 2000. | 400 | +| height | integer | Resize preview image height, Pass an integer between 0 to 2000. | 400 | + +## Get User Initials + +```http request +GET https://appwrite.io/v1/avatars/initials +``` + +** Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned. + +You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| name | string | Full Name. When empty, current user name or email will be used. | | +| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 500 | +| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 500 | +| color | string | Changes text color. By default a random color will be picked and stay will persistent to the given name. | | +| background | string | Changes background color. By default a random color will be picked and stay will persistent to the given name. | | + +## Get QR Code + +```http request +GET https://appwrite.io/v1/avatars/qr +``` + +** Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| text | string | **Required** Plain text to be converted to QR code image. | | +| size | integer | QR code size. Pass an integer between 0 to 1000. Defaults to 400. | 400 | +| margin | integer | Margin from edge. Pass an integer between 0 to 10. Defaults to 1. | 1 | +| download | boolean | Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0. | | + diff --git a/app/sdks/client-swift/docs/database.md b/app/sdks/client-swift/docs/database.md new file mode 100644 index 0000000000..d734cb3c1c --- /dev/null +++ b/app/sdks/client-swift/docs/database.md @@ -0,0 +1,90 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + +# Database Service + +## List Documents + +```http request +GET https://appwrite.io/v1/database/collections/{collectionId}/documents +``` + +** Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](/docs/admin). ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). | | +| filters | array | Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'. | [] | +| limit | integer | Maximum number of documents to return in response. Use this value to manage pagination. | 25 | +| offset | integer | Offset value. Use this value to manage pagination. | 0 | +| orderField | string | Document field that results will be sorted by. | $id | +| orderType | string | Order direction. Possible values are DESC for descending order, or ASC for ascending order. | ASC | +| orderCast | string | Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string. | string | +| search | string | Search query. Enter any free text search. The database will try to find a match against all document attributes and children. | | + +## Create Document + +```http request +POST https://appwrite.io/v1/database/collections/{collectionId}/documents +``` + +** Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](/docs/server/database?sdk=nodejs#createCollection) API or directly from your database console. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). | | +| data | object | Document data as JSON object. | | +| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | +| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | + +## Get Document + +```http request +GET https://appwrite.io/v1/database/collections/{collectionId}/documents/{documentId} +``` + +** Get document by its unique ID. This endpoint response returns a JSON object with the document data. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). | | +| documentId | string | **Required** Document unique ID. | | + +## Update Document + +```http request +PATCH https://appwrite.io/v1/database/collections/{collectionId}/documents/{documentId} +``` + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). | | +| documentId | string | **Required** Document unique ID. | | +| data | object | Document data as JSON object. | | +| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | +| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | + +## Delete Document + +```http request +DELETE https://appwrite.io/v1/database/collections/{collectionId}/documents/{documentId} +``` + +** Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). | | +| documentId | string | **Required** Document unique ID. | | + diff --git a/app/sdks/client-swift/docs/examples/account/create-o-auth2session.md b/app/sdks/client-swift/docs/examples/account/create-o-auth2session.md new file mode 100644 index 0000000000..0b67257890 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/account/create-o-auth2session.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var account: Account = Account(client: client); + +var result = account.createOAuth2Session(_provider: "amazon"); diff --git a/app/sdks/client-swift/docs/examples/account/create-recovery.md b/app/sdks/client-swift/docs/examples/account/create-recovery.md new file mode 100644 index 0000000000..04fdcae541 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/account/create-recovery.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var account: Account = Account(client: client); + +var result = account.createRecovery(_email: "email@example.com", _url: "https://example.com"); diff --git a/app/sdks/client-swift/docs/examples/account/create-session.md b/app/sdks/client-swift/docs/examples/account/create-session.md new file mode 100644 index 0000000000..477b20199c --- /dev/null +++ b/app/sdks/client-swift/docs/examples/account/create-session.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var account: Account = Account(client: client); + +var result = account.createSession(_email: "email@example.com", _password: "password"); diff --git a/app/sdks/client-swift/docs/examples/account/create-verification.md b/app/sdks/client-swift/docs/examples/account/create-verification.md new file mode 100644 index 0000000000..b0f8d6444e --- /dev/null +++ b/app/sdks/client-swift/docs/examples/account/create-verification.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var account: Account = Account(client: client); + +var result = account.createVerification(_url: "https://example.com"); diff --git a/app/sdks/client-swift/docs/examples/account/create.md b/app/sdks/client-swift/docs/examples/account/create.md new file mode 100644 index 0000000000..176b192c5e --- /dev/null +++ b/app/sdks/client-swift/docs/examples/account/create.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var account: Account = Account(client: client); + +var result = account.create(_email: "email@example.com", _password: "password"); diff --git a/app/sdks/client-swift/docs/examples/account/delete-session.md b/app/sdks/client-swift/docs/examples/account/delete-session.md new file mode 100644 index 0000000000..6f2373dc79 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/account/delete-session.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var account: Account = Account(client: client); + +var result = account.deleteSession(_sessionId: "[SESSION_ID]"); diff --git a/app/sdks/client-swift/docs/examples/account/delete-sessions.md b/app/sdks/client-swift/docs/examples/account/delete-sessions.md new file mode 100644 index 0000000000..6df71814c6 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/account/delete-sessions.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var account: Account = Account(client: client); + +var result = account.deleteSessions(); diff --git a/app/sdks/client-swift/docs/examples/account/delete.md b/app/sdks/client-swift/docs/examples/account/delete.md new file mode 100644 index 0000000000..f4123b0197 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/account/delete.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var account: Account = Account(client: client); + +var result = account.delete(); diff --git a/app/sdks/client-swift/docs/examples/account/get-logs.md b/app/sdks/client-swift/docs/examples/account/get-logs.md new file mode 100644 index 0000000000..8d3d965723 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/account/get-logs.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var account: Account = Account(client: client); + +var result = account.getLogs(); diff --git a/app/sdks/client-swift/docs/examples/account/get-prefs.md b/app/sdks/client-swift/docs/examples/account/get-prefs.md new file mode 100644 index 0000000000..e9746ab34b --- /dev/null +++ b/app/sdks/client-swift/docs/examples/account/get-prefs.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var account: Account = Account(client: client); + +var result = account.getPrefs(); diff --git a/app/sdks/client-swift/docs/examples/account/get-sessions.md b/app/sdks/client-swift/docs/examples/account/get-sessions.md new file mode 100644 index 0000000000..988e91c8e5 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/account/get-sessions.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var account: Account = Account(client: client); + +var result = account.getSessions(); diff --git a/app/sdks/client-swift/docs/examples/account/get.md b/app/sdks/client-swift/docs/examples/account/get.md new file mode 100644 index 0000000000..b84096bdb8 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/account/get.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var account: Account = Account(client: client); + +var result = account.get(); diff --git a/app/sdks/client-swift/docs/examples/account/update-email.md b/app/sdks/client-swift/docs/examples/account/update-email.md new file mode 100644 index 0000000000..cec700b330 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/account/update-email.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var account: Account = Account(client: client); + +var result = account.updateEmail(_email: "email@example.com", _password: "password"); diff --git a/app/sdks/client-swift/docs/examples/account/update-name.md b/app/sdks/client-swift/docs/examples/account/update-name.md new file mode 100644 index 0000000000..dbc6f7d2b8 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/account/update-name.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var account: Account = Account(client: client); + +var result = account.updateName(_name: "[NAME]"); diff --git a/app/sdks/client-swift/docs/examples/account/update-password.md b/app/sdks/client-swift/docs/examples/account/update-password.md new file mode 100644 index 0000000000..1346102a32 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/account/update-password.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var account: Account = Account(client: client); + +var result = account.updatePassword(_password: "password", _oldPassword: "password"); diff --git a/app/sdks/client-swift/docs/examples/account/update-prefs.md b/app/sdks/client-swift/docs/examples/account/update-prefs.md new file mode 100644 index 0000000000..fea1a8d6ff --- /dev/null +++ b/app/sdks/client-swift/docs/examples/account/update-prefs.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var account: Account = Account(client: client); + +var result = account.updatePrefs(_prefs: ); diff --git a/app/sdks/client-swift/docs/examples/account/update-recovery.md b/app/sdks/client-swift/docs/examples/account/update-recovery.md new file mode 100644 index 0000000000..6009d62e2c --- /dev/null +++ b/app/sdks/client-swift/docs/examples/account/update-recovery.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var account: Account = Account(client: client); + +var result = account.updateRecovery(_userId: "[USER_ID]", _secret: "[SECRET]", _password: "password", _passwordAgain: "password"); diff --git a/app/sdks/client-swift/docs/examples/account/update-verification.md b/app/sdks/client-swift/docs/examples/account/update-verification.md new file mode 100644 index 0000000000..376a87a9c3 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/account/update-verification.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var account: Account = Account(client: client); + +var result = account.updateVerification(_userId: "[USER_ID]", _secret: "[SECRET]"); diff --git a/app/sdks/client-swift/docs/examples/avatars/get-browser.md b/app/sdks/client-swift/docs/examples/avatars/get-browser.md new file mode 100644 index 0000000000..874ef96d31 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/avatars/get-browser.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var avatars: Avatars = Avatars(client: client); + +var result = avatars.getBrowser(_code: "aa"); diff --git a/app/sdks/client-swift/docs/examples/avatars/get-credit-card.md b/app/sdks/client-swift/docs/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..797431f3dc --- /dev/null +++ b/app/sdks/client-swift/docs/examples/avatars/get-credit-card.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var avatars: Avatars = Avatars(client: client); + +var result = avatars.getCreditCard(_code: "amex"); diff --git a/app/sdks/client-swift/docs/examples/avatars/get-favicon.md b/app/sdks/client-swift/docs/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..5623468481 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/avatars/get-favicon.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var avatars: Avatars = Avatars(client: client); + +var result = avatars.getFavicon(_url: "https://example.com"); diff --git a/app/sdks/client-swift/docs/examples/avatars/get-flag.md b/app/sdks/client-swift/docs/examples/avatars/get-flag.md new file mode 100644 index 0000000000..fba93ae4d4 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/avatars/get-flag.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var avatars: Avatars = Avatars(client: client); + +var result = avatars.getFlag(_code: "af"); diff --git a/app/sdks/client-swift/docs/examples/avatars/get-image.md b/app/sdks/client-swift/docs/examples/avatars/get-image.md new file mode 100644 index 0000000000..4ebe561b3b --- /dev/null +++ b/app/sdks/client-swift/docs/examples/avatars/get-image.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var avatars: Avatars = Avatars(client: client); + +var result = avatars.getImage(_url: "https://example.com"); diff --git a/app/sdks/client-swift/docs/examples/avatars/get-initials.md b/app/sdks/client-swift/docs/examples/avatars/get-initials.md new file mode 100644 index 0000000000..d317cfc5a8 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/avatars/get-initials.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var avatars: Avatars = Avatars(client: client); + +var result = avatars.getInitials(); diff --git a/app/sdks/client-swift/docs/examples/avatars/get-q-r.md b/app/sdks/client-swift/docs/examples/avatars/get-q-r.md new file mode 100644 index 0000000000..737acfc258 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/avatars/get-q-r.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var avatars: Avatars = Avatars(client: client); + +var result = avatars.getQR(_text: "[TEXT]"); diff --git a/app/sdks/client-swift/docs/examples/database/create-document.md b/app/sdks/client-swift/docs/examples/database/create-document.md new file mode 100644 index 0000000000..ebd59adc47 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/database/create-document.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var database: Database = Database(client: client); + +var result = database.createDocument(_collectionId: "[COLLECTION_ID]", _data: , _read: [], _write: []); diff --git a/app/sdks/client-swift/docs/examples/database/delete-document.md b/app/sdks/client-swift/docs/examples/database/delete-document.md new file mode 100644 index 0000000000..faec2ceee9 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/database/delete-document.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var database: Database = Database(client: client); + +var result = database.deleteDocument(_collectionId: "[COLLECTION_ID]", _documentId: "[DOCUMENT_ID]"); diff --git a/app/sdks/client-swift/docs/examples/database/get-document.md b/app/sdks/client-swift/docs/examples/database/get-document.md new file mode 100644 index 0000000000..0f3a05bfa5 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/database/get-document.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var database: Database = Database(client: client); + +var result = database.getDocument(_collectionId: "[COLLECTION_ID]", _documentId: "[DOCUMENT_ID]"); diff --git a/app/sdks/client-swift/docs/examples/database/list-documents.md b/app/sdks/client-swift/docs/examples/database/list-documents.md new file mode 100644 index 0000000000..2c9f4a2efa --- /dev/null +++ b/app/sdks/client-swift/docs/examples/database/list-documents.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var database: Database = Database(client: client); + +var result = database.listDocuments(_collectionId: "[COLLECTION_ID]"); diff --git a/app/sdks/client-swift/docs/examples/database/update-document.md b/app/sdks/client-swift/docs/examples/database/update-document.md new file mode 100644 index 0000000000..bddaf61111 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/database/update-document.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var database: Database = Database(client: client); + +var result = database.updateDocument(_collectionId: "[COLLECTION_ID]", _documentId: "[DOCUMENT_ID]", _data: , _read: [], _write: []); diff --git a/app/sdks/client-swift/docs/examples/locale/get-continents.md b/app/sdks/client-swift/docs/examples/locale/get-continents.md new file mode 100644 index 0000000000..3f57d5eb0d --- /dev/null +++ b/app/sdks/client-swift/docs/examples/locale/get-continents.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var locale: Locale = Locale(client: client); + +var result = locale.getContinents(); diff --git a/app/sdks/client-swift/docs/examples/locale/get-countries-e-u.md b/app/sdks/client-swift/docs/examples/locale/get-countries-e-u.md new file mode 100644 index 0000000000..9f2a26213c --- /dev/null +++ b/app/sdks/client-swift/docs/examples/locale/get-countries-e-u.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var locale: Locale = Locale(client: client); + +var result = locale.getCountriesEU(); diff --git a/app/sdks/client-swift/docs/examples/locale/get-countries-phones.md b/app/sdks/client-swift/docs/examples/locale/get-countries-phones.md new file mode 100644 index 0000000000..2cc9c4a9a0 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/locale/get-countries-phones.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var locale: Locale = Locale(client: client); + +var result = locale.getCountriesPhones(); diff --git a/app/sdks/client-swift/docs/examples/locale/get-countries.md b/app/sdks/client-swift/docs/examples/locale/get-countries.md new file mode 100644 index 0000000000..df52194af1 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/locale/get-countries.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var locale: Locale = Locale(client: client); + +var result = locale.getCountries(); diff --git a/app/sdks/client-swift/docs/examples/locale/get-currencies.md b/app/sdks/client-swift/docs/examples/locale/get-currencies.md new file mode 100644 index 0000000000..cf5f403eba --- /dev/null +++ b/app/sdks/client-swift/docs/examples/locale/get-currencies.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var locale: Locale = Locale(client: client); + +var result = locale.getCurrencies(); diff --git a/app/sdks/client-swift/docs/examples/locale/get-languages.md b/app/sdks/client-swift/docs/examples/locale/get-languages.md new file mode 100644 index 0000000000..e8296dd7ca --- /dev/null +++ b/app/sdks/client-swift/docs/examples/locale/get-languages.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var locale: Locale = Locale(client: client); + +var result = locale.getLanguages(); diff --git a/app/sdks/client-swift/docs/examples/locale/get.md b/app/sdks/client-swift/docs/examples/locale/get.md new file mode 100644 index 0000000000..5685e89440 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/locale/get.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var locale: Locale = Locale(client: client); + +var result = locale.get(); diff --git a/app/sdks/client-swift/docs/examples/storage/create-file.md b/app/sdks/client-swift/docs/examples/storage/create-file.md new file mode 100644 index 0000000000..b4e15a4ec1 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/storage/create-file.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var storage: Storage = Storage(client: client); + +var result = storage.createFile(_file: nil, _read: [], _write: []); diff --git a/app/sdks/client-swift/docs/examples/storage/delete-file.md b/app/sdks/client-swift/docs/examples/storage/delete-file.md new file mode 100644 index 0000000000..83152d9194 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/storage/delete-file.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var storage: Storage = Storage(client: client); + +var result = storage.deleteFile(_fileId: "[FILE_ID]"); diff --git a/app/sdks/client-swift/docs/examples/storage/get-file-download.md b/app/sdks/client-swift/docs/examples/storage/get-file-download.md new file mode 100644 index 0000000000..023f1a2243 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/storage/get-file-download.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var storage: Storage = Storage(client: client); + +var result = storage.getFileDownload(_fileId: "[FILE_ID]"); diff --git a/app/sdks/client-swift/docs/examples/storage/get-file-preview.md b/app/sdks/client-swift/docs/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..faaacd8e8c --- /dev/null +++ b/app/sdks/client-swift/docs/examples/storage/get-file-preview.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var storage: Storage = Storage(client: client); + +var result = storage.getFilePreview(_fileId: "[FILE_ID]"); diff --git a/app/sdks/client-swift/docs/examples/storage/get-file-view.md b/app/sdks/client-swift/docs/examples/storage/get-file-view.md new file mode 100644 index 0000000000..d480377b06 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/storage/get-file-view.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var storage: Storage = Storage(client: client); + +var result = storage.getFileView(_fileId: "[FILE_ID]"); diff --git a/app/sdks/client-swift/docs/examples/storage/get-file.md b/app/sdks/client-swift/docs/examples/storage/get-file.md new file mode 100644 index 0000000000..15bf5f7241 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/storage/get-file.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var storage: Storage = Storage(client: client); + +var result = storage.getFile(_fileId: "[FILE_ID]"); diff --git a/app/sdks/client-swift/docs/examples/storage/list-files.md b/app/sdks/client-swift/docs/examples/storage/list-files.md new file mode 100644 index 0000000000..bfce4293e5 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/storage/list-files.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var storage: Storage = Storage(client: client); + +var result = storage.listFiles(); diff --git a/app/sdks/client-swift/docs/examples/storage/update-file.md b/app/sdks/client-swift/docs/examples/storage/update-file.md new file mode 100644 index 0000000000..6a14e47773 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/storage/update-file.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var storage: Storage = Storage(client: client); + +var result = storage.updateFile(_fileId: "[FILE_ID]", _read: [], _write: []); diff --git a/app/sdks/client-swift/docs/examples/teams/create-membership.md b/app/sdks/client-swift/docs/examples/teams/create-membership.md new file mode 100644 index 0000000000..4af13ae6ee --- /dev/null +++ b/app/sdks/client-swift/docs/examples/teams/create-membership.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var teams: Teams = Teams(client: client); + +var result = teams.createMembership(_teamId: "[TEAM_ID]", _email: "email@example.com", _roles: [], _url: "https://example.com"); diff --git a/app/sdks/client-swift/docs/examples/teams/create.md b/app/sdks/client-swift/docs/examples/teams/create.md new file mode 100644 index 0000000000..a5cf829019 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/teams/create.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var teams: Teams = Teams(client: client); + +var result = teams.create(_name: "[NAME]"); diff --git a/app/sdks/client-swift/docs/examples/teams/delete-membership.md b/app/sdks/client-swift/docs/examples/teams/delete-membership.md new file mode 100644 index 0000000000..19bf8b2f7d --- /dev/null +++ b/app/sdks/client-swift/docs/examples/teams/delete-membership.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var teams: Teams = Teams(client: client); + +var result = teams.deleteMembership(_teamId: "[TEAM_ID]", _inviteId: "[INVITE_ID]"); diff --git a/app/sdks/client-swift/docs/examples/teams/delete.md b/app/sdks/client-swift/docs/examples/teams/delete.md new file mode 100644 index 0000000000..50cc25892b --- /dev/null +++ b/app/sdks/client-swift/docs/examples/teams/delete.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var teams: Teams = Teams(client: client); + +var result = teams.delete(_teamId: "[TEAM_ID]"); diff --git a/app/sdks/client-swift/docs/examples/teams/get-memberships.md b/app/sdks/client-swift/docs/examples/teams/get-memberships.md new file mode 100644 index 0000000000..089ea8f717 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/teams/get-memberships.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var teams: Teams = Teams(client: client); + +var result = teams.getMemberships(_teamId: "[TEAM_ID]"); diff --git a/app/sdks/client-swift/docs/examples/teams/get.md b/app/sdks/client-swift/docs/examples/teams/get.md new file mode 100644 index 0000000000..25bf212a45 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/teams/get.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var teams: Teams = Teams(client: client); + +var result = teams.get(_teamId: "[TEAM_ID]"); diff --git a/app/sdks/client-swift/docs/examples/teams/list.md b/app/sdks/client-swift/docs/examples/teams/list.md new file mode 100644 index 0000000000..8333d1fe43 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/teams/list.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var teams: Teams = Teams(client: client); + +var result = teams.list(); diff --git a/app/sdks/client-swift/docs/examples/teams/update-membership-status.md b/app/sdks/client-swift/docs/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..ae72e4c799 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/teams/update-membership-status.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var teams: Teams = Teams(client: client); + +var result = teams.updateMembershipStatus(_teamId: "[TEAM_ID]", _inviteId: "[INVITE_ID]", _userId: "[USER_ID]", _secret: "[SECRET]"); diff --git a/app/sdks/client-swift/docs/examples/teams/update.md b/app/sdks/client-swift/docs/examples/teams/update.md new file mode 100644 index 0000000000..fafd98b881 --- /dev/null +++ b/app/sdks/client-swift/docs/examples/teams/update.md @@ -0,0 +1,14 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + + +var client: Client = Client() + +client + .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject(value: "5df5acd0d48c2") // Your project ID + +var teams: Teams = Teams(client: client); + +var result = teams.update(_teamId: "[TEAM_ID]", _name: "[NAME]"); diff --git a/app/sdks/client-swift/docs/locale.md b/app/sdks/client-swift/docs/locale.md new file mode 100644 index 0000000000..efe5a690e2 --- /dev/null +++ b/app/sdks/client-swift/docs/locale.md @@ -0,0 +1,64 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + +# Locale Service + +## Get User Locale + +```http request +GET https://appwrite.io/v1/locale +``` + +** Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language. + +([IP Geolocation by DB-IP](https://db-ip.com)) ** + +## List Continents + +```http request +GET https://appwrite.io/v1/locale/continents +``` + +** List of all continents. You can use the locale header to get the data in a supported language. ** + +## List Countries + +```http request +GET https://appwrite.io/v1/locale/countries +``` + +** List of all countries. You can use the locale header to get the data in a supported language. ** + +## List EU Countries + +```http request +GET https://appwrite.io/v1/locale/countries/eu +``` + +** List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language. ** + +## List Countries Phone Codes + +```http request +GET https://appwrite.io/v1/locale/countries/phones +``` + +** List of all countries phone codes. You can use the locale header to get the data in a supported language. ** + +## List Currencies + +```http request +GET https://appwrite.io/v1/locale/currencies +``` + +** List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language. ** + +## List Languages + +```http request +GET https://appwrite.io/v1/locale/languages +``` + +** List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language. ** + diff --git a/app/sdks/client-swift/docs/storage.md b/app/sdks/client-swift/docs/storage.md new file mode 100644 index 0000000000..f902ebd2e9 --- /dev/null +++ b/app/sdks/client-swift/docs/storage.md @@ -0,0 +1,131 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + +# Storage Service + +## List Files + +```http request +GET https://appwrite.io/v1/storage/files +``` + +** Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](/docs/admin). ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| search | string | Search term to filter your list results. | | +| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 | +| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 | +| orderType | string | Order result by ASC or DESC order. | ASC | + +## Create File + +```http request +POST https://appwrite.io/v1/storage/files +``` + +** Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| file | file | Binary file. | | +| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | +| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | + +## Get File + +```http request +GET https://appwrite.io/v1/storage/files/{fileId} +``` + +** Get file by its unique ID. This endpoint response returns a JSON object with the file metadata. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| fileId | string | **Required** File unique ID. | | + +## Update File + +```http request +PUT https://appwrite.io/v1/storage/files/{fileId} +``` + +** Update file by its unique ID. Only users with write permissions have access to update this resource. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| fileId | string | **Required** File unique ID. | | +| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | +| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | | + +## Delete File + +```http request +DELETE https://appwrite.io/v1/storage/files/{fileId} +``` + +** Delete a file by its unique ID. Only users with write permissions have access to delete this resource. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| fileId | string | **Required** File unique ID. | | + +## Get File for Download + +```http request +GET https://appwrite.io/v1/storage/files/{fileId}/download +``` + +** Get file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| fileId | string | **Required** File unique ID. | | + +## Get File Preview + +```http request +GET https://appwrite.io/v1/storage/files/{fileId}/preview +``` + +** Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| fileId | string | **Required** File unique ID | | +| width | integer | Resize preview image width, Pass an integer between 0 to 4000. | 0 | +| height | integer | Resize preview image height, Pass an integer between 0 to 4000. | 0 | +| quality | integer | Preview image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 | +| background | string | Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix. | | +| output | string | Output format type (jpeg, jpg, png, gif and webp). | | + +## Get File for View + +```http request +GET https://appwrite.io/v1/storage/files/{fileId}/view +``` + +** Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| fileId | string | **Required** File unique ID. | | +| as | string | Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk. | | + diff --git a/app/sdks/client-swift/docs/teams.md b/app/sdks/client-swift/docs/teams.md new file mode 100644 index 0000000000..7f8b4238a7 --- /dev/null +++ b/app/sdks/client-swift/docs/teams.md @@ -0,0 +1,153 @@ +/// Swift Appwrite SDK +/// Produced by Appwrite SDK Generator +/// + +# Teams Service + +## List Teams + +```http request +GET https://appwrite.io/v1/teams +``` + +** Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](/docs/admin). ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| search | string | Search term to filter your list results. | | +| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 | +| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 | +| orderType | string | Order result by ASC or DESC order. | ASC | + +## Create Team + +```http request +POST https://appwrite.io/v1/teams +``` + +** Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| name | string | Team name. | | +| roles | array | Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](/docs/permissions). | ["owner"] | + +## Get Team + +```http request +GET https://appwrite.io/v1/teams/{teamId} +``` + +** Get team by its unique ID. All team members have read access for this resource. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| teamId | string | **Required** Team unique ID. | | + +## Update Team + +```http request +PUT https://appwrite.io/v1/teams/{teamId} +``` + +** Update team by its unique ID. Only team owners have write access for this resource. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| teamId | string | **Required** Team unique ID. | | +| name | string | Team name. | | + +## Delete Team + +```http request +DELETE https://appwrite.io/v1/teams/{teamId} +``` + +** Delete team by its unique ID. Only team owners have write access for this resource. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| teamId | string | **Required** Team unique ID. | | + +## Get Team Memberships + +```http request +GET https://appwrite.io/v1/teams/{teamId}/memberships +``` + +** Get team members by the team unique ID. All team members have read access for this list of resources. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| teamId | string | **Required** Team unique ID. | | +| search | string | Search term to filter your list results. | | +| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 | +| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 | +| orderType | string | Order result by ASC or DESC order. | ASC | + +## Create Team Membership + +```http request +POST https://appwrite.io/v1/teams/{teamId}/memberships +``` + +** Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically. + +Use the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. + +Please note that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| teamId | string | **Required** Team unique ID. | | +| email | string | New team member email. | | +| name | string | New team member name. | | +| roles | array | Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). | | +| url | string | URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | | + +## Delete Team Membership + +```http request +DELETE https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId} +``` + +** This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if he didn't accept it. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| teamId | string | **Required** Team unique ID. | | +| inviteId | string | **Required** Invite unique ID. | | + +## Update Team Membership Status + +```http request +PATCH https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}/status +``` + +** Use this endpoint to allow a user to accept an invitation to join a team after he is being redirected back to your app from the invitation email he was sent. ** + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| teamId | string | **Required** Team unique ID. | | +| inviteId | string | **Required** Invite unique ID. | | +| userId | string | User unique ID. | | +| secret | string | Secret key. | | + diff --git a/app/sdks/client-web/src/sdk.js b/app/sdks/client-web/src/sdk.js index 5c98ea89b3..90c9b8021b 100644 --- a/app/sdks/client-web/src/sdk.js +++ b/app/sdks/client-web/src/sdk.js @@ -787,16 +787,17 @@ * Use this endpoint to send a verification message to your user email address * to confirm they are the valid owners of that address. Both the **userId** * and **secret** arguments will be passed as query parameters to the URL you - * have provider to be attached to the verification email. The provided URL - * should redirect the user back for your app and allow you to complete the + * have provided to be attached to the verification email. The provided URL + * should redirect the user back to your app and allow you to complete the * verification process by verifying both the **userId** and **secret** * parameters. Learn more about how to [complete the verification * process](/docs/client/account#updateAccountVerification). * * Please note that in order to avoid a [Redirect - * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) + * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), * the only valid redirect URLs are the ones from domains you have set when * adding your platforms in the console interface. + * * * @param {string} url * @throws {Error} @@ -1217,11 +1218,11 @@ * @param {string} text * @param {number} size * @param {number} margin - * @param {number} download + * @param {boolean} download * @throws {Error} * @return {string} */ - getQR: function(text, size = 400, margin = 1, download = 0) { + getQR: function(text, size = 400, margin = 1, download = false) { if(text === undefined) { throw new Error('Missing required parameter: "text"'); } @@ -1281,18 +1282,16 @@ * * @param {string} collectionId * @param {string[]} filters - * @param {number} offset * @param {number} limit + * @param {number} offset * @param {string} orderField * @param {string} orderType * @param {string} orderCast * @param {string} search - * @param {number} first - * @param {number} last * @throws {Error} * @return {Promise} */ - listDocuments: function(collectionId, filters = [], offset = 0, limit = 50, orderField = '$id', orderType = 'ASC', orderCast = 'string', search = '', first = 0, last = 0) { + listDocuments: function(collectionId, filters = [], limit = 25, offset = 0, orderField = '$id', orderType = 'ASC', orderCast = 'string', search = '') { if(collectionId === undefined) { throw new Error('Missing required parameter: "collectionId"'); } @@ -1305,14 +1304,14 @@ payload['filters'] = filters; } - if(offset) { - payload['offset'] = offset; - } - if(limit) { payload['limit'] = limit; } + if(offset) { + payload['offset'] = offset; + } + if(orderField) { payload['orderField'] = orderField; } @@ -1329,14 +1328,6 @@ payload['search'] = search; } - if(first) { - payload['first'] = first; - } - - if(last) { - payload['last'] = last; - } - return http .get(path, { 'content-type': 'application/json', diff --git a/app/sdks/client-web/src/sdk.min.js b/app/sdks/client-web/src/sdk.min.js index 7b470dc380..2bc06cc935 100644 --- a/app/sdks/client-web/src/sdk.min.js +++ b/app/sdks/client-web/src/sdk.min.js @@ -86,22 +86,20 @@ if(height){payload.height=height} if(color){payload.color=color} if(background){payload.background=background} payload.project=config.project;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index; + listDocuments(collectionId: string, filters: string[], limit: number, offset: number, orderField: string, orderType: string, orderCast: string, search: string): Promise; /** * Create Document diff --git a/app/sdks/console-web/docs/examples/bar/delete.md b/app/sdks/console-web/docs/examples/bar/delete.md new file mode 100644 index 0000000000..c60d7a75f0 --- /dev/null +++ b/app/sdks/console-web/docs/examples/bar/delete.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.bar.delete('[]', null, []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/bar/get.md b/app/sdks/console-web/docs/examples/bar/get.md new file mode 100644 index 0000000000..a690ffc039 --- /dev/null +++ b/app/sdks/console-web/docs/examples/bar/get.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.bar.get('[]', null, []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/bar/patch.md b/app/sdks/console-web/docs/examples/bar/patch.md new file mode 100644 index 0000000000..46ac2d7438 --- /dev/null +++ b/app/sdks/console-web/docs/examples/bar/patch.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.bar.patch('[]', null, []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/bar/post.md b/app/sdks/console-web/docs/examples/bar/post.md new file mode 100644 index 0000000000..4b21090c3f --- /dev/null +++ b/app/sdks/console-web/docs/examples/bar/post.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.bar.post('[]', null, []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/bar/put.md b/app/sdks/console-web/docs/examples/bar/put.md new file mode 100644 index 0000000000..8eac3ebad8 --- /dev/null +++ b/app/sdks/console-web/docs/examples/bar/put.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.bar.put('[]', null, []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/foo/delete.md b/app/sdks/console-web/docs/examples/foo/delete.md new file mode 100644 index 0000000000..715289a5b8 --- /dev/null +++ b/app/sdks/console-web/docs/examples/foo/delete.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.foo.delete('[]', null, []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/foo/get.md b/app/sdks/console-web/docs/examples/foo/get.md new file mode 100644 index 0000000000..cb3ee31c9d --- /dev/null +++ b/app/sdks/console-web/docs/examples/foo/get.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.foo.get('[]', null, []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/foo/patch.md b/app/sdks/console-web/docs/examples/foo/patch.md new file mode 100644 index 0000000000..e39222e71d --- /dev/null +++ b/app/sdks/console-web/docs/examples/foo/patch.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.foo.patch('[]', null, []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/foo/post.md b/app/sdks/console-web/docs/examples/foo/post.md new file mode 100644 index 0000000000..4c236776f6 --- /dev/null +++ b/app/sdks/console-web/docs/examples/foo/post.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.foo.post('[]', null, []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/foo/put.md b/app/sdks/console-web/docs/examples/foo/put.md new file mode 100644 index 0000000000..d13c4c44ff --- /dev/null +++ b/app/sdks/console-web/docs/examples/foo/put.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.foo.put('[]', null, []); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/functions/create-execution.md b/app/sdks/console-web/docs/examples/functions/create-execution.md new file mode 100644 index 0000000000..e70d7f931a --- /dev/null +++ b/app/sdks/console-web/docs/examples/functions/create-execution.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.functions.createExecution('[FUNCTION_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/functions/create-tag.md b/app/sdks/console-web/docs/examples/functions/create-tag.md new file mode 100644 index 0000000000..743517ff1a --- /dev/null +++ b/app/sdks/console-web/docs/examples/functions/create-tag.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.functions.createTag('[FUNCTION_ID]', '[COMMAND]', document.getElementById('uploader').files[0]); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/functions/create.md b/app/sdks/console-web/docs/examples/functions/create.md new file mode 100644 index 0000000000..6fb506816f --- /dev/null +++ b/app/sdks/console-web/docs/examples/functions/create.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.functions.create('[NAME]', 'node-14'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/functions/delete-tag.md b/app/sdks/console-web/docs/examples/functions/delete-tag.md new file mode 100644 index 0000000000..9c1b5cdda3 --- /dev/null +++ b/app/sdks/console-web/docs/examples/functions/delete-tag.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.functions.deleteTag('[FUNCTION_ID]', '[TAG_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/functions/delete.md b/app/sdks/console-web/docs/examples/functions/delete.md new file mode 100644 index 0000000000..f76f809c2b --- /dev/null +++ b/app/sdks/console-web/docs/examples/functions/delete.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.functions.delete('[FUNCTION_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/functions/get-execution.md b/app/sdks/console-web/docs/examples/functions/get-execution.md new file mode 100644 index 0000000000..8287c4709e --- /dev/null +++ b/app/sdks/console-web/docs/examples/functions/get-execution.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.functions.getExecution('[FUNCTION_ID]', '[EXECUTION_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/functions/get-tag.md b/app/sdks/console-web/docs/examples/functions/get-tag.md new file mode 100644 index 0000000000..c6021ccdac --- /dev/null +++ b/app/sdks/console-web/docs/examples/functions/get-tag.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.functions.getTag('[FUNCTION_ID]', '[TAG_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/functions/get-usage.md b/app/sdks/console-web/docs/examples/functions/get-usage.md new file mode 100644 index 0000000000..7515c0fe5c --- /dev/null +++ b/app/sdks/console-web/docs/examples/functions/get-usage.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.functions.getUsage('[FUNCTION_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/functions/get.md b/app/sdks/console-web/docs/examples/functions/get.md new file mode 100644 index 0000000000..dc068ffa09 --- /dev/null +++ b/app/sdks/console-web/docs/examples/functions/get.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.functions.get('[FUNCTION_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/functions/list-executions.md b/app/sdks/console-web/docs/examples/functions/list-executions.md new file mode 100644 index 0000000000..9367a9eb52 --- /dev/null +++ b/app/sdks/console-web/docs/examples/functions/list-executions.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.functions.listExecutions('[FUNCTION_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/functions/list-tags.md b/app/sdks/console-web/docs/examples/functions/list-tags.md new file mode 100644 index 0000000000..4542bae44b --- /dev/null +++ b/app/sdks/console-web/docs/examples/functions/list-tags.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.functions.listTags('[FUNCTION_ID]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/functions/list.md b/app/sdks/console-web/docs/examples/functions/list.md new file mode 100644 index 0000000000..e2ce2511e0 --- /dev/null +++ b/app/sdks/console-web/docs/examples/functions/list.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.functions.list(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/functions/update-active.md b/app/sdks/console-web/docs/examples/functions/update-active.md new file mode 100644 index 0000000000..eed2be885c --- /dev/null +++ b/app/sdks/console-web/docs/examples/functions/update-active.md @@ -0,0 +1,14 @@ +let sdk = new Appwrite(); + +sdk + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.functions.updateActive('[FUNCTION_ID]', '[ACTIVE]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/functions/update-tag.md b/app/sdks/console-web/docs/examples/functions/update-tag.md new file mode 100644 index 0000000000..7ea2ba1808 --- /dev/null +++ b/app/sdks/console-web/docs/examples/functions/update-tag.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.functions.updateTag('[FUNCTION_ID]', '[TAG]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/functions/update.md b/app/sdks/console-web/docs/examples/functions/update.md new file mode 100644 index 0000000000..c6a34cff5c --- /dev/null +++ b/app/sdks/console-web/docs/examples/functions/update.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.functions.update('[FUNCTION_ID]', '[NAME]'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/general/empty.md b/app/sdks/console-web/docs/examples/general/empty.md new file mode 100644 index 0000000000..50fd0e8a5c --- /dev/null +++ b/app/sdks/console-web/docs/examples/general/empty.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.general.empty(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/general/get-cookie.md b/app/sdks/console-web/docs/examples/general/get-cookie.md new file mode 100644 index 0000000000..5785a0323f --- /dev/null +++ b/app/sdks/console-web/docs/examples/general/get-cookie.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.general.getCookie(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/general/redirect.md b/app/sdks/console-web/docs/examples/general/redirect.md new file mode 100644 index 0000000000..769533f6f6 --- /dev/null +++ b/app/sdks/console-web/docs/examples/general/redirect.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.general.redirect(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/general/redirected.md b/app/sdks/console-web/docs/examples/general/redirected.md new file mode 100644 index 0000000000..712e614ac9 --- /dev/null +++ b/app/sdks/console-web/docs/examples/general/redirected.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.general.redirected(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/general/set-cookie.md b/app/sdks/console-web/docs/examples/general/set-cookie.md new file mode 100644 index 0000000000..ee0f85cc1f --- /dev/null +++ b/app/sdks/console-web/docs/examples/general/set-cookie.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.general.setCookie(); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/general/upload.md b/app/sdks/console-web/docs/examples/general/upload.md new file mode 100644 index 0000000000..bbc2bee92a --- /dev/null +++ b/app/sdks/console-web/docs/examples/general/upload.md @@ -0,0 +1,15 @@ +let sdk = new Appwrite(); + +sdk + .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = sdk.general.upload('[]', null, [], document.getElementById('uploader').files[0]); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); \ No newline at end of file diff --git a/app/sdks/console-web/docs/examples/projects/create-task.md b/app/sdks/console-web/docs/examples/projects/create-task.md index 5698d000e8..9b0f3c1e03 100644 --- a/app/sdks/console-web/docs/examples/projects/create-task.md +++ b/app/sdks/console-web/docs/examples/projects/create-task.md @@ -6,7 +6,7 @@ sdk .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = sdk.projects.createTask('[PROJECT_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com'); +let promise = sdk.projects.createTask('[PROJECT_ID]', '[NAME]', 'play', '', false, 'GET', 'https://example.com'); promise.then(function (response) { console.log(response); // Success 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 728786f9fb..be722f3dbe 100644 --- a/app/sdks/console-web/docs/examples/projects/create-webhook.md +++ b/app/sdks/console-web/docs/examples/projects/create-webhook.md @@ -6,7 +6,7 @@ sdk .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = sdk.projects.createWebhook('[PROJECT_ID]', '[NAME]', [], '[URL]', 0); +let promise = sdk.projects.createWebhook('[PROJECT_ID]', '[NAME]', [], 'https://example.com', false); promise.then(function (response) { console.log(response); // Success 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 dc95cfda9f..38744a36bd 100644 --- a/app/sdks/console-web/docs/examples/projects/update-task.md +++ b/app/sdks/console-web/docs/examples/projects/update-task.md @@ -6,7 +6,7 @@ sdk .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = sdk.projects.updateTask('[PROJECT_ID]', '[TASK_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com'); +let promise = sdk.projects.updateTask('[PROJECT_ID]', '[TASK_ID]', '[NAME]', 'play', '', false, 'GET', 'https://example.com'); promise.then(function (response) { console.log(response); // Success 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 b1ead71e92..cdef2ec479 100644 --- a/app/sdks/console-web/docs/examples/projects/update-webhook.md +++ b/app/sdks/console-web/docs/examples/projects/update-webhook.md @@ -6,7 +6,7 @@ sdk .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -let promise = sdk.projects.updateWebhook('[PROJECT_ID]', '[WEBHOOK_ID]', '[NAME]', [], '[URL]', 0); +let promise = sdk.projects.updateWebhook('[PROJECT_ID]', '[WEBHOOK_ID]', '[NAME]', [], 'https://example.com', false); promise.then(function (response) { console.log(response); // Success diff --git a/app/sdks/console-web/src/sdk.js b/app/sdks/console-web/src/sdk.js index 27eb23b742..4c6ac61ee9 100644 --- a/app/sdks/console-web/src/sdk.js +++ b/app/sdks/console-web/src/sdk.js @@ -825,16 +825,17 @@ * Use this endpoint to send a verification message to your user email address * to confirm they are the valid owners of that address. Both the **userId** * and **secret** arguments will be passed as query parameters to the URL you - * have provider to be attached to the verification email. The provided URL - * should redirect the user back for your app and allow you to complete the + * have provided to be attached to the verification email. The provided URL + * should redirect the user back to your app and allow you to complete the * verification process by verifying both the **userId** and **secret** * parameters. Learn more about how to [complete the verification * process](/docs/client/account#updateAccountVerification). * * Please note that in order to avoid a [Redirect - * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) + * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), * the only valid redirect URLs are the ones from domains you have set when * adding your platforms in the console interface. + * * * @param {string} url * @throws {Error} @@ -1267,11 +1268,11 @@ * @param {string} text * @param {number} size * @param {number} margin - * @param {number} download + * @param {boolean} download * @throws {Error} * @return {string} */ - getQR: function(text, size = 400, margin = 1, download = 0) { + getQR: function(text, size = 400, margin = 1, download = false) { if(text === undefined) { throw new Error('Missing required parameter: "text"'); } @@ -1536,18 +1537,16 @@ * * @param {string} collectionId * @param {string[]} filters - * @param {number} offset * @param {number} limit + * @param {number} offset * @param {string} orderField * @param {string} orderType * @param {string} orderCast * @param {string} search - * @param {number} first - * @param {number} last * @throws {Error} * @return {Promise} */ - listDocuments: function(collectionId, filters = [], offset = 0, limit = 50, orderField = '$id', orderType = 'ASC', orderCast = 'string', search = '', first = 0, last = 0) { + listDocuments: function(collectionId, filters = [], limit = 25, offset = 0, orderField = '$id', orderType = 'ASC', orderCast = 'string', search = '') { if(collectionId === undefined) { throw new Error('Missing required parameter: "collectionId"'); } @@ -1560,14 +1559,14 @@ payload['filters'] = filters; } - if(offset) { - payload['offset'] = offset; - } - if(limit) { payload['limit'] = limit; } + if(offset) { + payload['offset'] = offset; + } + if(orderField) { payload['orderField'] = orderField; } @@ -1584,14 +1583,6 @@ payload['search'] = search; } - if(first) { - payload['first'] = first; - } - - if(last) { - payload['last'] = last; - } - return http .get(path, { 'content-type': 'application/json', @@ -1781,25 +1772,496 @@ .delete(path, { 'content-type': 'application/json', }, payload); - }, + } + }; + + let functions = { /** - * Get Collection Logs + * List Functions * * - * @param {string} collectionId + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType * @throws {Error} * @return {Promise} */ - getCollectionLogs: function(collectionId) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - let path = '/database/collections/{collectionId}/logs'.replace(new RegExp('{collectionId}', 'g'), collectionId); + list: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { + let path = '/functions'; let payload = {}; + if(search) { + payload['search'] = search; + } + + if(limit) { + payload['limit'] = limit; + } + + if(offset) { + payload['offset'] = offset; + } + + if(orderType) { + payload['orderType'] = orderType; + } + + return http + .get(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Create Function + * + * + * @param {string} name + * @param {string} env + * @param {object} vars + * @param {string[]} events + * @param {string} schedule + * @param {number} timeout + * @throws {Error} + * @return {Promise} + */ + create: function(name, env, vars = [], events = [], schedule = '', timeout = 15) { + if(name === undefined) { + throw new Error('Missing required parameter: "name"'); + } + + if(env === undefined) { + throw new Error('Missing required parameter: "env"'); + } + + let path = '/functions'; + + let payload = {}; + + if(name) { + payload['name'] = name; + } + + if(env) { + payload['env'] = env; + } + + if(vars) { + payload['vars'] = vars; + } + + if(events) { + payload['events'] = events; + } + + if(schedule) { + payload['schedule'] = schedule; + } + + if(timeout) { + payload['timeout'] = timeout; + } + + return http + .post(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Get Function + * + * + * @param {string} functionId + * @throws {Error} + * @return {Promise} + */ + get: function(functionId) { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + let path = '/functions/{functionId}'.replace(new RegExp('{functionId}', 'g'), functionId); + + let payload = {}; + + return http + .get(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Update Function + * + * + * @param {string} functionId + * @param {string} name + * @param {object} vars + * @param {string[]} events + * @param {string} schedule + * @param {number} timeout + * @throws {Error} + * @return {Promise} + */ + update: function(functionId, name, vars = [], events = [], schedule = '', timeout = 15) { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + if(name === undefined) { + throw new Error('Missing required parameter: "name"'); + } + + let path = '/functions/{functionId}'.replace(new RegExp('{functionId}', 'g'), functionId); + + let payload = {}; + + if(name) { + payload['name'] = name; + } + + if(vars) { + payload['vars'] = vars; + } + + if(events) { + payload['events'] = events; + } + + if(schedule) { + payload['schedule'] = schedule; + } + + if(timeout) { + payload['timeout'] = timeout; + } + + return http + .put(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Delete Function + * + * + * @param {string} functionId + * @throws {Error} + * @return {Promise} + */ + delete: function(functionId) { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + let path = '/functions/{functionId}'.replace(new RegExp('{functionId}', 'g'), functionId); + + let payload = {}; + + return http + .delete(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * List Executions + * + * + * @param {string} functionId + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType + * @throws {Error} + * @return {Promise} + */ + listExecutions: function(functionId, search = '', limit = 25, offset = 0, orderType = 'ASC') { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + let path = '/functions/{functionId}/executions'.replace(new RegExp('{functionId}', 'g'), functionId); + + let payload = {}; + + if(search) { + payload['search'] = search; + } + + if(limit) { + payload['limit'] = limit; + } + + if(offset) { + payload['offset'] = offset; + } + + if(orderType) { + payload['orderType'] = orderType; + } + + return http + .get(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Create Execution + * + * + * @param {string} functionId + * @param {number} async + * @throws {Error} + * @return {Promise} + */ + createExecution: function(functionId, async = 1) { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + let path = '/functions/{functionId}/executions'.replace(new RegExp('{functionId}', 'g'), functionId); + + let payload = {}; + + if(async) { + payload['async'] = async; + } + + return http + .post(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Get Execution + * + * + * @param {string} functionId + * @param {string} executionId + * @throws {Error} + * @return {Promise} + */ + getExecution: function(functionId, executionId) { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + if(executionId === undefined) { + throw new Error('Missing required parameter: "executionId"'); + } + + let path = '/functions/{functionId}/executions/{executionId}'.replace(new RegExp('{functionId}', 'g'), functionId).replace(new RegExp('{executionId}', 'g'), executionId); + + let payload = {}; + + return http + .get(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Update Function Tag + * + * + * @param {string} functionId + * @param {string} tag + * @throws {Error} + * @return {Promise} + */ + updateTag: function(functionId, tag) { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + if(tag === undefined) { + throw new Error('Missing required parameter: "tag"'); + } + + let path = '/functions/{functionId}/tag'.replace(new RegExp('{functionId}', 'g'), functionId); + + let payload = {}; + + if(tag) { + payload['tag'] = tag; + } + + return http + .patch(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * List Tags + * + * + * @param {string} functionId + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType + * @throws {Error} + * @return {Promise} + */ + listTags: function(functionId, search = '', limit = 25, offset = 0, orderType = 'ASC') { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + let path = '/functions/{functionId}/tags'.replace(new RegExp('{functionId}', 'g'), functionId); + + let payload = {}; + + if(search) { + payload['search'] = search; + } + + if(limit) { + payload['limit'] = limit; + } + + if(offset) { + payload['offset'] = offset; + } + + if(orderType) { + payload['orderType'] = orderType; + } + + return http + .get(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Create Tag + * + * + * @param {string} functionId + * @param {string} command + * @param {File} code + * @throws {Error} + * @return {Promise} + */ + createTag: function(functionId, command, code) { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + if(command === undefined) { + throw new Error('Missing required parameter: "command"'); + } + + if(code === undefined) { + throw new Error('Missing required parameter: "code"'); + } + + let path = '/functions/{functionId}/tags'.replace(new RegExp('{functionId}', 'g'), functionId); + + let payload = {}; + + if(command) { + payload['command'] = command; + } + + if(code) { + payload['code'] = code; + } + + return http + .post(path, { + 'content-type': 'multipart/form-data', + }, payload); + }, + + /** + * Get Tag + * + * + * @param {string} functionId + * @param {string} tagId + * @throws {Error} + * @return {Promise} + */ + getTag: function(functionId, tagId) { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + if(tagId === undefined) { + throw new Error('Missing required parameter: "tagId"'); + } + + let path = '/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}', 'g'), functionId).replace(new RegExp('{tagId}', 'g'), tagId); + + let payload = {}; + + return http + .get(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Delete Tag + * + * + * @param {string} functionId + * @param {string} tagId + * @throws {Error} + * @return {Promise} + */ + deleteTag: function(functionId, tagId) { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + if(tagId === undefined) { + throw new Error('Missing required parameter: "tagId"'); + } + + let path = '/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}', 'g'), functionId).replace(new RegExp('{tagId}', 'g'), tagId); + + let payload = {}; + + return http + .delete(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Get Function Usage + * + * + * @param {string} functionId + * @param {string} range + * @throws {Error} + * @return {Promise} + */ + getUsage: function(functionId, range = 'last30') { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + let path = '/functions/{functionId}/usage'.replace(new RegExp('{functionId}', 'g'), functionId); + + let payload = {}; + + if(range) { + payload['range'] = range; + } + return http .get(path, { 'content-type': 'application/json', @@ -2204,14 +2666,34 @@ * List Projects * * + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType * @throws {Error} * @return {Promise} */ - list: function() { + list: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { let path = '/projects'; let payload = {}; + if(search) { + payload['search'] = search; + } + + if(limit) { + payload['limit'] = limit; + } + + if(offset) { + payload['offset'] = offset; + } + + if(orderType) { + payload['orderType'] = orderType; + } + return http .get(path, { 'content-type': 'application/json', @@ -2996,7 +3478,7 @@ * @param {string} name * @param {string} status * @param {string} schedule - * @param {number} security + * @param {boolean} security * @param {string} httpMethod * @param {string} httpUrl * @param {string[]} httpHeaders @@ -3117,7 +3599,7 @@ * @param {string} name * @param {string} status * @param {string} schedule - * @param {number} security + * @param {boolean} security * @param {string} httpMethod * @param {string} httpUrl * @param {string[]} httpHeaders @@ -3292,7 +3774,7 @@ * @param {string} name * @param {string[]} events * @param {string} url - * @param {number} security + * @param {boolean} security * @param {string} httpUser * @param {string} httpPass * @throws {Error} @@ -3390,7 +3872,7 @@ * @param {string} name * @param {string[]} events * @param {string} url - * @param {number} security + * @param {boolean} security * @param {string} httpUser * @param {string} httpPass * @throws {Error} @@ -4498,6 +4980,7 @@ account: account, avatars: avatars, database: database, + functions: functions, health: health, locale: locale, projects: projects, diff --git a/app/sdks/console-web/src/sdk.min.js b/app/sdks/console-web/src/sdk.min.js index f6a2781f21..d2b1d8e84a 100644 --- a/app/sdks/console-web/src/sdk.min.js +++ b/app/sdks/console-web/src/sdk.min.js @@ -86,7 +86,7 @@ if(height){payload.height=height} if(color){payload.color=color} if(background){payload.background=background} payload.project=config.project;payload.key=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index; + listDocuments(collectionId: string, filters: string[], limit: number, offset: number, orderField: string, orderType: string, orderCast: string, search: string): Promise; /** * Create Document @@ -605,15 +605,178 @@ declare namespace Appwrite { */ deleteDocument(collectionId: string, documentId: string): Promise; + } + + export interface Functions { + /** - * Get Collection Logs + * List Functions * * - * @param {string} collectionId + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType * @throws {Error} * @return {Promise} */ - getCollectionLogs(collectionId: string): Promise; + list(search: string, limit: number, offset: number, orderType: string): Promise; + + /** + * Create Function + * + * + * @param {string} name + * @param {string} env + * @param {object} vars + * @param {string[]} events + * @param {string} schedule + * @param {number} timeout + * @throws {Error} + * @return {Promise} + */ + create(name: string, env: string, vars: object, events: string[], schedule: string, timeout: number): Promise; + + /** + * Get Function + * + * + * @param {string} functionId + * @throws {Error} + * @return {Promise} + */ + get(functionId: string): Promise; + + /** + * Update Function + * + * + * @param {string} functionId + * @param {string} name + * @param {object} vars + * @param {string[]} events + * @param {string} schedule + * @param {number} timeout + * @throws {Error} + * @return {Promise} + */ + update(functionId: string, name: string, vars: object, events: string[], schedule: string, timeout: number): Promise; + + /** + * Delete Function + * + * + * @param {string} functionId + * @throws {Error} + * @return {Promise} + */ + delete(functionId: string): Promise; + + /** + * List Executions + * + * + * @param {string} functionId + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType + * @throws {Error} + * @return {Promise} + */ + listExecutions(functionId: string, search: string, limit: number, offset: number, orderType: string): Promise; + + /** + * Create Execution + * + * + * @param {string} functionId + * @param {number} async + * @throws {Error} + * @return {Promise} + */ + createExecution(functionId: string, async: number): Promise; + + /** + * Get Execution + * + * + * @param {string} functionId + * @param {string} executionId + * @throws {Error} + * @return {Promise} + */ + getExecution(functionId: string, executionId: string): Promise; + + /** + * Update Function Tag + * + * + * @param {string} functionId + * @param {string} tag + * @throws {Error} + * @return {Promise} + */ + updateTag(functionId: string, tag: string): Promise; + + /** + * List Tags + * + * + * @param {string} functionId + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType + * @throws {Error} + * @return {Promise} + */ + listTags(functionId: string, search: string, limit: number, offset: number, orderType: string): Promise; + + /** + * Create Tag + * + * + * @param {string} functionId + * @param {string} command + * @param {File} code + * @throws {Error} + * @return {Promise} + */ + createTag(functionId: string, command: string, code: File): Promise; + + /** + * Get Tag + * + * + * @param {string} functionId + * @param {string} tagId + * @throws {Error} + * @return {Promise} + */ + getTag(functionId: string, tagId: string): Promise; + + /** + * Delete Tag + * + * + * @param {string} functionId + * @param {string} tagId + * @throws {Error} + * @return {Promise} + */ + deleteTag(functionId: string, tagId: string): Promise; + + /** + * Get Function Usage + * + * + * @param {string} functionId + * @param {string} range + * @throws {Error} + * @return {Promise} + */ + getUsage(functionId: string, range: string): Promise; } @@ -845,10 +1008,14 @@ declare namespace Appwrite { * List Projects * * + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType * @throws {Error} * @return {Promise} */ - list(): Promise; + list(search: string, limit: number, offset: number, orderType: string): Promise; /** * Create Project @@ -1115,7 +1282,7 @@ declare namespace Appwrite { * @param {string} name * @param {string} status * @param {string} schedule - * @param {number} security + * @param {boolean} security * @param {string} httpMethod * @param {string} httpUrl * @param {string[]} httpHeaders @@ -1124,7 +1291,7 @@ declare namespace Appwrite { * @throws {Error} * @return {Promise} */ - createTask(projectId: string, name: string, status: string, schedule: string, security: number, httpMethod: string, httpUrl: string, httpHeaders: string[], httpUser: string, httpPass: string): Promise; + createTask(projectId: string, name: string, status: string, schedule: string, security: boolean, httpMethod: string, httpUrl: string, httpHeaders: string[], httpUser: string, httpPass: string): Promise; /** * Get Task @@ -1146,7 +1313,7 @@ declare namespace Appwrite { * @param {string} name * @param {string} status * @param {string} schedule - * @param {number} security + * @param {boolean} security * @param {string} httpMethod * @param {string} httpUrl * @param {string[]} httpHeaders @@ -1155,7 +1322,7 @@ declare namespace Appwrite { * @throws {Error} * @return {Promise} */ - updateTask(projectId: string, taskId: string, name: string, status: string, schedule: string, security: number, httpMethod: string, httpUrl: string, httpHeaders: string[], httpUser: string, httpPass: string): Promise; + updateTask(projectId: string, taskId: string, name: string, status: string, schedule: string, security: boolean, httpMethod: string, httpUrl: string, httpHeaders: string[], httpUser: string, httpPass: string): Promise; /** * Delete Task @@ -1197,13 +1364,13 @@ declare namespace Appwrite { * @param {string} name * @param {string[]} events * @param {string} url - * @param {number} security + * @param {boolean} security * @param {string} httpUser * @param {string} httpPass * @throws {Error} * @return {Promise} */ - createWebhook(projectId: string, name: string, events: string[], url: string, security: number, httpUser: string, httpPass: string): Promise; + createWebhook(projectId: string, name: string, events: string[], url: string, security: boolean, httpUser: string, httpPass: string): Promise; /** * Get Webhook @@ -1225,13 +1392,13 @@ declare namespace Appwrite { * @param {string} name * @param {string[]} events * @param {string} url - * @param {number} security + * @param {boolean} security * @param {string} httpUser * @param {string} httpPass * @throws {Error} * @return {Promise} */ - updateWebhook(projectId: string, webhookId: string, name: string, events: string[], url: string, security: number, httpUser: string, httpPass: string): Promise; + updateWebhook(projectId: string, webhookId: string, name: string, events: string[], url: string, security: boolean, httpUser: string, httpPass: string): Promise; /** * Delete Webhook diff --git a/app/sdks/server-go/docs/examples/functions/create-execution.md b/app/sdks/server-go/docs/examples/functions/create-execution.md new file mode 100644 index 0000000000..ea060d6f7f --- /dev/null +++ b/app/sdks/server-go/docs/examples/functions/create-execution.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go" +) + +func main() { + var client := appwrite.Client{} + + client.SetProject("5df5acd0d48c2") // Your project ID + client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + + var service := appwrite.Functions{ + client: &client + } + + var response, error := service.CreateExecution("[FUNCTION_ID]", 0) + + if error != nil { + panic(error) + } + + fmt.Println(response) +} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/create-tag.md b/app/sdks/server-go/docs/examples/functions/create-tag.md new file mode 100644 index 0000000000..84d5e80787 --- /dev/null +++ b/app/sdks/server-go/docs/examples/functions/create-tag.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go" +) + +func main() { + var client := appwrite.Client{} + + client.SetProject("5df5acd0d48c2") // Your project ID + client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + + var service := appwrite.Functions{ + client: &client + } + + var response, error := service.CreateTag("[FUNCTION_ID]", "node-14", "[COMMAND]", "[CODE]") + + if error != nil { + panic(error) + } + + fmt.Println(response) +} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/create.md b/app/sdks/server-go/docs/examples/functions/create.md new file mode 100644 index 0000000000..a87a23b944 --- /dev/null +++ b/app/sdks/server-go/docs/examples/functions/create.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go" +) + +func main() { + var client := appwrite.Client{} + + client.SetProject("5df5acd0d48c2") // Your project ID + client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + + var service := appwrite.Functions{ + client: &client + } + + var response, error := service.Create("[NAME]", , [], "", 0) + + if error != nil { + panic(error) + } + + fmt.Println(response) +} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/delete-tag.md b/app/sdks/server-go/docs/examples/functions/delete-tag.md new file mode 100644 index 0000000000..caf36146da --- /dev/null +++ b/app/sdks/server-go/docs/examples/functions/delete-tag.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go" +) + +func main() { + var client := appwrite.Client{} + + client.SetProject("5df5acd0d48c2") // Your project ID + client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + + var service := appwrite.Functions{ + client: &client + } + + var response, error := service.DeleteTag("[FUNCTION_ID]", "[TAG_ID]") + + if error != nil { + panic(error) + } + + fmt.Println(response) +} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/delete.md b/app/sdks/server-go/docs/examples/functions/delete.md new file mode 100644 index 0000000000..e49addb2b1 --- /dev/null +++ b/app/sdks/server-go/docs/examples/functions/delete.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go" +) + +func main() { + var client := appwrite.Client{} + + client.SetProject("5df5acd0d48c2") // Your project ID + client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + + var service := appwrite.Functions{ + client: &client + } + + var response, error := service.Delete("[FUNCTION_ID]") + + if error != nil { + panic(error) + } + + fmt.Println(response) +} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/get-execution.md b/app/sdks/server-go/docs/examples/functions/get-execution.md new file mode 100644 index 0000000000..13a3ad4685 --- /dev/null +++ b/app/sdks/server-go/docs/examples/functions/get-execution.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go" +) + +func main() { + var client := appwrite.Client{} + + client.SetProject("5df5acd0d48c2") // Your project ID + client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + + var service := appwrite.Functions{ + client: &client + } + + var response, error := service.GetExecution("[FUNCTION_ID]", "[EXECUTION_ID]") + + if error != nil { + panic(error) + } + + fmt.Println(response) +} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/get-tag.md b/app/sdks/server-go/docs/examples/functions/get-tag.md new file mode 100644 index 0000000000..640543d94b --- /dev/null +++ b/app/sdks/server-go/docs/examples/functions/get-tag.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go" +) + +func main() { + var client := appwrite.Client{} + + client.SetProject("5df5acd0d48c2") // Your project ID + client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + + var service := appwrite.Functions{ + client: &client + } + + var response, error := service.GetTag("[FUNCTION_ID]", "[TAG_ID]") + + if error != nil { + panic(error) + } + + fmt.Println(response) +} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/get.md b/app/sdks/server-go/docs/examples/functions/get.md new file mode 100644 index 0000000000..2bba5028c0 --- /dev/null +++ b/app/sdks/server-go/docs/examples/functions/get.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go" +) + +func main() { + var client := appwrite.Client{} + + client.SetProject("5df5acd0d48c2") // Your project ID + client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + + var service := appwrite.Functions{ + client: &client + } + + var response, error := service.Get("[FUNCTION_ID]") + + if error != nil { + panic(error) + } + + fmt.Println(response) +} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/list-executions.md b/app/sdks/server-go/docs/examples/functions/list-executions.md new file mode 100644 index 0000000000..5115928c29 --- /dev/null +++ b/app/sdks/server-go/docs/examples/functions/list-executions.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go" +) + +func main() { + var client := appwrite.Client{} + + client.SetProject("5df5acd0d48c2") // Your project ID + client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + + var service := appwrite.Functions{ + client: &client + } + + var response, error := service.ListExecutions("[FUNCTION_ID]", "[SEARCH]", 0, 0, "ASC") + + if error != nil { + panic(error) + } + + fmt.Println(response) +} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/list-tags.md b/app/sdks/server-go/docs/examples/functions/list-tags.md new file mode 100644 index 0000000000..b6e495988e --- /dev/null +++ b/app/sdks/server-go/docs/examples/functions/list-tags.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go" +) + +func main() { + var client := appwrite.Client{} + + client.SetProject("5df5acd0d48c2") // Your project ID + client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + + var service := appwrite.Functions{ + client: &client + } + + var response, error := service.ListTags("[FUNCTION_ID]", "[SEARCH]", 0, 0, "ASC") + + if error != nil { + panic(error) + } + + fmt.Println(response) +} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/list.md b/app/sdks/server-go/docs/examples/functions/list.md new file mode 100644 index 0000000000..0a208e367d --- /dev/null +++ b/app/sdks/server-go/docs/examples/functions/list.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go" +) + +func main() { + var client := appwrite.Client{} + + client.SetProject("5df5acd0d48c2") // Your project ID + client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + + var service := appwrite.Functions{ + client: &client + } + + var response, error := service.List("[SEARCH]", 0, 0, "ASC") + + if error != nil { + panic(error) + } + + fmt.Println(response) +} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/update-active.md b/app/sdks/server-go/docs/examples/functions/update-active.md new file mode 100644 index 0000000000..da3b0f1227 --- /dev/null +++ b/app/sdks/server-go/docs/examples/functions/update-active.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go" +) + +func main() { + var client := appwrite.Client{} + + client.SetProject("5df5acd0d48c2") // Your project ID + client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + + var service := appwrite.Functions{ + client: &client + } + + var response, error := service.UpdateActive("[FUNCTION_ID]", "[ACTIVE]") + + if error != nil { + panic(error) + } + + fmt.Println(response) +} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/update-tag.md b/app/sdks/server-go/docs/examples/functions/update-tag.md new file mode 100644 index 0000000000..299b095736 --- /dev/null +++ b/app/sdks/server-go/docs/examples/functions/update-tag.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go" +) + +func main() { + var client := appwrite.Client{} + + client.SetProject("5df5acd0d48c2") // Your project ID + client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + + var service := appwrite.Functions{ + client: &client + } + + var response, error := service.UpdateTag("[FUNCTION_ID]", "[TAG]") + + if error != nil { + panic(error) + } + + fmt.Println(response) +} \ No newline at end of file diff --git a/app/sdks/server-go/docs/examples/functions/update.md b/app/sdks/server-go/docs/examples/functions/update.md new file mode 100644 index 0000000000..0f8f9e0190 --- /dev/null +++ b/app/sdks/server-go/docs/examples/functions/update.md @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go" +) + +func main() { + var client := appwrite.Client{} + + client.SetProject("5df5acd0d48c2") // Your project ID + client.SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + + var service := appwrite.Functions{ + client: &client + } + + var response, error := service.Update("[FUNCTION_ID]", "[NAME]", , [], "", 0) + + if error != nil { + panic(error) + } + + fmt.Println(response) +} \ No newline at end of file diff --git a/app/sdks/server-go/functions.go b/app/sdks/server-go/functions.go new file mode 100644 index 0000000000..3f82eb1fb2 --- /dev/null +++ b/app/sdks/server-go/functions.go @@ -0,0 +1,186 @@ +package appwrite + +import ( + "strings" +) + +// Functions service +type Functions struct { + client Client +} + +func NewFunctions(clt Client) Functions { + service := Functions{ + client: clt, + } + + return service +} + +// List +func (srv *Functions) List(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error) { + path := "/functions" + + params := map[string]interface{}{ + "search": Search, + "limit": Limit, + "offset": Offset, + "orderType": OrderType, + } + + return srv.client.Call("GET", path, nil, params) +} + +// Create +func (srv *Functions) Create(Name string, Vars object, Events []interface{}, Schedule string, Timeout int) (map[string]interface{}, error) { + path := "/functions" + + params := map[string]interface{}{ + "name": Name, + "vars": Vars, + "events": Events, + "schedule": Schedule, + "timeout": Timeout, + } + + return srv.client.Call("POST", path, nil, params) +} + +// Get +func (srv *Functions) Get(FunctionId string) (map[string]interface{}, error) { + r := strings.NewReplacer("{functionId}", FunctionId) + path := r.Replace("/functions/{functionId}") + + params := map[string]interface{}{ + } + + return srv.client.Call("GET", path, nil, params) +} + +// Update +func (srv *Functions) Update(FunctionId string, Name string, Vars object, Events []interface{}, Schedule string, Timeout int) (map[string]interface{}, error) { + r := strings.NewReplacer("{functionId}", FunctionId) + path := r.Replace("/functions/{functionId}") + + params := map[string]interface{}{ + "name": Name, + "vars": Vars, + "events": Events, + "schedule": Schedule, + "timeout": Timeout, + } + + return srv.client.Call("PUT", path, nil, params) +} + +// Delete +func (srv *Functions) Delete(FunctionId string) (map[string]interface{}, error) { + r := strings.NewReplacer("{functionId}", FunctionId) + path := r.Replace("/functions/{functionId}") + + params := map[string]interface{}{ + } + + return srv.client.Call("DELETE", path, nil, params) +} + +// ListExecutions +func (srv *Functions) ListExecutions(FunctionId string, Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error) { + r := strings.NewReplacer("{functionId}", FunctionId) + path := r.Replace("/functions/{functionId}/executions") + + params := map[string]interface{}{ + "search": Search, + "limit": Limit, + "offset": Offset, + "orderType": OrderType, + } + + return srv.client.Call("GET", path, nil, params) +} + +// CreateExecution +func (srv *Functions) CreateExecution(FunctionId string, Async int) (map[string]interface{}, error) { + r := strings.NewReplacer("{functionId}", FunctionId) + path := r.Replace("/functions/{functionId}/executions") + + params := map[string]interface{}{ + "async": Async, + } + + return srv.client.Call("POST", path, nil, params) +} + +// GetExecution +func (srv *Functions) GetExecution(FunctionId string, ExecutionId string) (map[string]interface{}, error) { + r := strings.NewReplacer("{functionId}", FunctionId, "{executionId}", ExecutionId) + path := r.Replace("/functions/{functionId}/executions/{executionId}") + + params := map[string]interface{}{ + } + + return srv.client.Call("GET", path, nil, params) +} + +// UpdateTag +func (srv *Functions) UpdateTag(FunctionId string, Tag string) (map[string]interface{}, error) { + r := strings.NewReplacer("{functionId}", FunctionId) + path := r.Replace("/functions/{functionId}/tag") + + params := map[string]interface{}{ + "tag": Tag, + } + + return srv.client.Call("PATCH", path, nil, params) +} + +// ListTags +func (srv *Functions) ListTags(FunctionId string, Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error) { + r := strings.NewReplacer("{functionId}", FunctionId) + path := r.Replace("/functions/{functionId}/tags") + + params := map[string]interface{}{ + "search": Search, + "limit": Limit, + "offset": Offset, + "orderType": OrderType, + } + + return srv.client.Call("GET", path, nil, params) +} + +// CreateTag +func (srv *Functions) CreateTag(FunctionId string, Env string, Command string, Code string) (map[string]interface{}, error) { + r := strings.NewReplacer("{functionId}", FunctionId) + path := r.Replace("/functions/{functionId}/tags") + + params := map[string]interface{}{ + "env": Env, + "command": Command, + "code": Code, + } + + return srv.client.Call("POST", path, nil, params) +} + +// GetTag +func (srv *Functions) GetTag(FunctionId string, TagId string) (map[string]interface{}, error) { + r := strings.NewReplacer("{functionId}", FunctionId, "{tagId}", TagId) + path := r.Replace("/functions/{functionId}/tags/{tagId}") + + params := map[string]interface{}{ + } + + return srv.client.Call("GET", path, nil, params) +} + +// DeleteTag +func (srv *Functions) DeleteTag(FunctionId string, TagId string) (map[string]interface{}, error) { + r := strings.NewReplacer("{functionId}", FunctionId, "{tagId}", TagId) + path := r.Replace("/functions/{functionId}/tags/{tagId}") + + params := map[string]interface{}{ + } + + return srv.client.Call("DELETE", path, nil, params) +} diff --git a/app/sdks/server-java/src/main/java/services/Functions.java b/app/sdks/server-java/src/main/java/services/Functions.java new file mode 100644 index 0000000000..a04ad1b5a9 --- /dev/null +++ b/app/sdks/server-java/src/main/java/services/Functions.java @@ -0,0 +1,255 @@ +package .services; + + + +import okhttp3.Call; +import .Client; +import .enums.OrderType; + +import java.io.File; +import java.util.List; +import java.util.HashMap; +import java.util.Map; + +import static java.util.Map.entry; + +public class Functions extends Service { + public Functions(Client client){ + super(client); + } + + /// List Functions + public Call list(String search, int limit, int offset, OrderType orderType) { + final String path = "/functions"; + + final Map params = Map.ofEntries( + entry("search", search), + entry("limit", limit), + entry("offset", offset), + entry("orderType", orderType.name()) + ); + + + + final Map headers = Map.ofEntries( + entry("content-type", "application/json") + ); + + return client.call("GET", path, headers, params); + } + + /// Create Function + public Call create(String name, Object vars, List events, String schedule, int timeout) { + final String path = "/functions"; + + final Map params = Map.ofEntries( + entry("name", name), + entry("vars", vars), + entry("events", events), + entry("schedule", schedule), + entry("timeout", timeout) + ); + + + + final Map headers = Map.ofEntries( + entry("content-type", "application/json") + ); + + return client.call("POST", path, headers, params); + } + + /// Get Function + public Call get(String functionId) { + final String path = "/functions/{functionId}".replace("{functionId}", functionId); + + final Map params = Map.ofEntries( + ); + + + + final Map headers = Map.ofEntries( + entry("content-type", "application/json") + ); + + return client.call("GET", path, headers, params); + } + + /// Update Function + public Call update(String functionId, String name, Object vars, List events, String schedule, int timeout) { + final String path = "/functions/{functionId}".replace("{functionId}", functionId); + + final Map params = Map.ofEntries( + entry("name", name), + entry("vars", vars), + entry("events", events), + entry("schedule", schedule), + entry("timeout", timeout) + ); + + + + final Map headers = Map.ofEntries( + entry("content-type", "application/json") + ); + + return client.call("PUT", path, headers, params); + } + + /// Delete Function + public Call delete(String functionId) { + final String path = "/functions/{functionId}".replace("{functionId}", functionId); + + final Map params = Map.ofEntries( + ); + + + + final Map headers = Map.ofEntries( + entry("content-type", "application/json") + ); + + return client.call("DELETE", path, headers, params); + } + + /// List Executions + public Call listExecutions(String functionId, String search, int limit, int offset, OrderType orderType) { + final String path = "/functions/{functionId}/executions".replace("{functionId}", functionId); + + final Map params = Map.ofEntries( + entry("search", search), + entry("limit", limit), + entry("offset", offset), + entry("orderType", orderType.name()) + ); + + + + final Map headers = Map.ofEntries( + entry("content-type", "application/json") + ); + + return client.call("GET", path, headers, params); + } + + /// Create Execution + public Call createExecution(String functionId, int async) { + final String path = "/functions/{functionId}/executions".replace("{functionId}", functionId); + + final Map params = Map.ofEntries( + entry("async", async) + ); + + + + final Map headers = Map.ofEntries( + entry("content-type", "application/json") + ); + + return client.call("POST", path, headers, params); + } + + /// Get Execution + public Call getExecution(String functionId, String executionId) { + final String path = "/functions/{functionId}/executions/{executionId}".replace("{functionId}", functionId).replace("{executionId}", executionId); + + final Map params = Map.ofEntries( + ); + + + + final Map headers = Map.ofEntries( + entry("content-type", "application/json") + ); + + return client.call("GET", path, headers, params); + } + + /// Update Function Tag + public Call updateTag(String functionId, String tag) { + final String path = "/functions/{functionId}/tag".replace("{functionId}", functionId); + + final Map params = Map.ofEntries( + entry("tag", tag) + ); + + + + final Map headers = Map.ofEntries( + entry("content-type", "application/json") + ); + + return client.call("PATCH", path, headers, params); + } + + /// List Tags + public Call listTags(String functionId, String search, int limit, int offset, OrderType orderType) { + final String path = "/functions/{functionId}/tags".replace("{functionId}", functionId); + + final Map params = Map.ofEntries( + entry("search", search), + entry("limit", limit), + entry("offset", offset), + entry("orderType", orderType.name()) + ); + + + + final Map headers = Map.ofEntries( + entry("content-type", "application/json") + ); + + return client.call("GET", path, headers, params); + } + + /// Create Tag + public Call createTag(String functionId, String env, String command, String code) { + final String path = "/functions/{functionId}/tags".replace("{functionId}", functionId); + + final Map params = Map.ofEntries( + entry("env", env), + entry("command", command), + entry("code", code) + ); + + + + final Map headers = Map.ofEntries( + entry("content-type", "application/json") + ); + + return client.call("POST", path, headers, params); + } + + /// Get Tag + public Call getTag(String functionId, String tagId) { + final String path = "/functions/{functionId}/tags/{tagId}".replace("{functionId}", functionId).replace("{tagId}", tagId); + + final Map params = Map.ofEntries( + ); + + + + final Map headers = Map.ofEntries( + entry("content-type", "application/json") + ); + + return client.call("GET", path, headers, params); + } + + /// Delete Tag + public Call deleteTag(String functionId, String tagId) { + final String path = "/functions/{functionId}/tags/{tagId}".replace("{functionId}", functionId).replace("{tagId}", tagId); + + final Map params = Map.ofEntries( + ); + + + + final Map headers = Map.ofEntries( + entry("content-type", "application/json") + ); + + return client.call("DELETE", path, headers, params); + } +} \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/functions/create-execution.md b/app/sdks/server-nodejs/docs/examples/functions/create-execution.md new file mode 100644 index 0000000000..9ed33ae50b --- /dev/null +++ b/app/sdks/server-nodejs/docs/examples/functions/create-execution.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.createExecution('[FUNCTION_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/functions/create-tag.md b/app/sdks/server-nodejs/docs/examples/functions/create-tag.md new file mode 100644 index 0000000000..5048701d05 --- /dev/null +++ b/app/sdks/server-nodejs/docs/examples/functions/create-tag.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.createTag('[FUNCTION_ID]', 'node-14', '[COMMAND]', '[CODE]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/functions/create.md b/app/sdks/server-nodejs/docs/examples/functions/create.md new file mode 100644 index 0000000000..3ac02eb506 --- /dev/null +++ b/app/sdks/server-nodejs/docs/examples/functions/create.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.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-nodejs/docs/examples/functions/delete-tag.md b/app/sdks/server-nodejs/docs/examples/functions/delete-tag.md new file mode 100644 index 0000000000..fc2fe8a53b --- /dev/null +++ b/app/sdks/server-nodejs/docs/examples/functions/delete-tag.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.deleteTag('[FUNCTION_ID]', '[TAG_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/functions/delete.md b/app/sdks/server-nodejs/docs/examples/functions/delete.md new file mode 100644 index 0000000000..048c96d99c --- /dev/null +++ b/app/sdks/server-nodejs/docs/examples/functions/delete.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.delete('[FUNCTION_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/functions/get-execution.md b/app/sdks/server-nodejs/docs/examples/functions/get-execution.md new file mode 100644 index 0000000000..482f7ee713 --- /dev/null +++ b/app/sdks/server-nodejs/docs/examples/functions/get-execution.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.getExecution('[FUNCTION_ID]', '[EXECUTION_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/functions/get-tag.md b/app/sdks/server-nodejs/docs/examples/functions/get-tag.md new file mode 100644 index 0000000000..5caa2134b6 --- /dev/null +++ b/app/sdks/server-nodejs/docs/examples/functions/get-tag.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.getTag('[FUNCTION_ID]', '[TAG_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/functions/get.md b/app/sdks/server-nodejs/docs/examples/functions/get.md new file mode 100644 index 0000000000..cfc2d0fae2 --- /dev/null +++ b/app/sdks/server-nodejs/docs/examples/functions/get.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.get('[FUNCTION_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/functions/list-executions.md b/app/sdks/server-nodejs/docs/examples/functions/list-executions.md new file mode 100644 index 0000000000..ceecf677a6 --- /dev/null +++ b/app/sdks/server-nodejs/docs/examples/functions/list-executions.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.listExecutions('[FUNCTION_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/functions/list-tags.md b/app/sdks/server-nodejs/docs/examples/functions/list-tags.md new file mode 100644 index 0000000000..147d65afe2 --- /dev/null +++ b/app/sdks/server-nodejs/docs/examples/functions/list-tags.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.listTags('[FUNCTION_ID]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/functions/list.md b/app/sdks/server-nodejs/docs/examples/functions/list.md new file mode 100644 index 0000000000..3cb999c51b --- /dev/null +++ b/app/sdks/server-nodejs/docs/examples/functions/list.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.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-nodejs/docs/examples/functions/update-active.md b/app/sdks/server-nodejs/docs/examples/functions/update-active.md new file mode 100644 index 0000000000..1c2f0da2e2 --- /dev/null +++ b/app/sdks/server-nodejs/docs/examples/functions/update-active.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.updateActive('[FUNCTION_ID]', '[ACTIVE]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/functions/update-tag.md b/app/sdks/server-nodejs/docs/examples/functions/update-tag.md new file mode 100644 index 0000000000..8b9baefaf0 --- /dev/null +++ b/app/sdks/server-nodejs/docs/examples/functions/update-tag.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.updateTag('[FUNCTION_ID]', '[TAG]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/docs/examples/functions/update.md b/app/sdks/server-nodejs/docs/examples/functions/update.md new file mode 100644 index 0000000000..73672ae162 --- /dev/null +++ b/app/sdks/server-nodejs/docs/examples/functions/update.md @@ -0,0 +1,19 @@ +const sdk = require('node-appwrite'); + +// Init SDK +let client = new sdk.Client(); + +let functions = new sdk.Functions(client); + +client + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +let promise = functions.update('[FUNCTION_ID]', '[NAME]'); + +promise.then(function (response) { + console.log(response); +}, function (error) { + console.log(error); +}); \ No newline at end of file diff --git a/app/sdks/server-nodejs/index.js b/app/sdks/server-nodejs/index.js index f5259f59dc..deb571190d 100644 --- a/app/sdks/server-nodejs/index.js +++ b/app/sdks/server-nodejs/index.js @@ -1,6 +1,7 @@ const Client = require('./lib/client.js'); const Avatars = require('./lib/services/avatars.js'); const Database = require('./lib/services/database.js'); +const Functions = require('./lib/services/functions.js'); const Health = require('./lib/services/health.js'); const Locale = require('./lib/services/locale.js'); const Storage = require('./lib/services/storage.js'); @@ -11,6 +12,7 @@ module.exports = { Client, Avatars, Database, + Functions, Health, Locale, Storage, diff --git a/app/sdks/server-nodejs/lib/services/functions.js b/app/sdks/server-nodejs/lib/services/functions.js new file mode 100644 index 0000000000..0dfd8d945d --- /dev/null +++ b/app/sdks/server-nodejs/lib/services/functions.js @@ -0,0 +1,282 @@ +const Service = require('../service.js'); + +class Functions extends Service { + + /** + * List Functions + * + * @param string search + * @param number limit + * @param number offset + * @param string orderType + * @throws Exception + * @return {} + */ + async list(search = '', limit = 25, offset = 0, orderType = 'ASC') { + let path = '/functions'; + + return await this.client.call('get', path, { + 'content-type': 'application/json', + }, + { + 'search': search, + 'limit': limit, + 'offset': offset, + 'orderType': orderType + }); + } + + /** + * Create Function + * + * @param string name + * @param object vars + * @param string[] events + * @param string schedule + * @param number timeout + * @throws Exception + * @return {} + */ + async create(name, vars = [], events = [], schedule = '', timeout = 15) { + let path = '/functions'; + + return await this.client.call('post', path, { + 'content-type': 'application/json', + }, + { + 'name': name, + 'vars': vars, + 'events': events, + 'schedule': schedule, + 'timeout': timeout + }); + } + + /** + * Get Function + * + * @param string functionId + * @throws Exception + * @return {} + */ + async get(functionId) { + let path = '/functions/{functionId}'.replace(new RegExp('{functionId}', 'g'), functionId); + + return await this.client.call('get', path, { + 'content-type': 'application/json', + }, + { + }); + } + + /** + * Update Function + * + * @param string functionId + * @param string name + * @param object vars + * @param string[] events + * @param string schedule + * @param number timeout + * @throws Exception + * @return {} + */ + async update(functionId, name, vars = [], events = [], schedule = '', timeout = 15) { + let path = '/functions/{functionId}'.replace(new RegExp('{functionId}', 'g'), functionId); + + return await this.client.call('put', path, { + 'content-type': 'application/json', + }, + { + 'name': name, + 'vars': vars, + 'events': events, + 'schedule': schedule, + 'timeout': timeout + }); + } + + /** + * Delete Function + * + * @param string functionId + * @throws Exception + * @return {} + */ + async delete(functionId) { + let path = '/functions/{functionId}'.replace(new RegExp('{functionId}', 'g'), functionId); + + return await this.client.call('delete', path, { + 'content-type': 'application/json', + }, + { + }); + } + + /** + * List Executions + * + * @param string functionId + * @param string search + * @param number limit + * @param number offset + * @param string orderType + * @throws Exception + * @return {} + */ + async listExecutions(functionId, search = '', limit = 25, offset = 0, orderType = 'ASC') { + let path = '/functions/{functionId}/executions'.replace(new RegExp('{functionId}', 'g'), functionId); + + return await this.client.call('get', path, { + 'content-type': 'application/json', + }, + { + 'search': search, + 'limit': limit, + 'offset': offset, + 'orderType': orderType + }); + } + + /** + * Create Execution + * + * @param string functionId + * @param number async + * @throws Exception + * @return {} + */ + async createExecution(functionId, async = 1) { + let path = '/functions/{functionId}/executions'.replace(new RegExp('{functionId}', 'g'), functionId); + + return await this.client.call('post', path, { + 'content-type': 'application/json', + }, + { + 'async': async + }); + } + + /** + * Get Execution + * + * @param string functionId + * @param string executionId + * @throws Exception + * @return {} + */ + async getExecution(functionId, executionId) { + let path = '/functions/{functionId}/executions/{executionId}'.replace(new RegExp('{functionId}', 'g'), functionId).replace(new RegExp('{executionId}', 'g'), executionId); + + return await this.client.call('get', path, { + 'content-type': 'application/json', + }, + { + }); + } + + /** + * Update Function Tag + * + * @param string functionId + * @param string tag + * @throws Exception + * @return {} + */ + async updateTag(functionId, tag) { + let path = '/functions/{functionId}/tag'.replace(new RegExp('{functionId}', 'g'), functionId); + + return await this.client.call('patch', path, { + 'content-type': 'application/json', + }, + { + 'tag': tag + }); + } + + /** + * List Tags + * + * @param string functionId + * @param string search + * @param number limit + * @param number offset + * @param string orderType + * @throws Exception + * @return {} + */ + async listTags(functionId, search = '', limit = 25, offset = 0, orderType = 'ASC') { + let path = '/functions/{functionId}/tags'.replace(new RegExp('{functionId}', 'g'), functionId); + + return await this.client.call('get', path, { + 'content-type': 'application/json', + }, + { + 'search': search, + 'limit': limit, + 'offset': offset, + 'orderType': orderType + }); + } + + /** + * Create Tag + * + * @param string functionId + * @param string env + * @param string command + * @param string code + * @throws Exception + * @return {} + */ + async createTag(functionId, env, command, code) { + let path = '/functions/{functionId}/tags'.replace(new RegExp('{functionId}', 'g'), functionId); + + return await this.client.call('post', path, { + 'content-type': 'application/json', + }, + { + 'env': env, + 'command': command, + 'code': code + }); + } + + /** + * Get Tag + * + * @param string functionId + * @param string tagId + * @throws Exception + * @return {} + */ + async getTag(functionId, tagId) { + let path = '/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}', 'g'), functionId).replace(new RegExp('{tagId}', 'g'), tagId); + + return await this.client.call('get', path, { + 'content-type': 'application/json', + }, + { + }); + } + + /** + * Delete Tag + * + * @param string functionId + * @param string tagId + * @throws Exception + * @return {} + */ + async deleteTag(functionId, tagId) { + let path = '/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}', 'g'), functionId).replace(new RegExp('{tagId}', 'g'), tagId); + + return await this.client.call('delete', path, { + 'content-type': 'application/json', + }, + { + }); + } +} + +module.exports = Functions; \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/functions/create-execution.md b/app/sdks/server-php/docs/examples/functions/create-execution.md new file mode 100644 index 0000000000..ca232c8771 --- /dev/null +++ b/app/sdks/server-php/docs/examples/functions/create-execution.md @@ -0,0 +1,15 @@ +setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$functions = new Functions($client); + +$result = $functions->createExecution('[FUNCTION_ID]'); \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/functions/create-tag.md b/app/sdks/server-php/docs/examples/functions/create-tag.md new file mode 100644 index 0000000000..cc4ff73e90 --- /dev/null +++ b/app/sdks/server-php/docs/examples/functions/create-tag.md @@ -0,0 +1,15 @@ +setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$functions = new Functions($client); + +$result = $functions->createTag('[FUNCTION_ID]', 'node-14', '[COMMAND]', '[CODE]'); \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/functions/create.md b/app/sdks/server-php/docs/examples/functions/create.md new file mode 100644 index 0000000000..7ec5dc2831 --- /dev/null +++ b/app/sdks/server-php/docs/examples/functions/create.md @@ -0,0 +1,15 @@ +setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$functions = new Functions($client); + +$result = $functions->create('[NAME]'); \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/functions/delete-tag.md b/app/sdks/server-php/docs/examples/functions/delete-tag.md new file mode 100644 index 0000000000..681c9c3aa7 --- /dev/null +++ b/app/sdks/server-php/docs/examples/functions/delete-tag.md @@ -0,0 +1,15 @@ +setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$functions = new Functions($client); + +$result = $functions->deleteTag('[FUNCTION_ID]', '[TAG_ID]'); \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/functions/delete.md b/app/sdks/server-php/docs/examples/functions/delete.md new file mode 100644 index 0000000000..12476f1d6a --- /dev/null +++ b/app/sdks/server-php/docs/examples/functions/delete.md @@ -0,0 +1,15 @@ +setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$functions = new Functions($client); + +$result = $functions->delete('[FUNCTION_ID]'); \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/functions/get-execution.md b/app/sdks/server-php/docs/examples/functions/get-execution.md new file mode 100644 index 0000000000..774c7ecc3f --- /dev/null +++ b/app/sdks/server-php/docs/examples/functions/get-execution.md @@ -0,0 +1,15 @@ +setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$functions = new Functions($client); + +$result = $functions->getExecution('[FUNCTION_ID]', '[EXECUTION_ID]'); \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/functions/get-tag.md b/app/sdks/server-php/docs/examples/functions/get-tag.md new file mode 100644 index 0000000000..b1c2f23dcf --- /dev/null +++ b/app/sdks/server-php/docs/examples/functions/get-tag.md @@ -0,0 +1,15 @@ +setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$functions = new Functions($client); + +$result = $functions->getTag('[FUNCTION_ID]', '[TAG_ID]'); \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/functions/get.md b/app/sdks/server-php/docs/examples/functions/get.md new file mode 100644 index 0000000000..0b6b438c65 --- /dev/null +++ b/app/sdks/server-php/docs/examples/functions/get.md @@ -0,0 +1,15 @@ +setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$functions = new Functions($client); + +$result = $functions->get('[FUNCTION_ID]'); \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/functions/list-executions.md b/app/sdks/server-php/docs/examples/functions/list-executions.md new file mode 100644 index 0000000000..a0403c653d --- /dev/null +++ b/app/sdks/server-php/docs/examples/functions/list-executions.md @@ -0,0 +1,15 @@ +setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$functions = new Functions($client); + +$result = $functions->listExecutions('[FUNCTION_ID]'); \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/functions/list-tags.md b/app/sdks/server-php/docs/examples/functions/list-tags.md new file mode 100644 index 0000000000..3c2e6b6e87 --- /dev/null +++ b/app/sdks/server-php/docs/examples/functions/list-tags.md @@ -0,0 +1,15 @@ +setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$functions = new Functions($client); + +$result = $functions->listTags('[FUNCTION_ID]'); \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/functions/list.md b/app/sdks/server-php/docs/examples/functions/list.md new file mode 100644 index 0000000000..bfbfde406f --- /dev/null +++ b/app/sdks/server-php/docs/examples/functions/list.md @@ -0,0 +1,15 @@ +setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$functions = new Functions($client); + +$result = $functions->list(); \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/functions/update-active.md b/app/sdks/server-php/docs/examples/functions/update-active.md new file mode 100644 index 0000000000..18b7316f3b --- /dev/null +++ b/app/sdks/server-php/docs/examples/functions/update-active.md @@ -0,0 +1,15 @@ +setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$functions = new Functions($client); + +$result = $functions->updateActive('[FUNCTION_ID]', '[ACTIVE]'); \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/functions/update-tag.md b/app/sdks/server-php/docs/examples/functions/update-tag.md new file mode 100644 index 0000000000..68099d8fbb --- /dev/null +++ b/app/sdks/server-php/docs/examples/functions/update-tag.md @@ -0,0 +1,15 @@ +setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$functions = new Functions($client); + +$result = $functions->updateTag('[FUNCTION_ID]', '[TAG]'); \ No newline at end of file diff --git a/app/sdks/server-php/docs/examples/functions/update.md b/app/sdks/server-php/docs/examples/functions/update.md new file mode 100644 index 0000000000..34315a129a --- /dev/null +++ b/app/sdks/server-php/docs/examples/functions/update.md @@ -0,0 +1,15 @@ +setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key +; + +$functions = new Functions($client); + +$result = $functions->update('[FUNCTION_ID]', '[NAME]'); \ No newline at end of file diff --git a/app/sdks/server-php/docs/functions.md b/app/sdks/server-php/docs/functions.md new file mode 100644 index 0000000000..39e28d55b8 --- /dev/null +++ b/app/sdks/server-php/docs/functions.md @@ -0,0 +1,186 @@ +# Functions Service + +## List Functions + +```http request +GET https://appwrite.io/v1/functions +``` + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| search | string | Search term to filter your list results. | | +| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 | +| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 | +| orderType | string | Order result by ASC or DESC order. | ASC | + +## Create Function + +```http request +POST https://appwrite.io/v1/functions +``` + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| name | string | Function name. | | +| vars | object | Key-value JSON object. | [] | +| events | array | Events list. | [] | +| schedule | string | Schedule CRON syntax. | | +| timeout | integer | Function maximum execution time in seconds. | 15 | + +## Get Function + +```http request +GET https://appwrite.io/v1/functions/{functionId} +``` + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| functionId | string | **Required** Function unique ID. | | + +## Update Function + +```http request +PUT https://appwrite.io/v1/functions/{functionId} +``` + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| functionId | string | **Required** Function unique ID. | | +| name | string | Function name. | | +| vars | object | Key-value JSON object. | [] | +| events | array | Events list. | [] | +| schedule | string | Schedule CRON syntax. | | +| timeout | integer | Function maximum execution time in seconds. | 15 | + +## Delete Function + +```http request +DELETE https://appwrite.io/v1/functions/{functionId} +``` + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| functionId | string | **Required** Function unique ID. | | + +## List Executions + +```http request +GET https://appwrite.io/v1/functions/{functionId}/executions +``` + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| functionId | string | **Required** Function unique ID. | | +| search | string | Search term to filter your list results. | | +| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 | +| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 | +| orderType | string | Order result by ASC or DESC order. | ASC | + +## Create Execution + +```http request +POST https://appwrite.io/v1/functions/{functionId}/executions +``` + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| functionId | string | **Required** Function unique ID. | | +| async | integer | Execute code asynchronously. Pass 1 for true, 0 for false. Default value is 1. | 1 | + +## Get Execution + +```http request +GET https://appwrite.io/v1/functions/{functionId}/executions/{executionId} +``` + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| functionId | string | **Required** Function unique ID. | | +| executionId | string | **Required** Execution unique ID. | | + +## Update Function Tag + +```http request +PATCH https://appwrite.io/v1/functions/{functionId}/tag +``` + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| functionId | string | **Required** Function unique ID. | | +| tag | string | Tag unique ID. | | + +## List Tags + +```http request +GET https://appwrite.io/v1/functions/{functionId}/tags +``` + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| functionId | string | **Required** Function unique ID. | | +| search | string | Search term to filter your list results. | | +| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 | +| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 | +| orderType | string | Order result by ASC or DESC order. | ASC | + +## Create Tag + +```http request +POST https://appwrite.io/v1/functions/{functionId}/tags +``` + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| functionId | string | **Required** Function unique ID. | | +| env | string | Execution enviornment. | | +| command | string | Code execution command. | | +| code | string | Code package. Use the Appwrite code packager to create a deployable package file. | | + +## Get Tag + +```http request +GET https://appwrite.io/v1/functions/{functionId}/tags/{tagId} +``` + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| functionId | string | **Required** Function unique ID. | | +| tagId | string | **Required** Tag unique ID. | | + +## Delete Tag + +```http request +DELETE https://appwrite.io/v1/functions/{functionId}/tags/{tagId} +``` + +### Parameters + +| Field Name | Type | Description | Default | +| --- | --- | --- | --- | +| functionId | string | **Required** Function unique ID. | | +| tagId | string | **Required** Tag unique ID. | | + diff --git a/app/sdks/server-php/src/Appwrite/Services/Functions.php b/app/sdks/server-php/src/Appwrite/Services/Functions.php new file mode 100644 index 0000000000..1771652072 --- /dev/null +++ b/app/sdks/server-php/src/Appwrite/Services/Functions.php @@ -0,0 +1,300 @@ +client->call(Client::METHOD_GET, $path, [ + 'content-type' => 'application/json', + ], $params); + } + + /** + * Create Function + * + * @param string $name + * @param array $vars + * @param array $events + * @param string $schedule + * @param int $timeout + * @throws Exception + * @return array + */ + public function create(string $name, array $vars = , array $events = [], string $schedule = '', int $timeout = 15):array + { + $path = str_replace([], [], '/functions'); + $params = []; + + $params['name'] = $name; + $params['vars'] = $vars; + $params['events'] = $events; + $params['schedule'] = $schedule; + $params['timeout'] = $timeout; + + return $this->client->call(Client::METHOD_POST, $path, [ + 'content-type' => 'application/json', + ], $params); + } + + /** + * Get Function + * + * @param string $functionId + * @throws Exception + * @return array + */ + public function get(string $functionId):array + { + $path = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}'); + $params = []; + + + return $this->client->call(Client::METHOD_GET, $path, [ + 'content-type' => 'application/json', + ], $params); + } + + /** + * Update Function + * + * @param string $functionId + * @param string $name + * @param array $vars + * @param array $events + * @param string $schedule + * @param int $timeout + * @throws Exception + * @return array + */ + public function update(string $functionId, string $name, array $vars = , array $events = [], string $schedule = '', int $timeout = 15):array + { + $path = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}'); + $params = []; + + $params['name'] = $name; + $params['vars'] = $vars; + $params['events'] = $events; + $params['schedule'] = $schedule; + $params['timeout'] = $timeout; + + return $this->client->call(Client::METHOD_PUT, $path, [ + 'content-type' => 'application/json', + ], $params); + } + + /** + * Delete Function + * + * @param string $functionId + * @throws Exception + * @return array + */ + public function delete(string $functionId):array + { + $path = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}'); + $params = []; + + + return $this->client->call(Client::METHOD_DELETE, $path, [ + 'content-type' => 'application/json', + ], $params); + } + + /** + * List Executions + * + * @param string $functionId + * @param string $search + * @param int $limit + * @param int $offset + * @param string $orderType + * @throws Exception + * @return array + */ + public function listExecutions(string $functionId, string $search = '', int $limit = 25, int $offset = 0, string $orderType = 'ASC'):array + { + $path = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}/executions'); + $params = []; + + $params['search'] = $search; + $params['limit'] = $limit; + $params['offset'] = $offset; + $params['orderType'] = $orderType; + + return $this->client->call(Client::METHOD_GET, $path, [ + 'content-type' => 'application/json', + ], $params); + } + + /** + * Create Execution + * + * @param string $functionId + * @param int $async + * @throws Exception + * @return array + */ + public function createExecution(string $functionId, int $async = 1):array + { + $path = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}/executions'); + $params = []; + + $params['async'] = $async; + + return $this->client->call(Client::METHOD_POST, $path, [ + 'content-type' => 'application/json', + ], $params); + } + + /** + * Get Execution + * + * @param string $functionId + * @param string $executionId + * @throws Exception + * @return array + */ + public function getExecution(string $functionId, string $executionId):array + { + $path = str_replace(['{functionId}', '{executionId}'], [$functionId, $executionId], '/functions/{functionId}/executions/{executionId}'); + $params = []; + + + return $this->client->call(Client::METHOD_GET, $path, [ + 'content-type' => 'application/json', + ], $params); + } + + /** + * Update Function Tag + * + * @param string $functionId + * @param string $tag + * @throws Exception + * @return array + */ + public function updateTag(string $functionId, string $tag):array + { + $path = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}/tag'); + $params = []; + + $params['tag'] = $tag; + + return $this->client->call(Client::METHOD_PATCH, $path, [ + 'content-type' => 'application/json', + ], $params); + } + + /** + * List Tags + * + * @param string $functionId + * @param string $search + * @param int $limit + * @param int $offset + * @param string $orderType + * @throws Exception + * @return array + */ + public function listTags(string $functionId, string $search = '', int $limit = 25, int $offset = 0, string $orderType = 'ASC'):array + { + $path = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}/tags'); + $params = []; + + $params['search'] = $search; + $params['limit'] = $limit; + $params['offset'] = $offset; + $params['orderType'] = $orderType; + + return $this->client->call(Client::METHOD_GET, $path, [ + 'content-type' => 'application/json', + ], $params); + } + + /** + * Create Tag + * + * @param string $functionId + * @param string $env + * @param string $command + * @param string $code + * @throws Exception + * @return array + */ + public function createTag(string $functionId, string $env, string $command, string $code):array + { + $path = str_replace(['{functionId}'], [$functionId], '/functions/{functionId}/tags'); + $params = []; + + $params['env'] = $env; + $params['command'] = $command; + $params['code'] = $code; + + return $this->client->call(Client::METHOD_POST, $path, [ + 'content-type' => 'application/json', + ], $params); + } + + /** + * Get Tag + * + * @param string $functionId + * @param string $tagId + * @throws Exception + * @return array + */ + public function getTag(string $functionId, string $tagId):array + { + $path = str_replace(['{functionId}', '{tagId}'], [$functionId, $tagId], '/functions/{functionId}/tags/{tagId}'); + $params = []; + + + return $this->client->call(Client::METHOD_GET, $path, [ + 'content-type' => 'application/json', + ], $params); + } + + /** + * Delete Tag + * + * @param string $functionId + * @param string $tagId + * @throws Exception + * @return array + */ + public function deleteTag(string $functionId, string $tagId):array + { + $path = str_replace(['{functionId}', '{tagId}'], [$functionId, $tagId], '/functions/{functionId}/tags/{tagId}'); + $params = []; + + + return $this->client->call(Client::METHOD_DELETE, $path, [ + 'content-type' => 'application/json', + ], $params); + } + +} \ No newline at end of file diff --git a/app/sdks/server-python/appwrite/services/functions.py b/app/sdks/server-python/appwrite/services/functions.py new file mode 100644 index 0000000000..1688f21f47 --- /dev/null +++ b/app/sdks/server-python/appwrite/services/functions.py @@ -0,0 +1,178 @@ +from ..service import Service + + +class Functions(Service): + + def __init__(self, client): + super(Functions, self).__init__(client) + + def list(self, search='', limit=25, offset=0, order_type='ASC'): + """List Functions""" + + params = {} + path = '/functions' + params['search'] = search + params['limit'] = limit + params['offset'] = offset + params['orderType'] = order_type + + return self.client.call('get', path, { + 'content-type': 'application/json', + }, params) + + def create(self, name, vars=[], events=[], schedule='', timeout=15): + """Create Function""" + + params = {} + path = '/functions' + params['name'] = name + params['vars'] = vars + params['events'] = events + params['schedule'] = schedule + params['timeout'] = timeout + + return self.client.call('post', path, { + 'content-type': 'application/json', + }, params) + + def get(self, function_id): + """Get Function""" + + params = {} + path = '/functions/{functionId}' + path = path.replace('{functionId}', function_id) + + return self.client.call('get', path, { + 'content-type': 'application/json', + }, params) + + def update(self, function_id, name, vars=[], events=[], schedule='', timeout=15): + """Update Function""" + + params = {} + path = '/functions/{functionId}' + path = path.replace('{functionId}', function_id) + params['name'] = name + params['vars'] = vars + params['events'] = events + params['schedule'] = schedule + params['timeout'] = timeout + + return self.client.call('put', path, { + 'content-type': 'application/json', + }, params) + + def delete(self, function_id): + """Delete Function""" + + params = {} + path = '/functions/{functionId}' + path = path.replace('{functionId}', function_id) + + return self.client.call('delete', path, { + 'content-type': 'application/json', + }, params) + + def list_executions(self, function_id, search='', limit=25, offset=0, order_type='ASC'): + """List Executions""" + + params = {} + path = '/functions/{functionId}/executions' + path = path.replace('{functionId}', function_id) + params['search'] = search + params['limit'] = limit + params['offset'] = offset + params['orderType'] = order_type + + return self.client.call('get', path, { + 'content-type': 'application/json', + }, params) + + def create_execution(self, function_id, async=1): + """Create Execution""" + + params = {} + path = '/functions/{functionId}/executions' + path = path.replace('{functionId}', function_id) + params['async'] = async + + return self.client.call('post', path, { + 'content-type': 'application/json', + }, params) + + def get_execution(self, function_id, execution_id): + """Get Execution""" + + params = {} + path = '/functions/{functionId}/executions/{executionId}' + path = path.replace('{functionId}', function_id) + path = path.replace('{executionId}', execution_id) + + return self.client.call('get', path, { + 'content-type': 'application/json', + }, params) + + def update_tag(self, function_id, tag): + """Update Function Tag""" + + params = {} + path = '/functions/{functionId}/tag' + path = path.replace('{functionId}', function_id) + params['tag'] = tag + + return self.client.call('patch', path, { + 'content-type': 'application/json', + }, params) + + def list_tags(self, function_id, search='', limit=25, offset=0, order_type='ASC'): + """List Tags""" + + params = {} + path = '/functions/{functionId}/tags' + path = path.replace('{functionId}', function_id) + params['search'] = search + params['limit'] = limit + params['offset'] = offset + params['orderType'] = order_type + + return self.client.call('get', path, { + 'content-type': 'application/json', + }, params) + + def create_tag(self, function_id, env, command, code): + """Create Tag""" + + params = {} + path = '/functions/{functionId}/tags' + path = path.replace('{functionId}', function_id) + params['env'] = env + params['command'] = command + params['code'] = code + + return self.client.call('post', path, { + 'content-type': 'application/json', + }, params) + + def get_tag(self, function_id, tag_id): + """Get Tag""" + + params = {} + path = '/functions/{functionId}/tags/{tagId}' + path = path.replace('{functionId}', function_id) + path = path.replace('{tagId}', tag_id) + + return self.client.call('get', path, { + 'content-type': 'application/json', + }, params) + + def delete_tag(self, function_id, tag_id): + """Delete Tag""" + + params = {} + path = '/functions/{functionId}/tags/{tagId}' + path = path.replace('{functionId}', function_id) + path = path.replace('{tagId}', tag_id) + + return self.client.call('delete', path, { + 'content-type': 'application/json', + }, params) diff --git a/app/sdks/server-python/docs/examples/functions/create-execution.md b/app/sdks/server-python/docs/examples/functions/create-execution.md new file mode 100644 index 0000000000..aa8e955751 --- /dev/null +++ b/app/sdks/server-python/docs/examples/functions/create-execution.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() + +(client + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +functions = Functions(client) + +result = functions.create_execution('[FUNCTION_ID]') diff --git a/app/sdks/server-python/docs/examples/functions/create-tag.md b/app/sdks/server-python/docs/examples/functions/create-tag.md new file mode 100644 index 0000000000..533f3095c3 --- /dev/null +++ b/app/sdks/server-python/docs/examples/functions/create-tag.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() + +(client + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +functions = Functions(client) + +result = functions.create_tag('[FUNCTION_ID]', 'node-14', '[COMMAND]', '[CODE]') diff --git a/app/sdks/server-python/docs/examples/functions/create.md b/app/sdks/server-python/docs/examples/functions/create.md new file mode 100644 index 0000000000..2b63ea7191 --- /dev/null +++ b/app/sdks/server-python/docs/examples/functions/create.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() + +(client + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +functions = Functions(client) + +result = functions.create('[NAME]') diff --git a/app/sdks/server-python/docs/examples/functions/delete-tag.md b/app/sdks/server-python/docs/examples/functions/delete-tag.md new file mode 100644 index 0000000000..554817cf5e --- /dev/null +++ b/app/sdks/server-python/docs/examples/functions/delete-tag.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() + +(client + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +functions = Functions(client) + +result = functions.delete_tag('[FUNCTION_ID]', '[TAG_ID]') diff --git a/app/sdks/server-python/docs/examples/functions/delete.md b/app/sdks/server-python/docs/examples/functions/delete.md new file mode 100644 index 0000000000..9c1575c1e8 --- /dev/null +++ b/app/sdks/server-python/docs/examples/functions/delete.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() + +(client + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +functions = Functions(client) + +result = functions.delete('[FUNCTION_ID]') diff --git a/app/sdks/server-python/docs/examples/functions/get-execution.md b/app/sdks/server-python/docs/examples/functions/get-execution.md new file mode 100644 index 0000000000..b979241983 --- /dev/null +++ b/app/sdks/server-python/docs/examples/functions/get-execution.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() + +(client + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +functions = Functions(client) + +result = functions.get_execution('[FUNCTION_ID]', '[EXECUTION_ID]') diff --git a/app/sdks/server-python/docs/examples/functions/get-tag.md b/app/sdks/server-python/docs/examples/functions/get-tag.md new file mode 100644 index 0000000000..b5c3f23059 --- /dev/null +++ b/app/sdks/server-python/docs/examples/functions/get-tag.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() + +(client + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +functions = Functions(client) + +result = functions.get_tag('[FUNCTION_ID]', '[TAG_ID]') diff --git a/app/sdks/server-python/docs/examples/functions/get.md b/app/sdks/server-python/docs/examples/functions/get.md new file mode 100644 index 0000000000..0e4036db4d --- /dev/null +++ b/app/sdks/server-python/docs/examples/functions/get.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() + +(client + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +functions = Functions(client) + +result = functions.get('[FUNCTION_ID]') diff --git a/app/sdks/server-python/docs/examples/functions/list-executions.md b/app/sdks/server-python/docs/examples/functions/list-executions.md new file mode 100644 index 0000000000..75f5260b46 --- /dev/null +++ b/app/sdks/server-python/docs/examples/functions/list-executions.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() + +(client + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +functions = Functions(client) + +result = functions.list_executions('[FUNCTION_ID]') diff --git a/app/sdks/server-python/docs/examples/functions/list-tags.md b/app/sdks/server-python/docs/examples/functions/list-tags.md new file mode 100644 index 0000000000..a992416640 --- /dev/null +++ b/app/sdks/server-python/docs/examples/functions/list-tags.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() + +(client + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +functions = Functions(client) + +result = functions.list_tags('[FUNCTION_ID]') diff --git a/app/sdks/server-python/docs/examples/functions/list.md b/app/sdks/server-python/docs/examples/functions/list.md new file mode 100644 index 0000000000..a2b1e7d3db --- /dev/null +++ b/app/sdks/server-python/docs/examples/functions/list.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() + +(client + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +functions = Functions(client) + +result = functions.list() diff --git a/app/sdks/server-python/docs/examples/functions/update-active.md b/app/sdks/server-python/docs/examples/functions/update-active.md new file mode 100644 index 0000000000..72f8314055 --- /dev/null +++ b/app/sdks/server-python/docs/examples/functions/update-active.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() + +(client + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +functions = Functions(client) + +result = functions.update_active('[FUNCTION_ID]', '[ACTIVE]') diff --git a/app/sdks/server-python/docs/examples/functions/update-tag.md b/app/sdks/server-python/docs/examples/functions/update-tag.md new file mode 100644 index 0000000000..4ab93d1b6a --- /dev/null +++ b/app/sdks/server-python/docs/examples/functions/update-tag.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() + +(client + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +functions = Functions(client) + +result = functions.update_tag('[FUNCTION_ID]', '[TAG]') diff --git a/app/sdks/server-python/docs/examples/functions/update.md b/app/sdks/server-python/docs/examples/functions/update.md new file mode 100644 index 0000000000..751a5d2538 --- /dev/null +++ b/app/sdks/server-python/docs/examples/functions/update.md @@ -0,0 +1,13 @@ +from appwrite.client import Client +from appwrite.services.functions import Functions + +client = Client() + +(client + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key +) + +functions = Functions(client) + +result = functions.update('[FUNCTION_ID]', '[NAME]') diff --git a/app/sdks/server-ruby/lib/appwrite.rb b/app/sdks/server-ruby/lib/appwrite.rb index 8e88842789..1b4f38bea2 100644 --- a/app/sdks/server-ruby/lib/appwrite.rb +++ b/app/sdks/server-ruby/lib/appwrite.rb @@ -5,6 +5,7 @@ require_relative 'appwrite/client' require_relative 'appwrite/service' require_relative 'appwrite/services/avatars' require_relative 'appwrite/services/database' +require_relative 'appwrite/services/functions' require_relative 'appwrite/services/health' require_relative 'appwrite/services/locale' require_relative 'appwrite/services/storage' diff --git a/app/sdks/server-ruby/lib/appwrite/services/functions.rb b/app/sdks/server-ruby/lib/appwrite/services/functions.rb new file mode 100644 index 0000000000..e6fb0c5f12 --- /dev/null +++ b/app/sdks/server-ruby/lib/appwrite/services/functions.rb @@ -0,0 +1,193 @@ +module Appwrite + class Functions < Service + + def list(search: '', limit: 25, offset: 0, order_type: 'ASC') + path = '/functions' + + params = { + 'search': search, + 'limit': limit, + 'offset': offset, + 'orderType': order_type + } + + return @client.call('get', path, { + 'content-type' => 'application/json', + }, params); + end + + def create(name:, vars: [], events: [], schedule: '', timeout: 15) + path = '/functions' + + params = { + 'name': name, + 'vars': vars, + 'events': events, + 'schedule': schedule, + 'timeout': timeout + } + + return @client.call('post', path, { + 'content-type' => 'application/json', + }, params); + end + + def get(function_id:) + path = '/functions/{functionId}' + .gsub('{function_id}', function_id) + + params = { + } + + return @client.call('get', path, { + 'content-type' => 'application/json', + }, params); + end + + def update(function_id:, name:, vars: [], events: [], schedule: '', timeout: 15) + path = '/functions/{functionId}' + .gsub('{function_id}', function_id) + + params = { + 'name': name, + 'vars': vars, + 'events': events, + 'schedule': schedule, + 'timeout': timeout + } + + return @client.call('put', path, { + 'content-type' => 'application/json', + }, params); + end + + def delete(function_id:) + path = '/functions/{functionId}' + .gsub('{function_id}', function_id) + + params = { + } + + return @client.call('delete', path, { + 'content-type' => 'application/json', + }, params); + end + + def list_executions(function_id:, search: '', limit: 25, offset: 0, order_type: 'ASC') + path = '/functions/{functionId}/executions' + .gsub('{function_id}', function_id) + + params = { + 'search': search, + 'limit': limit, + 'offset': offset, + 'orderType': order_type + } + + return @client.call('get', path, { + 'content-type' => 'application/json', + }, params); + end + + def create_execution(function_id:, async: 1) + path = '/functions/{functionId}/executions' + .gsub('{function_id}', function_id) + + params = { + 'async': async + } + + return @client.call('post', path, { + 'content-type' => 'application/json', + }, params); + end + + def get_execution(function_id:, execution_id:) + path = '/functions/{functionId}/executions/{executionId}' + .gsub('{function_id}', function_id) + .gsub('{execution_id}', execution_id) + + params = { + } + + return @client.call('get', path, { + 'content-type' => 'application/json', + }, params); + end + + def update_tag(function_id:, tag:) + path = '/functions/{functionId}/tag' + .gsub('{function_id}', function_id) + + params = { + 'tag': tag + } + + return @client.call('patch', path, { + 'content-type' => 'application/json', + }, params); + end + + def list_tags(function_id:, search: '', limit: 25, offset: 0, order_type: 'ASC') + path = '/functions/{functionId}/tags' + .gsub('{function_id}', function_id) + + params = { + 'search': search, + 'limit': limit, + 'offset': offset, + 'orderType': order_type + } + + return @client.call('get', path, { + 'content-type' => 'application/json', + }, params); + end + + def create_tag(function_id:, env:, command:, code:) + path = '/functions/{functionId}/tags' + .gsub('{function_id}', function_id) + + params = { + 'env': env, + 'command': command, + 'code': code + } + + return @client.call('post', path, { + 'content-type' => 'application/json', + }, params); + end + + def get_tag(function_id:, tag_id:) + path = '/functions/{functionId}/tags/{tagId}' + .gsub('{function_id}', function_id) + .gsub('{tag_id}', tag_id) + + params = { + } + + return @client.call('get', path, { + 'content-type' => 'application/json', + }, params); + end + + def delete_tag(function_id:, tag_id:) + path = '/functions/{functionId}/tags/{tagId}' + .gsub('{function_id}', function_id) + .gsub('{tag_id}', tag_id) + + params = { + } + + return @client.call('delete', path, { + 'content-type' => 'application/json', + }, params); + end + + + protected + + private + end +end \ No newline at end of file diff --git a/app/tasks/init.php b/app/tasks/doctor.php similarity index 76% rename from app/tasks/init.php rename to app/tasks/doctor.php index a6e6af101d..c28b4d2297 100644 --- a/app/tasks/init.php +++ b/app/tasks/doctor.php @@ -1,49 +1,28 @@ -#!/bin/env php task('ssl') - ->desc('Validate server certificates') - ->action(function () use ($request) { - $domain = $request->getServer('_APP_DOMAIN', ''); - - Console::log('Issue a TLS certificate for master domain ('.$domain.')'); - - ResqueScheduler::enqueueAt(\time() + 30, 'v1-certificates', 'CertificatesV1', [ - 'document' => [], - 'domain' => $domain, - 'validateTarget' => false, - 'validateCNAME' => false, - ]); - }); - $cli ->task('doctor') ->desc('Validate server health') - ->action(function () use ($request, $register) { + ->action(function () use ($register) { Console::log(" __ ____ ____ _ _ ____ __ ____ ____ __ __ / _\ ( _ \( _ \/ )( \( _ \( )(_ _)( __) ( )/ \ / \ ) __/ ) __/\ /\ / ) / )( )( ) _) _ )(( O ) \_/\_/(__) (__) (_/\_)(__\_)(__) (__) (____)(_)(__)\__/ "); - Console::log("\n".'👩‍⚕️ Running '.APP_NAME.' Doctor for version '.$request->getServer('_APP_VERSION', 'UNKNOWN').' ...'."\n"); + Console::log("\n".'👩‍⚕️ Running '.APP_NAME.' Doctor for version '.App::getEnv('_APP_VERSION', 'UNKNOWN').' ...'."\n"); Console::log('Checking for production best practices...'); - $domain = new Domain($request->getServer('_APP_DOMAIN')); + $domain = new Domain(App::getEnv('_APP_DOMAIN')); if(!$domain->isKnown() || $domain->isTest()) { Console::log('🔴 Hostname has a public suffix'); @@ -52,7 +31,7 @@ $cli Console::log('🟢 Hostname has a public suffix'); } - $domain = new Domain($request->getServer('_APP_DOMAIN_TARGET')); + $domain = new Domain(App::getEnv('_APP_DOMAIN_TARGET')); if(!$domain->isKnown() || $domain->isTest()) { Console::log('🔴 CNAME target has a public suffix'); @@ -61,30 +40,30 @@ $cli Console::log('🟢 CNAME target has a public suffix'); } - if($request->getServer('_APP_OPENSSL_KEY_V1', 'your-secret-key') === 'your-secret-key') { + if(App::getEnv('_APP_OPENSSL_KEY_V1', 'your-secret-key') === 'your-secret-key') { Console::log('🔴 Using a unique secret key for encryption'); } else { Console::log('🟢 Using a unique secret key for encryption'); } - if($request->getServer('_APP_ENV', 'development') === 'development') { + if(App::getEnv('_APP_ENV', 'development') === 'development') { Console::log('🔴 App enviornment is set for production'); } else { Console::log('🟢 App enviornment is set for production'); } - if($request->getServer('_APP_OPTIONS_ABUSE', 'disabled') === 'disabled') { + if(App::getEnv('_APP_OPTIONS_ABUSE', 'disabled') === 'disabled') { Console::log('🔴 Abuse protection is enabled'); } else { Console::log('🟢 Abuse protection is enabled'); } - $authWhitelistEmails = $request->getServer('_APP_CONSOLE_WHITELIST_EMAILS', null); - $authWhitelistIPs = $request->getServer('_APP_CONSOLE_WHITELIST_IPS', null); - $authWhitelistDomains = $request->getServer('_APP_CONSOLE_WHITELIST_DOMAINS', null); + $authWhitelistEmails = App::getEnv('_APP_CONSOLE_WHITELIST_EMAILS', null); + $authWhitelistIPs = App::getEnv('_APP_CONSOLE_WHITELIST_IPS', null); + $authWhitelistDomains = App::getEnv('_APP_CONSOLE_WHITELIST_DOMAINS', null); if(empty($authWhitelistEmails) && empty($authWhitelistDomains) @@ -96,7 +75,7 @@ $cli Console::log('🟢 Console access limits are enabled'); } - if(empty($request->getServer('_APP_OPTIONS_FORCE_HTTPS', null))) { + if(empty(App::getEnv('_APP_OPTIONS_FORCE_HTTPS', null))) { Console::log('🔴 HTTP force option is disabled'); } else { @@ -132,7 +111,7 @@ $cli Console::error('Cache............disconnected 👎'); } - if($request->getServer('_APP_STORAGE_ANTIVIRUS') === 'enabled') { // Check if scans are enabled + if(App::getEnv('_APP_STORAGE_ANTIVIRUS') === 'enabled') { // Check if scans are enabled try { $antiVirus = new Network('clamav', 3310); @@ -161,8 +140,8 @@ $cli Console::error('SMTP.............disconnected 👎'); } - $host = $request->getServer('_APP_STATSD_HOST', 'telegraf'); - $port = $request->getServer('_APP_STATSD_PORT', 8125); + $host = App::getEnv('_APP_STATSD_HOST', 'telegraf'); + $port = App::getEnv('_APP_STATSD_PORT', 8125); if($fp = @\fsockopen('udp://'.$host, $port, $errCode, $errStr, 2)){ Console::success('StatsD..............connected 👍'); @@ -171,8 +150,8 @@ $cli Console::error('StatsD...........disconnected 👎'); } - $host = $request->getServer('_APP_INFLUXDB_HOST', ''); - $port = $request->getServer('_APP_INFLUXDB_PORT', ''); + $host = App::getEnv('_APP_INFLUXDB_HOST', ''); + $port = App::getEnv('_APP_INFLUXDB_PORT', ''); if($fp = @\fsockopen($host, $port, $errCode, $errStr, 2)){ Console::success('InfluxDB............connected 👍'); @@ -234,14 +213,13 @@ $cli Console::error('🔴 ' . $message); } } - try { Console::log(''); - $version = \json_decode(@\file_get_contents($request->getServer('_APP_HOME', 'http://localhost').'/v1/health/version'), true); + $version = \json_decode(@\file_get_contents(App::getEnv('_APP_HOME', 'http://localhost').'/v1/health/version'), true); if($version && isset($version['version'])) { - if(\version_compare($version['version'], $request->getServer('_APP_VERSION', 'UNKNOWN')) === 0) { + if(\version_compare($version['version'], App::getEnv('_APP_VERSION', 'UNKNOWN')) === 0) { Console::info('You are running the latest version of '.APP_NAME.'! 🥳'); } else { @@ -255,5 +233,3 @@ $cli Console::error('Failed to check for a newer version'."\n"); } }); - -$cli->run(); diff --git a/app/tasks/install.php b/app/tasks/install.php new file mode 100644 index 0000000000..3b3aa4ea67 --- /dev/null +++ b/app/tasks/install.php @@ -0,0 +1,152 @@ +task('install') + ->desc('Install Appwrite') + ->action(function () { + /** + * 1. Start - DONE + * 2. Check for older setup and get older version - DONE + * 2.1 If older version is equal or bigger(?) than current version, **stop setup** + * 2.2. Get ENV vars - DONE + * 2.2.1 Fetch from older docker-compose.yml file + * 2.2.2 Fetch from older .env file (manually parse) + * 2.3 Use old ENV vars as default values + * 2.4 Ask for all required vars not given as CLI args and if in interactive mode + * Otherwise, just use default vars. - DONE + * 3. Ask user to backup important volumes, env vars, and SQL tables + * In th future we can try and automate this for smaller/medium size setups + * 4. Drop new docker-compose.yml setup (located inside the container, no network dependencies with appwrite.io) - DONE + * 5. Run docker-compose up -d - DONE + * 6. Run data migration + */ + $vars = Config::getParam('variables'); + $path = '/usr/src/code/appwrite'; + $version = null; + $defaultHTTPPort = '80'; + $defaultHTTPSPort = '443'; + + Console::success('Starting Appwrite installation...'); + + // Create directory with write permissions + if (null !== $path && !\file_exists(\dirname($path))) { + if (!@\mkdir(\dirname($path), 0755, true)) { + Console::error('Can\'t create directory '.\dirname($path)); + exit(1); + } + } + + $data = @file_get_contents($path.'/docker-compose.yml'); + + if($data !== false) { + $compose = new Compose($data); + $appwrite = $compose->getService('appwrite'); + $version = ($appwrite) ? $appwrite->getImageVersion() : $version; + $ports = $compose->getService('traefik')->getPorts(); + + if($version) { + foreach($compose->getServices() as $service) { // Fetch all env vars from previous compose file + if(!$service) { + continue; + } + + $env = $service->getEnvironment()->list(); + + foreach ($env as $key => $value) { + foreach($vars as &$var) { + if($var['name'] === $key) { + $var['default'] = $value; + } + } + } + } + + $data = @file_get_contents($path.'/.env'); + + if($data !== false) { // Fetch all env vars from previous .env file + $env = new Env($data); + + foreach ($env->list() as $key => $value) { + foreach($vars as &$var) { + if($var['name'] === $key) { + $var['default'] = $value; + } + } + } + } + + foreach ($ports as $key => $value) { + if($value === $defaultHTTPPort) { + $defaultHTTPPort = $key; + } + + if($value === $defaultHTTPSPort) { + $defaultHTTPSPort = $key; + } + } + } + } + + $httpPort = Console::confirm('Choose your server HTTP port: (default: '.$defaultHTTPPort.')'); + $httpPort = ($httpPort) ? $httpPort : $defaultHTTPPort; + + $httpsPort = Console::confirm('Choose your server HTTPS port: (default: '.$defaultHTTPSPort.')'); + $httpsPort = ($httpsPort) ? $httpsPort : $defaultHTTPPort; + + $input = []; + + foreach($vars as $key => $var) { + if(!$var['required']) { + $input[$var['name']] = $var['default']; + continue; + } + + $input[$var['name']] = Console::confirm($var['question'].' (default: \''.$var['default'].'\')'); + + if(empty($input[$key])) { + $input[$var['name']] = $var['default']; + } + } + + $templateForCompose = new View(__DIR__.'/../views/install/compose.phtml'); + $templateForEnv = new View(__DIR__.'/../views/install/env.phtml'); + + $templateForCompose + ->setParam('httpPort', $httpPort) + ->setParam('httpsPort', $httpsPort) + ->setParam('version', APP_VERSION_STABLE) + ; + + $templateForEnv + ->setParam('vars', $input) + ; + + if(!file_put_contents($path.'/docker-compose.yml', $templateForCompose->render(false))) { + Console::error('Failed to save Docker Compose file'); + exit(1); + } + + if(!file_put_contents($path.'/.env', $templateForEnv->render(false))) { + Console::error('Failed to save environment variables file'); + exit(1); + } + + $stdout = ''; + $stderr = ''; + + //Console::execute("docker-compose -f {$path}.'/docker-compose.yml up -d --remove-orphans", null, $stdout, $stderr); + + if ($stderr !== '') { + Console::error("Failed to install Appwrite dockers"); + } else { + Console::success("Appwrite installed successfully"); + } + }); \ No newline at end of file diff --git a/app/tasks/migrate.php b/app/tasks/migrate.php index fe833e27f6..5434856fb8 100644 --- a/app/tasks/migrate.php +++ b/app/tasks/migrate.php @@ -1,27 +1,24 @@ -#!/bin/env php get('db'); $callbacks = [ '0.4.0' => function() { Console::log('I got nothing to do.'); }, - '0.5.0' => function($project) use ($db, $projectDB, $requset) { + '0.5.0' => function(Document $project, $projectDB) use ($db) { - Console::log('Migrating project: '.$project->getId()); + Console::log('Migrating project: '.$project->getAttribute('name').' ('.$project->getId().')'); // Update all documents $uid -> $id @@ -52,6 +49,7 @@ $callbacks = [ try { $new = $projectDB->overwriteDocument($document->getArrayCopy()); } catch (\Throwable $th) { + var_dump($document); Console::error('Failed to update document: '.$th->getMessage()); continue; } @@ -113,6 +111,14 @@ function fixDocument(Document $document) { } } + if($document->getAttribute('$collection') === Database::SYSTEM_COLLECTION_WEBHOOKS){ + $document->setAttribute('security', ($document->getAttribute('security')) ? true : false); + } + + if($document->getAttribute('$collection') === Database::SYSTEM_COLLECTION_TASKS){ + $document->setAttribute('security', ($document->getAttribute('security')) ? true : false); + } + if($document->getAttribute('$collection') === Database::SYSTEM_COLLECTION_USERS) { foreach($providers as $key => $provider) { if(!empty($document->getAttribute('oauth'.\ucfirst($key)))) { @@ -152,9 +158,7 @@ function fixDocument(Document $document) { ->removeAttribute('$uid') ; - //Console::log('Switched from $uid to $id: '.$document->getCollection().'/'.$document->getId()); - - foreach($document as &$attr) { + foreach($document as &$attr) { // Handle child documents if($attr instanceof Document) { $attr = fixDocument($attr); } @@ -172,27 +176,39 @@ function fixDocument(Document $document) { } $cli - ->task('run') - ->action(function () use ($console, $projectDB, $consoleDB, $callbacks) { + ->task('migrate') + ->action(function () use ($register, $callbacks) { Console::success('Starting Data Migration'); + $consoleDB = new Database(); + $consoleDB->setAdapter(new RedisAdapter(new MySQLAdapter($register), $register)); + $consoleDB->setNamespace('app_console'); // Main DB + $consoleDB->setMocks(Config::getParam('collections', [])); + + $projectDB = new Database(); + $projectDB->setAdapter(new RedisAdapter(new MySQLAdapter($register), $register)); + $projectDB->setMocks(Config::getParam('collections', [])); + + $console = $consoleDB->getDocument('console'); + Authorization::disable(); $limit = 30; $sum = 30; $offset = 0; $projects = [$console]; + $count = 0; while ($sum >= 30) { foreach($projects as $project) { + $projectDB->setNamespace('app_'.$project->getId()); try { - $callbacks['0.5.0']($project); + $callbacks['0.5.0']($project, $projectDB); } catch (\Throwable $th) { + throw $th; Console::error('Failed to update project ("'.$project->getId().'") version with error: '.$th->getMessage()); - $projectDB->setNamespace('app_console'); - $projectDB->deleteDocument($project->getId()); } } @@ -209,11 +225,10 @@ $cli $sum = \count($projects); $offset = $offset + $limit; + $count = $count + $sum; - Console::log('Fetched '.$sum.' projects...'); + Console::log('Fetched '.$count.'/'.$consoleDB->getSum().' projects...'); } Console::success('Data Migration Completed'); - }); - -$cli->run(); + }); \ No newline at end of file diff --git a/app/tasks/sdks.php b/app/tasks/sdks.php index a8b9cdfdde..a54acfdf79 100644 --- a/app/tasks/sdks.php +++ b/app/tasks/sdks.php @@ -1,11 +1,10 @@ -#!/bin/env php task('generate') - ->action(function () use ($warning, $version) { + ->action(function () { function getSSLPage($url) { $ch = \curl_init(); @@ -44,8 +42,14 @@ $cli $platforms = Config::getParam('platforms'); $selected = \strtolower(Console::confirm('Choose SDK ("*" for all):')); + $version = Console::confirm('Choose an Appwrite version'); $message = Console::confirm('Please enter your commit message:'); $production = (Console::confirm('Type "Appwrite" to deploy for production') == 'Appwrite'); + $warning = '**This SDK is compatible with Appwrite server version ' . $version . '. For older versions, please check previous releases.**'; + + if(!in_array($version, ['0.6.2', '0.7.0'])) { + throw new Exception('Unknown version given'); + } foreach($platforms as $key => $platform) { foreach($platform['languages'] as $language) { @@ -58,11 +62,9 @@ $cli continue; } - Console::info('Fetching API Spec for '.$language['name'].' for '.$platform['name']); + Console::info('Fetching API Spec for '.$language['name'].' for '.$platform['name'] . ' (version: '.$version.')'); - //$spec = getSSLPage('http://localhost/v1/open-api-2.json?extensions=1&platform='.$language['family']); - $spec = getSSLPage('https://appwrite.io/v1/open-api-2.json?extensions=1&platform='.$language['family']); - $spec = getSSLPage('https://localhost/v1/open-api-2.json?extensions=1&platform='.$language['family']); + $spec = file_get_contents(__DIR__.'/../config/specs/'.$version.'.'.$language['family'].'.json'); $result = \realpath(__DIR__.'/..').'/sdks/'.$key.'-'.$language['key']; $target = \realpath(__DIR__.'/..').'/sdks/git/'.$language['key'].'/'; @@ -132,6 +134,9 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND case 'java': $config = new Java(); break; + case 'swift': + $config = new Swift(); + break; default: throw new Exception('Language "'.$language['key'].'" not supported'); break; @@ -208,4 +213,4 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND exit(); }); -$cli->run(); +$cli->run(); \ No newline at end of file diff --git a/app/tasks/ssl.php b/app/tasks/ssl.php new file mode 100644 index 0000000000..2c32324fa3 --- /dev/null +++ b/app/tasks/ssl.php @@ -0,0 +1,23 @@ +task('ssl') + ->desc('Validate server certificates') + ->action(function () { + $domain = App::getEnv('_APP_DOMAIN', ''); + + Console::log('Issue a TLS certificate for master domain ('.$domain.') in 30 seconds. + Make sure your domain points to your server or restart to try again.'); + + ResqueScheduler::enqueueAt(\time() + 30, 'v1-certificates', 'CertificatesV1', [ + 'document' => [], + 'domain' => $domain, + 'validateTarget' => false, + 'validateCNAME' => false, + ]); + }); \ No newline at end of file diff --git a/app/tasks/vars.php b/app/tasks/vars.php new file mode 100644 index 0000000000..ed4a329735 --- /dev/null +++ b/app/tasks/vars.php @@ -0,0 +1,18 @@ +task('vars') + ->desc('List all the server environment variables') + ->action(function () { + $variables = Config::getParam('variables', []); + + foreach ($variables as $key => $value) { + Console::log('- '.$value['name'].'='.App::getEnv($value['name'], '')); + } + }); \ No newline at end of file diff --git a/app/views/console/account/index.phtml b/app/views/console/account/index.phtml index da40715f19..d88f689a97 100644 --- a/app/views/console/account/index.phtml +++ b/app/views/console/account/index.phtml @@ -10,6 +10,8 @@
  • +

    Overview

    +
    -

    Overview

    -
    User Avatar @@ -46,7 +46,7 @@
    - +
    @@ -184,7 +184,7 @@
  • -

    Devices

    +

    Devices

    -
      +
      • @@ -236,17 +236,17 @@ - + - on + on   Current Session
        - - / + + /
      @@ -289,17 +289,17 @@ IP - + - + - - + + - - + + diff --git a/app/views/console/comps/header.phtml b/app/views/console/comps/header.phtml index 9300582af4..5add12b534 100644 --- a/app/views/console/comps/header.phtml +++ b/app/views/console/comps/header.phtml @@ -1,7 +1,7 @@ -
      +
      @@ -14,7 +14,7 @@ data-switch data-ls-bind="{{router.params.project}}" data-unsync="1" - data-ls-loop="projects" data-ls-as="option" aria-label="Switch Project"> + data-ls-loop="projects.projects" data-ls-as="option" aria-label="Switch Project"> @@ -72,8 +72,8 @@ data-analytics-label="Logo Link"> Appwrite Logo - Appwrite Light Logo - Appwrite Dark Logo + Appwrite Light Logo + Appwrite Dark Logo
      @@ -120,6 +120,16 @@ Users +
    • + + + Functions + +
    MANAGE @@ -173,6 +183,7 @@ data-name="projects" data-scope="console">
    +
    - Appwrite Light Logo - Appwrite Dark Logo + Appwrite Light Logo + Appwrite Dark Logo
  • - +
diff --git a/app/views/console/database/search/files.phtml b/app/views/console/database/search/files.phtml index af94cf104c..f8c39f4a87 100644 --- a/app/views/console/database/search/files.phtml +++ b/app/views/console/database/search/files.phtml @@ -66,7 +66,7 @@ - + + + +
+

No output was logged.

+
+ + + + + + + + + + +
+ + + + + + +
+ +
+
+ + +
+
+

No Logs Founds

+ +

Execute your function to view execution logs.

+
+
+ + +
  • +

    Settings

    + +
    +
    + + +
    + +
    +
    + + + + + +
    Max value is escape(number_format($timeout)); ?> seconds (escape((int) ($timeout / 60)); ?> minutes)
    +
    + +
    + +
    + $event) : ?> +
    +   +
    + +
    +
    + + + +
    +
    + +
    + + +
    Leave blank for no schedule
    +
    + +

    Variables

    + +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    + +
    + +
    + +
      +
    • +
    • Last Updated:
    • +
    • Created:
    • +
    + +
    + + +
    +
    +
    +
  • + + + \ No newline at end of file diff --git a/app/views/console/functions/index.phtml b/app/views/console/functions/index.phtml new file mode 100644 index 0000000000..1a1a1127f9 --- /dev/null +++ b/app/views/console/functions/index.phtml @@ -0,0 +1,126 @@ +getParam('environments', []); +?> +
    +

    + Home +
    + + Functions +

    +
    + +
    +
      +
    • +

      Functions

      + +
      + +
      +

      No Functions Found

      + +

      You haven't created any functions for your project yet.

      +
      + +
      +
      functions found
      + +
      + +
      +
      + +
      +
      + +
      + + + +
      + +
      +
      + +
      + +
      +
      +
    • +
    +
    \ No newline at end of file diff --git a/app/views/console/home/index.phtml b/app/views/console/home/index.phtml index 2141eb8ee8..6cea29611e 100644 --- a/app/views/console/home/index.phtml +++ b/app/views/console/home/index.phtml @@ -13,69 +13,105 @@ $graph = $this->getParam('graph', false);     -
      + + +
       
      -
      -
      -
      +
      +
      +
      - +
      + +
      + + + +
      + +
      + + + +
      + +
      + + +
      +
      +
      + + +
      -
      +
      N/A
      Requests
      -
      Last 30 days
      0
      Bandwidth
      -
      Last 30 days
      - + +
      + +
      + Func. Executions +
      +
      + -
      - - -
      -
      -
      -
      0
      -
      Documents
      -
      -
      -
      0
      -
      Storage
      -
      -
      -
      0
      -
      Users
      -
      -
      -
      0
      -
      Tasks
      -
      +
      +
      +
      +
      0
      +
      Documents
      +
      +
      +
      0
      +
      Storage
      +
      +
      +
      0
      +
      Users
      +
      +
      +
      0
      +
      Tasks
      @@ -122,22 +158,22 @@ $graph = $this->getParam('graph', false);
      - + Platform Logo
      - + iOS Logo
      - + Android Logo
      - +
      -

      +

      -
      +
      @@ -201,7 +237,7 @@ $graph = $this->getParam('graph', false); - + @@ -239,7 +275,7 @@ $graph = $this->getParam('graph', false); - + @@ -277,7 +313,7 @@ $graph = $this->getParam('graph', false); - + @@ -309,7 +345,7 @@ $graph = $this->getParam('graph', false); - + @@ -341,7 +377,7 @@ $graph = $this->getParam('graph', false); - + @@ -371,7 +407,7 @@ $graph = $this->getParam('graph', false); - + diff --git a/app/views/console/index.phtml b/app/views/console/index.phtml index a30006b052..731b6fcd4d 100644 --- a/app/views/console/index.phtml +++ b/app/views/console/index.phtml @@ -1,6 +1,7 @@ getParam('home', ''); ?> +
      @@ -9,8 +10,8 @@ $home = $this->getParam('home', '');

      Take advantage of the Appwrite APIs and tools.

      @@ -18,46 +19,68 @@ $home = $this->getParam('home', '');
      - diff --git a/app/views/console/keys/index.phtml b/app/views/console/keys/index.phtml index 0cb4c59cea..cb605e406d 100644 --- a/app/views/console/keys/index.phtml +++ b/app/views/console/keys/index.phtml @@ -18,14 +18,14 @@ $scopes = $this->getParam('scopes', []); data-success="trigger" data-success-param-trigger-events="projects.listKeys"> -
      +

      No API Keys Found

      You haven't created any API keys for your project yet.

      -
      -
        +
        +

      diff --git a/app/views/console/settings/index.phtml b/app/views/console/settings/index.phtml index d4c2c359fe..49809cf927 100644 --- a/app/views/console/settings/index.phtml +++ b/app/views/console/settings/index.phtml @@ -50,7 +50,7 @@ $customDomainsTarget = $this->getParam('customDomainsTarget', false); - + @@ -218,13 +218,13 @@ $customDomainsTarget = $this->getParam('customDomainsTarget', false); data-success="trigger" data-success-param-trigger-events="projects.listDomains"> -
      +

      No Custom Domains Added

      You haven't created any custom domains for your project yet.

      -
      +
      @@ -235,7 +235,7 @@ $customDomainsTarget = $this->getParam('customDomainsTarget', false); - + - - + + @@ -194,13 +194,13 @@ $fileLimitHuman = $this->getParam('fileLimitHuman', 0); diff --git a/app/views/console/tasks/index.phtml b/app/views/console/tasks/index.phtml index 5380dcde60..b03e0200f9 100644 --- a/app/views/console/tasks/index.phtml +++ b/app/views/console/tasks/index.phtml @@ -15,13 +15,13 @@ data-success="trigger" data-success-param-trigger-events="projects.listTasks"> -
      +

      No Tasks Found

      You haven't created any tasks for your project yet.

      -
      +
      Unverified  @@ -483,7 +483,7 @@ $customDomainsTarget = $this->getParam('customDomainsTarget', false); - +
      FilenameTypeSizeTypeSize Created
      - + - + - +
      @@ -31,13 +31,13 @@ - + - +
      - +   SSL/TLS Disabled @@ -45,7 +45,7 @@
      - +
      @@ -56,16 +56,16 @@ - +
      - + - + None. @@ -95,12 +95,12 @@ - + @@ -172,8 +172,8 @@

      Warning: Untrusted or self-signed certificates may not be secure. @@ -254,12 +254,12 @@ - +

      -   Play -   Pause +   Play   +   Pause  
      diff --git a/app/views/console/users/index.phtml b/app/views/console/users/index.phtml index 321220d0af..840958b9ad 100644 --- a/app/views/console/users/index.phtml +++ b/app/views/console/users/index.phtml @@ -36,7 +36,7 @@ $providers = $this->getParam('providers', []); data-failure-param-alert-classname="error"> - + @@ -128,7 +128,7 @@ $providers = $this->getParam('providers', []); Blocked
      @@ -189,7 +189,7 @@ $providers = $this->getParam('providers', []); data-failure-param-alert-classname="error"> - +
      @@ -256,7 +256,7 @@ $providers = $this->getParam('providers', []); - + diff --git a/app/views/console/users/team.phtml b/app/views/console/users/team.phtml index 262fd23a92..a04bdef011 100644 --- a/app/views/console/users/team.phtml +++ b/app/views/console/users/team.phtml @@ -31,7 +31,7 @@
      • -

        General

        +

        Overview

        @@ -55,7 +55,7 @@ - +
        @@ -110,8 +110,8 @@
           - - + +
          Pending Approval
      • @@ -145,7 +145,7 @@ - + @@ -200,7 +200,7 @@
        • -
        • Created:
        • +
        • Created:
        • -

          General

          +

          Overview

        • ');}} -text.push('
        ');return text.join('');},legend:{labels:{generateLabels:function(chart){var data=chart.data;if(data.labels.length&&data.datasets.length){return data.labels.map(function(label,i){var meta=chart.getDatasetMeta(0);var ds=data.datasets[0];var arc=meta.data[i];var custom=arc&&arc.custom||{};var valueAtIndexOrDefault=helpers.valueAtIndexOrDefault;var arcOpts=chart.options.elements.arc;var fill=custom.backgroundColor?custom.backgroundColor:valueAtIndexOrDefault(ds.backgroundColor,i,arcOpts.backgroundColor);var stroke=custom.borderColor?custom.borderColor:valueAtIndexOrDefault(ds.borderColor,i,arcOpts.borderColor);var bw=custom.borderWidth?custom.borderWidth:valueAtIndexOrDefault(ds.borderWidth,i,arcOpts.borderWidth);return{text:label,fillStyle:fill,strokeStyle:stroke,lineWidth:bw,hidden:isNaN(ds.data[i])||meta.data[i].hidden,index:i};});} -return[];}},onClick:function(e,legendItem){var index=legendItem.index;var chart=this.chart;var i,ilen,meta;for(i=0,ilen=(chart.data.datasets||[]).length;i=Math.PI?-1:startAngle<-Math.PI?1:0);var endAngle=startAngle+circumference;var start={x:Math.cos(startAngle),y:Math.sin(startAngle)};var end={x:Math.cos(endAngle),y:Math.sin(endAngle)};var contains0=(startAngle<=0&&endAngle>=0)||(startAngle<=Math.PI*2.0&&Math.PI*2.0<=endAngle);var contains90=(startAngle<=Math.PI*0.5&&Math.PI*0.5<=endAngle)||(startAngle<=Math.PI*2.5&&Math.PI*2.5<=endAngle);var contains180=(startAngle<=-Math.PI&&-Math.PI<=endAngle)||(startAngle<=Math.PI&&Math.PI<=endAngle);var contains270=(startAngle<=-Math.PI*0.5&&-Math.PI*0.5<=endAngle)||(startAngle<=Math.PI*1.5&&Math.PI*1.5<=endAngle);var cutout=cutoutPercentage/100.0;var min={x:contains180?-1:Math.min(start.x*(start.x<0?1:cutout),end.x*(end.x<0?1:cutout)),y:contains270?-1:Math.min(start.y*(start.y<0?1:cutout),end.y*(end.y<0?1:cutout))};var max={x:contains0?1:Math.max(start.x*(start.x>0?1:cutout),end.x*(end.x>0?1:cutout)),y:contains90?1:Math.max(start.y*(start.y>0?1:cutout),end.y*(end.y>0?1:cutout))};var size={width:(max.x-min.x)*0.5,height:(max.y-min.y)*0.5};minSize=Math.min(availableWidth/size.width,availableHeight/size.height);offset={x:(max.x+min.x)*-0.5,y:(max.y+min.y)*-0.5};} -chart.borderWidth=me.getMaxBorderWidth(meta.data);chart.outerRadius=Math.max((minSize-chart.borderWidth)/2,0);chart.innerRadius=Math.max(cutoutPercentage?(chart.outerRadius/100)*(cutoutPercentage):0,0);chart.radiusLength=(chart.outerRadius-chart.innerRadius)/chart.getVisibleDatasetCount();chart.offsetX=offset.x*chart.outerRadius;chart.offsetY=offset.y*chart.outerRadius;meta.total=me.calculateTotal();me.outerRadius=chart.outerRadius-(chart.radiusLength*me.getRingIndex(me.index));me.innerRadius=Math.max(me.outerRadius-chart.radiusLength,0);helpers.each(meta.data,function(arc,index){me.updateElement(arc,index,reset);});},updateElement:function(arc,index,reset){var me=this;var chart=me.chart;var chartArea=chart.chartArea;var opts=chart.options;var animationOpts=opts.animation;var centerX=(chartArea.left+chartArea.right)/2;var centerY=(chartArea.top+chartArea.bottom)/2;var startAngle=opts.rotation;var endAngle=opts.rotation;var dataset=me.getDataset();var circumference=reset&&animationOpts.animateRotate?0:arc.hidden?0:me.calculateCircumference(dataset.data[index])*(opts.circumference/(2.0*Math.PI));var innerRadius=reset&&animationOpts.animateScale?0:me.innerRadius;var outerRadius=reset&&animationOpts.animateScale?0:me.outerRadius;var valueAtIndexOrDefault=helpers.valueAtIndexOrDefault;helpers.extend(arc,{_datasetIndex:me.index,_index:index,_model:{x:centerX+chart.offsetX,y:centerY+chart.offsetY,startAngle:startAngle,endAngle:endAngle,circumference:circumference,outerRadius:outerRadius,innerRadius:innerRadius,label:valueAtIndexOrDefault(dataset.label,index,chart.data.labels[index])}});var model=arc._model;this.removeHoverStyle(arc);if(!reset||!animationOpts.animateRotate){if(index===0){model.startAngle=opts.rotation;}else{model.startAngle=me.getMeta().data[index-1]._model.endAngle;} -model.endAngle=model.startAngle+model.circumference;} -arc.pivot();},removeHoverStyle:function(arc){Chart.DatasetController.prototype.removeHoverStyle.call(this,arc,this.chart.options.elements.arc);},calculateTotal:function(){var dataset=this.getDataset();var meta=this.getMeta();var total=0;var value;helpers.each(meta.data,function(element,index){value=dataset.data[index];if(!isNaN(value)&&!element.hidden){total+=Math.abs(value);}});return total;},calculateCircumference:function(value){var total=this.getMeta().total;if(total>0&&!isNaN(value)){return(Math.PI*2.0)*(Math.abs(value)/total);} -return 0;},getMaxBorderWidth:function(arcs){var max=0;var index=this.index;var length=arcs.length;var borderWidth;var hoverWidth;for(var i=0;imax?borderWidth:max;max=hoverWidth>max?hoverWidth:max;} -return max;}});};},{"25":25,"40":40,"45":45}],18:[function(require,module,exports){'use strict';var defaults=require(25);var elements=require(40);var helpers=require(45);defaults._set('line',{showLines:true,spanGaps:false,hover:{mode:'label'},scales:{xAxes:[{type:'category',id:'x-axis-0'}],yAxes:[{type:'linear',id:'y-axis-0'}]}});module.exports=function(Chart){function lineEnabled(dataset,options){return helpers.valueOrDefault(dataset.showLine,options.showLines);} -Chart.controllers.line=Chart.DatasetController.extend({datasetElementType:elements.Line,dataElementType:elements.Point,update:function(reset){var me=this;var meta=me.getMeta();var line=meta.dataset;var points=meta.data||[];var options=me.chart.options;var lineElementOptions=options.elements.line;var scale=me.getScaleForId(meta.yAxisID);var i,ilen,custom;var dataset=me.getDataset();var showLine=lineEnabled(dataset,options);if(showLine){custom=line.custom||{};if((dataset.tension!==undefined)&&(dataset.lineTension===undefined)){dataset.lineTension=dataset.tension;} -line._scale=scale;line._datasetIndex=me.index;line._children=points;line._model={spanGaps:dataset.spanGaps?dataset.spanGaps:options.spanGaps,tension:custom.tension?custom.tension:helpers.valueOrDefault(dataset.lineTension,lineElementOptions.tension),backgroundColor:custom.backgroundColor?custom.backgroundColor:(dataset.backgroundColor||lineElementOptions.backgroundColor),borderWidth:custom.borderWidth?custom.borderWidth:(dataset.borderWidth||lineElementOptions.borderWidth),borderColor:custom.borderColor?custom.borderColor:(dataset.borderColor||lineElementOptions.borderColor),borderCapStyle:custom.borderCapStyle?custom.borderCapStyle:(dataset.borderCapStyle||lineElementOptions.borderCapStyle),borderDash:custom.borderDash?custom.borderDash:(dataset.borderDash||lineElementOptions.borderDash),borderDashOffset:custom.borderDashOffset?custom.borderDashOffset:(dataset.borderDashOffset||lineElementOptions.borderDashOffset),borderJoinStyle:custom.borderJoinStyle?custom.borderJoinStyle:(dataset.borderJoinStyle||lineElementOptions.borderJoinStyle),fill:custom.fill?custom.fill:(dataset.fill!==undefined?dataset.fill:lineElementOptions.fill),steppedLine:custom.steppedLine?custom.steppedLine:helpers.valueOrDefault(dataset.steppedLine,lineElementOptions.stepped),cubicInterpolationMode:custom.cubicInterpolationMode?custom.cubicInterpolationMode:helpers.valueOrDefault(dataset.cubicInterpolationMode,lineElementOptions.cubicInterpolationMode),};line.pivot();} -for(i=0,ilen=points.length;i');var data=chart.data;var datasets=data.datasets;var labels=data.labels;if(datasets.length){for(var i=0;i');if(labels[i]){text.push(labels[i]);} -text.push('');}} -text.push('
      ');return text.join('');},legend:{labels:{generateLabels:function(chart){var data=chart.data;if(data.labels.length&&data.datasets.length){return data.labels.map(function(label,i){var meta=chart.getDatasetMeta(0);var ds=data.datasets[0];var arc=meta.data[i];var custom=arc.custom||{};var valueAtIndexOrDefault=helpers.valueAtIndexOrDefault;var arcOpts=chart.options.elements.arc;var fill=custom.backgroundColor?custom.backgroundColor:valueAtIndexOrDefault(ds.backgroundColor,i,arcOpts.backgroundColor);var stroke=custom.borderColor?custom.borderColor:valueAtIndexOrDefault(ds.borderColor,i,arcOpts.borderColor);var bw=custom.borderWidth?custom.borderWidth:valueAtIndexOrDefault(ds.borderWidth,i,arcOpts.borderWidth);return{text:label,fillStyle:fill,strokeStyle:stroke,lineWidth:bw,hidden:isNaN(ds.data[i])||meta.data[i].hidden,index:i};});} -return[];}},onClick:function(e,legendItem){var index=legendItem.index;var chart=this.chart;var i,ilen,meta;for(i=0,ilen=(chart.data.datasets||[]).length;i0&&!isNaN(value)){return(2*Math.PI)/count;} -return 0;}});};},{"25":25,"40":40,"45":45}],20:[function(require,module,exports){'use strict';var defaults=require(25);var elements=require(40);var helpers=require(45);defaults._set('radar',{scale:{type:'radialLinear'},elements:{line:{tension:0}}});module.exports=function(Chart){Chart.controllers.radar=Chart.DatasetController.extend({datasetElementType:elements.Line,dataElementType:elements.Point,linkScales:helpers.noop,update:function(reset){var me=this;var meta=me.getMeta();var line=meta.dataset;var points=meta.data;var custom=line.custom||{};var dataset=me.getDataset();var lineElementOptions=me.chart.options.elements.line;var scale=me.chart.scale;if((dataset.tension!==undefined)&&(dataset.lineTension===undefined)){dataset.lineTension=dataset.tension;} -helpers.extend(meta.dataset,{_datasetIndex:me.index,_scale:scale,_children:points,_loop:true,_model:{tension:custom.tension?custom.tension:helpers.valueOrDefault(dataset.lineTension,lineElementOptions.tension),backgroundColor:custom.backgroundColor?custom.backgroundColor:(dataset.backgroundColor||lineElementOptions.backgroundColor),borderWidth:custom.borderWidth?custom.borderWidth:(dataset.borderWidth||lineElementOptions.borderWidth),borderColor:custom.borderColor?custom.borderColor:(dataset.borderColor||lineElementOptions.borderColor),fill:custom.fill?custom.fill:(dataset.fill!==undefined?dataset.fill:lineElementOptions.fill),borderCapStyle:custom.borderCapStyle?custom.borderCapStyle:(dataset.borderCapStyle||lineElementOptions.borderCapStyle),borderDash:custom.borderDash?custom.borderDash:(dataset.borderDash||lineElementOptions.borderDash),borderDashOffset:custom.borderDashOffset?custom.borderDashOffset:(dataset.borderDashOffset||lineElementOptions.borderDashOffset),borderJoinStyle:custom.borderJoinStyle?custom.borderJoinStyle:(dataset.borderJoinStyle||lineElementOptions.borderJoinStyle),}});meta.dataset.pivot();helpers.each(points,function(point,index){me.updateElement(point,index,reset);},me);me.updateBezierControlPoints();},updateElement:function(point,index,reset){var me=this;var custom=point.custom||{};var dataset=me.getDataset();var scale=me.chart.scale;var pointElementOptions=me.chart.options.elements.point;var pointPosition=scale.getPointPositionForValue(index,dataset.data[index]);if((dataset.radius!==undefined)&&(dataset.pointRadius===undefined)){dataset.pointRadius=dataset.radius;} -if((dataset.hitRadius!==undefined)&&(dataset.pointHitRadius===undefined)){dataset.pointHitRadius=dataset.hitRadius;} -helpers.extend(point,{_datasetIndex:me.index,_index:index,_scale:scale,_model:{x:reset?scale.xCenter:pointPosition.x,y:reset?scale.yCenter:pointPosition.y,tension:custom.tension?custom.tension:helpers.valueOrDefault(dataset.lineTension,me.chart.options.elements.line.tension),radius:custom.radius?custom.radius:helpers.valueAtIndexOrDefault(dataset.pointRadius,index,pointElementOptions.radius),backgroundColor:custom.backgroundColor?custom.backgroundColor:helpers.valueAtIndexOrDefault(dataset.pointBackgroundColor,index,pointElementOptions.backgroundColor),borderColor:custom.borderColor?custom.borderColor:helpers.valueAtIndexOrDefault(dataset.pointBorderColor,index,pointElementOptions.borderColor),borderWidth:custom.borderWidth?custom.borderWidth:helpers.valueAtIndexOrDefault(dataset.pointBorderWidth,index,pointElementOptions.borderWidth),pointStyle:custom.pointStyle?custom.pointStyle:helpers.valueAtIndexOrDefault(dataset.pointStyle,index,pointElementOptions.pointStyle),hitRadius:custom.hitRadius?custom.hitRadius:helpers.valueAtIndexOrDefault(dataset.pointHitRadius,index,pointElementOptions.hitRadius)}});point._model.skip=custom.skip?custom.skip:(isNaN(point._model.x)||isNaN(point._model.y));},updateBezierControlPoints:function(){var chartArea=this.chart.chartArea;var meta=this.getMeta();helpers.each(meta.data,function(point,index){var model=point._model;var controlPoints=helpers.splineCurve(helpers.previousItem(meta.data,index,true)._model,model,helpers.nextItem(meta.data,index,true)._model,model.tension);model.controlPointPreviousX=Math.max(Math.min(controlPoints.previous.x,chartArea.right),chartArea.left);model.controlPointPreviousY=Math.max(Math.min(controlPoints.previous.y,chartArea.bottom),chartArea.top);model.controlPointNextX=Math.max(Math.min(controlPoints.next.x,chartArea.right),chartArea.left);model.controlPointNextY=Math.max(Math.min(controlPoints.next.y,chartArea.bottom),chartArea.top);point.pivot();});},setHoverStyle:function(point){var dataset=this.chart.data.datasets[point._datasetIndex];var custom=point.custom||{};var index=point._index;var model=point._model;model.radius=custom.hoverRadius?custom.hoverRadius:helpers.valueAtIndexOrDefault(dataset.pointHoverRadius,index,this.chart.options.elements.point.hoverRadius);model.backgroundColor=custom.hoverBackgroundColor?custom.hoverBackgroundColor:helpers.valueAtIndexOrDefault(dataset.pointHoverBackgroundColor,index,helpers.getHoverColor(model.backgroundColor));model.borderColor=custom.hoverBorderColor?custom.hoverBorderColor:helpers.valueAtIndexOrDefault(dataset.pointHoverBorderColor,index,helpers.getHoverColor(model.borderColor));model.borderWidth=custom.hoverBorderWidth?custom.hoverBorderWidth:helpers.valueAtIndexOrDefault(dataset.pointHoverBorderWidth,index,model.borderWidth);},removeHoverStyle:function(point){var dataset=this.chart.data.datasets[point._datasetIndex];var custom=point.custom||{};var index=point._index;var model=point._model;var pointElementOptions=this.chart.options.elements.point;model.radius=custom.radius?custom.radius:helpers.valueAtIndexOrDefault(dataset.pointRadius,index,pointElementOptions.radius);model.backgroundColor=custom.backgroundColor?custom.backgroundColor:helpers.valueAtIndexOrDefault(dataset.pointBackgroundColor,index,pointElementOptions.backgroundColor);model.borderColor=custom.borderColor?custom.borderColor:helpers.valueAtIndexOrDefault(dataset.pointBorderColor,index,pointElementOptions.borderColor);model.borderWidth=custom.borderWidth?custom.borderWidth:helpers.valueAtIndexOrDefault(dataset.pointBorderWidth,index,pointElementOptions.borderWidth);}});};},{"25":25,"40":40,"45":45}],21:[function(require,module,exports){'use strict';var defaults=require(25);defaults._set('scatter',{hover:{mode:'single'},scales:{xAxes:[{id:'x-axis-1',type:'linear',position:'bottom'}],yAxes:[{id:'y-axis-1',type:'linear',position:'left'}]},showLines:false,tooltips:{callbacks:{title:function(){return'';},label:function(item){return'('+item.xLabel+', '+item.yLabel+')';}}}});module.exports=function(Chart){Chart.controllers.scatter=Chart.controllers.line;};},{"25":25}],22:[function(require,module,exports){'use strict';var defaults=require(25);var Element=require(26);var helpers=require(45);defaults._set('global',{animation:{duration:1000,easing:'easeOutQuart',onProgress:helpers.noop,onComplete:helpers.noop}});module.exports=function(Chart){Chart.Animation=Element.extend({chart:null,currentStep:0,numSteps:60,easing:'',render:null,onAnimationProgress:null,onAnimationComplete:null,});Chart.animationService={frameDuration:17,animations:[],dropFrames:0,request:null,addAnimation:function(chart,animation,duration,lazy){var animations=this.animations;var i,ilen;animation.chart=chart;if(!lazy){chart.animating=true;} -for(i=0,ilen=animations.length;i1){framesToDrop=Math.floor(me.dropFrames);me.dropFrames=me.dropFrames%1;} -me.advance(1+framesToDrop);var endTime=Date.now();me.dropFrames+=(endTime-startTime)/me.frameDuration;if(me.animations.length>0){me.requestAnimationFrame();}},advance:function(count){var animations=this.animations;var animation,chart;var i=0;while(i=animation.numSteps){helpers.callback(animation.onAnimationComplete,[animation],chart);chart.animating=false;animations.splice(i,1);}else{++i;}}}};Object.defineProperty(Chart.Animation.prototype,'animationObject',{get:function(){return this;}});Object.defineProperty(Chart.Animation.prototype,'chartInstance',{get:function(){return this.chart;},set:function(value){this.chart=value;}});};},{"25":25,"26":26,"45":45}],23:[function(require,module,exports){'use strict';var defaults=require(25);var helpers=require(45);var Interaction=require(28);var layouts=require(30);var platform=require(48);var plugins=require(31);module.exports=function(Chart){Chart.types={};Chart.instances={};Chart.controllers={};function initConfig(config){config=config||{};var data=config.data=config.data||{};data.datasets=data.datasets||[];data.labels=data.labels||[];config.options=helpers.configMerge(defaults.global,defaults[config.type],config.options||{});return config;} -function updateConfig(chart){var newOptions=chart.options;helpers.each(chart.scales,function(scale){layouts.removeBox(chart,scale);});newOptions=helpers.configMerge(Chart.defaults.global,Chart.defaults[chart.config.type],newOptions);chart.options=chart.config.options=newOptions;chart.ensureScalesHaveIDs();chart.buildOrUpdateScales();chart.tooltip._options=newOptions.tooltips;chart.tooltip.initialize();} -function positionIsHorizontal(position){return position==='top'||position==='bottom';} -helpers.extend(Chart.prototype,{construct:function(item,config){var me=this;config=initConfig(config);var context=platform.acquireContext(item,config);var canvas=context&&context.canvas;var height=canvas&&canvas.height;var width=canvas&&canvas.width;me.id=helpers.uid();me.ctx=context;me.canvas=canvas;me.config=config;me.width=width;me.height=height;me.aspectRatio=height?width/height:null;me.options=config.options;me._bufferedRender=false;me.chart=me;me.controller=me;Chart.instances[me.id]=me;Object.defineProperty(me,'data',{get:function(){return me.config.data;},set:function(value){me.config.data=value;}});if(!context||!canvas){console.error("Failed to create chart: can't acquire context from the given item");return;} -me.initialize();me.update();},initialize:function(){var me=this;plugins.notify(me,'beforeInit');helpers.retinaScale(me,me.options.devicePixelRatio);me.bindEvents();if(me.options.responsive){me.resize(true);} -me.ensureScalesHaveIDs();me.buildOrUpdateScales();me.initToolTip();plugins.notify(me,'afterInit');return me;},clear:function(){helpers.canvas.clear(this);return this;},stop:function(){Chart.animationService.cancelAnimation(this);return this;},resize:function(silent){var me=this;var options=me.options;var canvas=me.canvas;var aspectRatio=(options.maintainAspectRatio&&me.aspectRatio)||null;var newWidth=Math.max(0,Math.floor(helpers.getMaximumWidth(canvas)));var newHeight=Math.max(0,Math.floor(aspectRatio?newWidth/aspectRatio:helpers.getMaximumHeight(canvas)));if(me.width===newWidth&&me.height===newHeight){return;} -canvas.width=me.width=newWidth;canvas.height=me.height=newHeight;canvas.style.width=newWidth+'px';canvas.style.height=newHeight+'px';helpers.retinaScale(me,options.devicePixelRatio);if(!silent){var newSize={width:newWidth,height:newHeight};plugins.notify(me,'resize',[newSize]);if(me.options.onResize){me.options.onResize(me,newSize);} -me.stop();me.update(me.options.responsiveAnimationDuration);}},ensureScalesHaveIDs:function(){var options=this.options;var scalesOptions=options.scales||{};var scaleOptions=options.scale;helpers.each(scalesOptions.xAxes,function(xAxisOptions,index){xAxisOptions.id=xAxisOptions.id||('x-axis-'+index);});helpers.each(scalesOptions.yAxes,function(yAxisOptions,index){yAxisOptions.id=yAxisOptions.id||('y-axis-'+index);});if(scaleOptions){scaleOptions.id=scaleOptions.id||'scale';}},buildOrUpdateScales:function(){var me=this;var options=me.options;var scales=me.scales||{};var items=[];var updated=Object.keys(scales).reduce(function(obj,id){obj[id]=false;return obj;},{});if(options.scales){items=items.concat((options.scales.xAxes||[]).map(function(xAxisOptions){return{options:xAxisOptions,dtype:'category',dposition:'bottom'};}),(options.scales.yAxes||[]).map(function(yAxisOptions){return{options:yAxisOptions,dtype:'linear',dposition:'left'};}));} -if(options.scale){items.push({options:options.scale,dtype:'radialLinear',isDefault:true,dposition:'chartArea'});} -helpers.each(items,function(item){var scaleOptions=item.options;var id=scaleOptions.id;var scaleType=helpers.valueOrDefault(scaleOptions.type,item.dtype);if(positionIsHorizontal(scaleOptions.position)!==positionIsHorizontal(item.dposition)){scaleOptions.position=item.dposition;} -updated[id]=true;var scale=null;if(id in scales&&scales[id].type===scaleType){scale=scales[id];scale.options=scaleOptions;scale.ctx=me.ctx;scale.chart=me;}else{var scaleClass=Chart.scaleService.getScaleConstructor(scaleType);if(!scaleClass){return;} -scale=new scaleClass({id:id,type:scaleType,options:scaleOptions,ctx:me.ctx,chart:me});scales[scale.id]=scale;} -scale.mergeTicksOptions();if(item.isDefault){me.scale=scale;}});helpers.each(updated,function(hasUpdated,id){if(!hasUpdated){delete scales[id];}});me.scales=scales;Chart.scaleService.addScalesToLayout(this);},buildOrUpdateControllers:function(){var me=this;var types=[];var newControllers=[];helpers.each(me.data.datasets,function(dataset,datasetIndex){var meta=me.getDatasetMeta(datasetIndex);var type=dataset.type||me.config.type;if(meta.type&&meta.type!==type){me.destroyDatasetMeta(datasetIndex);meta=me.getDatasetMeta(datasetIndex);} -meta.type=type;types.push(meta.type);if(meta.controller){meta.controller.updateIndex(datasetIndex);meta.controller.linkScales();}else{var ControllerClass=Chart.controllers[meta.type];if(ControllerClass===undefined){throw new Error('"'+meta.type+'" is not a chart type.');} -meta.controller=new ControllerClass(me,datasetIndex);newControllers.push(meta.controller);}},me);return newControllers;},resetElements:function(){var me=this;helpers.each(me.data.datasets,function(dataset,datasetIndex){me.getDatasetMeta(datasetIndex).controller.reset();},me);},reset:function(){this.resetElements();this.tooltip.initialize();},update:function(config){var me=this;if(!config||typeof config!=='object'){config={duration:config,lazy:arguments[1]};} -updateConfig(me);plugins._invalidate(me);if(plugins.notify(me,'beforeUpdate')===false){return;} -me.tooltip._data=me.data;var newControllers=me.buildOrUpdateControllers();helpers.each(me.data.datasets,function(dataset,datasetIndex){me.getDatasetMeta(datasetIndex).controller.buildOrUpdateElements();},me);me.updateLayout();if(me.options.animation&&me.options.animation.duration){helpers.each(newControllers,function(controller){controller.reset();});} -me.updateDatasets();me.tooltip.initialize();me.lastActive=[];plugins.notify(me,'afterUpdate');if(me._bufferedRender){me._bufferedRequest={duration:config.duration,easing:config.easing,lazy:config.lazy};}else{me.render(config);}},updateLayout:function(){var me=this;if(plugins.notify(me,'beforeLayout')===false){return;} -layouts.update(this,this.width,this.height);plugins.notify(me,'afterScaleUpdate');plugins.notify(me,'afterLayout');},updateDatasets:function(){var me=this;if(plugins.notify(me,'beforeDatasetsUpdate')===false){return;} -for(var i=0,ilen=me.data.datasets.length;i=0;--i){if(me.isDatasetVisible(i)){me.drawDataset(i,easingValue);}} -plugins.notify(me,'afterDatasetsDraw',[easingValue]);},drawDataset:function(index,easingValue){var me=this;var meta=me.getDatasetMeta(index);var args={meta:meta,index:index,easingValue:easingValue};if(plugins.notify(me,'beforeDatasetDraw',[args])===false){return;} -meta.controller.draw(easingValue);plugins.notify(me,'afterDatasetDraw',[args]);},_drawTooltip:function(easingValue){var me=this;var tooltip=me.tooltip;var args={tooltip:tooltip,easingValue:easingValue};if(plugins.notify(me,'beforeTooltipDraw',[args])===false){return;} -tooltip.draw();plugins.notify(me,'afterTooltipDraw',[args]);},getElementAtEvent:function(e){return Interaction.modes.single(this,e);},getElementsAtEvent:function(e){return Interaction.modes.label(this,e,{intersect:true});},getElementsAtXAxis:function(e){return Interaction.modes['x-axis'](this,e,{intersect:true});},getElementsAtEventForMode:function(e,mode,options){var method=Interaction.modes[mode];if(typeof method==='function'){return method(this,e,options);} -return[];},getDatasetAtEvent:function(e){return Interaction.modes.dataset(this,e,{intersect:true});},getDatasetMeta:function(datasetIndex){var me=this;var dataset=me.data.datasets[datasetIndex];if(!dataset._meta){dataset._meta={};} -var meta=dataset._meta[me.id];if(!meta){meta=dataset._meta[me.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null};} -return meta;},getVisibleDatasetCount:function(){var count=0;for(var i=0,ilen=this.data.datasets.length;i0){return;} -arrayEvents.forEach(function(key){delete array[key];});delete array._chartjs;} -Chart.DatasetController=function(chart,datasetIndex){this.initialize(chart,datasetIndex);};helpers.extend(Chart.DatasetController.prototype,{datasetElementType:null,dataElementType:null,initialize:function(chart,datasetIndex){var me=this;me.chart=chart;me.index=datasetIndex;me.linkScales();me.addElements();},updateIndex:function(datasetIndex){this.index=datasetIndex;},linkScales:function(){var me=this;var meta=me.getMeta();var dataset=me.getDataset();if(meta.xAxisID===null||!(meta.xAxisID in me.chart.scales)){meta.xAxisID=dataset.xAxisID||me.chart.options.scales.xAxes[0].id;} -if(meta.yAxisID===null||!(meta.yAxisID in me.chart.scales)){meta.yAxisID=dataset.yAxisID||me.chart.options.scales.yAxes[0].id;}},getDataset:function(){return this.chart.data.datasets[this.index];},getMeta:function(){return this.chart.getDatasetMeta(this.index);},getScaleForId:function(scaleID){return this.chart.scales[scaleID];},reset:function(){this.update(true);},destroy:function(){if(this._data){unlistenArrayEvents(this._data,this);}},createMetaDataset:function(){var me=this;var type=me.datasetElementType;return type&&new type({_chart:me.chart,_datasetIndex:me.index});},createMetaData:function(index){var me=this;var type=me.dataElementType;return type&&new type({_chart:me.chart,_datasetIndex:me.index,_index:index});},addElements:function(){var me=this;var meta=me.getMeta();var data=me.getDataset().data||[];var metaData=meta.data;var i,ilen;for(i=0,ilen=data.length;inumMeta){me.insertElements(numMeta,numData-numMeta);}},insertElements:function(start,count){for(var i=0;i=target[key].length){target[key].push({});} -if(!target[key][i].type||(scale.type&&scale.type!==target[key][i].type)){helpers.merge(target[key][i],[Chart.scaleService.getScaleDefaults(type),scale]);}else{helpers.merge(target[key][i],scale);}}}else{helpers._merger(key,target,source,options);}}});};helpers.where=function(collection,filterCallback){if(helpers.isArray(collection)&&Array.prototype.filter){return collection.filter(filterCallback);} -var filtered=[];helpers.each(collection,function(item){if(filterCallback(item)){filtered.push(item);}});return filtered;};helpers.findIndex=Array.prototype.findIndex?function(array,callback,scope){return array.findIndex(callback,scope);}:function(array,callback,scope){scope=scope===undefined?array:scope;for(var i=0,ilen=array.length;i=0;i--){var currentItem=arrayToSearch[i];if(filterCallback(currentItem)){return currentItem;}}};helpers.isNumber=function(n){return!isNaN(parseFloat(n))&&isFinite(n);};helpers.almostEquals=function(x,y,epsilon){return Math.abs(x-y)x));};helpers.max=function(array){return array.reduce(function(max,value){if(!isNaN(value)){return Math.max(max,value);} -return max;},Number.NEGATIVE_INFINITY);};helpers.min=function(array){return array.reduce(function(min,value){if(!isNaN(value)){return Math.min(min,value);} -return min;},Number.POSITIVE_INFINITY);};helpers.sign=Math.sign?function(x){return Math.sign(x);}:function(x){x=+x;if(x===0||isNaN(x)){return x;} -return x>0?1:-1;};helpers.log10=Math.log10?function(x){return Math.log10(x);}:function(x){var exponent=Math.log(x)*Math.LOG10E;var powerOf10=Math.round(exponent);var isPowerOf10=x===Math.pow(10,powerOf10);return isPowerOf10?powerOf10:exponent;};helpers.toRadians=function(degrees){return degrees*(Math.PI/180);};helpers.toDegrees=function(radians){return radians*(180/Math.PI);};helpers.getAngleFromPoint=function(centrePoint,anglePoint){var distanceFromXCenter=anglePoint.x-centrePoint.x;var distanceFromYCenter=anglePoint.y-centrePoint.y;var radialDistanceFromCenter=Math.sqrt(distanceFromXCenter*distanceFromXCenter+distanceFromYCenter*distanceFromYCenter);var angle=Math.atan2(distanceFromYCenter,distanceFromXCenter);if(angle<(-0.5*Math.PI)){angle+=2.0*Math.PI;} -return{angle:angle,distance:radialDistanceFromCenter};};helpers.distanceBetweenPoints=function(pt1,pt2){return Math.sqrt(Math.pow(pt2.x-pt1.x,2)+Math.pow(pt2.y-pt1.y,2));};helpers.aliasPixel=function(pixelWidth){return(pixelWidth%2===0)?0:0.5;};helpers.splineCurve=function(firstPoint,middlePoint,afterPoint,t){var previous=firstPoint.skip?middlePoint:firstPoint;var current=middlePoint;var next=afterPoint.skip?middlePoint:afterPoint;var d01=Math.sqrt(Math.pow(current.x-previous.x,2)+Math.pow(current.y-previous.y,2));var d12=Math.sqrt(Math.pow(next.x-current.x,2)+Math.pow(next.y-current.y,2));var s01=d01/(d01+d12);var s12=d12/(d01+d12);s01=isNaN(s01)?0:s01;s12=isNaN(s12)?0:s12;var fa=t*s01;var fb=t*s12;return{previous:{x:current.x-fa*(next.x-previous.x),y:current.y-fa*(next.y-previous.y)},next:{x:current.x+fb*(next.x-previous.x),y:current.y+fb*(next.y-previous.y)}};};helpers.EPSILON=Number.EPSILON||1e-14;helpers.splineCurveMonotone=function(points){var pointsWithTangents=(points||[]).map(function(point){return{model:point._model,deltaK:0,mK:0};});var pointsLen=pointsWithTangents.length;var i,pointBefore,pointCurrent,pointAfter;for(i=0;i0?pointsWithTangents[i-1]:null;pointAfter=i0?pointsWithTangents[i-1]:null;pointAfter=i=collection.length-1?collection[0]:collection[index+1];} -return index>=collection.length-1?collection[collection.length-1]:collection[index+1];};helpers.previousItem=function(collection,index,loop){if(loop){return index<=0?collection[collection.length-1]:collection[index-1];} -return index<=0?collection[0]:collection[index-1];};helpers.niceNum=function(range,round){var exponent=Math.floor(helpers.log10(range));var fraction=range/Math.pow(10,exponent);var niceFraction;if(round){if(fraction<1.5){niceFraction=1;}else if(fraction<3){niceFraction=2;}else if(fraction<7){niceFraction=5;}else{niceFraction=10;}}else if(fraction<=1.0){niceFraction=1;}else if(fraction<=2){niceFraction=2;}else if(fraction<=5){niceFraction=5;}else{niceFraction=10;} -return niceFraction*Math.pow(10,exponent);};helpers.requestAnimFrame=(function(){if(typeof window==='undefined'){return function(callback){callback();};} -return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){return window.setTimeout(callback,1000/60);};}());helpers.getRelativePosition=function(evt,chart){var mouseX,mouseY;var e=evt.originalEvent||evt;var canvas=evt.currentTarget||evt.srcElement;var boundingRect=canvas.getBoundingClientRect();var touches=e.touches;if(touches&&touches.length>0){mouseX=touches[0].clientX;mouseY=touches[0].clientY;}else{mouseX=e.clientX;mouseY=e.clientY;} -var paddingLeft=parseFloat(helpers.getStyle(canvas,'padding-left'));var paddingTop=parseFloat(helpers.getStyle(canvas,'padding-top'));var paddingRight=parseFloat(helpers.getStyle(canvas,'padding-right'));var paddingBottom=parseFloat(helpers.getStyle(canvas,'padding-bottom'));var width=boundingRect.right-boundingRect.left-paddingLeft-paddingRight;var height=boundingRect.bottom-boundingRect.top-paddingTop-paddingBottom;mouseX=Math.round((mouseX-boundingRect.left-paddingLeft)/(width)*canvas.width/chart.currentDevicePixelRatio);mouseY=Math.round((mouseY-boundingRect.top-paddingTop)/(height)*canvas.height/chart.currentDevicePixelRatio);return{x:mouseX,y:mouseY};};function parseMaxStyle(styleValue,node,parentProperty){var valueInPixels;if(typeof styleValue==='string'){valueInPixels=parseInt(styleValue,10);if(styleValue.indexOf('%')!==-1){valueInPixels=valueInPixels/100*node.parentNode[parentProperty];}}else{valueInPixels=styleValue;} -return valueInPixels;} -function isConstrainedValue(value){return value!==undefined&&value!==null&&value!=='none';} -function getConstraintDimension(domNode,maxStyle,percentageProperty){var view=document.defaultView;var parentNode=domNode.parentNode;var constrainedNode=view.getComputedStyle(domNode)[maxStyle];var constrainedContainer=view.getComputedStyle(parentNode)[maxStyle];var hasCNode=isConstrainedValue(constrainedNode);var hasCContainer=isConstrainedValue(constrainedContainer);var infinity=Number.POSITIVE_INFINITY;if(hasCNode||hasCContainer){return Math.min(hasCNode?parseMaxStyle(constrainedNode,domNode,percentageProperty):infinity,hasCContainer?parseMaxStyle(constrainedContainer,parentNode,percentageProperty):infinity);} -return'none';} -helpers.getConstraintWidth=function(domNode){return getConstraintDimension(domNode,'max-width','clientWidth');};helpers.getConstraintHeight=function(domNode){return getConstraintDimension(domNode,'max-height','clientHeight');};helpers.getMaximumWidth=function(domNode){var container=domNode.parentNode;if(!container){return domNode.clientWidth;} -var paddingLeft=parseInt(helpers.getStyle(container,'padding-left'),10);var paddingRight=parseInt(helpers.getStyle(container,'padding-right'),10);var w=container.clientWidth-paddingLeft-paddingRight;var cw=helpers.getConstraintWidth(domNode);return isNaN(cw)?w:Math.min(w,cw);};helpers.getMaximumHeight=function(domNode){var container=domNode.parentNode;if(!container){return domNode.clientHeight;} -var paddingTop=parseInt(helpers.getStyle(container,'padding-top'),10);var paddingBottom=parseInt(helpers.getStyle(container,'padding-bottom'),10);var h=container.clientHeight-paddingTop-paddingBottom;var ch=helpers.getConstraintHeight(domNode);return isNaN(ch)?h:Math.min(h,ch);};helpers.getStyle=function(el,property){return el.currentStyle?el.currentStyle[property]:document.defaultView.getComputedStyle(el,null).getPropertyValue(property);};helpers.retinaScale=function(chart,forceRatio){var pixelRatio=chart.currentDevicePixelRatio=forceRatio||window.devicePixelRatio||1;if(pixelRatio===1){return;} -var canvas=chart.canvas;var height=chart.height;var width=chart.width;canvas.height=height*pixelRatio;canvas.width=width*pixelRatio;chart.ctx.scale(pixelRatio,pixelRatio);if(!canvas.style.height&&!canvas.style.width){canvas.style.height=height+'px';canvas.style.width=width+'px';}};helpers.fontString=function(pixelSize,fontStyle,fontFamily){return fontStyle+' '+pixelSize+'px '+fontFamily;};helpers.longestText=function(ctx,font,arrayOfThings,cache){cache=cache||{};var data=cache.data=cache.data||{};var gc=cache.garbageCollect=cache.garbageCollect||[];if(cache.font!==font){data=cache.data={};gc=cache.garbageCollect=[];cache.font=font;} -ctx.font=font;var longest=0;helpers.each(arrayOfThings,function(thing){if(thing!==undefined&&thing!==null&&helpers.isArray(thing)!==true){longest=helpers.measureText(ctx,data,gc,longest,thing);}else if(helpers.isArray(thing)){helpers.each(thing,function(nestedThing){if(nestedThing!==undefined&&nestedThing!==null&&!helpers.isArray(nestedThing)){longest=helpers.measureText(ctx,data,gc,longest,nestedThing);}});}});var gcLen=gc.length/2;if(gcLen>arrayOfThings.length){for(var i=0;ilongest){longest=textWidth;} -return longest;};helpers.numberOfLabelLines=function(arrayOfThings){var numberOfLines=1;helpers.each(arrayOfThings,function(thing){if(helpers.isArray(thing)){if(thing.length>numberOfLines){numberOfLines=thing.length;}}});return numberOfLines;};helpers.color=!color?function(value){console.error('Color.js not found!');return value;}:function(value){if(value instanceof CanvasGradient){value=defaults.global.defaultColor;} -return color(value);};helpers.getHoverColor=function(colorValue){return(colorValue instanceof CanvasPattern)?colorValue:helpers.color(colorValue).saturate(0.5).darken(0.1).rgbString();};};},{"2":2,"25":25,"45":45}],28:[function(require,module,exports){'use strict';var helpers=require(45);function getRelativePosition(e,chart){if(e.native){return{x:e.x,y:e.y};} -return helpers.getRelativePosition(e,chart);} -function parseVisibleItems(chart,handler){var datasets=chart.data.datasets;var meta,i,j,ilen,jlen;for(i=0,ilen=datasets.length;i0){items=chart.getDatasetMeta(items[0]._datasetIndex).data;} -return items;},'x-axis':function(chart,e){return indexMode(chart,e,{intersect:false});},point:function(chart,e){var position=getRelativePosition(e,chart);return getIntersectItems(chart,position);},nearest:function(chart,e,options){var position=getRelativePosition(e,chart);options.axis=options.axis||'xy';var distanceMetric=getDistanceMetricForAxis(options.axis);var nearestItems=getNearestItems(chart,position,options.intersect,distanceMetric);if(nearestItems.length>1){nearestItems.sort(function(a,b){var sizeA=a.getArea();var sizeB=b.getArea();var ret=sizeA-sizeB;if(ret===0){ret=a._datasetIndex-b._datasetIndex;} -return ret;});} -return nearestItems.slice(0,1);},x:function(chart,e,options){var position=getRelativePosition(e,chart);var items=[];var intersectsItem=false;parseVisibleItems(chart,function(element){if(element.inXRange(position.x)){items.push(element);} -if(element.inRange(position.x,position.y)){intersectsItem=true;}});if(options.intersect&&!intersectsItem){items=[];} -return items;},y:function(chart,e,options){var position=getRelativePosition(e,chart);var items=[];var intersectsItem=false;parseVisibleItems(chart,function(element){if(element.inYRange(position.y)){items.push(element);} -if(element.inRange(position.x,position.y)){intersectsItem=true;}});if(options.intersect&&!intersectsItem){items=[];} -return items;}}};},{"45":45}],29:[function(require,module,exports){'use strict';var defaults=require(25);defaults._set('global',{responsive:true,responsiveAnimationDuration:0,maintainAspectRatio:true,events:['mousemove','mouseout','click','touchstart','touchmove'],hover:{onHover:null,mode:'nearest',intersect:true,animationDuration:400},onClick:null,defaultColor:'rgba(0,0,0,0.1)',defaultFontColor:'#666',defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:'normal',showLines:true,elements:{},layout:{padding:{top:0,right:0,bottom:0,left:0}}});module.exports=function(){var Chart=function(item,config){this.construct(item,config);return this;};Chart.Chart=Chart;return Chart;};},{"25":25}],30:[function(require,module,exports){'use strict';var helpers=require(45);function filterByPosition(array,position){return helpers.where(array,function(v){return v.position===position;});} -function sortByWeight(array,reverse){array.forEach(function(v,i){v._tmpIndex_=i;return v;});array.sort(function(a,b){var v0=reverse?b:a;var v1=reverse?a:b;return v0.weight===v1.weight?v0._tmpIndex_-v1._tmpIndex_:v0.weight-v1.weight;});array.forEach(function(v){delete v._tmpIndex_;});} -module.exports={defaults:{},addBox:function(chart,item){if(!chart.boxes){chart.boxes=[];} -item.fullWidth=item.fullWidth||false;item.position=item.position||'top';item.weight=item.weight||0;chart.boxes.push(item);},removeBox:function(chart,layoutItem){var index=chart.boxes?chart.boxes.indexOf(layoutItem):-1;if(index!==-1){chart.boxes.splice(index,1);}},configure:function(chart,item,options){var props=['fullWidth','position','weight'];var ilen=props.length;var i=0;var prop;for(;itickWidth&&labelRotationme.maxHeight){labelRotation--;break;} -labelRotation++;labelWidth=cosRotation*originalLabelWidth;}} -me.labelRotation=labelRotation;},afterCalculateTickRotation:function(){helpers.callback(this.options.afterCalculateTickRotation,[this]);},beforeFit:function(){helpers.callback(this.options.beforeFit,[this]);},fit:function(){var me=this;var minSize=me.minSize={width:0,height:0};var labels=labelsFromTicks(me._ticks);var opts=me.options;var tickOpts=opts.ticks;var scaleLabelOpts=opts.scaleLabel;var gridLineOpts=opts.gridLines;var display=opts.display;var isHorizontal=me.isHorizontal();var tickFont=parseFontOptions(tickOpts);var tickMarkLength=opts.gridLines.tickMarkLength;if(isHorizontal){minSize.width=me.isFullWidth()?me.maxWidth-me.margins.left-me.margins.right:me.maxWidth;}else{minSize.width=display&&gridLineOpts.drawTicks?tickMarkLength:0;} -if(isHorizontal){minSize.height=display&&gridLineOpts.drawTicks?tickMarkLength:0;}else{minSize.height=me.maxHeight;} -if(scaleLabelOpts.display&&display){var scaleLabelLineHeight=parseLineHeight(scaleLabelOpts);var scaleLabelPadding=helpers.options.toPadding(scaleLabelOpts.padding);var deltaHeight=scaleLabelLineHeight+scaleLabelPadding.height;if(isHorizontal){minSize.height+=deltaHeight;}else{minSize.width+=deltaHeight;}} -if(tickOpts.display&&display){var largestTextWidth=helpers.longestText(me.ctx,tickFont.font,labels,me.longestTextCache);var tallestLabelHeightInLines=helpers.numberOfLabelLines(labels);var lineSpace=tickFont.size*0.5;var tickPadding=me.options.ticks.padding;if(isHorizontal){me.longestLabelWidth=largestTextWidth;var angleRadians=helpers.toRadians(me.labelRotation);var cosRotation=Math.cos(angleRadians);var sinRotation=Math.sin(angleRadians);var labelHeight=(sinRotation*largestTextWidth) -+(tickFont.size*tallestLabelHeightInLines) -+(lineSpace*(tallestLabelHeightInLines-1)) -+lineSpace;minSize.height=Math.min(me.maxHeight,minSize.height+labelHeight+tickPadding);me.ctx.font=tickFont.font;var firstLabelWidth=computeTextSize(me.ctx,labels[0],tickFont.font);var lastLabelWidth=computeTextSize(me.ctx,labels[labels.length-1],tickFont.font);if(me.labelRotation!==0){me.paddingLeft=opts.position==='bottom'?(cosRotation*firstLabelWidth)+3:(cosRotation*lineSpace)+3;me.paddingRight=opts.position==='bottom'?(cosRotation*lineSpace)+3:(cosRotation*lastLabelWidth)+3;}else{me.paddingLeft=firstLabelWidth/2+3;me.paddingRight=lastLabelWidth/2+3;}}else{if(tickOpts.mirror){largestTextWidth=0;}else{largestTextWidth+=tickPadding+lineSpace;} -minSize.width=Math.min(me.maxWidth,minSize.width+largestTextWidth);me.paddingTop=tickFont.size/2;me.paddingBottom=tickFont.size/2;}} -me.handleMargins();me.width=minSize.width;me.height=minSize.height;},handleMargins:function(){var me=this;if(me.margins){me.paddingLeft=Math.max(me.paddingLeft-me.margins.left,0);me.paddingTop=Math.max(me.paddingTop-me.margins.top,0);me.paddingRight=Math.max(me.paddingRight-me.margins.right,0);me.paddingBottom=Math.max(me.paddingBottom-me.margins.bottom,0);}},afterFit:function(){helpers.callback(this.options.afterFit,[this]);},isHorizontal:function(){return this.options.position==='top'||this.options.position==='bottom';},isFullWidth:function(){return(this.options.fullWidth);},getRightValue:function(rawValue){if(helpers.isNullOrUndef(rawValue)){return NaN;} -if(typeof rawValue==='number'&&!isFinite(rawValue)){return NaN;} -if(rawValue){if(this.isHorizontal()){if(rawValue.x!==undefined){return this.getRightValue(rawValue.x);}}else if(rawValue.y!==undefined){return this.getRightValue(rawValue.y);}} -return rawValue;},getLabelForIndex:helpers.noop,getPixelForValue:helpers.noop,getValueForPixel:helpers.noop,getPixelForTick:function(index){var me=this;var offset=me.options.offset;if(me.isHorizontal()){var innerWidth=me.width-(me.paddingLeft+me.paddingRight);var tickWidth=innerWidth/Math.max((me._ticks.length-(offset?0:1)),1);var pixel=(tickWidth*index)+me.paddingLeft;if(offset){pixel+=tickWidth/2;} -var finalVal=me.left+Math.round(pixel);finalVal+=me.isFullWidth()?me.margins.left:0;return finalVal;} -var innerHeight=me.height-(me.paddingTop+me.paddingBottom);return me.top+(index*(innerHeight/(me._ticks.length-1)));},getPixelForDecimal:function(decimal){var me=this;if(me.isHorizontal()){var innerWidth=me.width-(me.paddingLeft+me.paddingRight);var valueOffset=(innerWidth*decimal)+me.paddingLeft;var finalVal=me.left+Math.round(valueOffset);finalVal+=me.isFullWidth()?me.margins.left:0;return finalVal;} -return me.top+(decimal*me.height);},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue());},getBaseValue:function(){var me=this;var min=me.min;var max=me.max;return me.beginAtZero?0:min<0&&max<0?max:min>0&&max>0?min:0;},_autoSkip:function(ticks){var skipRatio;var me=this;var isHorizontal=me.isHorizontal();var optionTicks=me.options.ticks.minor;var tickCount=ticks.length;var labelRotationRadians=helpers.toRadians(me.labelRotation);var cosRotation=Math.cos(labelRotationRadians);var longestRotatedLabel=me.longestLabelWidth*cosRotation;var result=[];var i,tick,shouldSkip;var maxTicks;if(optionTicks.maxTicksLimit){maxTicks=optionTicks.maxTicksLimit;} -if(isHorizontal){skipRatio=false;if((longestRotatedLabel+optionTicks.autoSkipPadding)*tickCount>(me.width-(me.paddingLeft+me.paddingRight))){skipRatio=1+Math.floor(((longestRotatedLabel+optionTicks.autoSkipPadding)*tickCount)/(me.width-(me.paddingLeft+me.paddingRight)));} -if(maxTicks&&tickCount>maxTicks){skipRatio=Math.max(skipRatio,Math.floor(tickCount/maxTicks));}} -for(i=0;i1&&i%skipRatio>0)||(i%skipRatio===0&&i+skipRatio>=tickCount);if(shouldSkip&&i!==tickCount-1){delete tick.label;} -result.push(tick);} -return result;},draw:function(chartArea){var me=this;var options=me.options;if(!options.display){return;} -var context=me.ctx;var globalDefaults=defaults.global;var optionTicks=options.ticks.minor;var optionMajorTicks=options.ticks.major||optionTicks;var gridLines=options.gridLines;var scaleLabel=options.scaleLabel;var isRotated=me.labelRotation!==0;var isHorizontal=me.isHorizontal();var ticks=optionTicks.autoSkip?me._autoSkip(me.getTicks()):me.getTicks();var tickFontColor=helpers.valueOrDefault(optionTicks.fontColor,globalDefaults.defaultFontColor);var tickFont=parseFontOptions(optionTicks);var majorTickFontColor=helpers.valueOrDefault(optionMajorTicks.fontColor,globalDefaults.defaultFontColor);var majorTickFont=parseFontOptions(optionMajorTicks);var tl=gridLines.drawTicks?gridLines.tickMarkLength:0;var scaleLabelFontColor=helpers.valueOrDefault(scaleLabel.fontColor,globalDefaults.defaultFontColor);var scaleLabelFont=parseFontOptions(scaleLabel);var scaleLabelPadding=helpers.options.toPadding(scaleLabel.padding);var labelRotationRadians=helpers.toRadians(me.labelRotation);var itemsToDraw=[];var axisWidth=me.options.gridLines.lineWidth;var xTickStart=options.position==='right'?me.right:me.right-axisWidth-tl;var xTickEnd=options.position==='right'?me.right+tl:me.right;var yTickStart=options.position==='bottom'?me.top+axisWidth:me.bottom-tl-axisWidth;var yTickEnd=options.position==='bottom'?me.top+axisWidth+tl:me.bottom+axisWidth;helpers.each(ticks,function(tick,index){if(helpers.isNullOrUndef(tick.label)){return;} -var label=tick.label;var lineWidth,lineColor,borderDash,borderDashOffset;if(index===me.zeroLineIndex&&options.offset===gridLines.offsetGridLines){lineWidth=gridLines.zeroLineWidth;lineColor=gridLines.zeroLineColor;borderDash=gridLines.zeroLineBorderDash;borderDashOffset=gridLines.zeroLineBorderDashOffset;}else{lineWidth=helpers.valueAtIndexOrDefault(gridLines.lineWidth,index);lineColor=helpers.valueAtIndexOrDefault(gridLines.color,index);borderDash=helpers.valueOrDefault(gridLines.borderDash,globalDefaults.borderDash);borderDashOffset=helpers.valueOrDefault(gridLines.borderDashOffset,globalDefaults.borderDashOffset);} -var tx1,ty1,tx2,ty2,x1,y1,x2,y2,labelX,labelY;var textAlign='middle';var textBaseline='middle';var tickPadding=optionTicks.padding;if(isHorizontal){var labelYOffset=tl+tickPadding;if(options.position==='bottom'){textBaseline=!isRotated?'top':'middle';textAlign=!isRotated?'center':'right';labelY=me.top+labelYOffset;}else{textBaseline=!isRotated?'bottom':'middle';textAlign=!isRotated?'center':'left';labelY=me.bottom-labelYOffset;} -var xLineValue=getLineValue(me,index,gridLines.offsetGridLines&&ticks.length>1);if(xLineValue1);if(yLineValue3?ticks[2]-ticks[1]:ticks[1]-ticks[0];if(Math.abs(delta)>1){if(tickValue!==Math.floor(tickValue)){delta=tickValue-Math.floor(tickValue);}} -var logDelta=helpers.log10(Math.abs(delta));var tickString='';if(tickValue!==0){var numDecimal=-1*Math.floor(logDelta);numDecimal=Math.max(Math.min(numDecimal,20),0);tickString=tickValue.toFixed(numDecimal);}else{tickString='0';} -return tickString;},logarithmic:function(tickValue,index,ticks){var remain=tickValue/(Math.pow(10,Math.floor(helpers.log10(tickValue))));if(tickValue===0){return'0';}else if(remain===1||remain===2||remain===5||index===0||index===ticks.length-1){return tickValue.toExponential();} -return'';}}};},{"45":45}],35:[function(require,module,exports){'use strict';var defaults=require(25);var Element=require(26);var helpers=require(45);defaults._set('global',{tooltips:{enabled:true,custom:null,mode:'nearest',position:'average',intersect:true,backgroundColor:'rgba(0,0,0,0.8)',titleFontStyle:'bold',titleSpacing:2,titleMarginBottom:6,titleFontColor:'#fff',titleAlign:'left',bodySpacing:2,bodyFontColor:'#fff',bodyAlign:'left',footerFontStyle:'bold',footerSpacing:2,footerMarginTop:6,footerFontColor:'#fff',footerAlign:'left',yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:'#fff',displayColors:true,borderColor:'rgba(0,0,0,0)',borderWidth:0,callbacks:{beforeTitle:helpers.noop,title:function(tooltipItems,data){var title='';var labels=data.labels;var labelCount=labels?labels.length:0;if(tooltipItems.length>0){var item=tooltipItems[0];if(item.xLabel){title=item.xLabel;}else if(labelCount>0&&item.index(chart.height-size.height)){yAlign='bottom';} -var lf,rf;var olf,orf;var yf;var midX=(chartArea.left+chartArea.right)/2;var midY=(chartArea.top+chartArea.bottom)/2;if(yAlign==='center'){lf=function(x){return x<=midX;};rf=function(x){return x>midX;};}else{lf=function(x){return x<=(size.width/2);};rf=function(x){return x>=(chart.width-(size.width/2));};} -olf=function(x){return x+size.width+model.caretSize+model.caretPadding>chart.width;};orf=function(x){return x-size.width-model.caretSize-model.caretPadding<0;};yf=function(y){return y<=midY?'top':'bottom';};if(lf(model.x)){xAlign='left';if(olf(model.x)){xAlign='center';yAlign=yf(model.y);}}else if(rf(model.x)){xAlign='right';if(orf(model.x)){xAlign='center';yAlign=yf(model.y);}} -var opts=tooltip._options;return{xAlign:opts.xAlign?opts.xAlign:xAlign,yAlign:opts.yAlign?opts.yAlign:yAlign};} -function getBackgroundPoint(vm,size,alignment,chart){var x=vm.x;var y=vm.y;var caretSize=vm.caretSize;var caretPadding=vm.caretPadding;var cornerRadius=vm.cornerRadius;var xAlign=alignment.xAlign;var yAlign=alignment.yAlign;var paddingAndSize=caretSize+caretPadding;var radiusAndPadding=cornerRadius+caretPadding;if(xAlign==='right'){x-=size.width;}else if(xAlign==='center'){x-=(size.width/2);if(x+size.width>chart.width){x=chart.width-size.width;} -if(x<0){x=0;}} -if(yAlign==='top'){y+=paddingAndSize;}else if(yAlign==='bottom'){y-=size.height+paddingAndSize;}else{y-=(size.height/2);} -if(yAlign==='center'){if(xAlign==='left'){x+=paddingAndSize;}else if(xAlign==='right'){x-=paddingAndSize;}}else if(xAlign==='left'){x-=radiusAndPadding;}else if(xAlign==='right'){x+=radiusAndPadding;} -return{x:x,y:y};} -Chart.Tooltip=Element.extend({initialize:function(){this._model=getBaseModel(this._options);this._lastActive=[];},getTitle:function(){var me=this;var opts=me._options;var callbacks=opts.callbacks;var beforeTitle=callbacks.beforeTitle.apply(me,arguments);var title=callbacks.title.apply(me,arguments);var afterTitle=callbacks.afterTitle.apply(me,arguments);var lines=[];lines=pushOrConcat(lines,beforeTitle);lines=pushOrConcat(lines,title);lines=pushOrConcat(lines,afterTitle);return lines;},getBeforeBody:function(){var lines=this._options.callbacks.beforeBody.apply(this,arguments);return helpers.isArray(lines)?lines:lines!==undefined?[lines]:[];},getBody:function(tooltipItems,data){var me=this;var callbacks=me._options.callbacks;var bodyItems=[];helpers.each(tooltipItems,function(tooltipItem){var bodyItem={before:[],lines:[],after:[]};pushOrConcat(bodyItem.before,callbacks.beforeLabel.call(me,tooltipItem,data));pushOrConcat(bodyItem.lines,callbacks.label.call(me,tooltipItem,data));pushOrConcat(bodyItem.after,callbacks.afterLabel.call(me,tooltipItem,data));bodyItems.push(bodyItem);});return bodyItems;},getAfterBody:function(){var lines=this._options.callbacks.afterBody.apply(this,arguments);return helpers.isArray(lines)?lines:lines!==undefined?[lines]:[];},getFooter:function(){var me=this;var callbacks=me._options.callbacks;var beforeFooter=callbacks.beforeFooter.apply(me,arguments);var footer=callbacks.footer.apply(me,arguments);var afterFooter=callbacks.afterFooter.apply(me,arguments);var lines=[];lines=pushOrConcat(lines,beforeFooter);lines=pushOrConcat(lines,footer);lines=pushOrConcat(lines,afterFooter);return lines;},update:function(changed){var me=this;var opts=me._options;var existingModel=me._model;var model=me._model=getBaseModel(opts);var active=me._active;var data=me._data;var alignment={xAlign:existingModel.xAlign,yAlign:existingModel.yAlign};var backgroundPoint={x:existingModel.x,y:existingModel.y};var tooltipSize={width:existingModel.width,height:existingModel.height};var tooltipPosition={x:existingModel.caretX,y:existingModel.caretY};var i,len;if(active.length){model.opacity=1;var labelColors=[];var labelTextColors=[];tooltipPosition=Chart.Tooltip.positioners[opts.position].call(me,active,me._eventPosition);var tooltipItems=[];for(i=0,len=active.length;i0){ctx.stroke();}},draw:function(){var ctx=this._chart.ctx;var vm=this._view;if(vm.opacity===0){return;} -var tooltipSize={width:vm.width,height:vm.height};var pt={x:vm.x,y:vm.y};var opacity=Math.abs(vm.opacity<1e-3)?0:vm.opacity;var hasTooltipContent=vm.title.length||vm.beforeBody.length||vm.body.length||vm.afterBody.length||vm.footer.length;if(this._options.enabled&&hasTooltipContent){this.drawBackground(pt,vm,ctx,tooltipSize,opacity);pt.x+=vm.xPadding;pt.y+=vm.yPadding;this.drawTitle(pt,vm,ctx,opacity);this.drawBody(pt,vm,ctx,opacity);this.drawFooter(pt,vm,ctx,opacity);}},handleEvent:function(e){var me=this;var options=me._options;var changed=false;me._lastActive=me._lastActive||[];if(e.type==='mouseout'){me._active=[];}else{me._active=me._chart.getElementsAtEventForMode(e,options.mode,options);} -changed=!helpers.arrayEquals(me._active,me._lastActive);if(changed){me._lastActive=me._active;if(options.enabled||options.custom){me._eventPosition={x:e.x,y:e.y};me.update(true);me.pivot();}} -return changed;}});Chart.Tooltip.positioners={average:function(elements){if(!elements.length){return false;} -var i,len;var x=0;var y=0;var count=0;for(i=0,len=elements.length;iendAngle){angle-=2.0*Math.PI;} -while(angle=startAngle&&angle<=endAngle);var withinRadius=(distance>=vm.innerRadius&&distance<=vm.outerRadius);return(betweenAngles&&withinRadius);} -return false;},getCenterPoint:function(){var vm=this._view;var halfAngle=(vm.startAngle+vm.endAngle)/2;var halfRadius=(vm.innerRadius+vm.outerRadius)/2;return{x:vm.x+Math.cos(halfAngle)*halfRadius,y:vm.y+Math.sin(halfAngle)*halfRadius};},getArea:function(){var vm=this._view;return Math.PI*((vm.endAngle-vm.startAngle)/(2*Math.PI))*(Math.pow(vm.outerRadius,2)-Math.pow(vm.innerRadius,2));},tooltipPosition:function(){var vm=this._view;var centreAngle=vm.startAngle+((vm.endAngle-vm.startAngle)/2);var rangeFromCentre=(vm.outerRadius-vm.innerRadius)/2+vm.innerRadius;return{x:vm.x+(Math.cos(centreAngle)*rangeFromCentre),y:vm.y+(Math.sin(centreAngle)*rangeFromCentre)};},draw:function(){var ctx=this._chart.ctx;var vm=this._view;var sA=vm.startAngle;var eA=vm.endAngle;ctx.beginPath();ctx.arc(vm.x,vm.y,vm.outerRadius,sA,eA);ctx.arc(vm.x,vm.y,vm.innerRadius,eA,sA,true);ctx.closePath();ctx.strokeStyle=vm.borderColor;ctx.lineWidth=vm.borderWidth;ctx.fillStyle=vm.backgroundColor;ctx.fill();ctx.lineJoin='bevel';if(vm.borderWidth){ctx.stroke();}}});},{"25":25,"26":26,"45":45}],37:[function(require,module,exports){'use strict';var defaults=require(25);var Element=require(26);var helpers=require(45);var globalDefaults=defaults.global;defaults._set('global',{elements:{line:{tension:0.4,backgroundColor:globalDefaults.defaultColor,borderWidth:3,borderColor:globalDefaults.defaultColor,borderCapStyle:'butt',borderDash:[],borderDashOffset:0.0,borderJoinStyle:'miter',capBezierPoints:true,fill:true,}}});module.exports=Element.extend({draw:function(){var me=this;var vm=me._view;var ctx=me._chart.ctx;var spanGaps=vm.spanGaps;var points=me._children.slice();var globalOptionLineElements=globalDefaults.elements.line;var lastDrawnIndex=-1;var index,current,previous,currentVM;if(me._loop&&points.length){points.push(points[0]);} -ctx.save();ctx.lineCap=vm.borderCapStyle||globalOptionLineElements.borderCapStyle;if(ctx.setLineDash){ctx.setLineDash(vm.borderDash||globalOptionLineElements.borderDash);} -ctx.lineDashOffset=vm.borderDashOffset||globalOptionLineElements.borderDashOffset;ctx.lineJoin=vm.borderJoinStyle||globalOptionLineElements.borderJoinStyle;ctx.lineWidth=vm.borderWidth||globalOptionLineElements.borderWidth;ctx.strokeStyle=vm.borderColor||globalDefaults.defaultColor;ctx.beginPath();lastDrawnIndex=-1;for(index=0;indextop?1:-1;borderSkipped=vm.borderSkipped||'bottom';}else{left=vm.base;right=vm.x;top=vm.y-vm.height/2;bottom=vm.y+vm.height/2;signX=right>left?1:-1;signY=1;borderSkipped=vm.borderSkipped||'left';} -if(borderWidth){var barSize=Math.min(Math.abs(left-right),Math.abs(top-bottom));borderWidth=borderWidth>barSize?barSize:borderWidth;var halfStroke=borderWidth/2;var borderLeft=left+(borderSkipped!=='left'?halfStroke*signX:0);var borderRight=right+(borderSkipped!=='right'?-halfStroke*signX:0);var borderTop=top+(borderSkipped!=='top'?halfStroke*signY:0);var borderBottom=bottom+(borderSkipped!=='bottom'?-halfStroke*signY:0);if(borderLeft!==borderRight){top=borderTop;bottom=borderBottom;} -if(borderTop!==borderBottom){left=borderLeft;right=borderRight;}} -ctx.beginPath();ctx.fillStyle=vm.backgroundColor;ctx.strokeStyle=vm.borderColor;ctx.lineWidth=borderWidth;var corners=[[left,bottom],[left,top],[right,top],[right,bottom]];var borders=['bottom','left','top','right'];var startCorner=borders.indexOf(borderSkipped,0);if(startCorner===-1){startCorner=0;} -function cornerAt(index){return corners[(startCorner+index)%4];} -var corner=cornerAt(0);ctx.moveTo(corner[0],corner[1]);for(var i=1;i<4;i++){corner=cornerAt(i);ctx.lineTo(corner[0],corner[1]);} -ctx.fill();if(borderWidth){ctx.stroke();}},height:function(){var vm=this._view;return vm.base-vm.y;},inRange:function(mouseX,mouseY){var inRange=false;if(this._view){var bounds=getBarBounds(this);inRange=mouseX>=bounds.left&&mouseX<=bounds.right&&mouseY>=bounds.top&&mouseY<=bounds.bottom;} -return inRange;},inLabelRange:function(mouseX,mouseY){var me=this;if(!me._view){return false;} -var inRange=false;var bounds=getBarBounds(me);if(isVertical(me)){inRange=mouseX>=bounds.left&&mouseX<=bounds.right;}else{inRange=mouseY>=bounds.top&&mouseY<=bounds.bottom;} -return inRange;},inXRange:function(mouseX){var bounds=getBarBounds(this);return mouseX>=bounds.left&&mouseX<=bounds.right;},inYRange:function(mouseY){var bounds=getBarBounds(this);return mouseY>=bounds.top&&mouseY<=bounds.bottom;},getCenterPoint:function(){var vm=this._view;var x,y;if(isVertical(this)){x=vm.x;y=(vm.y+vm.base)/2;}else{x=(vm.x+vm.base)/2;y=vm.y;} -return{x:x,y:y};},getArea:function(){var vm=this._view;return vm.width*Math.abs(vm.y-vm.base);},tooltipPosition:function(){var vm=this._view;return{x:vm.x,y:vm.y};}});},{"25":25,"26":26}],40:[function(require,module,exports){'use strict';module.exports={};module.exports.Arc=require(36);module.exports.Line=require(37);module.exports.Point=require(38);module.exports.Rectangle=require(39);},{"36":36,"37":37,"38":38,"39":39}],41:[function(require,module,exports){'use strict';var helpers=require(42);var exports=module.exports={clear:function(chart){chart.ctx.clearRect(0,0,chart.width,chart.height);},roundedRect:function(ctx,x,y,width,height,radius){if(radius){var rx=Math.min(radius,width/2);var ry=Math.min(radius,height/2);ctx.moveTo(x+rx,y);ctx.lineTo(x+width-rx,y);ctx.quadraticCurveTo(x+width,y,x+width,y+ry);ctx.lineTo(x+width,y+height-ry);ctx.quadraticCurveTo(x+width,y+height,x+width-rx,y+height);ctx.lineTo(x+rx,y+height);ctx.quadraticCurveTo(x,y+height,x,y+height-ry);ctx.lineTo(x,y+ry);ctx.quadraticCurveTo(x,y,x+rx,y);}else{ctx.rect(x,y,width,height);}},drawPoint:function(ctx,style,radius,x,y){var type,edgeLength,xOffset,yOffset,height,size;if(style&&typeof style==='object'){type=style.toString();if(type==='[object HTMLImageElement]'||type==='[object HTMLCanvasElement]'){ctx.drawImage(style,x-style.width/2,y-style.height/2,style.width,style.height);return;}} -if(isNaN(radius)||radius<=0){return;} -switch(style){default:ctx.beginPath();ctx.arc(x,y,radius,0,Math.PI*2);ctx.closePath();ctx.fill();break;case'triangle':ctx.beginPath();edgeLength=3*radius/Math.sqrt(3);height=edgeLength*Math.sqrt(3)/2;ctx.moveTo(x-edgeLength/2,y+height/3);ctx.lineTo(x+edgeLength/2,y+height/3);ctx.lineTo(x,y-2*height/3);ctx.closePath();ctx.fill();break;case'rect':size=1/Math.SQRT2*radius;ctx.beginPath();ctx.fillRect(x-size,y-size,2*size,2*size);ctx.strokeRect(x-size,y-size,2*size,2*size);break;case'rectRounded':var offset=radius/Math.SQRT2;var leftX=x-offset;var topY=y-offset;var sideSize=Math.SQRT2*radius;ctx.beginPath();this.roundedRect(ctx,leftX,topY,sideSize,sideSize,radius/2);ctx.closePath();ctx.fill();break;case'rectRot':size=1/Math.SQRT2*radius;ctx.beginPath();ctx.moveTo(x-size,y);ctx.lineTo(x,y+size);ctx.lineTo(x+size,y);ctx.lineTo(x,y-size);ctx.closePath();ctx.fill();break;case'cross':ctx.beginPath();ctx.moveTo(x,y+radius);ctx.lineTo(x,y-radius);ctx.moveTo(x-radius,y);ctx.lineTo(x+radius,y);ctx.closePath();break;case'crossRot':ctx.beginPath();xOffset=Math.cos(Math.PI/4)*radius;yOffset=Math.sin(Math.PI/4)*radius;ctx.moveTo(x-xOffset,y-yOffset);ctx.lineTo(x+xOffset,y+yOffset);ctx.moveTo(x-xOffset,y+yOffset);ctx.lineTo(x+xOffset,y-yOffset);ctx.closePath();break;case'star':ctx.beginPath();ctx.moveTo(x,y+radius);ctx.lineTo(x,y-radius);ctx.moveTo(x-radius,y);ctx.lineTo(x+radius,y);xOffset=Math.cos(Math.PI/4)*radius;yOffset=Math.sin(Math.PI/4)*radius;ctx.moveTo(x-xOffset,y-yOffset);ctx.lineTo(x+xOffset,y+yOffset);ctx.moveTo(x-xOffset,y+yOffset);ctx.lineTo(x+xOffset,y-yOffset);ctx.closePath();break;case'line':ctx.beginPath();ctx.moveTo(x-radius,y);ctx.lineTo(x+radius,y);ctx.closePath();break;case'dash':ctx.beginPath();ctx.moveTo(x,y);ctx.lineTo(x+radius,y);ctx.closePath();break;} -ctx.stroke();},clipArea:function(ctx,area){ctx.save();ctx.beginPath();ctx.rect(area.left,area.top,area.right-area.left,area.bottom-area.top);ctx.clip();},unclipArea:function(ctx){ctx.restore();},lineTo:function(ctx,previous,target,flip){if(target.steppedLine){if((target.steppedLine==='after'&&!flip)||(target.steppedLine!=='after'&&flip)){ctx.lineTo(previous.x,target.y);}else{ctx.lineTo(target.x,previous.y);} -ctx.lineTo(target.x,target.y);return;} -if(!target.tension){ctx.lineTo(target.x,target.y);return;} -ctx.bezierCurveTo(flip?previous.controlPointPreviousX:previous.controlPointNextX,flip?previous.controlPointPreviousY:previous.controlPointNextY,flip?target.controlPointNextX:target.controlPointPreviousX,flip?target.controlPointNextY:target.controlPointPreviousY,target.x,target.y);}};helpers.clear=exports.clear;helpers.drawRoundedRectangle=function(ctx){ctx.beginPath();exports.roundedRect.apply(exports,arguments);ctx.closePath();};},{"42":42}],42:[function(require,module,exports){'use strict';var helpers={noop:function(){},uid:(function(){var id=0;return function(){return id++;};}()),isNullOrUndef:function(value){return value===null||typeof value==='undefined';},isArray:Array.isArray?Array.isArray:function(value){return Object.prototype.toString.call(value)==='[object Array]';},isObject:function(value){return value!==null&&Object.prototype.toString.call(value)==='[object Object]';},valueOrDefault:function(value,defaultValue){return typeof value==='undefined'?defaultValue:value;},valueAtIndexOrDefault:function(value,index,defaultValue){return helpers.valueOrDefault(helpers.isArray(value)?value[index]:value,defaultValue);},callback:function(fn,args,thisArg){if(fn&&typeof fn.call==='function'){return fn.apply(thisArg,args);}},each:function(loopable,fn,thisArg,reverse){var i,len,keys;if(helpers.isArray(loopable)){len=loopable.length;if(reverse){for(i=len-1;i>=0;i--){fn.call(thisArg,loopable[i],i);}}else{for(i=0;i=0;i--){fn.call(thisArg,loopable[i],i);}}else{for(i=0;iarea.left-epsilon&&point.xarea.top-epsilon&&point.y0){me.requestAnimationFrame();}},advance:function(){var animations=this.animations;var animation,chart,numSteps,nextStep;var i=0;while(i=numSteps){helpers$1.callback(animation.onAnimationComplete,[animation],chart);chart.animating=false;animations.splice(i,1);}else{++i;}}}};var resolve=helpers$1.options.resolve;var arrayEvents=['push','pop','shift','splice','unshift'];function listenArrayEvents(array,listener){if(array._chartjs){array._chartjs.listeners.push(listener);return;} +Object.defineProperty(array,'_chartjs',{configurable:true,enumerable:false,value:{listeners:[listener]}});arrayEvents.forEach(function(key){var method='onData'+key.charAt(0).toUpperCase()+key.slice(1);var base=array[key];Object.defineProperty(array,key,{configurable:true,enumerable:false,value:function(){var args=Array.prototype.slice.call(arguments);var res=base.apply(this,args);helpers$1.each(array._chartjs.listeners,function(object){if(typeof object[method]==='function'){object[method].apply(object,args);}});return res;}});});} +function unlistenArrayEvents(array,listener){var stub=array._chartjs;if(!stub){return;} +var listeners=stub.listeners;var index=listeners.indexOf(listener);if(index!==-1){listeners.splice(index,1);} +if(listeners.length>0){return;} +arrayEvents.forEach(function(key){delete array[key];});delete array._chartjs;} +var DatasetController=function(chart,datasetIndex){this.initialize(chart,datasetIndex);};helpers$1.extend(DatasetController.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:['backgroundColor','borderCapStyle','borderColor','borderDash','borderDashOffset','borderJoinStyle','borderWidth'],_dataElementOptions:['backgroundColor','borderColor','borderWidth','pointStyle'],initialize:function(chart,datasetIndex){var me=this;me.chart=chart;me.index=datasetIndex;me.linkScales();me.addElements();me._type=me.getMeta().type;},updateIndex:function(datasetIndex){this.index=datasetIndex;},linkScales:function(){var me=this;var meta=me.getMeta();var chart=me.chart;var scales=chart.scales;var dataset=me.getDataset();var scalesOpts=chart.options.scales;if(meta.xAxisID===null||!(meta.xAxisID in scales)||dataset.xAxisID){meta.xAxisID=dataset.xAxisID||scalesOpts.xAxes[0].id;} +if(meta.yAxisID===null||!(meta.yAxisID in scales)||dataset.yAxisID){meta.yAxisID=dataset.yAxisID||scalesOpts.yAxes[0].id;}},getDataset:function(){return this.chart.data.datasets[this.index];},getMeta:function(){return this.chart.getDatasetMeta(this.index);},getScaleForId:function(scaleID){return this.chart.scales[scaleID];},_getValueScaleId:function(){return this.getMeta().yAxisID;},_getIndexScaleId:function(){return this.getMeta().xAxisID;},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId());},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId());},reset:function(){this._update(true);},destroy:function(){if(this._data){unlistenArrayEvents(this._data,this);}},createMetaDataset:function(){var me=this;var type=me.datasetElementType;return type&&new type({_chart:me.chart,_datasetIndex:me.index});},createMetaData:function(index){var me=this;var type=me.dataElementType;return type&&new type({_chart:me.chart,_datasetIndex:me.index,_index:index});},addElements:function(){var me=this;var meta=me.getMeta();var data=me.getDataset().data||[];var metaData=meta.data;var i,ilen;for(i=0,ilen=data.length;inumMeta){me.insertElements(numMeta,numData-numMeta);}},insertElements:function(start,count){for(var i=0;ipixelMargin){angleMargin=pixelMargin/arc.innerRadius;ctx.arc(x,y,arc.innerRadius-pixelMargin,endAngle+angleMargin,startAngle-angleMargin,true);}else{ctx.arc(x,y,pixelMargin,endAngle+Math.PI/2,startAngle-Math.PI/2);} +ctx.closePath();ctx.clip();} +function drawFullCircleBorders(ctx,vm,arc,inner){var endAngle=arc.endAngle;var i;if(inner){arc.endAngle=arc.startAngle+TAU;clipArc(ctx,arc);arc.endAngle=endAngle;if(arc.endAngle===arc.startAngle&&arc.fullCircles){arc.endAngle+=TAU;arc.fullCircles--;}} +ctx.beginPath();ctx.arc(arc.x,arc.y,arc.innerRadius,arc.startAngle+TAU,arc.startAngle,true);for(i=0;iendAngle){angle-=TAU;} +while(angle=startAngle&&angle<=endAngle);var withinRadius=(distance>=vm.innerRadius&&distance<=vm.outerRadius);return(betweenAngles&&withinRadius);} +return false;},getCenterPoint:function(){var vm=this._view;var halfAngle=(vm.startAngle+vm.endAngle)/2;var halfRadius=(vm.innerRadius+vm.outerRadius)/2;return{x:vm.x+Math.cos(halfAngle)*halfRadius,y:vm.y+Math.sin(halfAngle)*halfRadius};},getArea:function(){var vm=this._view;return Math.PI*((vm.endAngle-vm.startAngle)/(2*Math.PI))*(Math.pow(vm.outerRadius,2)-Math.pow(vm.innerRadius,2));},tooltipPosition:function(){var vm=this._view;var centreAngle=vm.startAngle+((vm.endAngle-vm.startAngle)/2);var rangeFromCentre=(vm.outerRadius-vm.innerRadius)/2+vm.innerRadius;return{x:vm.x+(Math.cos(centreAngle)*rangeFromCentre),y:vm.y+(Math.sin(centreAngle)*rangeFromCentre)};},draw:function(){var ctx=this._chart.ctx;var vm=this._view;var pixelMargin=(vm.borderAlign==='inner')?0.33:0;var arc={x:vm.x,y:vm.y,innerRadius:vm.innerRadius,outerRadius:Math.max(vm.outerRadius-pixelMargin,0),pixelMargin:pixelMargin,startAngle:vm.startAngle,endAngle:vm.endAngle,fullCircles:Math.floor(vm.circumference/TAU)};var i;ctx.save();ctx.fillStyle=vm.backgroundColor;ctx.strokeStyle=vm.borderColor;if(arc.fullCircles){arc.endAngle=arc.startAngle+TAU;ctx.beginPath();ctx.arc(arc.x,arc.y,arc.outerRadius,arc.startAngle,arc.endAngle);ctx.arc(arc.x,arc.y,arc.innerRadius,arc.endAngle,arc.startAngle,true);ctx.closePath();for(i=0;ivm.x){edge=swap(edge,'left','right');}}else if(vm.basemaxH?maxH:t,r:skip.right||(r<0)?0:r>maxW?maxW:r,b:skip.bottom||(b<0)?0:b>maxH?maxH:b,l:skip.left||(l<0)?0:l>maxW?maxW:l};} +function boundingRects(vm){var bounds=getBarBounds(vm);var width=bounds.right-bounds.left;var height=bounds.bottom-bounds.top;var border=parseBorderWidth(vm,width/2,height/2);return{outer:{x:bounds.left,y:bounds.top,w:width,h:height},inner:{x:bounds.left+border.l,y:bounds.top+border.t,w:width-border.l-border.r,h:height-border.t-border.b}};} +function inRange(vm,x,y){var skipX=x===null;var skipY=y===null;var bounds=!vm||(skipX&&skipY)?false:getBarBounds(vm);return bounds&&(skipX||x>=bounds.left&&x<=bounds.right)&&(skipY||y>=bounds.top&&y<=bounds.bottom);} +var element_rectangle=core_element.extend({_type:'rectangle',draw:function(){var ctx=this._chart.ctx;var vm=this._view;var rects=boundingRects(vm);var outer=rects.outer;var inner=rects.inner;ctx.fillStyle=vm.backgroundColor;ctx.fillRect(outer.x,outer.y,outer.w,outer.h);if(outer.w===inner.w&&outer.h===inner.h){return;} +ctx.save();ctx.beginPath();ctx.rect(outer.x,outer.y,outer.w,outer.h);ctx.clip();ctx.fillStyle=vm.borderColor;ctx.rect(inner.x,inner.y,inner.w,inner.h);ctx.fill('evenodd');ctx.restore();},height:function(){var vm=this._view;return vm.base-vm.y;},inRange:function(mouseX,mouseY){return inRange(this._view,mouseX,mouseY);},inLabelRange:function(mouseX,mouseY){var vm=this._view;return isVertical(vm)?inRange(vm,mouseX,null):inRange(vm,null,mouseY);},inXRange:function(mouseX){return inRange(this._view,mouseX,null);},inYRange:function(mouseY){return inRange(this._view,null,mouseY);},getCenterPoint:function(){var vm=this._view;var x,y;if(isVertical(vm)){x=vm.x;y=(vm.y+vm.base)/2;}else{x=(vm.x+vm.base)/2;y=vm.y;} +return{x:x,y:y};},getArea:function(){var vm=this._view;return isVertical(vm)?vm.width*Math.abs(vm.y-vm.base):vm.height*Math.abs(vm.x-vm.base);},tooltipPosition:function(){var vm=this._view;return{x:vm.x,y:vm.y};}});var elements={};var Arc=element_arc;var Line=element_line;var Point=element_point;var Rectangle=element_rectangle;elements.Arc=Arc;elements.Line=Line;elements.Point=Point;elements.Rectangle=Rectangle;var deprecated=helpers$1._deprecated;var valueOrDefault$3=helpers$1.valueOrDefault;core_defaults._set('bar',{hover:{mode:'label'},scales:{xAxes:[{type:'category',offset:true,gridLines:{offsetGridLines:true}}],yAxes:[{type:'linear'}]}});core_defaults._set('global',{datasets:{bar:{categoryPercentage:0.8,barPercentage:0.9}}});function computeMinSampleSize(scale,pixels){var min=scale._length;var prev,curr,i,ilen;for(i=1,ilen=pixels.length;i0?Math.min(min,Math.abs(curr-prev)):min;prev=curr;} +return min;} +function computeFitCategoryTraits(index,ruler,options){var thickness=options.barThickness;var count=ruler.stackCount;var curr=ruler.pixels[index];var min=helpers$1.isNullOrUndef(thickness)?computeMinSampleSize(ruler.scale,ruler.pixels):-1;var size,ratio;if(helpers$1.isNullOrUndef(thickness)){size=min*options.categoryPercentage;ratio=options.barPercentage;}else{size=thickness*count;ratio=1;} +return{chunk:size/count,ratio:ratio,start:curr-(size/2)};} +function computeFlexCategoryTraits(index,ruler,options){var pixels=ruler.pixels;var curr=pixels[index];var prev=index>0?pixels[index-1]:null;var next=index=0&&value.min>=0?value.min:value.max;var length=value.start===undefined?value.end:value.max>=0&&value.min>=0?value.max-value.min:value.min-value.max;var ilen=metasets.length;var i,imeta,ivalue,base,head,size,stackLength;if(stacked||(stacked===undefined&&stack!==undefined)){for(i=0;i=0&&stackLength.max>=0?stackLength.max:stackLength.min;if((value.min<0&&ivalue<0)||(value.max>=0&&ivalue>0)){start+=ivalue;}}}} +base=scale.getPixelForValue(start);head=scale.getPixelForValue(start+length);size=head-base;if(minBarLength!==undefined&&Math.abs(size)=0&&!isHorizontal||length<0&&isHorizontal){head=base-minBarLength;}else{head=base+minBarLength;}} +return{size:size,base:base,head:head,center:head+size/2};},calculateBarIndexPixels:function(datasetIndex,index,ruler,options){var me=this;var range=options.barThickness==='flex'?computeFlexCategoryTraits(index,ruler,options):computeFitCategoryTraits(index,ruler,options);var stackIndex=me.getStackIndex(datasetIndex,me.getMeta().stack);var center=range.start+(range.chunk*stackIndex)+(range.chunk/2);var size=Math.min(valueOrDefault$3(options.maxBarThickness,Infinity),range.chunk*range.ratio);return{base:center-size/2,head:center+size/2,center:center,size:size};},draw:function(){var me=this;var chart=me.chart;var scale=me._getValueScale();var rects=me.getMeta().data;var dataset=me.getDataset();var ilen=rects.length;var i=0;helpers$1.canvas.clipArea(chart.ctx,chart.chartArea);for(;i=PI$1?-DOUBLE_PI$1:startAngle<-PI$1?DOUBLE_PI$1:0;var endAngle=startAngle+circumference;var startX=Math.cos(startAngle);var startY=Math.sin(startAngle);var endX=Math.cos(endAngle);var endY=Math.sin(endAngle);var contains0=(startAngle<=0&&endAngle>=0)||endAngle>=DOUBLE_PI$1;var contains90=(startAngle<=HALF_PI$1&&endAngle>=HALF_PI$1)||endAngle>=DOUBLE_PI$1+HALF_PI$1;var contains180=startAngle===-PI$1||endAngle>=PI$1;var contains270=(startAngle<=-HALF_PI$1&&endAngle>=-HALF_PI$1)||endAngle>=PI$1+HALF_PI$1;var minX=contains180?-1:Math.min(startX,startX*cutout,endX,endX*cutout);var minY=contains270?-1:Math.min(startY,startY*cutout,endY,endY*cutout);var maxX=contains0?1:Math.max(startX,startX*cutout,endX,endX*cutout);var maxY=contains90?1:Math.max(startY,startY*cutout,endY,endY*cutout);ratioX=(maxX-minX)/2;ratioY=(maxY-minY)/2;offsetX=-(maxX+minX)/2;offsetY=-(maxY+minY)/2;} +for(i=0,ilen=arcs.length;i0&&!isNaN(value)){return DOUBLE_PI$1*(Math.abs(value)/total);} +return 0;},getMaxBorderWidth:function(arcs){var me=this;var max=0;var chart=me.chart;var i,ilen,meta,arc,controller,options,borderWidth,hoverWidth;if(!arcs){for(i=0,ilen=chart.data.datasets.length;imax?borderWidth:max;max=hoverWidth>max?hoverWidth:max;}} +return max;},setHoverStyle:function(arc){var model=arc._model;var options=arc._options;var getHoverColor=helpers$1.getHoverColor;arc.$previousStyle={backgroundColor:model.backgroundColor,borderColor:model.borderColor,borderWidth:model.borderWidth,};model.backgroundColor=valueOrDefault$5(options.hoverBackgroundColor,getHoverColor(options.backgroundColor));model.borderColor=valueOrDefault$5(options.hoverBorderColor,getHoverColor(options.borderColor));model.borderWidth=valueOrDefault$5(options.hoverBorderWidth,options.borderWidth);},_getRingWeightOffset:function(datasetIndex){var ringWeightOffset=0;for(var i=0;i0&&isPointInArea(points[i-1]._model,area)){model.controlPointPreviousX=capControlPoint(model.controlPointPreviousX,area.left,area.right);model.controlPointPreviousY=capControlPoint(model.controlPointPreviousY,area.top,area.bottom);} +if(i0){items=chart.getDatasetMeta(items[0]._datasetIndex).data;} +return items;},'x-axis':function(chart,e){return indexMode(chart,e,{intersect:false});},point:function(chart,e){var position=getRelativePosition(e,chart);return getIntersectItems(chart,position);},nearest:function(chart,e,options){var position=getRelativePosition(e,chart);options.axis=options.axis||'xy';var distanceMetric=getDistanceMetricForAxis(options.axis);return getNearestItems(chart,position,options.intersect,distanceMetric);},x:function(chart,e,options){var position=getRelativePosition(e,chart);var items=[];var intersectsItem=false;parseVisibleItems(chart,function(element){if(element.inXRange(position.x)){items.push(element);} +if(element.inRange(position.x,position.y)){intersectsItem=true;}});if(options.intersect&&!intersectsItem){items=[];} +return items;},y:function(chart,e,options){var position=getRelativePosition(e,chart);var items=[];var intersectsItem=false;parseVisibleItems(chart,function(element){if(element.inYRange(position.y)){items.push(element);} +if(element.inRange(position.x,position.y)){intersectsItem=true;}});if(options.intersect&&!intersectsItem){items=[];} +return items;}}};var extend=helpers$1.extend;function filterByPosition(array,position){return helpers$1.where(array,function(v){return v.pos===position;});} +function sortByWeight(array,reverse){return array.sort(function(a,b){var v0=reverse?b:a;var v1=reverse?a:b;return v0.weight===v1.weight?v0.index-v1.index:v0.weight-v1.weight;});} +function wrapBoxes(boxes){var layoutBoxes=[];var i,ilen,box;for(i=0,ilen=(boxes||[]).length;i'+'
      '+'
      '+'
      '+'
      '+'
      '+'
      '+'
      ';var expand=resizer.childNodes[0];var shrink=resizer.childNodes[1];resizer._reset=function(){expand.scrollLeft=maxSize;expand.scrollTop=maxSize;shrink.scrollLeft=maxSize;shrink.scrollTop=maxSize;};var onScroll=function(){resizer._reset();handler();};addEventListener(expand,'scroll',onScroll.bind(expand,'expand'));addEventListener(shrink,'scroll',onScroll.bind(shrink,'shrink'));return resizer;} -function watchForRender(node,handler){var expando=node[EXPANDO_KEY]||(node[EXPANDO_KEY]={});var proxy=expando.renderProxy=function(e){if(e.animationName===CSS_RENDER_ANIMATION){handler();}};helpers.each(ANIMATION_START_EVENTS,function(type){addEventListener(node,type,proxy);});expando.reflow=!!node.offsetParent;node.classList.add(CSS_RENDER_MONITOR);} -function unwatchForRender(node){var expando=node[EXPANDO_KEY]||{};var proxy=expando.renderProxy;if(proxy){helpers.each(ANIMATION_START_EVENTS,function(type){removeEventListener(node,type,proxy);});delete expando.renderProxy;} +function fromNativeEvent(event,chart){var type=EVENT_TYPES[event.type]||event.type;var pos=helpers$1.getRelativePosition(event,chart);return createEvent(type,chart,pos.x,pos.y,event);} +function throttled(fn,thisArg){var ticking=false;var args=[];return function(){args=Array.prototype.slice.call(arguments);thisArg=thisArg||this;if(!ticking){ticking=true;helpers$1.requestAnimFrame.call(window,function(){ticking=false;fn.apply(thisArg,args);});}};} +function createDiv(cls){var el=document.createElement('div');el.className=cls||'';return el;} +function createResizer(handler){var maxSize=1000000;var resizer=createDiv(CSS_SIZE_MONITOR);var expand=createDiv(CSS_SIZE_MONITOR+'-expand');var shrink=createDiv(CSS_SIZE_MONITOR+'-shrink');expand.appendChild(createDiv());shrink.appendChild(createDiv());resizer.appendChild(expand);resizer.appendChild(shrink);resizer._reset=function(){expand.scrollLeft=maxSize;expand.scrollTop=maxSize;shrink.scrollLeft=maxSize;shrink.scrollTop=maxSize;};var onScroll=function(){resizer._reset();handler();};addListener(expand,'scroll',onScroll.bind(expand,'expand'));addListener(shrink,'scroll',onScroll.bind(shrink,'shrink'));return resizer;} +function watchForRender(node,handler){var expando=node[EXPANDO_KEY]||(node[EXPANDO_KEY]={});var proxy=expando.renderProxy=function(e){if(e.animationName===CSS_RENDER_ANIMATION){handler();}};helpers$1.each(ANIMATION_START_EVENTS,function(type){addListener(node,type,proxy);});expando.reflow=!!node.offsetParent;node.classList.add(CSS_RENDER_MONITOR);} +function unwatchForRender(node){var expando=node[EXPANDO_KEY]||{};var proxy=expando.renderProxy;if(proxy){helpers$1.each(ANIMATION_START_EVENTS,function(type){removeListener(node,type,proxy);});delete expando.renderProxy;} node.classList.remove(CSS_RENDER_MONITOR);} -function addResizeListener(node,listener,chart){var expando=node[EXPANDO_KEY]||(node[EXPANDO_KEY]={});var resizer=expando.resizer=createResizer(throttled(function(){if(expando.resizer){return listener(createEvent('resize',chart));}}));watchForRender(node,function(){if(expando.resizer){var container=node.parentNode;if(container&&container!==resizer.parentNode){container.insertBefore(resizer,container.firstChild);} +function addResizeListener(node,listener,chart){var expando=node[EXPANDO_KEY]||(node[EXPANDO_KEY]={});var resizer=expando.resizer=createResizer(throttled(function(){if(expando.resizer){var container=chart.options.maintainAspectRatio&&node.parentNode;var w=container?container.clientWidth:0;listener(createEvent('resize',chart));if(container&&container.clientWidth0){var item=tooltipItems[0];if(item.label){title=item.label;}else if(item.xLabel){title=item.xLabel;}else if(labelCount>0&&item.index-1){return str.split('\n');} +return str;} +function createTooltipItem(element){var xScale=element._xScale;var yScale=element._yScale||element._scale;var index=element._index;var datasetIndex=element._datasetIndex;var controller=element._chart.getDatasetMeta(datasetIndex).controller;var indexScale=controller._getIndexScale();var valueScale=controller._getValueScale();return{xLabel:xScale?xScale.getLabelForIndex(index,datasetIndex):'',yLabel:yScale?yScale.getLabelForIndex(index,datasetIndex):'',label:indexScale?''+indexScale.getLabelForIndex(index,datasetIndex):'',value:valueScale?''+valueScale.getLabelForIndex(index,datasetIndex):'',index:index,datasetIndex:datasetIndex,x:element._model.x,y:element._model.y};} +function getBaseModel(tooltipOpts){var globalDefaults=core_defaults.global;return{xPadding:tooltipOpts.xPadding,yPadding:tooltipOpts.yPadding,xAlign:tooltipOpts.xAlign,yAlign:tooltipOpts.yAlign,rtl:tooltipOpts.rtl,textDirection:tooltipOpts.textDirection,bodyFontColor:tooltipOpts.bodyFontColor,_bodyFontFamily:valueOrDefault$8(tooltipOpts.bodyFontFamily,globalDefaults.defaultFontFamily),_bodyFontStyle:valueOrDefault$8(tooltipOpts.bodyFontStyle,globalDefaults.defaultFontStyle),_bodyAlign:tooltipOpts.bodyAlign,bodyFontSize:valueOrDefault$8(tooltipOpts.bodyFontSize,globalDefaults.defaultFontSize),bodySpacing:tooltipOpts.bodySpacing,titleFontColor:tooltipOpts.titleFontColor,_titleFontFamily:valueOrDefault$8(tooltipOpts.titleFontFamily,globalDefaults.defaultFontFamily),_titleFontStyle:valueOrDefault$8(tooltipOpts.titleFontStyle,globalDefaults.defaultFontStyle),titleFontSize:valueOrDefault$8(tooltipOpts.titleFontSize,globalDefaults.defaultFontSize),_titleAlign:tooltipOpts.titleAlign,titleSpacing:tooltipOpts.titleSpacing,titleMarginBottom:tooltipOpts.titleMarginBottom,footerFontColor:tooltipOpts.footerFontColor,_footerFontFamily:valueOrDefault$8(tooltipOpts.footerFontFamily,globalDefaults.defaultFontFamily),_footerFontStyle:valueOrDefault$8(tooltipOpts.footerFontStyle,globalDefaults.defaultFontStyle),footerFontSize:valueOrDefault$8(tooltipOpts.footerFontSize,globalDefaults.defaultFontSize),_footerAlign:tooltipOpts.footerAlign,footerSpacing:tooltipOpts.footerSpacing,footerMarginTop:tooltipOpts.footerMarginTop,caretSize:tooltipOpts.caretSize,cornerRadius:tooltipOpts.cornerRadius,backgroundColor:tooltipOpts.backgroundColor,opacity:0,legendColorBackground:tooltipOpts.multiKeyBackground,displayColors:tooltipOpts.displayColors,borderColor:tooltipOpts.borderColor,borderWidth:tooltipOpts.borderWidth};} +function getTooltipSize(tooltip,model){var ctx=tooltip._chart.ctx;var height=model.yPadding*2;var width=0;var body=model.body;var combinedBodyLength=body.reduce(function(count,bodyItem){return count+bodyItem.before.length+bodyItem.lines.length+bodyItem.after.length;},0);combinedBodyLength+=model.beforeBody.length+model.afterBody.length;var titleLineCount=model.title.length;var footerLineCount=model.footer.length;var titleFontSize=model.titleFontSize;var bodyFontSize=model.bodyFontSize;var footerFontSize=model.footerFontSize;height+=titleLineCount*titleFontSize;height+=titleLineCount?(titleLineCount-1)*model.titleSpacing:0;height+=titleLineCount?model.titleMarginBottom:0;height+=combinedBodyLength*bodyFontSize;height+=combinedBodyLength?(combinedBodyLength-1)*model.bodySpacing:0;height+=footerLineCount?model.footerMarginTop:0;height+=footerLineCount*(footerFontSize);height+=footerLineCount?(footerLineCount-1)*model.footerSpacing:0;var widthPadding=0;var maxLineWidth=function(line){width=Math.max(width,ctx.measureText(line).width+widthPadding);};ctx.font=helpers$1.fontString(titleFontSize,model._titleFontStyle,model._titleFontFamily);helpers$1.each(model.title,maxLineWidth);ctx.font=helpers$1.fontString(bodyFontSize,model._bodyFontStyle,model._bodyFontFamily);helpers$1.each(model.beforeBody.concat(model.afterBody),maxLineWidth);widthPadding=model.displayColors?(bodyFontSize+2):0;helpers$1.each(body,function(bodyItem){helpers$1.each(bodyItem.before,maxLineWidth);helpers$1.each(bodyItem.lines,maxLineWidth);helpers$1.each(bodyItem.after,maxLineWidth);});widthPadding=0;ctx.font=helpers$1.fontString(footerFontSize,model._footerFontStyle,model._footerFontFamily);helpers$1.each(model.footer,maxLineWidth);width+=2*model.xPadding;return{width:width,height:height};} +function determineAlignment(tooltip,size){var model=tooltip._model;var chart=tooltip._chart;var chartArea=tooltip._chart.chartArea;var xAlign='center';var yAlign='center';if(model.y(chart.height-size.height)){yAlign='bottom';} +var lf,rf;var olf,orf;var yf;var midX=(chartArea.left+chartArea.right)/2;var midY=(chartArea.top+chartArea.bottom)/2;if(yAlign==='center'){lf=function(x){return x<=midX;};rf=function(x){return x>midX;};}else{lf=function(x){return x<=(size.width/2);};rf=function(x){return x>=(chart.width-(size.width/2));};} +olf=function(x){return x+size.width+model.caretSize+model.caretPadding>chart.width;};orf=function(x){return x-size.width-model.caretSize-model.caretPadding<0;};yf=function(y){return y<=midY?'top':'bottom';};if(lf(model.x)){xAlign='left';if(olf(model.x)){xAlign='center';yAlign=yf(model.y);}}else if(rf(model.x)){xAlign='right';if(orf(model.x)){xAlign='center';yAlign=yf(model.y);}} +var opts=tooltip._options;return{xAlign:opts.xAlign?opts.xAlign:xAlign,yAlign:opts.yAlign?opts.yAlign:yAlign};} +function getBackgroundPoint(vm,size,alignment,chart){var x=vm.x;var y=vm.y;var caretSize=vm.caretSize;var caretPadding=vm.caretPadding;var cornerRadius=vm.cornerRadius;var xAlign=alignment.xAlign;var yAlign=alignment.yAlign;var paddingAndSize=caretSize+caretPadding;var radiusAndPadding=cornerRadius+caretPadding;if(xAlign==='right'){x-=size.width;}else if(xAlign==='center'){x-=(size.width/2);if(x+size.width>chart.width){x=chart.width-size.width;} +if(x<0){x=0;}} +if(yAlign==='top'){y+=paddingAndSize;}else if(yAlign==='bottom'){y-=size.height+paddingAndSize;}else{y-=(size.height/2);} +if(yAlign==='center'){if(xAlign==='left'){x+=paddingAndSize;}else if(xAlign==='right'){x-=paddingAndSize;}}else if(xAlign==='left'){x-=radiusAndPadding;}else if(xAlign==='right'){x+=radiusAndPadding;} +return{x:x,y:y};} +function getAlignedX(vm,align){return align==='center'?vm.x+vm.width/2:align==='right'?vm.x+vm.width-vm.xPadding:vm.x+vm.xPadding;} +function getBeforeAfterBodyLines(callback){return pushOrConcat([],splitNewlines(callback));} +var exports$4=core_element.extend({initialize:function(){this._model=getBaseModel(this._options);this._lastActive=[];},getTitle:function(){var me=this;var opts=me._options;var callbacks=opts.callbacks;var beforeTitle=callbacks.beforeTitle.apply(me,arguments);var title=callbacks.title.apply(me,arguments);var afterTitle=callbacks.afterTitle.apply(me,arguments);var lines=[];lines=pushOrConcat(lines,splitNewlines(beforeTitle));lines=pushOrConcat(lines,splitNewlines(title));lines=pushOrConcat(lines,splitNewlines(afterTitle));return lines;},getBeforeBody:function(){return getBeforeAfterBodyLines(this._options.callbacks.beforeBody.apply(this,arguments));},getBody:function(tooltipItems,data){var me=this;var callbacks=me._options.callbacks;var bodyItems=[];helpers$1.each(tooltipItems,function(tooltipItem){var bodyItem={before:[],lines:[],after:[]};pushOrConcat(bodyItem.before,splitNewlines(callbacks.beforeLabel.call(me,tooltipItem,data)));pushOrConcat(bodyItem.lines,callbacks.label.call(me,tooltipItem,data));pushOrConcat(bodyItem.after,splitNewlines(callbacks.afterLabel.call(me,tooltipItem,data)));bodyItems.push(bodyItem);});return bodyItems;},getAfterBody:function(){return getBeforeAfterBodyLines(this._options.callbacks.afterBody.apply(this,arguments));},getFooter:function(){var me=this;var callbacks=me._options.callbacks;var beforeFooter=callbacks.beforeFooter.apply(me,arguments);var footer=callbacks.footer.apply(me,arguments);var afterFooter=callbacks.afterFooter.apply(me,arguments);var lines=[];lines=pushOrConcat(lines,splitNewlines(beforeFooter));lines=pushOrConcat(lines,splitNewlines(footer));lines=pushOrConcat(lines,splitNewlines(afterFooter));return lines;},update:function(changed){var me=this;var opts=me._options;var existingModel=me._model;var model=me._model=getBaseModel(opts);var active=me._active;var data=me._data;var alignment={xAlign:existingModel.xAlign,yAlign:existingModel.yAlign};var backgroundPoint={x:existingModel.x,y:existingModel.y};var tooltipSize={width:existingModel.width,height:existingModel.height};var tooltipPosition={x:existingModel.caretX,y:existingModel.caretY};var i,len;if(active.length){model.opacity=1;var labelColors=[];var labelTextColors=[];tooltipPosition=positioners[opts.position].call(me,active,me._eventPosition);var tooltipItems=[];for(i=0,len=active.length;i0){ctx.stroke();}},draw:function(){var ctx=this._chart.ctx;var vm=this._view;if(vm.opacity===0){return;} +var tooltipSize={width:vm.width,height:vm.height};var pt={x:vm.x,y:vm.y};var opacity=Math.abs(vm.opacity<1e-3)?0:vm.opacity;var hasTooltipContent=vm.title.length||vm.beforeBody.length||vm.body.length||vm.afterBody.length||vm.footer.length;if(this._options.enabled&&hasTooltipContent){ctx.save();ctx.globalAlpha=opacity;this.drawBackground(pt,vm,ctx,tooltipSize);pt.y+=vm.yPadding;helpers$1.rtl.overrideTextDirection(ctx,vm.textDirection);this.drawTitle(pt,vm,ctx);this.drawBody(pt,vm,ctx);this.drawFooter(pt,vm,ctx);helpers$1.rtl.restoreTextDirection(ctx,vm.textDirection);ctx.restore();}},handleEvent:function(e){var me=this;var options=me._options;var changed=false;me._lastActive=me._lastActive||[];if(e.type==='mouseout'){me._active=[];}else{me._active=me._chart.getElementsAtEventForMode(e,options.mode,options);if(options.reverse){me._active.reverse();}} +changed=!helpers$1.arrayEquals(me._active,me._lastActive);if(changed){me._lastActive=me._active;if(options.enabled||options.custom){me._eventPosition={x:e.x,y:e.y};me.update(true);me.pivot();}} +return changed;}});var positioners_1=positioners;var core_tooltip=exports$4;core_tooltip.positioners=positioners_1;var valueOrDefault$9=helpers$1.valueOrDefault;core_defaults._set('global',{elements:{},events:['mousemove','mouseout','click','touchstart','touchmove'],hover:{onHover:null,mode:'nearest',intersect:true,animationDuration:400},onClick:null,maintainAspectRatio:true,responsive:true,responsiveAnimationDuration:0});function mergeScaleConfig(){return helpers$1.merge({},[].slice.call(arguments),{merger:function(key,target,source,options){if(key==='xAxes'||key==='yAxes'){var slen=source[key].length;var i,type,scale;if(!target[key]){target[key]=[];} +for(i=0;i=target[key].length){target[key].push({});} +if(!target[key][i].type||(scale.type&&scale.type!==target[key][i].type)){helpers$1.merge(target[key][i],[core_scaleService.getScaleDefaults(type),scale]);}else{helpers$1.merge(target[key][i],scale);}}}else{helpers$1._merger(key,target,source,options);}}});} +function mergeConfig(){return helpers$1.merge({},[].slice.call(arguments),{merger:function(key,target,source,options){var tval=target[key]||{};var sval=source[key];if(key==='scales'){target[key]=mergeScaleConfig(tval,sval);}else if(key==='scale'){target[key]=helpers$1.merge(tval,[core_scaleService.getScaleDefaults(sval.type),sval]);}else{helpers$1._merger(key,target,source,options);}}});} +function initConfig(config){config=config||{};var data=config.data=config.data||{};data.datasets=data.datasets||[];data.labels=data.labels||[];config.options=mergeConfig(core_defaults.global,core_defaults[config.type],config.options||{});return config;} +function updateConfig(chart){var newOptions=chart.options;helpers$1.each(chart.scales,function(scale){core_layouts.removeBox(chart,scale);});newOptions=mergeConfig(core_defaults.global,core_defaults[chart.config.type],newOptions);chart.options=chart.config.options=newOptions;chart.ensureScalesHaveIDs();chart.buildOrUpdateScales();chart.tooltip._options=newOptions.tooltips;chart.tooltip.initialize();} +function nextAvailableScaleId(axesOpts,prefix,index){var id;var hasId=function(obj){return obj.id===id;};do{id=prefix+index++;}while(helpers$1.findIndex(axesOpts,hasId)>=0);return id;} +function positionIsHorizontal(position){return position==='top'||position==='bottom';} +function compare2Level(l1,l2){return function(a,b){return a[l1]===b[l1]?a[l2]-b[l2]:a[l1]-b[l1];};} +var Chart=function(item,config){this.construct(item,config);return this;};helpers$1.extend(Chart.prototype,{construct:function(item,config){var me=this;config=initConfig(config);var context=platform.acquireContext(item,config);var canvas=context&&context.canvas;var height=canvas&&canvas.height;var width=canvas&&canvas.width;me.id=helpers$1.uid();me.ctx=context;me.canvas=canvas;me.config=config;me.width=width;me.height=height;me.aspectRatio=height?width/height:null;me.options=config.options;me._bufferedRender=false;me._layers=[];me.chart=me;me.controller=me;Chart.instances[me.id]=me;Object.defineProperty(me,'data',{get:function(){return me.config.data;},set:function(value){me.config.data=value;}});if(!context||!canvas){console.error("Failed to create chart: can't acquire context from the given item");return;} +me.initialize();me.update();},initialize:function(){var me=this;core_plugins.notify(me,'beforeInit');helpers$1.retinaScale(me,me.options.devicePixelRatio);me.bindEvents();if(me.options.responsive){me.resize(true);} +me.initToolTip();core_plugins.notify(me,'afterInit');return me;},clear:function(){helpers$1.canvas.clear(this);return this;},stop:function(){core_animations.cancelAnimation(this);return this;},resize:function(silent){var me=this;var options=me.options;var canvas=me.canvas;var aspectRatio=(options.maintainAspectRatio&&me.aspectRatio)||null;var newWidth=Math.max(0,Math.floor(helpers$1.getMaximumWidth(canvas)));var newHeight=Math.max(0,Math.floor(aspectRatio?newWidth/aspectRatio:helpers$1.getMaximumHeight(canvas)));if(me.width===newWidth&&me.height===newHeight){return;} +canvas.width=me.width=newWidth;canvas.height=me.height=newHeight;canvas.style.width=newWidth+'px';canvas.style.height=newHeight+'px';helpers$1.retinaScale(me,options.devicePixelRatio);if(!silent){var newSize={width:newWidth,height:newHeight};core_plugins.notify(me,'resize',[newSize]);if(options.onResize){options.onResize(me,newSize);} +me.stop();me.update({duration:options.responsiveAnimationDuration});}},ensureScalesHaveIDs:function(){var options=this.options;var scalesOptions=options.scales||{};var scaleOptions=options.scale;helpers$1.each(scalesOptions.xAxes,function(xAxisOptions,index){if(!xAxisOptions.id){xAxisOptions.id=nextAvailableScaleId(scalesOptions.xAxes,'x-axis-',index);}});helpers$1.each(scalesOptions.yAxes,function(yAxisOptions,index){if(!yAxisOptions.id){yAxisOptions.id=nextAvailableScaleId(scalesOptions.yAxes,'y-axis-',index);}});if(scaleOptions){scaleOptions.id=scaleOptions.id||'scale';}},buildOrUpdateScales:function(){var me=this;var options=me.options;var scales=me.scales||{};var items=[];var updated=Object.keys(scales).reduce(function(obj,id){obj[id]=false;return obj;},{});if(options.scales){items=items.concat((options.scales.xAxes||[]).map(function(xAxisOptions){return{options:xAxisOptions,dtype:'category',dposition:'bottom'};}),(options.scales.yAxes||[]).map(function(yAxisOptions){return{options:yAxisOptions,dtype:'linear',dposition:'left'};}));} +if(options.scale){items.push({options:options.scale,dtype:'radialLinear',isDefault:true,dposition:'chartArea'});} +helpers$1.each(items,function(item){var scaleOptions=item.options;var id=scaleOptions.id;var scaleType=valueOrDefault$9(scaleOptions.type,item.dtype);if(positionIsHorizontal(scaleOptions.position)!==positionIsHorizontal(item.dposition)){scaleOptions.position=item.dposition;} +updated[id]=true;var scale=null;if(id in scales&&scales[id].type===scaleType){scale=scales[id];scale.options=scaleOptions;scale.ctx=me.ctx;scale.chart=me;}else{var scaleClass=core_scaleService.getScaleConstructor(scaleType);if(!scaleClass){return;} +scale=new scaleClass({id:id,type:scaleType,options:scaleOptions,ctx:me.ctx,chart:me});scales[scale.id]=scale;} +scale.mergeTicksOptions();if(item.isDefault){me.scale=scale;}});helpers$1.each(updated,function(hasUpdated,id){if(!hasUpdated){delete scales[id];}});me.scales=scales;core_scaleService.addScalesToLayout(this);},buildOrUpdateControllers:function(){var me=this;var newControllers=[];var datasets=me.data.datasets;var i,ilen;for(i=0,ilen=datasets.length;i=0;--i){me.drawDataset(metasets[i],easingValue);} +core_plugins.notify(me,'afterDatasetsDraw',[easingValue]);},drawDataset:function(meta,easingValue){var me=this;var args={meta:meta,index:meta.index,easingValue:easingValue};if(core_plugins.notify(me,'beforeDatasetDraw',[args])===false){return;} +meta.controller.draw(easingValue);core_plugins.notify(me,'afterDatasetDraw',[args]);},_drawTooltip:function(easingValue){var me=this;var tooltip=me.tooltip;var args={tooltip:tooltip,easingValue:easingValue};if(core_plugins.notify(me,'beforeTooltipDraw',[args])===false){return;} +tooltip.draw();core_plugins.notify(me,'afterTooltipDraw',[args]);},getElementAtEvent:function(e){return core_interaction.modes.single(this,e);},getElementsAtEvent:function(e){return core_interaction.modes.label(this,e,{intersect:true});},getElementsAtXAxis:function(e){return core_interaction.modes['x-axis'](this,e,{intersect:true});},getElementsAtEventForMode:function(e,mode,options){var method=core_interaction.modes[mode];if(typeof method==='function'){return method(this,e,options);} +return[];},getDatasetAtEvent:function(e){return core_interaction.modes.dataset(this,e,{intersect:true});},getDatasetMeta:function(datasetIndex){var me=this;var dataset=me.data.datasets[datasetIndex];if(!dataset._meta){dataset._meta={};} +var meta=dataset._meta[me.id];if(!meta){meta=dataset._meta[me.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:dataset.order||0,index:datasetIndex};} +return meta;},getVisibleDatasetCount:function(){var count=0;for(var i=0,ilen=this.data.datasets.length;i=0;i--){var currentItem=arrayToSearch[i];if(filterCallback(currentItem)){return currentItem;}}};helpers$1.isNumber=function(n){return!isNaN(parseFloat(n))&&isFinite(n);};helpers$1.almostEquals=function(x,y,epsilon){return Math.abs(x-y)=x);};helpers$1.max=function(array){return array.reduce(function(max,value){if(!isNaN(value)){return Math.max(max,value);} +return max;},Number.NEGATIVE_INFINITY);};helpers$1.min=function(array){return array.reduce(function(min,value){if(!isNaN(value)){return Math.min(min,value);} +return min;},Number.POSITIVE_INFINITY);};helpers$1.sign=Math.sign?function(x){return Math.sign(x);}:function(x){x=+x;if(x===0||isNaN(x)){return x;} +return x>0?1:-1;};helpers$1.toRadians=function(degrees){return degrees*(Math.PI/180);};helpers$1.toDegrees=function(radians){return radians*(180/Math.PI);};helpers$1._decimalPlaces=function(x){if(!helpers$1.isFinite(x)){return;} +var e=1;var p=0;while(Math.round(x*e)/e!==x){e*=10;p++;} +return p;};helpers$1.getAngleFromPoint=function(centrePoint,anglePoint){var distanceFromXCenter=anglePoint.x-centrePoint.x;var distanceFromYCenter=anglePoint.y-centrePoint.y;var radialDistanceFromCenter=Math.sqrt(distanceFromXCenter*distanceFromXCenter+distanceFromYCenter*distanceFromYCenter);var angle=Math.atan2(distanceFromYCenter,distanceFromXCenter);if(angle<(-0.5*Math.PI)){angle+=2.0*Math.PI;} +return{angle:angle,distance:radialDistanceFromCenter};};helpers$1.distanceBetweenPoints=function(pt1,pt2){return Math.sqrt(Math.pow(pt2.x-pt1.x,2)+Math.pow(pt2.y-pt1.y,2));};helpers$1.aliasPixel=function(pixelWidth){return(pixelWidth%2===0)?0:0.5;};helpers$1._alignPixel=function(chart,pixel,width){var devicePixelRatio=chart.currentDevicePixelRatio;var halfWidth=width/2;return Math.round((pixel-halfWidth)*devicePixelRatio)/devicePixelRatio+halfWidth;};helpers$1.splineCurve=function(firstPoint,middlePoint,afterPoint,t){var previous=firstPoint.skip?middlePoint:firstPoint;var current=middlePoint;var next=afterPoint.skip?middlePoint:afterPoint;var d01=Math.sqrt(Math.pow(current.x-previous.x,2)+Math.pow(current.y-previous.y,2));var d12=Math.sqrt(Math.pow(next.x-current.x,2)+Math.pow(next.y-current.y,2));var s01=d01/(d01+d12);var s12=d12/(d01+d12);s01=isNaN(s01)?0:s01;s12=isNaN(s12)?0:s12;var fa=t*s01;var fb=t*s12;return{previous:{x:current.x-fa*(next.x-previous.x),y:current.y-fa*(next.y-previous.y)},next:{x:current.x+fb*(next.x-previous.x),y:current.y+fb*(next.y-previous.y)}};};helpers$1.EPSILON=Number.EPSILON||1e-14;helpers$1.splineCurveMonotone=function(points){var pointsWithTangents=(points||[]).map(function(point){return{model:point._model,deltaK:0,mK:0};});var pointsLen=pointsWithTangents.length;var i,pointBefore,pointCurrent,pointAfter;for(i=0;i0?pointsWithTangents[i-1]:null;pointAfter=i0?pointsWithTangents[i-1]:null;pointAfter=i=collection.length-1?collection[0]:collection[index+1];} +return index>=collection.length-1?collection[collection.length-1]:collection[index+1];};helpers$1.previousItem=function(collection,index,loop){if(loop){return index<=0?collection[collection.length-1]:collection[index-1];} +return index<=0?collection[0]:collection[index-1];};helpers$1.niceNum=function(range,round){var exponent=Math.floor(helpers$1.log10(range));var fraction=range/Math.pow(10,exponent);var niceFraction;if(round){if(fraction<1.5){niceFraction=1;}else if(fraction<3){niceFraction=2;}else if(fraction<7){niceFraction=5;}else{niceFraction=10;}}else if(fraction<=1.0){niceFraction=1;}else if(fraction<=2){niceFraction=2;}else if(fraction<=5){niceFraction=5;}else{niceFraction=10;} +return niceFraction*Math.pow(10,exponent);};helpers$1.requestAnimFrame=(function(){if(typeof window==='undefined'){return function(callback){callback();};} +return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){return window.setTimeout(callback,1000/60);};}());helpers$1.getRelativePosition=function(evt,chart){var mouseX,mouseY;var e=evt.originalEvent||evt;var canvas=evt.target||evt.srcElement;var boundingRect=canvas.getBoundingClientRect();var touches=e.touches;if(touches&&touches.length>0){mouseX=touches[0].clientX;mouseY=touches[0].clientY;}else{mouseX=e.clientX;mouseY=e.clientY;} +var paddingLeft=parseFloat(helpers$1.getStyle(canvas,'padding-left'));var paddingTop=parseFloat(helpers$1.getStyle(canvas,'padding-top'));var paddingRight=parseFloat(helpers$1.getStyle(canvas,'padding-right'));var paddingBottom=parseFloat(helpers$1.getStyle(canvas,'padding-bottom'));var width=boundingRect.right-boundingRect.left-paddingLeft-paddingRight;var height=boundingRect.bottom-boundingRect.top-paddingTop-paddingBottom;mouseX=Math.round((mouseX-boundingRect.left-paddingLeft)/(width)*canvas.width/chart.currentDevicePixelRatio);mouseY=Math.round((mouseY-boundingRect.top-paddingTop)/(height)*canvas.height/chart.currentDevicePixelRatio);return{x:mouseX,y:mouseY};};function parseMaxStyle(styleValue,node,parentProperty){var valueInPixels;if(typeof styleValue==='string'){valueInPixels=parseInt(styleValue,10);if(styleValue.indexOf('%')!==-1){valueInPixels=valueInPixels/100*node.parentNode[parentProperty];}}else{valueInPixels=styleValue;} +return valueInPixels;} +function isConstrainedValue(value){return value!==undefined&&value!==null&&value!=='none';} +function getConstraintDimension(domNode,maxStyle,percentageProperty){var view=document.defaultView;var parentNode=helpers$1._getParentNode(domNode);var constrainedNode=view.getComputedStyle(domNode)[maxStyle];var constrainedContainer=view.getComputedStyle(parentNode)[maxStyle];var hasCNode=isConstrainedValue(constrainedNode);var hasCContainer=isConstrainedValue(constrainedContainer);var infinity=Number.POSITIVE_INFINITY;if(hasCNode||hasCContainer){return Math.min(hasCNode?parseMaxStyle(constrainedNode,domNode,percentageProperty):infinity,hasCContainer?parseMaxStyle(constrainedContainer,parentNode,percentageProperty):infinity);} +return'none';} +helpers$1.getConstraintWidth=function(domNode){return getConstraintDimension(domNode,'max-width','clientWidth');};helpers$1.getConstraintHeight=function(domNode){return getConstraintDimension(domNode,'max-height','clientHeight');};helpers$1._calculatePadding=function(container,padding,parentDimension){padding=helpers$1.getStyle(container,padding);return padding.indexOf('%')>-1?parentDimension*parseInt(padding,10)/100:parseInt(padding,10);};helpers$1._getParentNode=function(domNode){var parent=domNode.parentNode;if(parent&&parent.toString()==='[object ShadowRoot]'){parent=parent.host;} +return parent;};helpers$1.getMaximumWidth=function(domNode){var container=helpers$1._getParentNode(domNode);if(!container){return domNode.clientWidth;} +var clientWidth=container.clientWidth;var paddingLeft=helpers$1._calculatePadding(container,'padding-left',clientWidth);var paddingRight=helpers$1._calculatePadding(container,'padding-right',clientWidth);var w=clientWidth-paddingLeft-paddingRight;var cw=helpers$1.getConstraintWidth(domNode);return isNaN(cw)?w:Math.min(w,cw);};helpers$1.getMaximumHeight=function(domNode){var container=helpers$1._getParentNode(domNode);if(!container){return domNode.clientHeight;} +var clientHeight=container.clientHeight;var paddingTop=helpers$1._calculatePadding(container,'padding-top',clientHeight);var paddingBottom=helpers$1._calculatePadding(container,'padding-bottom',clientHeight);var h=clientHeight-paddingTop-paddingBottom;var ch=helpers$1.getConstraintHeight(domNode);return isNaN(ch)?h:Math.min(h,ch);};helpers$1.getStyle=function(el,property){return el.currentStyle?el.currentStyle[property]:document.defaultView.getComputedStyle(el,null).getPropertyValue(property);};helpers$1.retinaScale=function(chart,forceRatio){var pixelRatio=chart.currentDevicePixelRatio=forceRatio||(typeof window!=='undefined'&&window.devicePixelRatio)||1;if(pixelRatio===1){return;} +var canvas=chart.canvas;var height=chart.height;var width=chart.width;canvas.height=height*pixelRatio;canvas.width=width*pixelRatio;chart.ctx.scale(pixelRatio,pixelRatio);if(!canvas.style.height&&!canvas.style.width){canvas.style.height=height+'px';canvas.style.width=width+'px';}};helpers$1.fontString=function(pixelSize,fontStyle,fontFamily){return fontStyle+' '+pixelSize+'px '+fontFamily;};helpers$1.longestText=function(ctx,font,arrayOfThings,cache){cache=cache||{};var data=cache.data=cache.data||{};var gc=cache.garbageCollect=cache.garbageCollect||[];if(cache.font!==font){data=cache.data={};gc=cache.garbageCollect=[];cache.font=font;} +ctx.font=font;var longest=0;var ilen=arrayOfThings.length;var i,j,jlen,thing,nestedThing;for(i=0;iarrayOfThings.length){for(i=0;ilongest){longest=textWidth;} +return longest;};helpers$1.numberOfLabelLines=function(arrayOfThings){var numberOfLines=1;helpers$1.each(arrayOfThings,function(thing){if(helpers$1.isArray(thing)){if(thing.length>numberOfLines){numberOfLines=thing.length;}}});return numberOfLines;};helpers$1.color=!chartjsColor?function(value){console.error('Color.js not found!');return value;}:function(value){if(value instanceof CanvasGradient){value=core_defaults.global.defaultColor;} +return chartjsColor(value);};helpers$1.getHoverColor=function(colorValue){return(colorValue instanceof CanvasPattern||colorValue instanceof CanvasGradient)?colorValue:helpers$1.color(colorValue).saturate(0.5).darken(0.1).rgbString();};};function abstract(){throw new Error('This method is not implemented: either no adapter can '+'be found or an incomplete integration was provided.');} +function DateAdapter(options){this.options=options||{};} +helpers$1.extend(DateAdapter.prototype,{formats:abstract,parse:abstract,format:abstract,add:abstract,diff:abstract,startOf:abstract,endOf:abstract,_create:function(value){return value;}});DateAdapter.override=function(members){helpers$1.extend(DateAdapter.prototype,members);};var _date=DateAdapter;var core_adapters={_date:_date};var core_ticks={formatters:{values:function(value){return helpers$1.isArray(value)?value:''+value;},linear:function(tickValue,index,ticks){var delta=ticks.length>3?ticks[2]-ticks[1]:ticks[1]-ticks[0];if(Math.abs(delta)>1){if(tickValue!==Math.floor(tickValue)){delta=tickValue-Math.floor(tickValue);}} +var logDelta=helpers$1.log10(Math.abs(delta));var tickString='';if(tickValue!==0){var maxTick=Math.max(Math.abs(ticks[0]),Math.abs(ticks[ticks.length-1]));if(maxTick<1e-4){var logTick=helpers$1.log10(Math.abs(tickValue));var numExponential=Math.floor(logTick)-Math.floor(logDelta);numExponential=Math.max(Math.min(numExponential,20),0);tickString=tickValue.toExponential(numExponential);}else{var numDecimal=-1*Math.floor(logDelta);numDecimal=Math.max(Math.min(numDecimal,20),0);tickString=tickValue.toFixed(numDecimal);}}else{tickString='0';} +return tickString;},logarithmic:function(tickValue,index,ticks){var remain=tickValue/(Math.pow(10,Math.floor(helpers$1.log10(tickValue))));if(tickValue===0){return'0';}else if(remain===1||remain===2||remain===5||index===0||index===ticks.length-1){return tickValue.toExponential();} +return'';}}};var isArray=helpers$1.isArray;var isNullOrUndef=helpers$1.isNullOrUndef;var valueOrDefault$a=helpers$1.valueOrDefault;var valueAtIndexOrDefault=helpers$1.valueAtIndexOrDefault;core_defaults._set('scale',{display:true,position:'left',offset:false,gridLines:{display:true,color:'rgba(0,0,0,0.1)',lineWidth:1,drawBorder:true,drawOnChartArea:true,drawTicks:true,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:'rgba(0,0,0,0.25)',zeroLineBorderDash:[],zeroLineBorderDashOffset:0.0,offsetGridLines:false,borderDash:[],borderDashOffset:0.0},scaleLabel:{display:false,labelString:'',padding:{top:4,bottom:4}},ticks:{beginAtZero:false,minRotation:0,maxRotation:50,mirror:false,padding:0,reverse:false,display:true,autoSkip:true,autoSkipPadding:0,labelOffset:0,callback:core_ticks.formatters.values,minor:{},major:{}}});function sample(arr,numItems){var result=[];var increment=arr.length/numItems;var i=0;var len=arr.length;for(;iend+epsilon){return;}} +return lineValue;} +function garbageCollect(caches,length){helpers$1.each(caches,function(cache){var gc=cache.gc;var gcLen=gc.length/2;var i;if(gcLen>length){for(i=0;ispacing){return factor;}} +return Math.max(spacing,1);} +function getMajorIndices(ticks){var result=[];var i,ilen;for(i=0,ilen=ticks.length;i=maxRotation||numTicks<=1||!me.isHorizontal()){me.labelRotation=minRotation;return;} +labelSizes=me._getLabelSizes();maxLabelWidth=labelSizes.widest.width;maxLabelHeight=labelSizes.highest.height-labelSizes.highest.offset;maxWidth=Math.min(me.maxWidth,me.chart.width-maxLabelWidth);tickWidth=options.offset?me.maxWidth/numTicks:maxWidth/(numTicks-1);if(maxLabelWidth+6>tickWidth){tickWidth=maxWidth/(numTicks-(options.offset?0.5:1));maxHeight=me.maxHeight-getTickMarkLength(options.gridLines) +-tickOpts.padding-getScaleLabelHeight(options.scaleLabel);maxLabelDiagonal=Math.sqrt(maxLabelWidth*maxLabelWidth+maxLabelHeight*maxLabelHeight);labelRotation=helpers$1.toDegrees(Math.min(Math.asin(Math.min((labelSizes.highest.height+6)/tickWidth,1)),Math.asin(Math.min(maxHeight/maxLabelDiagonal,1))-Math.asin(maxLabelHeight/maxLabelDiagonal)));labelRotation=Math.max(minRotation,Math.min(maxRotation,labelRotation));} +me.labelRotation=labelRotation;},afterCalculateTickRotation:function(){helpers$1.callback(this.options.afterCalculateTickRotation,[this]);},beforeFit:function(){helpers$1.callback(this.options.beforeFit,[this]);},fit:function(){var me=this;var minSize=me.minSize={width:0,height:0};var chart=me.chart;var opts=me.options;var tickOpts=opts.ticks;var scaleLabelOpts=opts.scaleLabel;var gridLineOpts=opts.gridLines;var display=me._isVisible();var isBottom=opts.position==='bottom';var isHorizontal=me.isHorizontal();if(isHorizontal){minSize.width=me.maxWidth;}else if(display){minSize.width=getTickMarkLength(gridLineOpts)+getScaleLabelHeight(scaleLabelOpts);} +if(!isHorizontal){minSize.height=me.maxHeight;}else if(display){minSize.height=getTickMarkLength(gridLineOpts)+getScaleLabelHeight(scaleLabelOpts);} +if(tickOpts.display&&display){var tickFonts=parseTickFontOptions(tickOpts);var labelSizes=me._getLabelSizes();var firstLabelSize=labelSizes.first;var lastLabelSize=labelSizes.last;var widestLabelSize=labelSizes.widest;var highestLabelSize=labelSizes.highest;var lineSpace=tickFonts.minor.lineHeight*0.4;var tickPadding=tickOpts.padding;if(isHorizontal){var isRotated=me.labelRotation!==0;var angleRadians=helpers$1.toRadians(me.labelRotation);var cosRotation=Math.cos(angleRadians);var sinRotation=Math.sin(angleRadians);var labelHeight=sinRotation*widestLabelSize.width ++cosRotation*(highestLabelSize.height-(isRotated?highestLabelSize.offset:0)) ++(isRotated?0:lineSpace);minSize.height=Math.min(me.maxHeight,minSize.height+labelHeight+tickPadding);var offsetLeft=me.getPixelForTick(0)-me.left;var offsetRight=me.right-me.getPixelForTick(me.getTicks().length-1);var paddingLeft,paddingRight;if(isRotated){paddingLeft=isBottom?cosRotation*firstLabelSize.width+sinRotation*firstLabelSize.offset:sinRotation*(firstLabelSize.height-firstLabelSize.offset);paddingRight=isBottom?sinRotation*(lastLabelSize.height-lastLabelSize.offset):cosRotation*lastLabelSize.width+sinRotation*lastLabelSize.offset;}else{paddingLeft=firstLabelSize.width/2;paddingRight=lastLabelSize.width/2;} +me.paddingLeft=Math.max((paddingLeft-offsetLeft)*me.width/(me.width-offsetLeft),0)+3;me.paddingRight=Math.max((paddingRight-offsetRight)*me.width/(me.width-offsetRight),0)+3;}else{var labelWidth=tickOpts.mirror?0:widestLabelSize.width+tickPadding+lineSpace;minSize.width=Math.min(me.maxWidth,minSize.width+labelWidth);me.paddingTop=firstLabelSize.height/2;me.paddingBottom=lastLabelSize.height/2;}} +me.handleMargins();if(isHorizontal){me.width=me._length=chart.width-me.margins.left-me.margins.right;me.height=minSize.height;}else{me.width=minSize.width;me.height=me._length=chart.height-me.margins.top-me.margins.bottom;}},handleMargins:function(){var me=this;if(me.margins){me.margins.left=Math.max(me.paddingLeft,me.margins.left);me.margins.top=Math.max(me.paddingTop,me.margins.top);me.margins.right=Math.max(me.paddingRight,me.margins.right);me.margins.bottom=Math.max(me.paddingBottom,me.margins.bottom);}},afterFit:function(){helpers$1.callback(this.options.afterFit,[this]);},isHorizontal:function(){var pos=this.options.position;return pos==='top'||pos==='bottom';},isFullWidth:function(){return this.options.fullWidth;},getRightValue:function(rawValue){if(isNullOrUndef(rawValue)){return NaN;} +if((typeof rawValue==='number'||rawValue instanceof Number)&&!isFinite(rawValue)){return NaN;} +if(rawValue){if(this.isHorizontal()){if(rawValue.x!==undefined){return this.getRightValue(rawValue.x);}}else if(rawValue.y!==undefined){return this.getRightValue(rawValue.y);}} +return rawValue;},_convertTicksToLabels:function(ticks){var me=this;var labels,i,ilen;me.ticks=ticks.map(function(tick){return tick.value;});me.beforeTickToLabelConversion();labels=me.convertTicksToLabels(ticks)||me.ticks;me.afterTickToLabelConversion();for(i=0,ilen=ticks.length;inumTicks-1?null:me.getPixelForDecimal(index*tickWidth+(offset?tickWidth/2:0));},getPixelForDecimal:function(decimal){var me=this;if(me._reversePixels){decimal=1-decimal;} +return me._startPixel+decimal*me._length;},getDecimalForPixel:function(pixel){var decimal=(pixel-this._startPixel)/this._length;return this._reversePixels?1-decimal:decimal;},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue());},getBaseValue:function(){var me=this;var min=me.min;var max=me.max;return me.beginAtZero?0:min<0&&max<0?max:min>0&&max>0?min:0;},_autoSkip:function(ticks){var me=this;var tickOpts=me.options.ticks;var axisLength=me._length;var ticksLimit=tickOpts.maxTicksLimit||axisLength/me._tickSize()+1;var majorIndices=tickOpts.major.enabled?getMajorIndices(ticks):[];var numMajorIndices=majorIndices.length;var first=majorIndices[0];var last=majorIndices[numMajorIndices-1];var i,ilen,spacing,avgMajorSpacing;if(numMajorIndices>ticksLimit){skipMajors(ticks,majorIndices,numMajorIndices/ticksLimit);return nonSkipped(ticks);} +spacing=calculateSpacing(majorIndices,ticks,axisLength,ticksLimit);if(numMajorIndices>0){for(i=0,ilen=numMajorIndices-1;i1?(last-first)/(numMajorIndices-1):null;skip(ticks,spacing,helpers$1.isNullOrUndef(avgMajorSpacing)?0:first-avgMajorSpacing,first);skip(ticks,spacing,last,helpers$1.isNullOrUndef(avgMajorSpacing)?ticks.length:last+avgMajorSpacing);return nonSkipped(ticks);} +skip(ticks,spacing);return nonSkipped(ticks);},_tickSize:function(){var me=this;var optionTicks=me.options.ticks;var rot=helpers$1.toRadians(me.labelRotation);var cos=Math.abs(Math.cos(rot));var sin=Math.abs(Math.sin(rot));var labelSizes=me._getLabelSizes();var padding=optionTicks.autoSkipPadding||0;var w=labelSizes?labelSizes.widest.width+padding:0;var h=labelSizes?labelSizes.highest.height+padding:0;return me.isHorizontal()?h*cos>w*sin?w/cos:h/sin:h*sin=0){minIndex=findIndex;}} +if(max!==undefined){findIndex=labels.indexOf(max);if(findIndex>=0){maxIndex=findIndex;}} +me.minIndex=minIndex;me.maxIndex=maxIndex;me.min=labels[minIndex];me.max=labels[maxIndex];},buildTicks:function(){var me=this;var labels=me._getLabels();var minIndex=me.minIndex;var maxIndex=me.maxIndex;me.ticks=(minIndex===0&&maxIndex===labels.length-1)?labels:labels.slice(minIndex,maxIndex+1);},getLabelForIndex:function(index,datasetIndex){var me=this;var chart=me.chart;if(chart.getDatasetMeta(datasetIndex).controller._getValueScaleId()===me.id){return me.getRightValue(chart.data.datasets[datasetIndex].data[index]);} +return me._getLabels()[index];},_configure:function(){var me=this;var offset=me.options.offset;var ticks=me.ticks;core_scale.prototype._configure.call(me);if(!me.isHorizontal()){me._reversePixels=!me._reversePixels;} +if(!ticks){return;} +me._startValue=me.minIndex-(offset?0.5:0);me._valueRange=Math.max(ticks.length-(offset?0:1),1);},getPixelForValue:function(value,index,datasetIndex){var me=this;var valueCategory,labels,idx;if(!isNullOrUndef$1(index)&&!isNullOrUndef$1(datasetIndex)){value=me.chart.data.datasets[datasetIndex].data[index];} +if(!isNullOrUndef$1(value)){valueCategory=me.isHorizontal()?value.x:value.y;} +if(valueCategory!==undefined||(value!==undefined&&isNaN(index))){labels=me._getLabels();value=helpers$1.valueOrDefault(valueCategory,value);idx=labels.indexOf(value);index=idx!==-1?idx:index;if(isNaN(index)){index=value;}} +return me.getPixelForDecimal((index-me._startValue)/me._valueRange);},getPixelForTick:function(index){var ticks=this.ticks;return index<0||index>ticks.length-1?null:this.getPixelForValue(ticks[index],index+this.minIndex);},getValueForPixel:function(pixel){var me=this;var value=Math.round(me._startValue+me.getDecimalForPixel(pixel)*me._valueRange);return Math.min(Math.max(value,0),me.ticks.length-1);},getBasePixel:function(){return this.bottom;}});var _defaults=defaultConfig;scale_category._defaults=_defaults;var noop=helpers$1.noop;var isNullOrUndef$2=helpers$1.isNullOrUndef;function generateTicks(generationOptions,dataRange){var ticks=[];var MIN_SPACING=1e-14;var stepSize=generationOptions.stepSize;var unit=stepSize||1;var maxNumSpaces=generationOptions.maxTicks-1;var min=generationOptions.min;var max=generationOptions.max;var precision=generationOptions.precision;var rmin=dataRange.min;var rmax=dataRange.max;var spacing=helpers$1.niceNum((rmax-rmin)/maxNumSpaces/unit)*unit;var factor,niceMin,niceMax,numSpaces;if(spacingmaxNumSpaces){spacing=helpers$1.niceNum(numSpaces*spacing/maxNumSpaces/unit)*unit;} +if(stepSize||isNullOrUndef$2(precision)){factor=Math.pow(10,helpers$1._decimalPlaces(spacing));}else{factor=Math.pow(10,precision);spacing=Math.ceil(spacing*factor)/factor;} +niceMin=Math.floor(rmin/spacing)*spacing;niceMax=Math.ceil(rmax/spacing)*spacing;if(stepSize){if(!isNullOrUndef$2(min)&&helpers$1.almostWhole(min/spacing,spacing/1000)){niceMin=min;} +if(!isNullOrUndef$2(max)&&helpers$1.almostWhole(max/spacing,spacing/1000)){niceMax=max;}} +numSpaces=(niceMax-niceMin)/spacing;if(helpers$1.almostEquals(numSpaces,Math.round(numSpaces),spacing/1000)){numSpaces=Math.round(numSpaces);}else{numSpaces=Math.ceil(numSpaces);} +niceMin=Math.round(niceMin*factor)/factor;niceMax=Math.round(niceMax*factor)/factor;ticks.push(isNullOrUndef$2(min)?niceMin:min);for(var j=1;j0&&maxSign>0){me.min=0;}} +var setMin=tickOpts.min!==undefined||tickOpts.suggestedMin!==undefined;var setMax=tickOpts.max!==undefined||tickOpts.suggestedMax!==undefined;if(tickOpts.min!==undefined){me.min=tickOpts.min;}else if(tickOpts.suggestedMin!==undefined){if(me.min===null){me.min=tickOpts.suggestedMin;}else{me.min=Math.min(me.min,tickOpts.suggestedMin);}} +if(tickOpts.max!==undefined){me.max=tickOpts.max;}else if(tickOpts.suggestedMax!==undefined){if(me.max===null){me.max=tickOpts.suggestedMax;}else{me.max=Math.max(me.max,tickOpts.suggestedMax);}} +if(setMin!==setMax){if(me.min>=me.max){if(setMin){me.max=me.min+1;}else{me.min=me.max-1;}}} +if(me.min===me.max){me.max++;if(!tickOpts.beginAtZero){me.min--;}}},getTickLimit:function(){var me=this;var tickOpts=me.options.ticks;var stepSize=tickOpts.stepSize;var maxTicksLimit=tickOpts.maxTicksLimit;var maxTicks;if(stepSize){maxTicks=Math.ceil(me.max/stepSize)-Math.floor(me.min/stepSize)+1;}else{maxTicks=me._computeTickLimit();maxTicksLimit=maxTicksLimit||11;} +if(maxTicksLimit){maxTicks=Math.min(maxTicksLimit,maxTicks);} +return maxTicks;},_computeTickLimit:function(){return Number.POSITIVE_INFINITY;},handleDirectionalChanges:noop,buildTicks:function(){var me=this;var opts=me.options;var tickOpts=opts.ticks;var maxTicks=me.getTickLimit();maxTicks=Math.max(2,maxTicks);var numericGeneratorOptions={maxTicks:maxTicks,min:tickOpts.min,max:tickOpts.max,precision:tickOpts.precision,stepSize:helpers$1.valueOrDefault(tickOpts.fixedStepSize,tickOpts.stepSize)};var ticks=me.ticks=generateTicks(numericGeneratorOptions,me);me.handleDirectionalChanges();me.max=helpers$1.max(ticks);me.min=helpers$1.min(ticks);if(tickOpts.reverse){ticks.reverse();me.start=me.max;me.end=me.min;}else{me.start=me.min;me.end=me.max;}},convertTicksToLabels:function(){var me=this;me.ticksAsNumbers=me.ticks.slice();me.zeroLineIndex=me.ticks.indexOf(0);core_scale.prototype.convertTicksToLabels.call(me);},_configure:function(){var me=this;var ticks=me.getTicks();var start=me.min;var end=me.max;var offset;core_scale.prototype._configure.call(me);if(me.options.offset&&ticks.length){offset=(end-start)/Math.max(ticks.length-1,1)/2;start-=offset;end+=offset;} +me._startValue=start;me._endValue=end;me._valueRange=end-start;}});var defaultConfig$1={position:'left',ticks:{callback:core_ticks.formatters.linear}};var DEFAULT_MIN=0;var DEFAULT_MAX=1;function getOrCreateStack(stacks,stacked,meta){var key=[meta.type,stacked===undefined&&meta.stack===undefined?meta.index:'',meta.stack].join('.');if(stacks[key]===undefined){stacks[key]={pos:[],neg:[]};} +return stacks[key];} +function stackData(scale,stacks,meta,data){var opts=scale.options;var stacked=opts.stacked;var stack=getOrCreateStack(stacks,stacked,meta);var pos=stack.pos;var neg=stack.neg;var ilen=data.length;var i,value;for(i=0;iticks.length-1){return null;} +return this.getPixelForValue(ticks[index]);}});var _defaults$1=defaultConfig$1;scale_linear._defaults=_defaults$1;var valueOrDefault$b=helpers$1.valueOrDefault;var log10=helpers$1.math.log10;function generateTicks$1(generationOptions,dataRange){var ticks=[];var tickVal=valueOrDefault$b(generationOptions.min,Math.pow(10,Math.floor(log10(dataRange.min))));var endExp=Math.floor(log10(dataRange.max));var endSignificand=Math.ceil(dataRange.max/Math.pow(10,endExp));var exp,significand;if(tickVal===0){exp=Math.floor(log10(dataRange.minNotZero));significand=Math.floor(dataRange.minNotZero/Math.pow(10,exp));ticks.push(tickVal);tickVal=significand*Math.pow(10,exp);}else{exp=Math.floor(log10(tickVal));significand=Math.floor(tickVal/Math.pow(10,exp));} +var precision=exp<0?Math.pow(10,Math.abs(exp)):1;do{ticks.push(tickVal);++significand;if(significand===10){significand=1;++exp;precision=exp>=0?1:precision;} +tickVal=Math.round(significand*Math.pow(10,exp)*precision)/precision;}while(exp=0?value:defaultValue;} +var scale_logarithmic=core_scale.extend({determineDataLimits:function(){var me=this;var opts=me.options;var chart=me.chart;var datasets=chart.data.datasets;var isHorizontal=me.isHorizontal();function IDMatches(meta){return isHorizontal?meta.xAxisID===me.id:meta.yAxisID===me.id;} +var datasetIndex,meta,value,data,i,ilen;me.min=Number.POSITIVE_INFINITY;me.max=Number.NEGATIVE_INFINITY;me.minNotZero=Number.POSITIVE_INFINITY;var hasStacks=opts.stacked;if(hasStacks===undefined){for(datasetIndex=0;datasetIndex0){var minVal=helpers$1.min(valuesForType);var maxVal=helpers$1.max(valuesForType);me.min=Math.min(me.min,minVal);me.max=Math.max(me.max,maxVal);}});}else{for(datasetIndex=0;datasetIndex0){me.minNotZero=me.min;}else if(me.max<1){me.minNotZero=Math.pow(10,Math.floor(log10(me.max)));}else{me.minNotZero=DEFAULT_MIN;}}},buildTicks:function(){var me=this;var tickOpts=me.options.ticks;var reverse=!me.isHorizontal();var generationOptions={min:nonNegativeOrDefault(tickOpts.min),max:nonNegativeOrDefault(tickOpts.max)};var ticks=me.ticks=generateTicks$1(generationOptions,me);me.max=helpers$1.max(ticks);me.min=helpers$1.min(ticks);if(tickOpts.reverse){reverse=!reverse;me.start=me.max;me.end=me.min;}else{me.start=me.min;me.end=me.max;} +if(reverse){ticks.reverse();}},convertTicksToLabels:function(){this.tickValues=this.ticks.slice();core_scale.prototype.convertTicksToLabels.call(this);},getLabelForIndex:function(index,datasetIndex){return this._getScaleLabel(this.chart.data.datasets[datasetIndex].data[index]);},getPixelForTick:function(index){var ticks=this.tickValues;if(index<0||index>ticks.length-1){return null;} +return this.getPixelForValue(ticks[index]);},_getFirstTickValue:function(value){var exp=Math.floor(log10(value));var significand=Math.floor(value/Math.pow(10,exp));return significand*Math.pow(10,exp);},_configure:function(){var me=this;var start=me.min;var offset=0;core_scale.prototype._configure.call(me);if(start===0){start=me._getFirstTickValue(me.minNotZero);offset=valueOrDefault$b(me.options.ticks.fontSize,core_defaults.global.defaultFontSize)/me._length;} +me._startValue=log10(start);me._valueOffset=offset;me._valueRange=(log10(me.max)-log10(start))/(1-offset);},getPixelForValue:function(value){var me=this;var decimal=0;value=+me.getRightValue(value);if(value>me.min&&value>0){decimal=(log10(value)-me._startValue)/me._valueRange+me._valueOffset;} +return me.getPixelForDecimal(decimal);},getValueForPixel:function(pixel){var me=this;var decimal=me.getDecimalForPixel(pixel);return decimal===0&&me.min===0?0:Math.pow(10,me._startValue+(decimal-me._valueOffset)*me._valueRange);}});var _defaults$2=defaultConfig$2;scale_logarithmic._defaults=_defaults$2;var valueOrDefault$c=helpers$1.valueOrDefault;var valueAtIndexOrDefault$1=helpers$1.valueAtIndexOrDefault;var resolve$4=helpers$1.options.resolve;var defaultConfig$3={display:true,animate:true,position:'chartArea',angleLines:{display:true,color:'rgba(0,0,0,0.1)',lineWidth:1,borderDash:[],borderDashOffset:0.0},gridLines:{circular:false},ticks:{showLabelBackdrop:true,backdropColor:'rgba(255,255,255,0.75)',backdropPaddingY:2,backdropPaddingX:2,callback:core_ticks.formatters.linear},pointLabels:{display:true,fontSize:10,callback:function(label){return label;}}};function getTickBackdropHeight(opts){var tickOpts=opts.ticks;if(tickOpts.display&&opts.display){return valueOrDefault$c(tickOpts.fontSize,core_defaults.global.defaultFontSize)+tickOpts.backdropPaddingY*2;} +return 0;} +function measureLabelSize(ctx,lineHeight,label){if(helpers$1.isArray(label)){return{w:helpers$1.longestText(ctx,ctx.font,label),h:label.length*lineHeight};} +return{w:ctx.measureText(label).width,h:lineHeight};} +function determineLimits(angle,pos,size,min,max){if(angle===min||angle===max){return{start:pos-(size/2),end:pos+(size/2)};}else if(anglemax){return{start:pos-size,end:pos};} +return{start:pos,end:pos+size};} +function fitWithPointLabels(scale){var plFont=helpers$1.options._parseFont(scale.options.pointLabels);var furthestLimits={l:0,r:scale.width,t:0,b:scale.height-scale.paddingTop};var furthestAngles={};var i,textSize,pointPosition;scale.ctx.font=plFont.string;scale._pointLabelSizes=[];var valueCount=scale.chart.data.labels.length;for(i=0;ifurthestLimits.r){furthestLimits.r=hLimits.end;furthestAngles.r=angleRadians;} +if(vLimits.startfurthestLimits.b){furthestLimits.b=vLimits.end;furthestAngles.b=angleRadians;}} +scale.setReductions(scale.drawingArea,furthestLimits,furthestAngles);} +function getTextAlignForAngle(angle){if(angle===0||angle===180){return'center';}else if(angle<180){return'left';} +return'right';} +function fillText(ctx,text,position,lineHeight){var y=position.y+lineHeight/2;var i,ilen;if(helpers$1.isArray(text)){for(i=0,ilen=text.length;i270||angle<90){position.y-=textSize.h;}} +function drawPointLabels(scale){var ctx=scale.ctx;var opts=scale.options;var pointLabelOpts=opts.pointLabels;var tickBackdropHeight=getTickBackdropHeight(opts);var outerDistance=scale.getDistanceFromCenterForValue(opts.ticks.reverse?scale.min:scale.max);var plFont=helpers$1.options._parseFont(pointLabelOpts);ctx.save();ctx.font=plFont.string;ctx.textBaseline='middle';for(var i=scale.chart.data.labels.length-1;i>=0;i--){var extra=(i===0?tickBackdropHeight/2:0);var pointLabelPosition=scale.getPointPosition(i,outerDistance+extra+5);var pointLabelFontColor=valueAtIndexOrDefault$1(pointLabelOpts.fontColor,i,core_defaults.global.defaultFontColor);ctx.fillStyle=pointLabelFontColor;var angleRadians=scale.getIndexAngle(i);var angle=helpers$1.toDegrees(angleRadians);ctx.textAlign=getTextAlignForAngle(angle);adjustPointPositionForLabelHeight(angle,scale._pointLabelSizes[i],pointLabelPosition);fillText(ctx,scale.pointLabels[i],pointLabelPosition,plFont.lineHeight);} +ctx.restore();} +function drawRadiusLine(scale,gridLineOpts,radius,index){var ctx=scale.ctx;var circular=gridLineOpts.circular;var valueCount=scale.chart.data.labels.length;var lineColor=valueAtIndexOrDefault$1(gridLineOpts.color,index-1);var lineWidth=valueAtIndexOrDefault$1(gridLineOpts.lineWidth,index-1);var pointPosition;if((!circular&&!valueCount)||!lineColor||!lineWidth){return;} +ctx.save();ctx.strokeStyle=lineColor;ctx.lineWidth=lineWidth;if(ctx.setLineDash){ctx.setLineDash(gridLineOpts.borderDash||[]);ctx.lineDashOffset=gridLineOpts.borderDashOffset||0.0;} +ctx.beginPath();if(circular){ctx.arc(scale.xCenter,scale.yCenter,radius,0,Math.PI*2);}else{pointPosition=scale.getPointPosition(0,radius);ctx.moveTo(pointPosition.x,pointPosition.y);for(var i=1;i0&&max>0?min:0);},_drawGrid:function(){var me=this;var ctx=me.ctx;var opts=me.options;var gridLineOpts=opts.gridLines;var angleLineOpts=opts.angleLines;var lineWidth=valueOrDefault$c(angleLineOpts.lineWidth,gridLineOpts.lineWidth);var lineColor=valueOrDefault$c(angleLineOpts.color,gridLineOpts.color);var i,offset,position;if(opts.pointLabels.display){drawPointLabels(me);} +if(gridLineOpts.display){helpers$1.each(me.ticks,function(label,index){if(index!==0){offset=me.getDistanceFromCenterForValue(me.ticksAsNumbers[index]);drawRadiusLine(me,gridLineOpts,offset,index);}});} +if(angleLineOpts.display&&lineWidth&&lineColor){ctx.save();ctx.lineWidth=lineWidth;ctx.strokeStyle=lineColor;if(ctx.setLineDash){ctx.setLineDash(resolve$4([angleLineOpts.borderDash,gridLineOpts.borderDash,[]]));ctx.lineDashOffset=resolve$4([angleLineOpts.borderDashOffset,gridLineOpts.borderDashOffset,0.0]);} +for(i=me.chart.data.labels.length-1;i>=0;i--){offset=me.getDistanceFromCenterForValue(opts.ticks.reverse?me.min:me.max);position=me.getPointPosition(i,offset);ctx.beginPath();ctx.moveTo(me.xCenter,me.yCenter);ctx.lineTo(position.x,position.y);ctx.stroke();} +ctx.restore();}},_drawLabels:function(){var me=this;var ctx=me.ctx;var opts=me.options;var tickOpts=opts.ticks;if(!tickOpts.display){return;} +var startAngle=me.getIndexAngle(0);var tickFont=helpers$1.options._parseFont(tickOpts);var tickFontColor=valueOrDefault$c(tickOpts.fontColor,core_defaults.global.defaultFontColor);var offset,width;ctx.save();ctx.font=tickFont.string;ctx.translate(me.xCenter,me.yCenter);ctx.rotate(startAngle);ctx.textAlign='center';ctx.textBaseline='middle';helpers$1.each(me.ticks,function(label,index){if(index===0&&!tickOpts.reverse){return;} +offset=me.getDistanceFromCenterForValue(me.ticksAsNumbers[index]);if(tickOpts.showLabelBackdrop){width=ctx.measureText(label).width;ctx.fillStyle=tickOpts.backdropColor;ctx.fillRect(-width/2-tickOpts.backdropPaddingX,-offset-tickFont.size/2-tickOpts.backdropPaddingY,width+tickOpts.backdropPaddingX*2,tickFont.size+tickOpts.backdropPaddingY*2);} +ctx.fillStyle=tickFontColor;ctx.fillText(label,0,-offset);});ctx.restore();},_drawTitle:helpers$1.noop});var _defaults$3=defaultConfig$3;scale_radialLinear._defaults=_defaults$3;var deprecated$1=helpers$1._deprecated;var resolve$5=helpers$1.options.resolve;var valueOrDefault$d=helpers$1.valueOrDefault;var MIN_INTEGER=Number.MIN_SAFE_INTEGER||-9007199254740991;var MAX_INTEGER=Number.MAX_SAFE_INTEGER||9007199254740991;var INTERVALS={millisecond:{common:true,size:1,steps:1000},second:{common:true,size:1000,steps:60},minute:{common:true,size:60000,steps:60},hour:{common:true,size:3600000,steps:24},day:{common:true,size:86400000,steps:30},week:{common:false,size:604800000,steps:4},month:{common:true,size:2.628e9,steps:12},quarter:{common:false,size:7.884e9,steps:4},year:{common:true,size:3.154e10}};var UNITS=Object.keys(INTERVALS);function sorter(a,b){return a-b;} +function arrayUnique(items){var hash={};var out=[];var i,ilen,item;for(i=0,ilen=items.length;imin&&curr=0&&lo<=hi){mid=(lo+hi)>>1;i0=table[mid-1]||null;i1=table[mid];if(!i0){return{lo:null,hi:i1};}else if(i1[key]value){hi=mid-1;}else{return{lo:i0,hi:i1};}} +return{lo:i1,hi:null};} +function interpolate$1(table,skey,sval,tkey){var range=lookup(table,skey,sval);var prev=!range.lo?table[0]:!range.hi?table[table.length-2]:range.lo;var next=!range.lo?table[1]:!range.hi?table[table.length-1]:range.hi;var span=next[skey]-prev[skey];var ratio=span?(sval-prev[skey])/span:0;var offset=(next[tkey]-prev[tkey])*ratio;return prev[tkey]+offset;} +function toTimestamp(scale,input){var adapter=scale._adapter;var options=scale.options.time;var parser=options.parser;var format=parser||options.format;var value=input;if(typeof parser==='function'){value=parser(value);} +if(!helpers$1.isFinite(value)){value=typeof format==='string'?adapter.parse(value,format):adapter.parse(value);} +if(value!==null){return+value;} +if(!parser&&typeof format==='function'){value=format(input);if(!helpers$1.isFinite(value)){value=adapter.parse(value);}} +return value;} +function parse(scale,input){if(helpers$1.isNullOrUndef(input)){return null;} +var options=scale.options.time;var value=toTimestamp(scale,scale.getRightValue(input));if(value===null){return value;} +if(options.round){value=+scale._adapter.startOf(value,options.round);} +return value;} +function determineUnitForAutoTicks(minUnit,min,max,capacity){var ilen=UNITS.length;var i,interval,factor;for(i=UNITS.indexOf(minUnit);i=UNITS.indexOf(minUnit);i--){unit=UNITS[i];if(INTERVALS[unit].common&&scale._adapter.diff(max,min,unit)>=numTicks-1){return unit;}} +return UNITS[minUnit?UNITS.indexOf(minUnit):0];} +function determineMajorUnit(unit){for(var i=UNITS.indexOf(unit)+1,ilen=UNITS.length;i100000*stepSize){throw min+' and '+max+' are too far apart with stepSize of '+stepSize+' '+minor;} +for(time=first;time=0){ticks[index].major=true;}} +return ticks;} +function ticksFromTimestamps(scale,values,majorUnit){var ticks=[];var map={};var ilen=values.length;var i,value;for(i=0;i1?arrayUnique(timestamps).sort(sorter):timestamps.sort(sorter);min=Math.min(min,timestamps[0]);max=Math.max(max,timestamps[timestamps.length-1]);} +min=parse(me,getMin(options))||min;max=parse(me,getMax(options))||max;min=min===MAX_INTEGER?+adapter.startOf(Date.now(),unit):min;max=max===MIN_INTEGER?+adapter.endOf(Date.now(),unit)+1:max;me.min=Math.min(min,max);me.max=Math.max(min+1,max);me._table=[];me._timestamps={data:timestamps,datasets:datasets,labels:labels};},buildTicks:function(){var me=this;var min=me.min;var max=me.max;var options=me.options;var tickOpts=options.ticks;var timeOpts=options.time;var timestamps=me._timestamps;var ticks=[];var capacity=me.getLabelCapacity(min);var source=tickOpts.source;var distribution=options.distribution;var i,ilen,timestamp;if(source==='data'||(source==='auto'&&distribution==='series')){timestamps=timestamps.data;}else if(source==='labels'){timestamps=timestamps.labels;}else{timestamps=generate(me,min,max,capacity);} +if(options.bounds==='ticks'&×tamps.length){min=timestamps[0];max=timestamps[timestamps.length-1];} +min=parse(me,getMin(options))||min;max=parse(me,getMax(options))||max;for(i=0,ilen=timestamps.length;i=min&×tamp<=max){ticks.push(timestamp);}} +me.min=min;me.max=max;me._unit=timeOpts.unit||(tickOpts.autoSkip?determineUnitForAutoTicks(timeOpts.minUnit,me.min,me.max,capacity):determineUnitForFormatting(me,ticks.length,timeOpts.minUnit,me.min,me.max));me._majorUnit=!tickOpts.major.enabled||me._unit==='year'?undefined:determineMajorUnit(me._unit);me._table=buildLookupTable(me._timestamps.data,min,max,distribution);me._offsets=computeOffsets(me._table,ticks,min,max,options);if(tickOpts.reverse){ticks.reverse();} +return ticksFromTimestamps(me,ticks,me._majorUnit);},getLabelForIndex:function(index,datasetIndex){var me=this;var adapter=me._adapter;var data=me.chart.data;var timeOpts=me.options.time;var label=data.labels&&index=0&&index0?capacity:1;}});var _defaults$4=defaultConfig$4;scale_time._defaults=_defaults$4;var scales={category:scale_category,linear:scale_linear,logarithmic:scale_logarithmic,radialLinear:scale_radialLinear,time:scale_time};var FORMATS={datetime:'MMM D, YYYY, h:mm:ss a',millisecond:'h:mm:ss.SSS a',second:'h:mm:ss a',minute:'h:mm a',hour:'hA',day:'MMM D',week:'ll',month:'MMM YYYY',quarter:'[Q]Q - YYYY',year:'YYYY'};core_adapters._date.override(typeof moment==='function'?{_id:'moment',formats:function(){return FORMATS;},parse:function(value,format){if(typeof value==='string'&&typeof format==='string'){value=moment(value,format);}else if(!(value instanceof moment)){value=moment(value);} +return value.isValid()?value.valueOf():null;},format:function(time,format){return moment(time).format(format);},add:function(time,amount,unit){return moment(time).add(amount,unit).valueOf();},diff:function(max,min,unit){return moment(max).diff(moment(min),unit);},startOf:function(time,unit,weekday){time=moment(time);if(unit==='isoWeek'){return time.isoWeekday(weekday).valueOf();} +return time.startOf(unit).valueOf();},endOf:function(time,unit){return moment(time).endOf(unit).valueOf();},_create:function(time){return moment(time);},}:{});core_defaults._set('global',{plugins:{filler:{propagate:true}}});var mappers={dataset:function(source){var index=source.fill;var chart=source.chart;var meta=chart.getDatasetMeta(index);var visible=meta&&chart.isDatasetVisible(index);var points=(visible&&meta.dataset._children)||[];var length=points.length||0;return!length?null:function(point,i){return(i=count){return false;} return target;} switch(fill){case'bottom':return'start';case'top':return'end';case'zero':return'origin';case'origin':case'start':case'end':return fill;default:return false;}} -function computeBoundary(source){var model=source.el._model||{};var scale=source.el._scale||{};var fill=source.fill;var target=null;var horizontal;if(isFinite(fill)){return null;} -if(fill==='start'){target=model.scaleBottom===undefined?scale.bottom:model.scaleBottom;}else if(fill==='end'){target=model.scaleTop===undefined?scale.top:model.scaleTop;}else if(model.scaleZero!==undefined){target=model.scaleZero;}else if(scale.getBasePosition){target=scale.getBasePosition();}else if(scale.getBasePixel){target=scale.getBasePixel();} +function computeLinearBoundary(source){var model=source.el._model||{};var scale=source.el._scale||{};var fill=source.fill;var target=null;var horizontal;if(isFinite(fill)){return null;} +if(fill==='start'){target=model.scaleBottom===undefined?scale.bottom:model.scaleBottom;}else if(fill==='end'){target=model.scaleTop===undefined?scale.top:model.scaleTop;}else if(model.scaleZero!==undefined){target=model.scaleZero;}else if(scale.getBasePixel){target=scale.getBasePixel();} if(target!==undefined&&target!==null){if(target.x!==undefined&&target.y!==undefined){return target;} -if(typeof target==='number'&&isFinite(target)){horizontal=scale.isHorizontal();return{x:horizontal?target:null,y:horizontal?null:target};}} +if(helpers$1.isFinite(target)){horizontal=scale.isHorizontal();return{x:horizontal?target:null,y:horizontal?null:target};}} return null;} +function computeCircularBoundary(source){var scale=source.el._scale;var options=scale.options;var length=scale.chart.data.labels.length;var fill=source.fill;var target=[];var start,end,center,i,point;if(!length){return null;} +start=options.ticks.reverse?scale.max:scale.min;end=options.ticks.reverse?scale.min:scale.max;center=scale.getPointPositionForValue(0,start);for(i=0;i0;--i){helpers.canvas.lineTo(ctx,curve1[i],curve1[i-1],true);}} -function doFill(ctx,points,mapper,view,color,loop){var count=points.length;var span=view.spanGaps;var curve0=[];var curve1=[];var len0=0;var len1=0;var i,ilen,index,p0,p1,d0,d1;ctx.beginPath();for(i=0,ilen=(count+!!loop);i0;--i){ctx.arc(cx,cy,r,curve1[i].angle,curve1[i-1].angle,true);} +return;} +ctx.lineTo(curve1[len1-1].x,curve1[len1-1].y);for(i=len1-1;i>0;--i){helpers$1.canvas.lineTo(ctx,curve1[i],curve1[i-1],true);}} +function doFill(ctx,points,mapper,view,color,loop){var count=points.length;var span=view.spanGaps;var curve0=[];var curve1=[];var len0=0;var len1=0;var i,ilen,index,p0,p1,d0,d1,loopOffset;ctx.beginPath();for(i=0,ilen=count;i');for(var i=0;i');if(chart.data.datasets[i].label){text.push(chart.data.datasets[i].label);} -text.push('');} -text.push('
    ');return text.join('');}});function getBoxWidth(labelOpts,fontSize){return labelOpts.usePointStyle?fontSize*Math.SQRT2:labelOpts.boxWidth;} -var Legend=Element.extend({initialize:function(config){helpers.extend(this,config);this.legendHitBoxes=[];this.doughnutMode=false;},beforeUpdate:noop,update:function(maxWidth,maxHeight,margins){var me=this;me.beforeUpdate();me.maxWidth=maxWidth;me.maxHeight=maxHeight;me.margins=margins;me.beforeSetDimensions();me.setDimensions();me.afterSetDimensions();me.beforeBuildLabels();me.buildLabels();me.afterBuildLabels();me.beforeFit();me.fit();me.afterFit();me.afterUpdate();return me.minSize;},afterUpdate:noop,beforeSetDimensions:noop,setDimensions:function(){var me=this;if(me.isHorizontal()){me.width=me.maxWidth;me.left=0;me.right=me.width;}else{me.height=me.maxHeight;me.top=0;me.bottom=me.height;} -me.paddingLeft=0;me.paddingTop=0;me.paddingRight=0;me.paddingBottom=0;me.minSize={width:0,height:0};},afterSetDimensions:noop,beforeBuildLabels:noop,buildLabels:function(){var me=this;var labelOpts=me.options.labels||{};var legendItems=helpers.callback(labelOpts.generateLabels,[me.chart],me)||[];if(labelOpts.filter){legendItems=legendItems.filter(function(item){return labelOpts.filter(item,me.chart.data);});} +source.fill=resolveTarget(sources,i,propagate);source.boundary=computeBoundary(source);source.mapper=createMapper(source);}},beforeDatasetsDraw:function(chart){var metasets=chart._getSortedVisibleDatasetMetas();var ctx=chart.ctx;var meta,i,el,view,points,mapper,color;for(i=metasets.length-1;i>=0;--i){meta=metasets[i].$filler;if(!meta||!meta.visible){continue;} +el=meta.el;view=el._view;points=el._children||[];mapper=meta.mapper;color=view.backgroundColor||core_defaults.global.defaultColor;if(mapper&&color&&points.length){helpers$1.canvas.clipArea(ctx,chart.chartArea);doFill(ctx,points,mapper,view,color,el._loop);helpers$1.canvas.unclipArea(ctx);}}}};var getRtlHelper$1=helpers$1.rtl.getRtlAdapter;var noop$1=helpers$1.noop;var valueOrDefault$e=helpers$1.valueOrDefault;core_defaults._set('global',{legend:{display:true,position:'top',align:'center',fullWidth:true,reverse:false,weight:1000,onClick:function(e,legendItem){var index=legendItem.datasetIndex;var ci=this.chart;var meta=ci.getDatasetMeta(index);meta.hidden=meta.hidden===null?!ci.data.datasets[index].hidden:null;ci.update();},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(chart){var datasets=chart.data.datasets;var options=chart.options.legend||{};var usePointStyle=options.labels&&options.labels.usePointStyle;return chart._getSortedDatasetMetas().map(function(meta){var style=meta.controller.getStyle(usePointStyle?0:undefined);return{text:datasets[meta.index].label,fillStyle:style.backgroundColor,hidden:!chart.isDatasetVisible(meta.index),lineCap:style.borderCapStyle,lineDash:style.borderDash,lineDashOffset:style.borderDashOffset,lineJoin:style.borderJoinStyle,lineWidth:style.borderWidth,strokeStyle:style.borderColor,pointStyle:style.pointStyle,rotation:style.rotation,datasetIndex:meta.index};},this);}}},legendCallback:function(chart){var list=document.createElement('ul');var datasets=chart.data.datasets;var i,ilen,listItem,listItemSpan;list.setAttribute('class',chart.id+'-legend');for(i=0,ilen=datasets.length;ifontSize?fontSize:labelOpts.boxWidth;} +var Legend=core_element.extend({initialize:function(config){var me=this;helpers$1.extend(me,config);me.legendHitBoxes=[];me._hoveredItem=null;me.doughnutMode=false;},beforeUpdate:noop$1,update:function(maxWidth,maxHeight,margins){var me=this;me.beforeUpdate();me.maxWidth=maxWidth;me.maxHeight=maxHeight;me.margins=margins;me.beforeSetDimensions();me.setDimensions();me.afterSetDimensions();me.beforeBuildLabels();me.buildLabels();me.afterBuildLabels();me.beforeFit();me.fit();me.afterFit();me.afterUpdate();return me.minSize;},afterUpdate:noop$1,beforeSetDimensions:noop$1,setDimensions:function(){var me=this;if(me.isHorizontal()){me.width=me.maxWidth;me.left=0;me.right=me.width;}else{me.height=me.maxHeight;me.top=0;me.bottom=me.height;} +me.paddingLeft=0;me.paddingTop=0;me.paddingRight=0;me.paddingBottom=0;me.minSize={width:0,height:0};},afterSetDimensions:noop$1,beforeBuildLabels:noop$1,buildLabels:function(){var me=this;var labelOpts=me.options.labels||{};var legendItems=helpers$1.callback(labelOpts.generateLabels,[me.chart],me)||[];if(labelOpts.filter){legendItems=legendItems.filter(function(item){return labelOpts.filter(item,me.chart.data);});} if(me.options.reverse){legendItems.reverse();} -me.legendItems=legendItems;},afterBuildLabels:noop,beforeFit:noop,fit:function(){var me=this;var opts=me.options;var labelOpts=opts.labels;var display=opts.display;var ctx=me.ctx;var globalDefault=defaults.global;var valueOrDefault=helpers.valueOrDefault;var fontSize=valueOrDefault(labelOpts.fontSize,globalDefault.defaultFontSize);var fontStyle=valueOrDefault(labelOpts.fontStyle,globalDefault.defaultFontStyle);var fontFamily=valueOrDefault(labelOpts.fontFamily,globalDefault.defaultFontFamily);var labelFont=helpers.fontString(fontSize,fontStyle,fontFamily);var hitboxes=me.legendHitBoxes=[];var minSize=me.minSize;var isHorizontal=me.isHorizontal();if(isHorizontal){minSize.width=me.maxWidth;minSize.height=display?10:0;}else{minSize.width=display?10:0;minSize.height=me.maxHeight;} -if(display){ctx.font=labelFont;if(isHorizontal){var lineWidths=me.lineWidths=[0];var totalHeight=me.legendItems.length?fontSize+(labelOpts.padding):0;ctx.textAlign='left';ctx.textBaseline='top';helpers.each(me.legendItems,function(legendItem,i){var boxWidth=getBoxWidth(labelOpts,fontSize);var width=boxWidth+(fontSize/2)+ctx.measureText(legendItem.text).width;if(lineWidths[lineWidths.length-1]+width+labelOpts.padding>=me.width){totalHeight+=fontSize+(labelOpts.padding);lineWidths[lineWidths.length]=me.left;} -hitboxes[i]={left:0,top:0,width:width,height:fontSize};lineWidths[lineWidths.length-1]+=width+labelOpts.padding;});minSize.height+=totalHeight;}else{var vPadding=labelOpts.padding;var columnWidths=me.columnWidths=[];var totalWidth=labelOpts.padding;var currentColWidth=0;var currentColHeight=0;var itemHeight=fontSize+vPadding;helpers.each(me.legendItems,function(legendItem,i){var boxWidth=getBoxWidth(labelOpts,fontSize);var itemWidth=boxWidth+(fontSize/2)+ctx.measureText(legendItem.text).width;if(currentColHeight+itemHeight>minSize.height){totalWidth+=currentColWidth+labelOpts.padding;columnWidths.push(currentColWidth);currentColWidth=0;currentColHeight=0;} -currentColWidth=Math.max(currentColWidth,itemWidth);currentColHeight+=itemHeight;hitboxes[i]={left:0,top:0,width:itemWidth,height:fontSize};});totalWidth+=currentColWidth;columnWidths.push(currentColWidth);minSize.width+=totalWidth;}} -me.width=minSize.width;me.height=minSize.height;},afterFit:noop,isHorizontal:function(){return this.options.position==='top'||this.options.position==='bottom';},draw:function(){var me=this;var opts=me.options;var labelOpts=opts.labels;var globalDefault=defaults.global;var lineDefault=globalDefault.elements.line;var legendWidth=me.width;var lineWidths=me.lineWidths;if(opts.display){var ctx=me.ctx;var valueOrDefault=helpers.valueOrDefault;var fontColor=valueOrDefault(labelOpts.fontColor,globalDefault.defaultFontColor);var fontSize=valueOrDefault(labelOpts.fontSize,globalDefault.defaultFontSize);var fontStyle=valueOrDefault(labelOpts.fontStyle,globalDefault.defaultFontStyle);var fontFamily=valueOrDefault(labelOpts.fontFamily,globalDefault.defaultFontFamily);var labelFont=helpers.fontString(fontSize,fontStyle,fontFamily);var cursor;ctx.textAlign='left';ctx.textBaseline='middle';ctx.lineWidth=0.5;ctx.strokeStyle=fontColor;ctx.fillStyle=fontColor;ctx.font=labelFont;var boxWidth=getBoxWidth(labelOpts,fontSize);var hitboxes=me.legendHitBoxes;var drawLegendBox=function(x,y,legendItem){if(isNaN(boxWidth)||boxWidth<=0){return;} -ctx.save();ctx.fillStyle=valueOrDefault(legendItem.fillStyle,globalDefault.defaultColor);ctx.lineCap=valueOrDefault(legendItem.lineCap,lineDefault.borderCapStyle);ctx.lineDashOffset=valueOrDefault(legendItem.lineDashOffset,lineDefault.borderDashOffset);ctx.lineJoin=valueOrDefault(legendItem.lineJoin,lineDefault.borderJoinStyle);ctx.lineWidth=valueOrDefault(legendItem.lineWidth,lineDefault.borderWidth);ctx.strokeStyle=valueOrDefault(legendItem.strokeStyle,globalDefault.defaultColor);var isLineWidthZero=(valueOrDefault(legendItem.lineWidth,lineDefault.borderWidth)===0);if(ctx.setLineDash){ctx.setLineDash(valueOrDefault(legendItem.lineDash,lineDefault.borderDash));} -if(opts.labels&&opts.labels.usePointStyle){var radius=fontSize*Math.SQRT2/2;var offSet=radius/Math.SQRT2;var centerX=x+offSet;var centerY=y+offSet;helpers.canvas.drawPoint(ctx,legendItem.pointStyle,radius,centerX,centerY);}else{if(!isLineWidthZero){ctx.strokeRect(x,y,boxWidth,fontSize);} -ctx.fillRect(x,y,boxWidth,fontSize);} -ctx.restore();};var fillText=function(x,y,legendItem,textWidth){var halfFontSize=fontSize/2;var xLeft=boxWidth+halfFontSize+x;var yMiddle=y+halfFontSize;ctx.fillText(legendItem.text,xLeft,yMiddle);if(legendItem.hidden){ctx.beginPath();ctx.lineWidth=2;ctx.moveTo(xLeft,yMiddle);ctx.lineTo(xLeft+textWidth,yMiddle);ctx.stroke();}};var isHorizontal=me.isHorizontal();if(isHorizontal){cursor={x:me.left+((legendWidth-lineWidths[0])/2),y:me.top+labelOpts.padding,line:0};}else{cursor={x:me.left+labelOpts.padding,y:me.top+labelOpts.padding,line:0};} -var itemHeight=fontSize+labelOpts.padding;helpers.each(me.legendItems,function(legendItem,i){var textWidth=ctx.measureText(legendItem.text).width;var width=boxWidth+(fontSize/2)+textWidth;var x=cursor.x;var y=cursor.y;if(isHorizontal){if(x+width>=legendWidth){y=cursor.y+=itemHeight;cursor.line++;x=cursor.x=me.left+((legendWidth-lineWidths[cursor.line])/2);}}else if(y+itemHeight>me.bottom){x=cursor.x=x+me.columnWidths[cursor.line]+labelOpts.padding;y=cursor.y=me.top+labelOpts.padding;cursor.line++;} -drawLegendBox(x,y,legendItem);hitboxes[i].left=x;hitboxes[i].top=y;fillText(x,y,legendItem,textWidth);if(isHorizontal){cursor.x+=width+(labelOpts.padding);}else{cursor.y+=itemHeight;}});}},handleEvent:function(e){var me=this;var opts=me.options;var type=e.type==='mouseup'?'click':e.type;var changed=false;if(type==='mousemove'){if(!opts.onHover){return;}}else if(type==='click'){if(!opts.onClick){return;}}else{return;} -var x=e.x;var y=e.y;if(x>=me.left&&x<=me.right&&y>=me.top&&y<=me.bottom){var lh=me.legendHitBoxes;for(var i=0;i=hitBox.left&&x<=hitBox.left+hitBox.width&&y>=hitBox.top&&y<=hitBox.top+hitBox.height){if(type==='click'){opts.onClick.call(me,e.native,me.legendItems[i]);changed=true;break;}else if(type==='mousemove'){opts.onHover.call(me,e.native,me.legendItems[i]);changed=true;break;}}}} -return changed;}});function createNewLegendAndAttach(chart,legendOpts){var legend=new Legend({ctx:chart.ctx,options:legendOpts,chart:chart});layouts.configure(chart,legend,legendOpts);layouts.addBox(chart,legend);chart.legend=legend;} -module.exports={id:'legend',_element:Legend,beforeInit:function(chart){var legendOpts=chart.options.legend;if(legendOpts){createNewLegendAndAttach(chart,legendOpts);}},beforeUpdate:function(chart){var legendOpts=chart.options.legend;var legend=chart.legend;if(legendOpts){helpers.mergeIf(legendOpts,defaults.global.legend);if(legend){layouts.configure(chart,legend,legendOpts);legend.options=legendOpts;}else{createNewLegendAndAttach(chart,legendOpts);}}else if(legend){layouts.removeBox(chart,legend);delete chart.legend;}},afterEvent:function(chart,e){var legend=chart.legend;if(legend){legend.handleEvent(e);}}};},{"25":25,"26":26,"30":30,"45":45}],52:[function(require,module,exports){'use strict';var defaults=require(25);var Element=require(26);var helpers=require(45);var layouts=require(30);var noop=helpers.noop;defaults._set('global',{title:{display:false,fontStyle:'bold',fullWidth:true,lineHeight:1.2,padding:10,position:'top',text:'',weight:2000}});var Title=Element.extend({initialize:function(config){var me=this;helpers.extend(me,config);me.legendHitBoxes=[];},beforeUpdate:noop,update:function(maxWidth,maxHeight,margins){var me=this;me.beforeUpdate();me.maxWidth=maxWidth;me.maxHeight=maxHeight;me.margins=margins;me.beforeSetDimensions();me.setDimensions();me.afterSetDimensions();me.beforeBuildLabels();me.buildLabels();me.afterBuildLabels();me.beforeFit();me.fit();me.afterFit();me.afterUpdate();return me.minSize;},afterUpdate:noop,beforeSetDimensions:noop,setDimensions:function(){var me=this;if(me.isHorizontal()){me.width=me.maxWidth;me.left=0;me.right=me.width;}else{me.height=me.maxHeight;me.top=0;me.bottom=me.height;} -me.paddingLeft=0;me.paddingTop=0;me.paddingRight=0;me.paddingBottom=0;me.minSize={width:0,height:0};},afterSetDimensions:noop,beforeBuildLabels:noop,buildLabels:noop,afterBuildLabels:noop,beforeFit:noop,fit:function(){var me=this;var valueOrDefault=helpers.valueOrDefault;var opts=me.options;var display=opts.display;var fontSize=valueOrDefault(opts.fontSize,defaults.global.defaultFontSize);var minSize=me.minSize;var lineCount=helpers.isArray(opts.text)?opts.text.length:1;var lineHeight=helpers.options.toLineHeight(opts.lineHeight,fontSize);var textSize=display?(lineCount*lineHeight)+(opts.padding*2):0;if(me.isHorizontal()){minSize.width=me.maxWidth;minSize.height=textSize;}else{minSize.width=textSize;minSize.height=me.maxHeight;} -me.width=minSize.width;me.height=minSize.height;},afterFit:noop,isHorizontal:function(){var pos=this.options.position;return pos==='top'||pos==='bottom';},draw:function(){var me=this;var ctx=me.ctx;var valueOrDefault=helpers.valueOrDefault;var opts=me.options;var globalDefaults=defaults.global;if(opts.display){var fontSize=valueOrDefault(opts.fontSize,globalDefaults.defaultFontSize);var fontStyle=valueOrDefault(opts.fontStyle,globalDefaults.defaultFontStyle);var fontFamily=valueOrDefault(opts.fontFamily,globalDefaults.defaultFontFamily);var titleFont=helpers.fontString(fontSize,fontStyle,fontFamily);var lineHeight=helpers.options.toLineHeight(opts.lineHeight,fontSize);var offset=lineHeight/2+opts.padding;var rotation=0;var top=me.top;var left=me.left;var bottom=me.bottom;var right=me.right;var maxWidth,titleX,titleY;ctx.fillStyle=valueOrDefault(opts.fontColor,globalDefaults.defaultFontColor);ctx.font=titleFont;if(me.isHorizontal()){titleX=left+((right-left)/2);titleY=top+offset;maxWidth=right-left;}else{titleX=opts.position==='left'?left+offset:right-offset;titleY=top+((bottom-top)/2);maxWidth=bottom-top;rotation=Math.PI*(opts.position==='left'?-0.5:0.5);} -ctx.save();ctx.translate(titleX,titleY);ctx.rotate(rotation);ctx.textAlign='center';ctx.textBaseline='middle';var text=opts.text;if(helpers.isArray(text)){var y=0;for(var i=0;ime.max){me.max=value;}});}});} -me.min=isFinite(me.min)&&!isNaN(me.min)?me.min:DEFAULT_MIN;me.max=isFinite(me.max)&&!isNaN(me.max)?me.max:DEFAULT_MAX;this.handleTickRangeOptions();},getTickLimit:function(){var maxTicks;var me=this;var tickOpts=me.options.ticks;if(me.isHorizontal()){maxTicks=Math.min(tickOpts.maxTicksLimit?tickOpts.maxTicksLimit:11,Math.ceil(me.width/50));}else{var tickFontSize=helpers.valueOrDefault(tickOpts.fontSize,defaults.global.defaultFontSize);maxTicks=Math.min(tickOpts.maxTicksLimit?tickOpts.maxTicksLimit:11,Math.ceil(me.height/(2*tickFontSize)));} -return maxTicks;},handleDirectionalChanges:function(){if(!this.isHorizontal()){this.ticks.reverse();}},getLabelForIndex:function(index,datasetIndex){return+this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);},getPixelForValue:function(value){var me=this;var start=me.start;var rightValue=+me.getRightValue(value);var pixel;var range=me.end-start;if(me.isHorizontal()){pixel=me.left+(me.width/range*(rightValue-start));}else{pixel=me.bottom-(me.height/range*(rightValue-start));} -return pixel;},getValueForPixel:function(pixel){var me=this;var isHorizontal=me.isHorizontal();var innerDimension=isHorizontal?me.width:me.height;var offset=(isHorizontal?pixel-me.left:me.bottom-pixel)/innerDimension;return me.start+((me.end-me.start)*offset);},getPixelForTick:function(index){return this.getPixelForValue(this.ticksAsNumbers[index]);}});Chart.scaleService.registerScaleType('linear',LinearScale,defaultConfig);};},{"25":25,"34":34,"45":45}],55:[function(require,module,exports){'use strict';var helpers=require(45);function generateTicks(generationOptions,dataRange){var ticks=[];var spacing;if(generationOptions.stepSize&&generationOptions.stepSize>0){spacing=generationOptions.stepSize;}else{var niceRange=helpers.niceNum(dataRange.max-dataRange.min,false);spacing=helpers.niceNum(niceRange/(generationOptions.maxTicks-1),true);} -var niceMin=Math.floor(dataRange.min/spacing)*spacing;var niceMax=Math.ceil(dataRange.max/spacing)*spacing;if(generationOptions.min&&generationOptions.max&&generationOptions.stepSize){if(helpers.almostWhole((generationOptions.max-generationOptions.min)/generationOptions.stepSize,spacing/1000)){niceMin=generationOptions.min;niceMax=generationOptions.max;}} -var numSpaces=(niceMax-niceMin)/spacing;if(helpers.almostEquals(numSpaces,Math.round(numSpaces),spacing/1000)){numSpaces=Math.round(numSpaces);}else{numSpaces=Math.ceil(numSpaces);} -var precision=1;if(spacing<1){precision=Math.pow(10,spacing.toString().length-2);niceMin=Math.round(niceMin*precision)/precision;niceMax=Math.round(niceMax*precision)/precision;} -ticks.push(generationOptions.min!==undefined?generationOptions.min:niceMin);for(var j=1;j0&&maxSign>0){me.min=0;}} -var setMin=tickOpts.min!==undefined||tickOpts.suggestedMin!==undefined;var setMax=tickOpts.max!==undefined||tickOpts.suggestedMax!==undefined;if(tickOpts.min!==undefined){me.min=tickOpts.min;}else if(tickOpts.suggestedMin!==undefined){if(me.min===null){me.min=tickOpts.suggestedMin;}else{me.min=Math.min(me.min,tickOpts.suggestedMin);}} -if(tickOpts.max!==undefined){me.max=tickOpts.max;}else if(tickOpts.suggestedMax!==undefined){if(me.max===null){me.max=tickOpts.suggestedMax;}else{me.max=Math.max(me.max,tickOpts.suggestedMax);}} -if(setMin!==setMax){if(me.min>=me.max){if(setMin){me.max=me.min+1;}else{me.min=me.max-1;}}} -if(me.min===me.max){me.max++;if(!tickOpts.beginAtZero){me.min--;}}},getTickLimit:noop,handleDirectionalChanges:noop,buildTicks:function(){var me=this;var opts=me.options;var tickOpts=opts.ticks;var maxTicks=me.getTickLimit();maxTicks=Math.max(2,maxTicks);var numericGeneratorOptions={maxTicks:maxTicks,min:tickOpts.min,max:tickOpts.max,stepSize:helpers.valueOrDefault(tickOpts.fixedStepSize,tickOpts.stepSize)};var ticks=me.ticks=generateTicks(numericGeneratorOptions,me);me.handleDirectionalChanges();me.max=helpers.max(ticks);me.min=helpers.min(ticks);if(tickOpts.reverse){ticks.reverse();me.start=me.max;me.end=me.min;}else{me.start=me.min;me.end=me.max;}},convertTicksToLabels:function(){var me=this;me.ticksAsNumbers=me.ticks.slice();me.zeroLineIndex=me.ticks.indexOf(0);Chart.Scale.prototype.convertTicksToLabels.call(me);}});};},{"45":45}],56:[function(require,module,exports){'use strict';var helpers=require(45);var Ticks=require(34);function generateTicks(generationOptions,dataRange){var ticks=[];var valueOrDefault=helpers.valueOrDefault;var tickVal=valueOrDefault(generationOptions.min,Math.pow(10,Math.floor(helpers.log10(dataRange.min))));var endExp=Math.floor(helpers.log10(dataRange.max));var endSignificand=Math.ceil(dataRange.max/Math.pow(10,endExp));var exp,significand;if(tickVal===0){exp=Math.floor(helpers.log10(dataRange.minNotZero));significand=Math.floor(dataRange.minNotZero/Math.pow(10,exp));ticks.push(tickVal);tickVal=significand*Math.pow(10,exp);}else{exp=Math.floor(helpers.log10(tickVal));significand=Math.floor(tickVal/Math.pow(10,exp));} -var precision=exp<0?Math.pow(10,Math.abs(exp)):1;do{ticks.push(tickVal);++significand;if(significand===10){significand=1;++exp;precision=exp>=0?1:precision;} -tickVal=Math.round(significand*Math.pow(10,exp)*precision)/precision;}while(exp0){var minVal=helpers.min(valuesForType);var maxVal=helpers.max(valuesForType);me.min=me.min===null?minVal:Math.min(me.min,minVal);me.max=me.max===null?maxVal:Math.max(me.max,maxVal);}});}else{helpers.each(datasets,function(dataset,datasetIndex){var meta=chart.getDatasetMeta(datasetIndex);if(chart.isDatasetVisible(datasetIndex)&&IDMatches(meta)){helpers.each(dataset.data,function(rawValue,index){var value=+me.getRightValue(rawValue);if(isNaN(value)||meta.data[index].hidden||value<0){return;} -if(me.min===null){me.min=value;}else if(valueme.max){me.max=value;} -if(value!==0&&(me.minNotZero===null||value0){me.minNotZero=me.min;}else if(me.max<1){me.minNotZero=Math.pow(10,Math.floor(helpers.log10(me.max)));}else{me.minNotZero=DEFAULT_MIN;}}},buildTicks:function(){var me=this;var opts=me.options;var tickOpts=opts.ticks;var reverse=!me.isHorizontal();var generationOptions={min:tickOpts.min,max:tickOpts.max};var ticks=me.ticks=generateTicks(generationOptions,me);me.max=helpers.max(ticks);me.min=helpers.min(ticks);if(tickOpts.reverse){reverse=!reverse;me.start=me.max;me.end=me.min;}else{me.start=me.min;me.end=me.max;} -if(reverse){ticks.reverse();}},convertTicksToLabels:function(){this.tickValues=this.ticks.slice();Chart.Scale.prototype.convertTicksToLabels.call(this);},getLabelForIndex:function(index,datasetIndex){return+this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);},getPixelForTick:function(index){return this.getPixelForValue(this.tickValues[index]);},_getFirstTickValue:function(value){var exp=Math.floor(helpers.log10(value));var significand=Math.floor(value/Math.pow(10,exp));return significand*Math.pow(10,exp);},getPixelForValue:function(value){var me=this;var reverse=me.options.ticks.reverse;var log10=helpers.log10;var firstTickValue=me._getFirstTickValue(me.minNotZero);var offset=0;var innerDimension,pixel,start,end,sign;value=+me.getRightValue(value);if(reverse){start=me.end;end=me.start;sign=-1;}else{start=me.start;end=me.end;sign=1;} -if(me.isHorizontal()){innerDimension=me.width;pixel=reverse?me.right:me.left;}else{innerDimension=me.height;sign*=-1;pixel=reverse?me.top:me.bottom;} -if(value!==start){if(start===0){offset=helpers.getValueOrDefault(me.options.ticks.fontSize,Chart.defaults.global.defaultFontSize);innerDimension-=offset;start=firstTickValue;} -if(value!==0){offset+=innerDimension/(log10(end)-log10(start))*(log10(value)-log10(start));} -pixel+=sign*offset;} -return pixel;},getValueForPixel:function(pixel){var me=this;var reverse=me.options.ticks.reverse;var log10=helpers.log10;var firstTickValue=me._getFirstTickValue(me.minNotZero);var innerDimension,start,end,value;if(reverse){start=me.end;end=me.start;}else{start=me.start;end=me.end;} -if(me.isHorizontal()){innerDimension=me.width;value=reverse?me.right-pixel:pixel-me.left;}else{innerDimension=me.height;value=reverse?pixel-me.top:me.bottom-pixel;} -if(value!==start){if(start===0){var offset=helpers.getValueOrDefault(me.options.ticks.fontSize,Chart.defaults.global.defaultFontSize);value-=offset;innerDimension-=offset;start=firstTickValue;} -value*=log10(end)-log10(start);value/=innerDimension;value=Math.pow(10,log10(start)+value);} -return value;}});Chart.scaleService.registerScaleType('logarithmic',LogarithmicScale,defaultConfig);};},{"34":34,"45":45}],57:[function(require,module,exports){'use strict';var defaults=require(25);var helpers=require(45);var Ticks=require(34);module.exports=function(Chart){var globalDefaults=defaults.global;var defaultConfig={display:true,animate:true,position:'chartArea',angleLines:{display:true,color:'rgba(0, 0, 0, 0.1)',lineWidth:1},gridLines:{circular:false},ticks:{showLabelBackdrop:true,backdropColor:'rgba(255,255,255,0.75)',backdropPaddingY:2,backdropPaddingX:2,callback:Ticks.formatters.linear},pointLabels:{display:true,fontSize:10,callback:function(label){return label;}}};function getValueCount(scale){var opts=scale.options;return opts.angleLines.display||opts.pointLabels.display?scale.chart.data.labels.length:0;} -function getPointLabelFontOptions(scale){var pointLabelOptions=scale.options.pointLabels;var fontSize=helpers.valueOrDefault(pointLabelOptions.fontSize,globalDefaults.defaultFontSize);var fontStyle=helpers.valueOrDefault(pointLabelOptions.fontStyle,globalDefaults.defaultFontStyle);var fontFamily=helpers.valueOrDefault(pointLabelOptions.fontFamily,globalDefaults.defaultFontFamily);var font=helpers.fontString(fontSize,fontStyle,fontFamily);return{size:fontSize,style:fontStyle,family:fontFamily,font:font};} -function measureLabelSize(ctx,fontSize,label){if(helpers.isArray(label)){return{w:helpers.longestText(ctx,ctx.font,label),h:(label.length*fontSize)+((label.length-1)*1.5*fontSize)};} -return{w:ctx.measureText(label).width,h:fontSize};} -function determineLimits(angle,pos,size,min,max){if(angle===min||angle===max){return{start:pos-(size/2),end:pos+(size/2)};}else if(anglemax){return{start:pos-size-5,end:pos};} -return{start:pos,end:pos+size+5};} -function fitWithPointLabels(scale){var plFont=getPointLabelFontOptions(scale);var largestPossibleRadius=Math.min(scale.height/2,scale.width/2);var furthestLimits={r:scale.width,l:0,t:scale.height,b:0};var furthestAngles={};var i,textSize,pointPosition;scale.ctx.font=plFont.font;scale._pointLabelSizes=[];var valueCount=getValueCount(scale);for(i=0;ifurthestLimits.r){furthestLimits.r=hLimits.end;furthestAngles.r=angleRadians;} -if(vLimits.startfurthestLimits.b){furthestLimits.b=vLimits.end;furthestAngles.b=angleRadians;}} -scale.setReductions(largestPossibleRadius,furthestLimits,furthestAngles);} -function fit(scale){var largestPossibleRadius=Math.min(scale.height/2,scale.width/2);scale.drawingArea=Math.round(largestPossibleRadius);scale.setCenterPoint(0,0,0,0);} -function getTextAlignForAngle(angle){if(angle===0||angle===180){return'center';}else if(angle<180){return'left';} -return'right';} -function fillText(ctx,text,position,fontSize){if(helpers.isArray(text)){var y=position.y;var spacing=1.5*fontSize;for(var i=0;i270||angle<90){position.y-=textSize.h;}} -function drawPointLabels(scale){var ctx=scale.ctx;var opts=scale.options;var angleLineOpts=opts.angleLines;var pointLabelOpts=opts.pointLabels;ctx.lineWidth=angleLineOpts.lineWidth;ctx.strokeStyle=angleLineOpts.color;var outerDistance=scale.getDistanceFromCenterForValue(opts.ticks.reverse?scale.min:scale.max);var plFont=getPointLabelFontOptions(scale);ctx.textBaseline='top';for(var i=getValueCount(scale)-1;i>=0;i--){if(angleLineOpts.display){var outerPosition=scale.getPointPosition(i,outerDistance);ctx.beginPath();ctx.moveTo(scale.xCenter,scale.yCenter);ctx.lineTo(outerPosition.x,outerPosition.y);ctx.stroke();ctx.closePath();} -if(pointLabelOpts.display){var pointLabelPosition=scale.getPointPosition(i,outerDistance+5);var pointLabelFontColor=helpers.valueAtIndexOrDefault(pointLabelOpts.fontColor,i,globalDefaults.defaultFontColor);ctx.font=plFont.font;ctx.fillStyle=pointLabelFontColor;var angleRadians=scale.getIndexAngle(i);var angle=helpers.toDegrees(angleRadians);ctx.textAlign=getTextAlignForAngle(angle);adjustPointPositionForLabelHeight(angle,scale._pointLabelSizes[i],pointLabelPosition);fillText(ctx,scale.pointLabels[i]||'',pointLabelPosition,plFont.size);}}} -function drawRadiusLine(scale,gridLineOpts,radius,index){var ctx=scale.ctx;ctx.strokeStyle=helpers.valueAtIndexOrDefault(gridLineOpts.color,index-1);ctx.lineWidth=helpers.valueAtIndexOrDefault(gridLineOpts.lineWidth,index-1);if(scale.options.gridLines.circular){ctx.beginPath();ctx.arc(scale.xCenter,scale.yCenter,radius,0,Math.PI*2);ctx.closePath();ctx.stroke();}else{var valueCount=getValueCount(scale);if(valueCount===0){return;} -ctx.beginPath();var pointPosition=scale.getPointPosition(0,radius);ctx.moveTo(pointPosition.x,pointPosition.y);for(var i=1;i0&&max>0?min:0);},draw:function(){var me=this;var opts=me.options;var gridLineOpts=opts.gridLines;var tickOpts=opts.ticks;var valueOrDefault=helpers.valueOrDefault;if(opts.display){var ctx=me.ctx;var startAngle=this.getIndexAngle(0);var tickFontSize=valueOrDefault(tickOpts.fontSize,globalDefaults.defaultFontSize);var tickFontStyle=valueOrDefault(tickOpts.fontStyle,globalDefaults.defaultFontStyle);var tickFontFamily=valueOrDefault(tickOpts.fontFamily,globalDefaults.defaultFontFamily);var tickLabelFont=helpers.fontString(tickFontSize,tickFontStyle,tickFontFamily);helpers.each(me.ticks,function(label,index){if(index>0||tickOpts.reverse){var yCenterOffset=me.getDistanceFromCenterForValue(me.ticksAsNumbers[index]);if(gridLineOpts.display&&index!==0){drawRadiusLine(me,gridLineOpts,yCenterOffset,index);} -if(tickOpts.display){var tickFontColor=valueOrDefault(tickOpts.fontColor,globalDefaults.defaultFontColor);ctx.font=tickLabelFont;ctx.save();ctx.translate(me.xCenter,me.yCenter);ctx.rotate(startAngle);if(tickOpts.showLabelBackdrop){var labelWidth=ctx.measureText(label).width;ctx.fillStyle=tickOpts.backdropColor;ctx.fillRect(-labelWidth/2-tickOpts.backdropPaddingX,-yCenterOffset-tickFontSize/2-tickOpts.backdropPaddingY,labelWidth+tickOpts.backdropPaddingX*2,tickFontSize+tickOpts.backdropPaddingY*2);} -ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillStyle=tickFontColor;ctx.fillText(label,0,-yCenterOffset);ctx.restore();}}});if(opts.angleLines.display||opts.pointLabels.display){drawPointLabels(me);}}}});Chart.scaleService.registerScaleType('radialLinear',LinearRadialScale,defaultConfig);};},{"25":25,"34":34,"45":45}],58:[function(require,module,exports){'use strict';var moment=require(6);moment=typeof moment==='function'?moment:window.moment;var defaults=require(25);var helpers=require(45);var MIN_INTEGER=Number.MIN_SAFE_INTEGER||-9007199254740991;var MAX_INTEGER=Number.MAX_SAFE_INTEGER||9007199254740991;var INTERVALS={millisecond:{common:true,size:1,steps:[1,2,5,10,20,50,100,250,500]},second:{common:true,size:1000,steps:[1,2,5,10,30]},minute:{common:true,size:60000,steps:[1,2,5,10,30]},hour:{common:true,size:3600000,steps:[1,2,3,6,12]},day:{common:true,size:86400000,steps:[1,2,5]},week:{common:false,size:604800000,steps:[1,2,3,4]},month:{common:true,size:2.628e9,steps:[1,2,3]},quarter:{common:false,size:7.884e9,steps:[1,2,3,4]},year:{common:true,size:3.154e10}};var UNITS=Object.keys(INTERVALS);function sorter(a,b){return a-b;} -function arrayUnique(items){var hash={};var out=[];var i,ilen,item;for(i=0,ilen=items.length;imin&&curr=0&&lo<=hi){mid=(lo+hi)>>1;i0=table[mid-1]||null;i1=table[mid];if(!i0){return{lo:null,hi:i1};}else if(i1[key]value){hi=mid-1;}else{return{lo:i0,hi:i1};}} -return{lo:i1,hi:null};} -function interpolate(table,skey,sval,tkey){var range=lookup(table,skey,sval);var prev=!range.lo?table[0]:!range.hi?table[table.length-2]:range.lo;var next=!range.lo?table[1]:!range.hi?table[table.length-1]:range.hi;var span=next[skey]-prev[skey];var ratio=span?(sval-prev[skey])/span:0;var offset=(next[tkey]-prev[tkey])*ratio;return prev[tkey]+offset;} -function momentify(value,options){var parser=options.parser;var format=options.parser||options.format;if(typeof parser==='function'){return parser(value);} -if(typeof value==='string'&&typeof format==='string'){return moment(value,format);} -if(!(value instanceof moment)){value=moment(value);} -if(value.isValid()){return value;} -if(typeof format==='function'){return format(value);} -return value;} -function parse(input,scale){if(helpers.isNullOrUndef(input)){return null;} -var options=scale.options.time;var value=momentify(scale.getRightValue(input),options);if(!value.isValid()){return null;} -if(options.round){value.startOf(options.round);} -return value.valueOf();} -function determineStepSize(min,max,unit,capacity){var range=max-min;var interval=INTERVALS[unit];var milliseconds=interval.size;var steps=interval.steps;var i,ilen,factor;if(!steps){return Math.ceil(range/(capacity*milliseconds));} -for(i=0,ilen=steps.length;i=UNITS.indexOf(minUnit);i--){unit=UNITS[i];if(INTERVALS[unit].common&&duration.as(unit)>=ticks.length){return unit;}} -return UNITS[minUnit?UNITS.indexOf(minUnit):0];} -function determineMajorUnit(unit){for(var i=UNITS.indexOf(unit)+1,ilen=UNITS.length;i1?ticks[1]:max;lower=ticks[0];left=(interpolate(table,'time',upper,'pos')- -interpolate(table,'time',lower,'pos'))/2;} -if(!options.time.max){upper=ticks[ticks.length-1];lower=ticks.length>1?ticks[ticks.length-2]:min;right=(interpolate(table,'time',upper,'pos')- -interpolate(table,'time',lower,'pos'))/2;}} -return{left:left,right:right};} -function ticksFromTimestamps(values,majorUnit){var ticks=[];var i,ilen,value,major;for(i=0,ilen=values.length;i=min&×tamp<=max){ticks.push(timestamp);}} -me.min=min;me.max=max;me._unit=timeOpts.unit||determineUnitForFormatting(ticks,timeOpts.minUnit,me.min,me.max);me._majorUnit=determineMajorUnit(me._unit);me._table=buildLookupTable(me._timestamps.data,min,max,options.distribution);me._offsets=computeOffsets(me._table,ticks,min,max,options);me._labelFormat=determineLabelFormat(me._timestamps.data,timeOpts);return ticksFromTimestamps(ticks,me._majorUnit);},getLabelForIndex:function(index,datasetIndex){var me=this;var data=me.chart.data;var timeOpts=me.options.time;var label=data.labels&&index=0&&index0?capacity:1;}});Chart.scaleService.registerScaleType('time',TimeScale,defaultConfig);};},{"25":25,"45":45,"6":6}]},{},[7])(7)});(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.markdownit=f()}})(function(){var define,module,exports;return(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o`\\x00-\\x20]+';var single_quoted="'[^']*'";var double_quoted='"[^"]*"';var attr_value='(?:'+unquoted+'|'+single_quoted+'|'+double_quoted+')';var attribute='(?:\\s+'+attr_name+'(?:\\s*=\\s*'+attr_value+')?)';var open_tag='<[A-Za-z][A-Za-z0-9\\-]*'+attribute+'*\\s*\\/?>';var close_tag='<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>';var comment='|';var processing='<[?].*?[?]>';var declaration=']*>';var cdata='';var HTML_TAG_RE=new RegExp('^(?:'+open_tag+'|'+close_tag+'|'+comment+'|'+processing+'|'+declaration+'|'+cdata+')');var HTML_OPEN_CLOSE_TAG_RE=new RegExp('^(?:'+open_tag+'|'+close_tag+')');module.exports.HTML_TAG_RE=HTML_TAG_RE;module.exports.HTML_OPEN_CLOSE_TAG_RE=HTML_OPEN_CLOSE_TAG_RE;},{}],4:[function(require,module,exports){'use strict';function _class(obj){return Object.prototype.toString.call(obj);} +me.legendItems=legendItems;},afterBuildLabels:noop$1,beforeFit:noop$1,fit:function(){var me=this;var opts=me.options;var labelOpts=opts.labels;var display=opts.display;var ctx=me.ctx;var labelFont=helpers$1.options._parseFont(labelOpts);var fontSize=labelFont.size;var hitboxes=me.legendHitBoxes=[];var minSize=me.minSize;var isHorizontal=me.isHorizontal();if(isHorizontal){minSize.width=me.maxWidth;minSize.height=display?10:0;}else{minSize.width=display?10:0;minSize.height=me.maxHeight;} +if(!display){me.width=minSize.width=me.height=minSize.height=0;return;} +ctx.font=labelFont.string;if(isHorizontal){var lineWidths=me.lineWidths=[0];var totalHeight=0;ctx.textAlign='left';ctx.textBaseline='middle';helpers$1.each(me.legendItems,function(legendItem,i){var boxWidth=getBoxWidth(labelOpts,fontSize);var width=boxWidth+(fontSize/2)+ctx.measureText(legendItem.text).width;if(i===0||lineWidths[lineWidths.length-1]+width+2*labelOpts.padding>minSize.width){totalHeight+=fontSize+labelOpts.padding;lineWidths[lineWidths.length-(i>0?0:1)]=0;} +hitboxes[i]={left:0,top:0,width:width,height:fontSize};lineWidths[lineWidths.length-1]+=width+labelOpts.padding;});minSize.height+=totalHeight;}else{var vPadding=labelOpts.padding;var columnWidths=me.columnWidths=[];var columnHeights=me.columnHeights=[];var totalWidth=labelOpts.padding;var currentColWidth=0;var currentColHeight=0;helpers$1.each(me.legendItems,function(legendItem,i){var boxWidth=getBoxWidth(labelOpts,fontSize);var itemWidth=boxWidth+(fontSize/2)+ctx.measureText(legendItem.text).width;if(i>0&¤tColHeight+fontSize+2*vPadding>minSize.height){totalWidth+=currentColWidth+labelOpts.padding;columnWidths.push(currentColWidth);columnHeights.push(currentColHeight);currentColWidth=0;currentColHeight=0;} +currentColWidth=Math.max(currentColWidth,itemWidth);currentColHeight+=fontSize+vPadding;hitboxes[i]={left:0,top:0,width:itemWidth,height:fontSize};});totalWidth+=currentColWidth;columnWidths.push(currentColWidth);columnHeights.push(currentColHeight);minSize.width+=totalWidth;} +me.width=minSize.width;me.height=minSize.height;},afterFit:noop$1,isHorizontal:function(){return this.options.position==='top'||this.options.position==='bottom';},draw:function(){var me=this;var opts=me.options;var labelOpts=opts.labels;var globalDefaults=core_defaults.global;var defaultColor=globalDefaults.defaultColor;var lineDefault=globalDefaults.elements.line;var legendHeight=me.height;var columnHeights=me.columnHeights;var legendWidth=me.width;var lineWidths=me.lineWidths;if(!opts.display){return;} +var rtlHelper=getRtlHelper$1(opts.rtl,me.left,me.minSize.width);var ctx=me.ctx;var fontColor=valueOrDefault$e(labelOpts.fontColor,globalDefaults.defaultFontColor);var labelFont=helpers$1.options._parseFont(labelOpts);var fontSize=labelFont.size;var cursor;ctx.textAlign=rtlHelper.textAlign('left');ctx.textBaseline='middle';ctx.lineWidth=0.5;ctx.strokeStyle=fontColor;ctx.fillStyle=fontColor;ctx.font=labelFont.string;var boxWidth=getBoxWidth(labelOpts,fontSize);var hitboxes=me.legendHitBoxes;var drawLegendBox=function(x,y,legendItem){if(isNaN(boxWidth)||boxWidth<=0){return;} +ctx.save();var lineWidth=valueOrDefault$e(legendItem.lineWidth,lineDefault.borderWidth);ctx.fillStyle=valueOrDefault$e(legendItem.fillStyle,defaultColor);ctx.lineCap=valueOrDefault$e(legendItem.lineCap,lineDefault.borderCapStyle);ctx.lineDashOffset=valueOrDefault$e(legendItem.lineDashOffset,lineDefault.borderDashOffset);ctx.lineJoin=valueOrDefault$e(legendItem.lineJoin,lineDefault.borderJoinStyle);ctx.lineWidth=lineWidth;ctx.strokeStyle=valueOrDefault$e(legendItem.strokeStyle,defaultColor);if(ctx.setLineDash){ctx.setLineDash(valueOrDefault$e(legendItem.lineDash,lineDefault.borderDash));} +if(labelOpts&&labelOpts.usePointStyle){var radius=boxWidth*Math.SQRT2/2;var centerX=rtlHelper.xPlus(x,boxWidth/2);var centerY=y+fontSize/2;helpers$1.canvas.drawPoint(ctx,legendItem.pointStyle,radius,centerX,centerY,legendItem.rotation);}else{ctx.fillRect(rtlHelper.leftForLtr(x,boxWidth),y,boxWidth,fontSize);if(lineWidth!==0){ctx.strokeRect(rtlHelper.leftForLtr(x,boxWidth),y,boxWidth,fontSize);}} +ctx.restore();};var fillText=function(x,y,legendItem,textWidth){var halfFontSize=fontSize/2;var xLeft=rtlHelper.xPlus(x,boxWidth+halfFontSize);var yMiddle=y+halfFontSize;ctx.fillText(legendItem.text,xLeft,yMiddle);if(legendItem.hidden){ctx.beginPath();ctx.lineWidth=2;ctx.moveTo(xLeft,yMiddle);ctx.lineTo(rtlHelper.xPlus(xLeft,textWidth),yMiddle);ctx.stroke();}};var alignmentOffset=function(dimension,blockSize){switch(opts.align){case'start':return labelOpts.padding;case'end':return dimension-blockSize;default:return(dimension-blockSize+labelOpts.padding)/2;}};var isHorizontal=me.isHorizontal();if(isHorizontal){cursor={x:me.left+alignmentOffset(legendWidth,lineWidths[0]),y:me.top+labelOpts.padding,line:0};}else{cursor={x:me.left+labelOpts.padding,y:me.top+alignmentOffset(legendHeight,columnHeights[0]),line:0};} +helpers$1.rtl.overrideTextDirection(me.ctx,opts.textDirection);var itemHeight=fontSize+labelOpts.padding;helpers$1.each(me.legendItems,function(legendItem,i){var textWidth=ctx.measureText(legendItem.text).width;var width=boxWidth+(fontSize/2)+textWidth;var x=cursor.x;var y=cursor.y;rtlHelper.setWidth(me.minSize.width);if(isHorizontal){if(i>0&&x+width+labelOpts.padding>me.left+me.minSize.width){y=cursor.y+=itemHeight;cursor.line++;x=cursor.x=me.left+alignmentOffset(legendWidth,lineWidths[cursor.line]);}}else if(i>0&&y+itemHeight>me.top+me.minSize.height){x=cursor.x=x+me.columnWidths[cursor.line]+labelOpts.padding;cursor.line++;y=cursor.y=me.top+alignmentOffset(legendHeight,columnHeights[cursor.line]);} +var realX=rtlHelper.x(x);drawLegendBox(realX,y,legendItem);hitboxes[i].left=rtlHelper.leftForLtr(realX,hitboxes[i].width);hitboxes[i].top=y;fillText(realX,y,legendItem,textWidth);if(isHorizontal){cursor.x+=width+labelOpts.padding;}else{cursor.y+=itemHeight;}});helpers$1.rtl.restoreTextDirection(me.ctx,opts.textDirection);},_getLegendItemAt:function(x,y){var me=this;var i,hitBox,lh;if(x>=me.left&&x<=me.right&&y>=me.top&&y<=me.bottom){lh=me.legendHitBoxes;for(i=0;i=hitBox.left&&x<=hitBox.left+hitBox.width&&y>=hitBox.top&&y<=hitBox.top+hitBox.height){return me.legendItems[i];}}} +return null;},handleEvent:function(e){var me=this;var opts=me.options;var type=e.type==='mouseup'?'click':e.type;var hoveredItem;if(type==='mousemove'){if(!opts.onHover&&!opts.onLeave){return;}}else if(type==='click'){if(!opts.onClick){return;}}else{return;} +hoveredItem=me._getLegendItemAt(e.x,e.y);if(type==='click'){if(hoveredItem&&opts.onClick){opts.onClick.call(me,e.native,hoveredItem);}}else{if(opts.onLeave&&hoveredItem!==me._hoveredItem){if(me._hoveredItem){opts.onLeave.call(me,e.native,me._hoveredItem);} +me._hoveredItem=hoveredItem;} +if(opts.onHover&&hoveredItem){opts.onHover.call(me,e.native,hoveredItem);}}}});function createNewLegendAndAttach(chart,legendOpts){var legend=new Legend({ctx:chart.ctx,options:legendOpts,chart:chart});core_layouts.configure(chart,legend,legendOpts);core_layouts.addBox(chart,legend);chart.legend=legend;} +var plugin_legend={id:'legend',_element:Legend,beforeInit:function(chart){var legendOpts=chart.options.legend;if(legendOpts){createNewLegendAndAttach(chart,legendOpts);}},beforeUpdate:function(chart){var legendOpts=chart.options.legend;var legend=chart.legend;if(legendOpts){helpers$1.mergeIf(legendOpts,core_defaults.global.legend);if(legend){core_layouts.configure(chart,legend,legendOpts);legend.options=legendOpts;}else{createNewLegendAndAttach(chart,legendOpts);}}else if(legend){core_layouts.removeBox(chart,legend);delete chart.legend;}},afterEvent:function(chart,e){var legend=chart.legend;if(legend){legend.handleEvent(e);}}};var noop$2=helpers$1.noop;core_defaults._set('global',{title:{display:false,fontStyle:'bold',fullWidth:true,padding:10,position:'top',text:'',weight:2000}});var Title=core_element.extend({initialize:function(config){var me=this;helpers$1.extend(me,config);me.legendHitBoxes=[];},beforeUpdate:noop$2,update:function(maxWidth,maxHeight,margins){var me=this;me.beforeUpdate();me.maxWidth=maxWidth;me.maxHeight=maxHeight;me.margins=margins;me.beforeSetDimensions();me.setDimensions();me.afterSetDimensions();me.beforeBuildLabels();me.buildLabels();me.afterBuildLabels();me.beforeFit();me.fit();me.afterFit();me.afterUpdate();return me.minSize;},afterUpdate:noop$2,beforeSetDimensions:noop$2,setDimensions:function(){var me=this;if(me.isHorizontal()){me.width=me.maxWidth;me.left=0;me.right=me.width;}else{me.height=me.maxHeight;me.top=0;me.bottom=me.height;} +me.paddingLeft=0;me.paddingTop=0;me.paddingRight=0;me.paddingBottom=0;me.minSize={width:0,height:0};},afterSetDimensions:noop$2,beforeBuildLabels:noop$2,buildLabels:noop$2,afterBuildLabels:noop$2,beforeFit:noop$2,fit:function(){var me=this;var opts=me.options;var minSize=me.minSize={};var isHorizontal=me.isHorizontal();var lineCount,textSize;if(!opts.display){me.width=minSize.width=me.height=minSize.height=0;return;} +lineCount=helpers$1.isArray(opts.text)?opts.text.length:1;textSize=lineCount*helpers$1.options._parseFont(opts).lineHeight+opts.padding*2;me.width=minSize.width=isHorizontal?me.maxWidth:textSize;me.height=minSize.height=isHorizontal?textSize:me.maxHeight;},afterFit:noop$2,isHorizontal:function(){var pos=this.options.position;return pos==='top'||pos==='bottom';},draw:function(){var me=this;var ctx=me.ctx;var opts=me.options;if(!opts.display){return;} +var fontOpts=helpers$1.options._parseFont(opts);var lineHeight=fontOpts.lineHeight;var offset=lineHeight/2+opts.padding;var rotation=0;var top=me.top;var left=me.left;var bottom=me.bottom;var right=me.right;var maxWidth,titleX,titleY;ctx.fillStyle=helpers$1.valueOrDefault(opts.fontColor,core_defaults.global.defaultFontColor);ctx.font=fontOpts.string;if(me.isHorizontal()){titleX=left+((right-left)/2);titleY=top+offset;maxWidth=right-left;}else{titleX=opts.position==='left'?left+offset:right-offset;titleY=top+((bottom-top)/2);maxWidth=bottom-top;rotation=Math.PI*(opts.position==='left'?-0.5:0.5);} +ctx.save();ctx.translate(titleX,titleY);ctx.rotate(rotation);ctx.textAlign='center';ctx.textBaseline='middle';var text=opts.text;if(helpers$1.isArray(text)){var y=0;for(var i=0;i`\\x00-\\x20]+';var single_quoted="'[^']*'";var double_quoted='"[^"]*"';var attr_value='(?:'+unquoted+'|'+single_quoted+'|'+double_quoted+')';var attribute='(?:\\s+'+attr_name+'(?:\\s*=\\s*'+attr_value+')?)';var open_tag='<[A-Za-z][A-Za-z0-9\\-]*'+attribute+'*\\s*\\/?>';var close_tag='<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>';var comment='|';var processing='<[?].*?[?]>';var declaration=']*>';var cdata='';var HTML_TAG_RE=new RegExp('^(?:'+open_tag+'|'+close_tag+'|'+comment+'|'+processing+'|'+declaration+'|'+cdata+')');var HTML_OPEN_CLOSE_TAG_RE=new RegExp('^(?:'+open_tag+'|'+close_tag+')');module.exports.HTML_TAG_RE=HTML_TAG_RE;module.exports.HTML_OPEN_CLOSE_TAG_RE=HTML_OPEN_CLOSE_TAG_RE;},{}],4:[function(require,module,exports){'use strict';function _class(obj){return Object.prototype.toString.call(obj);} function isString(obj){return _class(obj)==='[object String]';} var _hasOwnProperty=Object.prototype.hasOwnProperty;function has(object,key){return _hasOwnProperty.call(object,key);} function assign(obj){var sources=Array.prototype.slice.call(arguments,1);sources.forEach(function(source){if(!source){return;} diff --git a/public/dist/scripts/app.js b/public/dist/scripts/app.js index ff9a5b2d2b..2c73bc0649 100644 --- a/public/dist/scripts/app.js +++ b/public/dist/scripts/app.js @@ -248,16 +248,22 @@ return slf.renderToken(tokens,idx,opts);} md.renderer.rules.strong_open=renderEm;md.renderer.rules.strong_close=renderEm;return md;},true);})(window);(function(window){"use strict";window.ls.container.set('rtl',function(){var rtlStock="^ا^ب^ت^ث^ج^ح^خ^د^ذ^ر^ز^س^ش^ص^ض^ط^ظ^ع^غ^ف^ق^ك^ل^م^ن^ه^و^ي^א^ב^ג^ד^ה^ו^ז^ח^ט^י^כ^ך^ל^מ^ם^נ^ן^ס^ע^פ^ף^צ^ץ^ק^ר^ש^ת^";var special=["\n"," "," ","״",'"',"_","'","!","@","#","$","^","&","%","*","(",")","+","=","-","[","]","\\","/","{","}","|",":","<",">","?",",",".","0","1","2","3","4","5","6","7","8","9"];var isRTL=function(value){for(var i=0;i=31536000){value=Math.floor(seconds/31536000);unit="year";} +else if(seconds>=86400){value=Math.floor(seconds/86400);unit="day";} +else if(seconds>=3600){value=Math.floor(seconds/3600);unit="hour";} +else if(seconds>=60){value=Math.floor(seconds/60);unit="minute";} +if(value!=1){unit=unit+"s";} +return value+" "+unit+" "+direction;}).add("ms2hum",function($value){let temp=$value;const years=Math.floor(temp/31536000),days=Math.floor((temp%=31536000)/86400),hours=Math.floor((temp%=86400)/3600),minutes=Math.floor((temp%=3600)/60),seconds=temp%60;if(days||hours||seconds||minutes){return((years?years+"y ":"")+ (days?days+"d ":"")+ (hours?hours+"h ":"")+ (minutes?minutes+"m ":"")+ Number.parseFloat(seconds).toFixed(0)+"s");} -return"< 1s";}).add("markdown",function($value,markdown){return markdown.render($value);}).add("pageCurrent",function($value,env){return Math.ceil(parseInt($value||0)/env.PAGING_LIMIT)+1;}).add("pageTotal",function($value,env){let total=Math.ceil(parseInt($value||0)/env.PAGING_LIMIT);return total?total:1;}).add("humanFileSize",function($value){if(!$value){return 0;} +return"< 1s";}).add("seconds2hum",function($value){var seconds=($value).toFixed(3);var minutes=($value/(60)).toFixed(1);var hours=($value/(60*60)).toFixed(1);var days=($value/(60*60*24)).toFixed(1);if(seconds<60){return seconds+"s";}else if(minutes<60){return minutes+"m";}else if(hours<24){return hours+"h";}else{return days+"d"}}).add("markdown",function($value,markdown){return markdown.render($value);}).add("pageCurrent",function($value,env){return Math.ceil(parseInt($value||0)/env.PAGING_LIMIT)+1;}).add("pageTotal",function($value,env){let total=Math.ceil(parseInt($value||0)/env.PAGING_LIMIT);return total?total:1;}).add("humanFileSize",function($value){if(!$value){return 0;} let thresh=1000;if(Math.abs($value)=thresh&&u'+ units[u]+"");}).add("statsTotal",function($value){if(!$value){return 0;} @@ -266,7 +272,10 @@ return result.length;}).add("documentAction",function(container){let collection= return'database.updateDocument';}).add("documentSuccess",function(container){let document=container.get('project-document');if(document&&!document.$id){return',redirect';} return'';}).add("firstElement",function($value){if($value&&$value[0]){return $value[0];} return $value;}).add("platformsLimit",function($value){return $value;}).add("limit",function($value){let postfix=($value.length>=50)?'...':'';return $value.substring(0,50)+postfix;;}).add("arraySentence",function($value){if(!Array.isArray($value)){return'';} -return $value.join(", ").replace(/,\s([^,]+)$/,' and $1');});function abbreviate(number,maxPlaces,forcePlaces,forceLetter){number=Number(number);forceLetter=forceLetter||false;if(forceLetter!==false){return annotate(number,maxPlaces,forcePlaces,forceLetter);} +return $value.join(", ").replace(/,\s([^,]+)$/,' and $1');}).add("envName",function($value,env){if(env&&env.ENVIRONMENTS&&env.ENVIRONMENTS[$value]){return env.ENVIRONMENTS[$value].name;} +return'';}).add("envLogo",function($value,env){if(env&&env.ENVIRONMENTS&&env.ENVIRONMENTS[$value]){return env.ENVIRONMENTS[$value].logo;} +return'';}).add("envVersion",function($value,env){if(env&&env.ENVIRONMENTS&&env.ENVIRONMENTS[$value]){return env.ENVIRONMENTS[$value].version;} +return'';});function abbreviate(number,maxPlaces,forcePlaces,forceLetter){number=Number(number);forceLetter=forceLetter||false;if(forceLetter!==false){return annotate(number,maxPlaces,forcePlaces,forceLetter);} let abbr;if(number>=1e12){abbr="T";}else if(number>=1e9){abbr="B";}else if(number>=1e6){abbr="M";}else if(number>=1e3){abbr="K";}else{abbr="";} return annotate(number,maxPlaces,forcePlaces,abbr);} function annotate(number,maxPlaces,forcePlaces,abbr){let rounded=0;switch(abbr){case"T":rounded=number/1e12;break;case"B":rounded=number/1e9;break;case"M":rounded=number/1e6;break;case"K":rounded=number/1e3;break;case"":rounded=number;break;} @@ -274,10 +283,8 @@ if(maxPlaces!==false){let test=new RegExp("\\.\\d{"+(maxPlaces+1)+",}$");if(test if(forcePlaces!==false){rounded=Number(rounded).toFixed(forcePlaces);} return rounded+abbr;} window.ls.container.get("view").add({selector:"data-acl",controller:function(element,document,router,alerts){document.body.classList.remove("console");document.body.classList.remove("home");document.body.classList.add(router.getCurrent().view.scope);if(!router.getCurrent().view.project){document.body.classList.add("hide-nav");document.body.classList.remove("show-nav");}else{document.body.classList.add("show-nav");document.body.classList.remove("hide-nav");} -if("/console"===router.getCurrent().path){document.body.classList.add("index");}else{document.body.classList.remove("index");}}}).add({selector:"data-forms-headers",controller:function(element){let key=document.createElement("input");let value=document.createElement("input");let wrap=document.createElement("div");let cell1=document.createElement("div");let cell2=document.createElement("div");key.type="text";key.className="margin-bottom-no";key.placeholder="Key";value.type="text";value.className="margin-bottom-no";value.placeholder="Value";wrap.className="row thin margin-bottom-small";cell1.className="col span-6";cell2.className="col span-6";element.parentNode.insertBefore(wrap,element);cell1.appendChild(key);cell2.appendChild(value);wrap.appendChild(cell1);wrap.appendChild(cell2);key.addEventListener("input",function(){syncA();});value.addEventListener("input",function(){syncA();});element.addEventListener("change",function(){syncB();});let syncA=function(){element.value=key.value.toLowerCase()+":"+value.value.toLowerCase();};let syncB=function(){let split=element.value.toLowerCase().split(":");key.value=split[0]||"";value.value=split[1]||"";key.value=key.value.trim();value.value=value.value.trim();};syncB();}}).add({selector:"data-prism",controller:function(window,document,element,alerts){Prism.highlightElement(element);let copy=document.createElement("i");copy.className="icon-docs copy";copy.title="Copy to Clipboard";copy.textContent="Click Here to Copy";copy.addEventListener("click",function(){window.getSelection().removeAllRanges();let range=document.createRange();range.selectNode(element);window.getSelection().addRange(range);try{document.execCommand("copy");alerts.add({text:"Copied to clipboard",class:""},3000);}catch(err){alerts.add({text:"Failed to copy text ",class:"error"},3000);} -window.getSelection().removeAllRanges();});element.parentNode.parentNode.appendChild(copy);}}).add({selector:"data-ls-ui-chart",controller:function(element,container,date,document){let child=document.createElement("canvas");child.width=500;child.height=175;let stats=container.get("usage");if(!stats||!stats["requests"]||!stats["requests"]["data"]){return;} -let config={type:"line",data:{labels:[],datasets:[{label:"Requests",backgroundColor:"rgba(230, 248, 253, 0.3)",borderColor:"#29b5d9",borderWidth:2,data:[0,0,0,0,0,0,0],fill:true}]},options:{responsive:true,title:{display:false,text:"Stats"},legend:{display:false},tooltips:{mode:"index",intersect:false,caretPadding:0},hover:{mode:"nearest",intersect:true},scales:{xAxes:[{display:false}],yAxes:[{display:false}]}}};for(let i=0;ielement.trim());return function(serviceForm,router,window){let url=window.location.href;keys.map(node=>{node=node.split("=");let key=node[0]||"";let name=node[1]||key;let value=getValue(key,"param",serviceForm);url=updateQueryString(name,value?value:null,url);});if(url!==window.location.href){window.history.pushState({},"",url);router.reset();}};},trigger:function(events){return function(document){events=events.trim().split(",");for(let i=0;i=distance)&&(distance>=0)){if(minLink){minLink.classList.remove('selected');} +break;default:break;}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-forms-headers",controller:function(element){let key=document.createElement("input");let value=document.createElement("input");let wrap=document.createElement("div");let cell1=document.createElement("div");let cell2=document.createElement("div");key.type="text";key.className="margin-bottom-no";key.placeholder="Key";value.type="text";value.className="margin-bottom-no";value.placeholder="Value";wrap.className="row thin margin-bottom-small";cell1.className="col span-6";cell2.className="col span-6";element.parentNode.insertBefore(wrap,element);cell1.appendChild(key);cell2.appendChild(value);wrap.appendChild(cell1);wrap.appendChild(cell2);key.addEventListener("input",function(){syncA();});value.addEventListener("input",function(){syncA();});element.addEventListener("change",function(){syncB();});let syncA=function(){element.value=key.value.toLowerCase()+":"+value.value.toLowerCase();};let syncB=function(){let split=element.value.toLowerCase().split(":");key.value=split[0]||"";value.value=split[1]||"";key.value=key.value.trim();value.value=value.value.trim();};syncB();}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-forms-key-value",controller:function(element){let key=document.createElement("input");let value=document.createElement("input");let wrap=document.createElement("div");let cell1=document.createElement("div");let cell2=document.createElement("div");key.type="text";key.className="margin-bottom-no";key.placeholder="Key";value.type="text";value.className="margin-bottom-no";value.placeholder="Value";wrap.className="row thin margin-bottom-small";cell1.className="col span-6";cell2.className="col span-6";element.parentNode.insertBefore(wrap,element);cell1.appendChild(key);cell2.appendChild(value);wrap.appendChild(cell1);wrap.appendChild(cell2);key.addEventListener("input",function(){syncA();});value.addEventListener("input",function(){syncA();});element.addEventListener("change",function(){syncB();});let syncA=function(){element.name=key.value;element.value=value.value;};let syncB=function(){key.value=element.name||"";value.value=element.value||"";};syncB();}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-move-down",controller:function(element){Array.prototype.slice.call(element.querySelectorAll("[data-move-down]")).map(function(obj){obj.addEventListener("click",function(){if(element.nextElementSibling){console.log('down',element.offsetHeight);element.parentNode.insertBefore(element.nextElementSibling,element);element.scrollIntoView({block:'center'});}});});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-move-up",controller:function(element){Array.prototype.slice.call(element.querySelectorAll("[data-move-up]")).map(function(obj){obj.addEventListener("click",function(){if(element.previousElementSibling){console.log('up',element);element.parentNode.insertBefore(element,element.previousElementSibling);element.scrollIntoView({block:'center'});}});});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-nav",repeat:false,controller:function(element,view,container,document){let titles=document.querySelectorAll('[data-forms-nav-anchor]');let links=element.querySelectorAll('[data-forms-nav-link]');let minLink=null;let check=function(){let minDistance=null;let minElement=null;for(let i=0;i=distance)&&(distance>=0)){if(minLink){minLink.classList.remove('selected');} console.log('old',minLink);minDistance=distance;minElement=title;minLink=links[i];minLink.classList.add('selected');console.log('new',minLink);}}};window.addEventListener('scroll',check);check();}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-oauth-apple",controller:function(element){let container=document.createElement("div");let row=document.createElement("div");let col1=document.createElement("div");let col2=document.createElement("div");let keyID=document.createElement("input");let keyLabel=document.createElement("label");let teamID=document.createElement("input");let teamLabel=document.createElement("label");let p8=document.createElement("textarea");let p8Label=document.createElement("label");keyLabel.textContent='Key ID';teamLabel.textContent='Team ID';p8Label.textContent='P8 File';row.classList.add('row');row.classList.add('thin');container.appendChild(row);container.appendChild(p8Label);container.appendChild(p8);row.appendChild(col1);row.appendChild(col2);col1.classList.add('col');col1.classList.add('span-6');col1.appendChild(keyLabel);col1.appendChild(keyID);col2.classList.add('col');col2.classList.add('span-6');col2.appendChild(teamLabel);col2.appendChild(teamID);keyID.type='text';keyID.placeholder='SHAB13ROFN';teamID.type='text';teamID.placeholder='ELA2CD3AED';p8.accept='.p8';p8.classList.add('margin-bottom-no');element.parentNode.insertBefore(container,element.nextSibling);element.addEventListener('change',sync);keyID.addEventListener('change',update);teamID.addEventListener('change',update);p8.addEventListener('change',update);function update(){let json={};json.keyID=keyID.value;json.teamID=teamID.value;json.p8=p8.value;element.value=JSON.stringify(json);} function sync(){if(!element.value){return;} let json={};try{json=JSON.parse(element.value);}catch(error){console.error('Failed to parse secret key');} @@ -343,7 +356,8 @@ var variations={digits:/\d/.test(password),lower:/[a-z]/.test(password),upper:/[ score+=(variationCount-1)*10;return parseInt(score);};var callback=function(){var score=calc(this.value);if(""===this.value)return(meter.className="password-meter");if(score>60)return(meter.className="password-meter strong");if(score>30)return(meter.className="password-meter medium");if(score>=0)return(meter.className="password-meter weak");};var meter=window.document.createElement("div");meter.className="password-meter";element.parentNode.insertBefore(meter,element.nextSibling);element.addEventListener("change",callback);element.addEventListener("keypress",callback);element.addEventListener("keyup",callback);element.addEventListener("keydown",callback);}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-pell",controller:function(element,window,document,markdown,rtl){var div=document.createElement("div");element.className="pell hide";div.className="input pell";element.parentNode.insertBefore(div,element);element.tabIndex=-1;var turndownService=new TurndownService();turndownService.addRule("underline",{filter:["u"],replacement:function(content){return"__"+content+"__";}});var editor=window.pell.init({element:div,onChange:function onChange(html){alignText();element.value=turndownService.turndown(html);},defaultParagraphSeparator:"p",actions:[{name:"bold",icon:''},{name:"underline",icon:''},{name:"italic",icon:''},{name:"olist",icon:''},{name:"ulist",icon:''},{name:"link",icon:''}]});var clean=function(e){e.stopPropagation();e.preventDefault();var clipboardData=e.clipboardData||window.clipboardData;console.log(clipboardData.getData("Text"));window.pell.exec("insertText",clipboardData.getData("Text"));return true;};var alignText=function(){let paragraphs=editor.content.querySelectorAll('p,li');let last='';for(let paragraph of paragraphs){var content=paragraph.textContent;if(content.trim()===''){content=last.textContent;} if(rtl.isRTL(content)){paragraph.style.direction='rtl';paragraph.style.textAlign='right';} else{paragraph.style.direction='ltr';paragraph.style.textAlign='left';} -last=paragraph;}};var santize=function(e){clean(e);alignText(e);};element.addEventListener("change",function(){editor.content.innerHTML=markdown.render(element.value);alignText();});editor.content.setAttribute("placeholder",element.placeholder);editor.content.innerHTML=markdown.render(element.value);editor.content.tabIndex=0;alignText();editor.content.onkeydown=function preventTab(event){if(event.which===9){event.preventDefault();if(document.activeElement){var focussable=Array.prototype.filter.call(document.querySelectorAll('a:not([disabled]), button:not([disabled]), select:not([disabled]), input[type=text]:not([disabled]), input[type=checkbox]:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])'),function(element){return(element.offsetWidth>0||element.offsetHeight>0||element===document.activeElement);});var index=focussable.indexOf(document.activeElement);if(index>-1){if(event.shiftKey){var prevElement=focussable[index-1]||focussable[focussable.length-1];prevElement.focus();}else{var nextElement=focussable[index+1]||focussable[0];nextElement.focus();}}}}};div.addEventListener("paste",santize);div.addEventListener("drop",santize);}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-remove",controller:function(element){Array.prototype.slice.call(element.querySelectorAll("[data-remove]")).map(function(obj){obj.addEventListener("click",function(){element.parentNode.removeChild(element);});});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-run",repeat:false,controller:function(element,expression,container){let action=expression.parse(element.dataset["formsRun"]||'');element.addEventListener('click',function(){return container.path(action)();});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-switch",controller:function(element){let input=window.document.createElement("input");input.type="checkbox";input.className="button switch";let syncA=function(){let value=input.checked?"true":"false" +last=paragraph;}};var santize=function(e){clean(e);alignText(e);};element.addEventListener("change",function(){editor.content.innerHTML=markdown.render(element.value);alignText();});editor.content.setAttribute("placeholder",element.placeholder);editor.content.innerHTML=markdown.render(element.value);editor.content.tabIndex=0;alignText();editor.content.onkeydown=function preventTab(event){if(event.which===9){event.preventDefault();if(document.activeElement){var focussable=Array.prototype.filter.call(document.querySelectorAll('a:not([disabled]), button:not([disabled]), select:not([disabled]), input[type=text]:not([disabled]), input[type=checkbox]:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])'),function(element){return(element.offsetWidth>0||element.offsetHeight>0||element===document.activeElement);});var index=focussable.indexOf(document.activeElement);if(index>-1){if(event.shiftKey){var prevElement=focussable[index-1]||focussable[focussable.length-1];prevElement.focus();}else{var nextElement=focussable[index+1]||focussable[0];nextElement.focus();}}}}};div.addEventListener("paste",santize);div.addEventListener("drop",santize);}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-remove",controller:function(element){Array.prototype.slice.call(element.querySelectorAll("[data-remove]")).map(function(obj){obj.addEventListener("click",function(){element.parentNode.removeChild(element);});});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-run",repeat:false,controller:function(element,expression,container){let action=expression.parse(element.dataset["formsRun"]||'');element.addEventListener('click',function(){return container.path(action)();});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-select-all",controller:function(element){let select=document.createElement("button");let unselect=document.createElement("button");select.textContent='Select All';unselect.textContent='Unselect All';select.classList.add('link');select.classList.add('margin-top-tiny');select.classList.add('margin-start-small');select.classList.add('text-size-small');select.classList.add('pull-end');unselect.classList.add('link');unselect.classList.add('margin-top-tiny');unselect.classList.add('margin-start-small');unselect.classList.add('text-size-small');unselect.classList.add('pull-end');select.type='button';unselect.type='button';element.parentNode.insertBefore(select,element);element.parentNode.insertBefore(unselect,element);select.addEventListener('click',function(){let checkboxes=document.querySelectorAll("input[type='checkbox']");for(var i=0;i0){array.push(add.value);add.value="";element.value=JSON.stringify(array);check();if(event.key!=="Tab"){event.preventDefault();}} if((event.key==="Backspace"||event.key==="Delete")&&add.value===""){array.splice(-1,1);element.value=JSON.stringify(array);check();} return false;};let check=function(){try{array=JSON.parse(element.value)||[];}catch(error){array=[];} @@ -358,7 +372,7 @@ var file=document.createElement("li");var image=document.createElement("img");im result+"/preview?width="+ previewWidth+"&height="+ previewHeight+"&project="+project+"&mode=admin";image.alt=previewAlt;file.className="file avatar";file.tabIndex=0;file.appendChild(image);preview.appendChild(file);var remove=(function(result){return function(event){render(result.$id);element.value='';};})(result);file.addEventListener("click",remove);file.addEventListener("keypress",remove);element.value=result;};input.addEventListener("change",function(){var message=alerts.add({text:labelLoading,class:""},0);var files=input.files;var read=JSON.parse(expression.parse(element.dataset["read"]||"[]"));var write=JSON.parse(expression.parse(element.dataset["write"]||"[]"));sdk.storage.createFile(files[0],read,write,1).then(function(response){onComplete(message);render(response.$id);},function(error){alerts.add({text:"An error occurred!",class:""},3000);onComplete(message);});input.disabled=true;});element.addEventListener("change",function(){if(!element.value){return;} -render(element.value);wrapper.scrollIntoView();});upload.addEventListener("keypress",function(){input.click();});element.parentNode.insertBefore(wrapper,element);wrapper.appendChild(preview);wrapper.appendChild(progress);wrapper.appendChild(upload);upload.appendChild(input);render(output);if(searchButton){let searchOpen=document.createElement("button");searchOpen.type='button';searchOpen.innerHTML=' Search';searchOpen.classList.add('reverse');let path=container.scope(searchButton);searchOpen.addEventListener('click',function(){search.selected=element.value;search.path=path;document.dispatchEvent(new CustomEvent("open-file-serach",{bubbles:false,cancelable:true}));});wrapper.appendChild(searchOpen);}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-cookies",controller:function(element,alerts,cookie,env){if(!cookie.get("cookie-alert")){let text=element.dataset["cookies"]||"";alerts.add({text:text,class:"cookie-alert",link:env.HOME+"/policy/cookies",callback:function(){cookie.set("cookie-alert","true",365*10);}},0);}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-page-title",repeat:true,controller:function(element,document,expression){document.title=expression.parse(element.getAttribute("data-page-title"))||document.title;}});})(window);(function(window){"use strict";window.ls.view.add({selector:'data-general-scroll-to',repeat:false,controller:function(element,window){let button=window.document.createElement('button');button.className='scroll-to icon-up-dir';button.alt='Back To Top';button.title='Back To Top';button.addEventListener('click',function(){element.scrollIntoView(true,{behavior:'smooth'});button.blur();},false);element.appendChild(button);}});})(window);(function(window){"use strict";window.ls.view.add({selector:'data-general-scroll-direction',repeat:false,controller:function(element,window){let position=0;let check=function(){let direction=window.document.documentElement.scrollTop;if(direction>position){element.classList.remove('scroll-to-top') +render(element.value);wrapper.scrollIntoView();});upload.addEventListener("keypress",function(){input.click();});element.parentNode.insertBefore(wrapper,element);wrapper.appendChild(preview);wrapper.appendChild(progress);wrapper.appendChild(upload);upload.appendChild(input);render(output);if(searchButton){let searchOpen=document.createElement("button");searchOpen.type='button';searchOpen.innerHTML=' Search';searchOpen.classList.add('reverse');let path=container.scope(searchButton);searchOpen.addEventListener('click',function(){search.selected=element.value;search.path=path;document.dispatchEvent(new CustomEvent("open-file-serach",{bubbles:false,cancelable:true}));});wrapper.appendChild(searchOpen);}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-cookies",controller:function(element,alerts,cookie,env){if(!cookie.get("cookie-alert")){let text=element.dataset["cookies"]||"";alerts.add({text:text,class:"cookie-alert",link:env.HOME+"/policy/cookies",label:'Learn More',callback:function(){cookie.set("cookie-alert","true",365*10);}},0);}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-page-title",repeat:true,controller:function(element,document,expression){document.title=expression.parse(element.getAttribute("data-page-title"))||document.title;}});})(window);(function(window){"use strict";window.ls.view.add({selector:'data-general-scroll-to',repeat:false,controller:function(element,window){let button=window.document.createElement('button');button.className='scroll-to icon-up-dir';button.alt='Back To Top';button.title='Back To Top';button.addEventListener('click',function(){element.scrollIntoView(true,{behavior:'smooth'});button.blur();},false);element.appendChild(button);}});})(window);(function(window){"use strict";window.ls.view.add({selector:'data-general-scroll-direction',repeat:false,controller:function(element,window){let position=0;let check=function(){let direction=window.document.documentElement.scrollTop;if(direction>position){element.classList.remove('scroll-to-top') element.classList.add('scroll-to-bottom')} else{element.classList.remove('scroll-to-bottom') element.classList.add('scroll-to-top')} @@ -366,7 +380,13 @@ position=direction;let current=Math.ceil(direction/window.innerHeight);element.s else{element.classList.remove('scroll-end')}};window.addEventListener('scroll',check,false);window.addEventListener('resize',check,false);check();}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-setup",controller:function(element,console,form,alerts,router){element.addEventListener("submit",function(event){event.preventDefault();let loaderId=alerts.add({text:'Creating new project...',class:""},0);let formData=form.toJson(element);formData["name"]=formData["name"]||(element.dataset["defaultName"]||"");console.teams.create(formData["name"]||"").then(function(data){let team=data["$id"];formData=JSON.parse(JSON.stringify(formData).replace(new RegExp("{{teamId}}","g"),team));console.projects.create(formData["name"],team).then(function(project){alerts.remove(loaderId);window.location.href="/console/home?project="+project["$id"];},function(){throw new Error("Failed to setup project");});},function(){throw new Error("Setup failed creating project team");});});}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-switch",controller:function(element,router,document){let check=function(c){if(!element.value){return;} if(element.value===router.params.project){return;} return router.change("/console/home?project="+element.value);};element.addEventListener("change",function(){check();});}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-general-theme",controller:function(element,router,document){let toggle=function(c){if(document.body.classList.contains('theme-light')){document.body.classList.remove('theme-light');document.body.classList.add('theme-dark');window.localStorage.setItem('user-theme','theme-dark')} -else{document.body.classList.remove('theme-dark');document.body.classList.add('theme-light');window.localStorage.setItem('user-theme','theme-light')}};element.addEventListener("click",function(){toggle();});}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-paging-back",controller:function(element,container,expression,env){let paths=[];let limit=env.PAGING_LIMIT;let check=function(){let offset=parseInt(expression.parse(element.dataset["offset"])||"0");paths=paths.concat(expression.getPaths());if(offset-limit<0){element.disabled=true;}else{element.disabled=false;element.value=offset-limit;}};check();for(let i=0;i=sum){element.disabled=true;}else{element.disabled=false;element.value=offset+limit;}};check();for(let i=0;ib)return true +if(a=sum){element.disabled=true;}else{element.disabled=false;element.value=offset+limit;}};check();for(let i=0;i")}:root .theme-dark{--config-color-background:#061F2F;--config-color-background-dark:#262d50;--config-color-background-fade:#1c223a;--config-color-background-fade-super:#1a1f35;--config-color-background-focus:#1a1f35;--config-color-background-input:#dce8f5;--config-color-tooltip-text:#061F2F;--config-color-tooltip-background:#dce8f5;--config-color-link:#4caedb;--config-color-placeholder:#9ea1af;--config-color-focus:#c7d8eb;--config-color-focus-fade:#1e233e;--config-color-focus-hover:#d3deea;--config-color-focus-glow:#d3deea;--config-color-focus-dark:#657586;--config-color-normal:#c7d8eb;--config-color-dark:#c7d8eb;--config-color-fade:#bec3e0;--config-color-fade-light:#181818;--config-color-fade-super:#262D50;--config-color-danger:#d84a4a;--config-color-success:#34b86d;--config-color-warning:#e0d56d;--config-color-info:#386fd2;--config-border-color:#262D50;--config-prism-background:#1F253F;--config-prism-numbers:#1F253F;--config-note-background:#171e33;--config-note-border:#262D50;--config-warning-background:#1F253F;--config-warning-border:#262D50;--config-social-twitter:var(--config-color-normal);--config-social-github:var(--config-color-normal);--config-social-discord:var(--config-color-normal);--config-social-facebook:var(--config-color-normal);--config-language-bash:var(--config-color-normal);--config-language-bash-contrast:var(--config-color-background);--config-language-javascript:var(--config-color-normal);--config-language-javascript-contrast:var(--config-color-background);--config-language-web:var(--config-color-normal);--config-language-web-contrast:var(--config-color-background);--config-language-yaml:var(--config-color-normal);--config-language-yaml-contrast:var(--config-color-background);--config-language-html:var(--config-color-normal);--config-language-html-contrast:var(--config-color-background);--config-language-php:var(--config-color-normal);--config-language-php-contrast:var(--config-color-background);--config-language-nodejs:var(--config-color-normal);--config-language-nodejs-contrast:var(--config-color-background);--config-language-ruby:var(--config-color-normal);--config-language-ruby-contrast:var(--config-color-background);--config-language-python:var(--config-color-normal);--config-language-python-contrast:var(--config-color-background);--config-language-go:var(--config-color-normal);--config-language-go-contrast:var(--config-color-background);--config-language-dart:var(--config-color-normal);--config-language-dart-contrast:var(--config-color-background);--config-language-flutter:var(--config-color-normal);--config-language-flutter-contrast:var(--config-color-background);--config-modal-note-background:#15192b;--config-modal-note-border:#161b31;--config-modal-note-color:var(--config-color-normal);--config-switch-background:var(--config-color-normal);--config-console-background:#20263f;--config-console-nav-start:#1c2139;--config-console-nav-end:#151929;--config-console-nav-border:#171b30;--config-console-nav-switch-background:var(--config-color-focus);--config-console-nav-switch-color:var(--config-color-background);--config-console-nav-switch-arrow:url("data:image/svg+xml;utf8,")}.theme-light .force-light{display:block!important}.theme-dark .force-dark{display:block!important}.force-dark{display:none!important}.force-light{display:none!important}@font-face{font-family:Poppins;font-style:normal;font-weight:100;src:url(/fonts/poppins-v9-latin-100.eot);src:local('Poppins Thin'),local('Poppins-Thin'),url(/fonts/poppins-v9-latin-100.eot?#iefix) format('embedded-opentype'),url(/fonts/poppins-v9-latin-100.woff2) format('woff2'),url(/fonts/poppins-v9-latin-100.woff) format('woff'),url(/fonts/poppins-v9-latin-100.ttf) format('truetype'),url(/fonts/poppins-v9-latin-100.svg#Poppins) format('svg')}@font-face{font-family:Poppins;font-style:normal;font-weight:300;src:url(/fonts/poppins-v9-latin-300.eot);src:local('Poppins Light'),local('Poppins-Light'),url(/fonts/poppins-v9-latin-300.eot?#iefix) format('embedded-opentype'),url(/fonts/poppins-v9-latin-300.woff2) format('woff2'),url(/fonts/poppins-v9-latin-300.woff) format('woff'),url(/fonts/poppins-v9-latin-300.ttf) format('truetype'),url(/fonts/poppins-v9-latin-300.svg#Poppins) format('svg')}@font-face{font-family:Poppins;font-style:normal;font-weight:400;src:url(/fonts/poppins-v9-latin-regular.eot);src:local('Poppins Regular'),local('Poppins-Regular'),url(/fonts/poppins-v9-latin-regular.eot?#iefix) format('embedded-opentype'),url(/fonts/poppins-v9-latin-regular.woff2) format('woff2'),url(/fonts/poppins-v9-latin-regular.woff) format('woff'),url(/fonts/poppins-v9-latin-regular.ttf) format('truetype'),url(/fonts/poppins-v9-latin-regular.svg#Poppins) format('svg')}@font-face{font-family:Poppins;font-style:normal;font-weight:500;src:url(/fonts/poppins-v9-latin-500.eot);src:local('Poppins Medium'),local('Poppins-Medium'),url(/fonts/poppins-v9-latin-500.eot?#iefix) format('embedded-opentype'),url(/fonts/poppins-v9-latin-500.woff2) format('woff2'),url(/fonts/poppins-v9-latin-500.woff) format('woff'),url(/fonts/poppins-v9-latin-500.ttf) format('truetype'),url(/fonts/poppins-v9-latin-500.svg#Poppins) format('svg')}@font-face{font-family:Poppins;font-style:normal;font-weight:600;src:url(/fonts/poppins-v9-latin-600.eot);src:local('Poppins SemiBold'),local('Poppins-SemiBold'),url(/fonts/poppins-v9-latin-600.eot?#iefix) format('embedded-opentype'),url(/fonts/poppins-v9-latin-600.woff2) format('woff2'),url(/fonts/poppins-v9-latin-600.woff) format('woff'),url(/fonts/poppins-v9-latin-600.ttf) format('truetype'),url(/fonts/poppins-v9-latin-600.svg#Poppins) format('svg')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url(/fonts/source-code-pro-v11-latin-regular.eot);src:local('Source Code Pro Regular'),local('SourceCodePro-Regular'),url(/fonts/source-code-pro-v11-latin-regular.eot?#iefix) format('embedded-opentype'),url(/fonts/source-code-pro-v11-latin-regular.woff2) format('woff2'),url(/fonts/source-code-pro-v11-latin-regular.woff) format('woff'),url(/fonts/source-code-pro-v11-latin-regular.ttf) format('truetype'),url(/fonts/source-code-pro-v11-latin-regular.svg#SourceCodePro) format('svg')}.padding{padding:30px}.padding-top{padding-top:30px!important}.padding-top-large{padding-top:50px!important}.padding-top-xl{padding-top:80px!important}.padding-bottom{padding-bottom:30px!important}.padding-bottom-large{padding-bottom:50px!important}.padding-bottom-xl{padding-bottom:80px!important}.margin-end{margin-right:20px!important}.margin-start{margin-left:20px!important}.margin-end-small{margin-right:10px!important}.margin-start-small{margin-left:10px!important}.margin-end-large{margin-right:50px!important}.margin-start-large{margin-left:50px!important}.margin-end-no{margin-right:0!important}.margin-start-no{margin-left:0!important}.margin-end-negative{margin-right:-30px!important}.margin-start-negative{margin-left:-30px!important}.margin-end-negative-small{margin-right:-15px!important}.margin-start-negative-small{margin-left:-15px!important}.margin-end-negative-tiny{margin-right:-5px!important}.margin-start-negative-tiny{margin-left:-5px!important}.margin-top{margin-top:30px!important}.margin-bottom{margin-bottom:30px!important}.margin-top-no{margin-top:0!important}.margin-bottom-no{margin-bottom:0!important}.margin-top-xxl{margin-top:140px!important}.margin-top-xl{margin-top:80px!important}.margin-top-large{margin-top:50px!important}.margin-top-small{margin-top:15px!important}.margin-top-tiny{margin-top:5px!important}.margin-top-negative{margin-top:-30px!important}.margin-top-negative-tiny{margin-top:-5px!important}.margin-top-negative-small{margin-top:-15px!important}.margin-top-negative-large{margin-top:-50px!important}.margin-top-negative-xl{margin-top:-80px!important}.margin-top-negative-xxl{margin-top:-100px!important}.margin-bottom-xxl{margin-bottom:140px!important}.margin-bottom-xl{margin-bottom:80px!important}.margin-bottom-large{margin-bottom:50px!important}.margin-bottom-small{margin-bottom:15px!important}.margin-bottom-tiny{margin-bottom:5px!important}.margin-bottom-negative{margin-bottom:-30px!important}.margin-bottom-negative-tiny{margin-bottom:-5px!important}.margin-bottom-negative-small{margin-bottom:-15px!important}.margin-bottom-negative-large{margin-bottom:-50px!important}.margin-bottom-negative-xl{margin-bottom:-80px!important}.margin-bottom-negative-xl{margin-bottom:-100px!important}.force-left,.ide{direction:ltr;text-align:left}.force-right{direction:rtl;text-align:right}.pull-left{float:left}.pull-right{float:right}.ratio-wide{height:0;overflow:hidden;padding-top:56%;position:relative;width:100%}.ratio-wide>*{position:absolute;top:0;left:0;width:100%;height:100%}.ratio-square{height:0;overflow:hidden;padding-top:56%;position:relative;width:100%}.ratio-square>*{position:absolute;top:0;left:0;width:100%;height:100%}.clear:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.phones-only{display:none}@media only screen and (max-width:550px){.phones-only{display:inherit!important}}.tablets-only{display:none}@media only screen and (min-width:551px) and (max-width:1198px){.tablets-only{display:inherit!important}}.desktops-only{display:none}@media only screen and (min-width:1199px){.desktops-only{display:inherit!important}}.phones-only-inline{display:none}@media only screen and (max-width:550px){.phones-only-inline{display:inline-block!important}}.tablets-only-inline{display:none}@media only screen and (min-width:551px) and (max-width:1198px){.tablets-only-inline{display:inline-block!important}}.desktops-only-inline{display:none}@media only screen and (min-width:1199px){.desktops-only-inline{display:inline-block!important}}*{font-family:Poppins,sans-serif;-webkit-font-smoothing:antialiased;font-weight:300}h1,h2,h3,h4,h5,h6{margin:0}h4,h5,h6{font-weight:400}.link,a{color:var(--config-color-link);text-decoration:none;border-left:2px solid transparent;border-right:2px solid transparent;transition:.2s;cursor:pointer}.link.disabled,a.disabled{opacity:.5}.link.tag:hover,a.tag:hover{opacity:.9}.link.danger,a.danger{color:var(--config-color-danger)}.link.link-animation-enabled,a.link-animation-enabled{display:inline-block}.link.link-animation-enabled:hover,a.link-animation-enabled:hover{transform:translateY(-2px)}.link-return-animation--start>i{display:inline-block;transition:.2s}.link-return-animation--start:hover>i{transform:translateX(-2px)}.link-return-animation--end>i{display:inline-block;transition:.2s}.link-return-animation--end:hover>i{transform:translateX(2px)}b,strong{font-weight:500}p{margin:0 0 20px 0;line-height:26px}small{font-size:16px;color:var(--config-color-fade)}.text-size-small{font-size:13px}.text-size-xs{font-size:10px}.text-size-normal{font-size:16px}.text-height-large{height:30px;line-height:30px}.text-height-small{line-height:13px}.text-one-liner{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text-bold{font-weight:400!important}.text-bold-large{font-weight:500!important}.text-bold-xl{font-weight:600!important}.text-danger{color:var(--config-color-danger)!important}.text-success{color:var(--config-color-success)!important}.text-upper{text-transform:uppercase}.text-warning{color:var(--config-color-warning)}.text-focus{color:var(--config-color-focus)}.text-fade{color:var(--config-color-fade)}.text-green{color:var(--config-color-success)}.text-red{color:var(--config-color-danger)}.text-info{color:var(--config-color-info)}.text-yellow{color:#ffe28b}.text-disclaimer{font-size:11px;color:var(--config-color-fade)}.text-fade-extra{color:var(--config-color-fade);opacity:.5}.text-line-high-large{line-height:30px}.text-line-high-xl{line-height:40px}.text-sign{margin:5px 0;font-size:25px;width:25px;height:25px;line-height:25px;display:inline-block}.text-align-center{text-align:center}.text-align-start{text-align:left}.text-align-end{text-align:right}.text-align-left{text-align:left}.text-align-right{text-align:right}.text-dir-ltr{direction:ltr;display:inline-block}.text-dir-rtl{direction:rtl;display:inline-block}.icon-dot-3:before{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-o-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}i[class*=' icon-']:before,i[class^=icon-]:before{display:inline;line-height:unset}table{width:calc(100% + 60px);border-collapse:collapse;margin:-30px;border-radius:10px;overflow:hidden;position:relative;table-layout:fixed}table.y-scroll{overflow-y:auto}table thead{box-shadow:0 0 2px rgba(0,0,0,.25);border-bottom:solid 1px var(--config-color-fade-super);font-size:14px}table.small{font-size:14px}table.open-end tbody tr:last-child{border-bottom:none;font-weight:700;background:#f7fbf7}table.full tbody td,table.full tbody th{vertical-align:top;white-space:normal;overflow:auto;line-height:24px;padding-top:20px;padding-bottom:20px;height:auto}table .avatar{width:30px;height:30px}table tr{border-bottom:solid 1px var(--config-color-fade-super)}table tr:last-child{border-bottom:none}table tr:nth-child(even){background:var(--config-color-background-fade-super)}table tr.selected{background:var(--config-note-background)}table tr.selected td,table tr.selected td span{font-weight:500}table th{text-align:left;font-weight:400}table th i{color:var(--config-color-fade);font-size:10px;display:inline-block;vertical-align:top;line-height:16px;padding:0 3px}table td,table th{height:65px;padding:0 15px;line-height:50px}table td:first-child,table th:first-child{padding-left:30px}table td:last-child,table th:last-child{padding-right:30px}table td,table th{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){table.vertical{border-top:solid 1px var(--config-color-fade-super);display:block;overflow:hidden;padding-top:12px}table.vertical .hide{display:none}table.vertical tbody,table.vertical td,table.vertical th,table.vertical thead,table.vertical tr{width:100%;display:block}table.vertical th,table.vertical tr{padding-top:12px;padding-bottom:12px}table.vertical th:first-child,table.vertical tr:first-child{padding-top:0}table.vertical td,table.vertical th{padding:5px 20px!important;text-overflow:ellipsis;white-space:normal;height:40px;line-height:40px;width:calc(100% - 40px)}table.vertical td:first-child,table.vertical td:last-child,table.vertical th:first-child,table.vertical th:last-child{padding:0 10px}table.vertical td:last-child,table.vertical th:last-child{padding-bottom:0}table.vertical td p,table.vertical th p{display:inline-block;width:calc(100% - 40px)}table.vertical td:not([data-title=""]):before{content:attr(data-title);margin-right:4px;font-weight:400}table.vertical thead{display:none}}.zone{max-width:var(--config-width-xl);margin:0 auto 40px auto}.zone.xxxl{max-width:calc(1400px - 100px)}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.zone.xxxl{max-width:100%}}.zone.xxl{max-width:var(--config-width-xxl)}.zone.xl{max-width:var(--config-width-xl)}.zone.large{max-width:var(--config-width-large)}.zone.medium{max-width:var(--config-width-medium)}.zone.small{max-width:var(--config-width-small)}.row{position:relative;margin:0 -50px;padding-left:50px}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.row{margin:0 -30px;padding-left:30px}}.row.force-ltr>.col{float:left}.row.force-rtl>.col{float:right}.row.force-reverse>.col{float:right}.row.wide{margin:0 -100px;padding-left:100px}.row.wide>.span-1{width:calc(8.33333333% * 1 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-2{width:calc(8.33333333% * 2 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-3{width:calc(8.33333333% * 3 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-4{width:calc(8.33333333% * 4 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-5{width:calc(8.33333333% * 5 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-6{width:calc(8.33333333% * 6 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-7{width:calc(8.33333333% * 7 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-8{width:calc(8.33333333% * 8 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-9{width:calc(8.33333333% * 9 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-10{width:calc(8.33333333% * 10 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-11{width:calc(8.33333333% * 11 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-12{width:calc(8.33333333% * 12 - 100px);box-sizing:content-box;padding-right:100px}.row.thin{margin:0 -20px;padding-left:20px}.row.thin>.span-1{width:calc(8.33333333% * 1 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-2{width:calc(8.33333333% * 2 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-3{width:calc(8.33333333% * 3 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-4{width:calc(8.33333333% * 4 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-5{width:calc(8.33333333% * 5 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-6{width:calc(8.33333333% * 6 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-7{width:calc(8.33333333% * 7 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-8{width:calc(8.33333333% * 8 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-9{width:calc(8.33333333% * 9 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-10{width:calc(8.33333333% * 10 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-11{width:calc(8.33333333% * 11 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-12{width:calc(8.33333333% * 12 - 20px);box-sizing:content-box;padding-right:20px}.row.modalize{margin:0 -30px;padding-left:30px}.row.modalize>.span-1{width:calc(8.33333333% * 1 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-2{width:calc(8.33333333% * 2 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-3{width:calc(8.33333333% * 3 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-4{width:calc(8.33333333% * 4 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-5{width:calc(8.33333333% * 5 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-6{width:calc(8.33333333% * 6 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-7{width:calc(8.33333333% * 7 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-8{width:calc(8.33333333% * 8 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-9{width:calc(8.33333333% * 9 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-10{width:calc(8.33333333% * 10 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-11{width:calc(8.33333333% * 11 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-12{width:calc(8.33333333% * 12 - 30px);box-sizing:content-box;padding-right:30px}.row:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.row .col{float:left;box-sizing:border-box}.row .col.sticky-top{position:sticky;top:90px}.row .col.sticky-bottom{position:sticky;bottom:0}.row .span-1{width:calc(8.33333333% * 1 - 40px);box-sizing:content-box;padding-right:40px}.row .span-2{width:calc(8.33333333% * 2 - 40px);box-sizing:content-box;padding-right:40px}.row .span-3{width:calc(8.33333333% * 3 - 40px);box-sizing:content-box;padding-right:40px}.row .span-4{width:calc(8.33333333% * 4 - 40px);box-sizing:content-box;padding-right:40px}.row .span-5{width:calc(8.33333333% * 5 - 40px);box-sizing:content-box;padding-right:40px}.row .span-6{width:calc(8.33333333% * 6 - 40px);box-sizing:content-box;padding-right:40px}.row .span-7{width:calc(8.33333333% * 7 - 40px);box-sizing:content-box;padding-right:40px}.row .span-8{width:calc(8.33333333% * 8 - 40px);box-sizing:content-box;padding-right:40px}.row .span-9{width:calc(8.33333333% * 9 - 40px);box-sizing:content-box;padding-right:40px}.row .span-10{width:calc(8.33333333% * 10 - 40px);box-sizing:content-box;padding-right:40px}.row .span-11{width:calc(8.33333333% * 11 - 40px);box-sizing:content-box;padding-right:40px}.row .span-12{width:calc(8.33333333% * 12 - 40px);box-sizing:content-box;padding-right:40px}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.row.responsive{width:100%;padding:0;margin:0}.row.responsive>.span-1,.row.responsive>.span-10,.row.responsive>.span-11,.row.responsive>.span-12,.row.responsive>.span-2,.row.responsive>.span-3,.row.responsive>.span-4,.row.responsive>.span-5,.row.responsive>.span-6,.row.responsive>.span-7,.row.responsive>.span-8,.row.responsive>.span-9{width:calc(8.33333333% * 12 - 0px)!important;box-sizing:content-box!important;padding-right:0!important;width:100%!important}}.tiles{position:relative}.tiles:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.tiles>*{margin-right:50px!important;float:left;width:calc(33.3333% - 33.3333px)}.tiles>* .photo-title{width:calc(100% + 30px);height:15px;margin:-15px -15px 10px -15px;border-radius:10px 10px 0 0;background:var(--config-color-fade-super);border-bottom:solid 1px var(--config-color-fade-super)}.tiles>:nth-child(3n){margin-right:0!important}@media only screen and (min-width:551px) and (max-width:1198px){.tiles>li{width:calc(50% - 25px)}.tiles>li:nth-child(3n){margin-right:50px!important}.tiles>li:nth-child(2n){margin-right:0!important}}@media only screen and (max-width:550px){.tiles>li{width:100%;margin-right:0!important}}@font-face{font-family:fontello;src:url(data:application/octet-stream;base64,d09GRgABAAAAAFmMAA8AAAAAi8QAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABWAAAADsAAABUIIslek9TLzIAAAGUAAAAQwAAAFY+UFQDY21hcAAAAdgAAALzAAAIKqLdc4ljdnQgAAAEzAAAABMAAAAgBzP+pGZwZ20AAATgAAAFkAAAC3CKkZBZZ2FzcAAACnAAAAAIAAAACAAAABBnbHlmAAAKeAAASAMAAGt6OKY+3GhlYWQAAFJ8AAAAMgAAADYZsmDsaGhlYQAAUrAAAAAgAAAAJAgaBJ1obXR4AABS0AAAAMsAAAG0fTz/kGxvY2EAAFOcAAAA3AAAANxOk2dLbWF4cAAAVHgAAAAgAAAAIAJZDRRuYW1lAABUmAAAAXQAAALNzZ0XGHBvc3QAAFYMAAADAgAABHZShL4scHJlcAAAWRAAAAB6AAAAhuVBK7x4nGNgZGBg4GIwYLBjYHJx8wlh4MtJLMljkG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AADoLAAA6CwAAAAtAADoLQAA6C0AAAAuAADoLgAA6C4AAAAvAADoLwAA6C8AAAAwAADoMAAA6DAAAAAxAADoMQAA6DEAAAAyAADoMgAA6DIAAAAzAADoMwAA6DMAAAA0AADoNAAA6DQAAAA1AADoNQAA6DUAAAA2AADoNgAA6DYAAAA3AADoNwAA6DcAAAA4AADoOAAA6DgAAAA5AADoOQAA6DkAAAA6AADoOgAA6DoAAAA7AADoOwAA6DsAAAA8AADoPAAA6DwAAAA9AADoPQAA6D0AAAA+AADoPgAA6D4AAAA/AADoPwAA6D8AAABAAADoQAAA6EAAAABBAADoQQAA6EEAAABCAADoQgAA6EIAAABDAADoQwAA6EMAAABEAADoRAAA6EQAAABFAADoRQAA6EUAAABGAADoRgAA6EYAAABHAADoRwAA6EcAAABIAADoSAAA6EgAAABJAADoSQAA6EkAAABKAADoSgAA6EoAAABLAADoSwAA6EsAAABMAADoTAAA6EwAAABNAADwjgAA8I4AAABOAADwmwAA8JsAAABPAADwsAAA8LAAAABQAADwxQAA8MUAAABRAADwygAA8MoAAABSAADwywAA8MsAAABTAADwzQAA8M0AAABUAADw3AAA8NwAAABVAADw4QAA8OEAAABWAADxGAAA8RgAAABXAADxHAAA8RwAAABYAADxIQAA8SEAAABZAADxMgAA8TIAAABaAADxNwAA8TcAAABbAADxOAAA8TgAAABcAADxcQAA8XEAAABdAADxegAA8XoAAABeAADxkgAA8ZIAAABfAADxkwAA8ZMAAABgAADxnAAA8ZwAAABhAADxoAAA8aAAAABiAADxrQAA8a0AAABjAADxwAAA8cAAAABkAADxzQAA8c0AAABlAADx3AAA8dwAAABmAADx5QAA8eUAAABnAADx/gAA8f4AAABoAADyMQAA8jEAAABpAADyOgAA8joAAABqAADylgAA8pYAAABrAADyxgAA8sYAAABsAAAAAgAA/7ECygMMABUAHgAlQCIABQEFbwMBAQQBbwAEAgRvAAIAAm8AAABmExcRERcyBgUaKyUUBiMhIiY1ND4DFxYyNzIeAwMUBiIuATYeAQLKRjH+JD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rAAFrAEJbAEJSAuRyNHI2EgsAQjQrAJQysgsGBQWCCwQFFYswIgAyAbswImAxpZQkIjIEewBEOwAmIgsABQWLBAYFlmsAFjYCCwASsgiophILACQ2BkI7ADQ2FkUFiwAkNhG7ADQ2BZsAMlsAJiILAAUFiwQGBZZrABY2GwAiVGYTgjIDwjOBshICBGI0ewASsjYTghWbErARQrLbBCLLA1Ky6xKwEUKy2wQyywNishIyAgPLAEI0IjOLErARQrsARDLrArKy2wRCywABUgR7AAI0KyAAEBFRQTLrAxKi2wRSywABUgR7AAI0KyAAEBFRQTLrAxKi2wRiyxAAEUE7AyKi2wRyywNCotsEgssAAWRSMgLiBGiiNhOLErARQrLbBJLLAII0KwSCstsEossgAAQSstsEsssgABQSstsEwssgEAQSstsE0ssgEBQSstsE4ssgAAQistsE8ssgABQistsFAssgEAQistsFEssgEBQistsFIssgAAPistsFMssgABPistsFQssgEAPistsFUssgEBPistsFYssgAAQCstsFcssgABQCstsFgssgEAQCstsFkssgEBQCstsFossgAAQystsFsssgABQystsFwssgEAQystsF0ssgEBQystsF4ssgAAPystsF8ssgABPystsGAssgEAPystsGEssgEBPystsGIssDcrLrErARQrLbBjLLA3K7A7Ky2wZCywNyuwPCstsGUssAAWsDcrsD0rLbBmLLA4Ky6xKwEUKy2wZyywOCuwOystsGgssDgrsDwrLbBpLLA4K7A9Ky2waiywOSsusSsBFCstsGsssDkrsDsrLbBsLLA5K7A8Ky2wbSywOSuwPSstsG4ssDorLrErARQrLbBvLLA6K7A7Ky2wcCywOiuwPCstsHEssDorsD0rLbByLLMJBAIDRVghGyMhWUIrsAhlsAMkUHiwARUwLQBLuADIUlixAQGOWbABuQgACABjcLEABUKyAAEAKrEABUKzCgIBCCqxAAVCsw4AAQgqsQAGQroCwAABAAkqsQAHQroAQAABAAkqsQMARLEkAYhRWLBAiFixA2REsSYBiFFYugiAAAEEQIhjVFixAwBEWVlZWbMMAgEMKrgB/4WwBI2xAgBEAAA=) format('truetype')}[class*=" icon-"]:before,[class^=icon-]:before{font-family:fontello;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em}.icon-user:before{content:'\e800'}.icon-folder:before{content:'\e801'}.icon-list:before{content:'\e802'}.icon-login:before{content:'\e803'}.icon-cog:before{content:'\e804'}.icon-twitter:before{content:'\e805'}.icon-article-alt:before{content:'\e806'}.icon-cancel:before{content:'\e807'}.icon-home:before{content:'\e808'}.icon-down-dir:before{content:'\e809'}.icon-facebook:before{content:'\e80a'}.icon-asterisk:before{content:'\e80b'}.icon-upload:before{content:'\e80c'}.icon-stopwatch:before{content:'\e80d'}.icon-export:before{content:'\e80e'}.icon-heart:before{content:'\e80f'}.icon-plus:before{content:'\e810'}.icon-up-dir:before{content:'\e811'}.icon-menu:before{content:'\e812'}.icon-left-open:before{content:'\e813'}.icon-right-open:before{content:'\e814'}.icon-inbox:before{content:'\e815'}.icon-wrench:before{content:'\e816'}.icon-comment:before{content:'\e817'}.icon-stackoverflow:before{content:'\e818'}.icon-question:before{content:'\e819'}.icon-ok-circled:before{content:'\e81a'}.icon-warning:before{content:'\e81b'}.icon-mail:before{content:'\e81c'}.icon-link:before{content:'\e81d'}.icon-key-inv:before{content:'\e81e'}.icon-trash:before{content:'\e81f'}.icon-download:before{content:'\e820'}.icon-glasses:before{content:'\e821'}.icon-qrcode:before{content:'\e822'}.icon-shuffle:before{content:'\e823'}.icon-eye:before{content:'\e824'}.icon-lock:before{content:'\e825'}.icon-search:before{content:'\e826'}.icon-bell:before{content:'\e827'}.icon-users:before{content:'\e828'}.icon-location:before{content:'\e829'}.icon-briefcase:before{content:'\e82a'}.icon-instagram:before{content:'\e82b'}.icon-clock:before{content:'\e82c'}.icon-phone:before{content:'\e82d'}.icon-calendar:before{content:'\e82e'}.icon-print:before{content:'\e82f'}.icon-edit:before{content:'\e830'}.icon-bold:before{content:'\e831'}.icon-italic:before{content:'\e832'}.icon-rocket:before{content:'\e833'}.icon-whatsapp:before{content:'\e834'}.icon-dot-3:before{content:'\e835'}.icon-info-circled:before{content:'\e836'}.icon-videocam:before{content:'\e837'}.icon-quote-right:before{content:'\e838'}.icon-picture:before{content:'\e839'}.icon-palette:before{content:'\e83a'}.icon-lamp:before{content:'\e83b'}.icon-book-open:before{content:'\e83c'}.icon-ok:before{content:'\e83d'}.icon-chat-alt:before{content:'\e83e'}.icon-archive:before{content:'\e83f'}.icon-play:before{content:'\e840'}.icon-pause:before{content:'\e841'}.icon-down-open:before{content:'\e842'}.icon-up-open:before{content:'\e843'}.icon-minus:before{content:'\e844'}.icon-exchange:before{content:'\e845'}.icon-network:before{content:'\e846'}.icon-discord:before{content:'\e847'}.icon-moon-inv:before{content:'\e848'}.icon-sun-inv:before{content:'\e849'}.icon-cancel-circled:before{content:'\e84a'}.icon-lightning:before{content:'\e84b'}.icon-dev:before{content:'\e84c'}.icon-link-ext:before{content:'\f08e'}.icon-github-circled:before{content:'\f09b'}.icon-filter:before{content:'\f0b0'}.icon-docs:before{content:'\f0c5'}.icon-list-bullet:before{content:'\f0ca'}.icon-list-numbered:before{content:'\f0cb'}.icon-underline:before{content:'\f0cd'}.icon-sort:before{content:'\f0dc'}.icon-linkedin:before{content:'\f0e1'}.icon-smile:before{content:'\f118'}.icon-keyboard:before{content:'\f11c'}.icon-code:before{content:'\f121'}.icon-shield:before{content:'\f132'}.icon-angle-circled-left:before{content:'\f137'}.icon-angle-circled-right:before{content:'\f138'}.icon-bitbucket:before{content:'\f171'}.icon-windows:before{content:'\f17a'}.icon-dot-circled:before{content:'\f192'}.icon-wheelchair:before{content:'\f193'}.icon-bank:before{content:'\f19c'}.icon-google:before{content:'\f1a0'}.icon-building-filled:before{content:'\f1ad'}.icon-database:before{content:'\f1c0'}.icon-lifebuoy:before{content:'\f1cd'}.icon-header:before{content:'\f1dc'}.icon-binoculars:before{content:'\f1e5'}.icon-chart-area:before{content:'\f1fe'}.icon-pinterest:before{content:'\f231'}.icon-medium:before{content:'\f23a'}.icon-gitlab:before{content:'\f296'}.icon-telegram:before{content:'\f2c6'}.datalist-polyfill{list-style:none;display:none;background:#fff;box-shadow:0 2px 2px #999;position:absolute;left:0;top:0;margin:0;padding:0;max-height:300px;overflow-y:auto}.datalist-polyfill:empty{display:none!important}.datalist-polyfill>li{padding:3px;font:13px "Lucida Grande",Sans-Serif}.datalist-polyfill__active{background:#3875d7;color:#fff}date-input-polyfill{z-index:1000!important;max-width:320px!important;width:320px!important}date-input-polyfill .monthSelect-wrapper,date-input-polyfill .yearSelect-wrapper{height:50px;line-height:50px;padding:0;width:40%!important;margin-bottom:10px!important}date-input-polyfill .monthSelect-wrapper select,date-input-polyfill .yearSelect-wrapper select{padding:0 12px;height:50px;line-height:50px;box-sizing:border-box}date-input-polyfill .yearSelect-wrapper{width:35%!important}date-input-polyfill table{width:100%!important;max-width:100%!important;padding:0 12px 12px 12px!important;box-sizing:border-box;margin:0}date-input-polyfill table td:first-child,date-input-polyfill table td:last-child,date-input-polyfill table th:first-child,date-input-polyfill table th:last-child{width:32px!important;padding:4px!important}date-input-polyfill select{margin-bottom:10px}date-input-polyfill button{width:25%!important;height:50px!important;line-height:50px!important;margin-bottom:10px!important;background:inherit;position:relative;color:inherit;padding:inherit;box-sizing:inherit;border-radius:inherit;font-size:inherit;box-shadow:none;border:none;border-bottom:none!important}::placeholder{color:var(--config-color-placeholder);text-align:left}::-webkit-input-placeholder{text-align:left}input:-moz-placeholder{text-align:left}input,textarea{background:var(--config-color-background-input)}input[type=file],input[type=file]::-webkit-file-upload-button{cursor:pointer}.button,button{display:inline-block;background:var(--config-color-focus);border-radius:26px;border:none;color:var(--config-color-background-fade);height:52px;line-height:52px;padding:0 25px;cursor:pointer;font-size:16px;box-sizing:border-box;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.button:focus,.button:hover,button:focus,button:hover{background:var(--config-color-focus-hover)}.button.fly,button.fly{position:fixed;z-index:2;bottom:30px;right:30px}@media only screen and (max-width:550px){.button.fly,button.fly{right:15px}}.button.fill,button.fill{display:block;width:100%;text-align:center;padding:0 10px!important}.button.fill-aligned,button.fill-aligned{display:block;width:100%;text-align:left;padding:0 20px!important}.button.icon,button.icon{padding-right:30px!important}.button.icon-reduce,button.icon-reduce{padding-left:15px!important}.button.reverse,button.reverse{background:0 0;height:50px;line-height:48px;padding:0 23px;color:var(--config-color-focus);border:solid 2px var(--config-color-focus)}.button.reverse:focus,.button.reverse:hover,button.reverse:focus,button.reverse:hover{color:var(--config-color-focus-hover);border-color:var(--config-color-focus-hover)}.button.small,button.small{padding:0 15px;height:40px;line-height:36px;font-size:13px}.button.round,button.round{width:52px;padding:0}.button.round.small,button.round.small{font-size:12px;width:30px;height:30px;line-height:30px}.button.white,button.white{background:#fff;color:var(--config-color-focus)}.button.white.reverse,button.white.reverse{color:#fff;background:0 0;border:solid 2px #fff}.button.trans,button.trans{background:0 0!important}.button.trans.reverse,button.trans.reverse{background:0 0!important}.button.success,button.success{background:var(--config-color-success)}.button.success.reverse,button.success.reverse{color:var(--config-color-success);background:#fff;border:solid 2px var(--config-color-success)}.button.danger,button.danger{background:var(--config-color-danger);color:#fff}.button.danger.reverse,button.danger.reverse{color:var(--config-color-danger);background:var(--config-color-background-fade);border:solid 2px var(--config-color-danger)}.button.dark,button.dark{background:var(--config-color-dark);color:var(--config-color-background-fade)}.button.dark.reverse,button.dark.reverse{color:var(--config-color-dark);background:var(--config-color-background-fade);border:solid 2px var(--config-color-dark)}.button .disabled,.button.disabled,.button:disabled,button .disabled,button.disabled,button:disabled{color:var(--config-color-normal);background:var(--config-color-background-dark);opacity:.6;cursor:default}.button.link,button.link{background:0 0;border-radius:0;color:var(--config-color-link);height:auto;line-height:normal;padding:0;padding-right:0!important}.button.link:focus,button.link:focus{box-shadow:inherit}.button.strip,button.strip{background:0 0;height:auto;line-height:16px;color:inherit;padding:0 5px}.button.facebook,button.facebook{color:#fff!important;background:#4070b4!important}.button.twitter,button.twitter{color:#fff!important;background:#56c2ea!important}.button.linkedin,button.linkedin{color:#fff!important;background:#0076b5!important}.button.github,button.github{color:#fff!important;background:#7e7c7c!important}.button:focus,button:focus{outline:0}label{margin-bottom:15px;display:block;line-height:normal}.input,input[type=date],input[type=datetime-local],input[type=email],input[type=file],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=url],select,textarea{-webkit-appearance:none;-moz-appearance:none;-webkit-transform:translateZ(0);box-sizing:content-box;color:#313131;height:40px;line-height:40px;border:solid 1px var(--config-color-fade-light);border-radius:10px;padding:5px 15px;font-size:16px;display:block;width:calc(100% - 32px);margin-bottom:30px}.input[type=file],input[type=date][type=file],input[type=datetime-local][type=file],input[type=email][type=file],input[type=file][type=file],input[type=number][type=file],input[type=password][type=file],input[type=search][type=file],input[type=tel][type=file],input[type=text][type=file],input[type=url][type=file],select[type=file],textarea[type=file]{line-height:0;padding:15px;height:auto}.input:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=email]:focus,input[type=file]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=url]:focus,select:focus,textarea:focus{outline:0;border-color:#b3d7fd}.input:disabled,input[type=date]:disabled,input[type=datetime-local]:disabled,input[type=email]:disabled,input[type=file]:disabled,input[type=number]:disabled,input[type=password]:disabled,input[type=search]:disabled,input[type=tel]:disabled,input[type=text]:disabled,input[type=url]:disabled,select:disabled,textarea:disabled{color:var(--config-color-normal);background:var(--config-color-fade-super);opacity:1!important}.input.strip,input[type=date].strip,input[type=datetime-local].strip,input[type=email].strip,input[type=file].strip,input[type=number].strip,input[type=password].strip,input[type=search].strip,input[type=tel].strip,input[type=text].strip,input[type=url].strip,select.strip,textarea.strip{border:none;border-radius:0;padding:5px 0;width:100%;background-color:transparent;background-position:right 2px top 50%;border-bottom:solid 1px var(--config-color-fade-light);color:var(--config-color-placeholder)}.input.strip:focus,input[type=date].strip:focus,input[type=datetime-local].strip:focus,input[type=email].strip:focus,input[type=file].strip:focus,input[type=number].strip:focus,input[type=password].strip:focus,input[type=search].strip:focus,input[type=tel].strip:focus,input[type=text].strip:focus,input[type=url].strip:focus,select.strip:focus,textarea.strip:focus{border-color:#b3d7fd}.input:-webkit-autofill::first-line,input[type=date]:-webkit-autofill::first-line,input[type=datetime-local]:-webkit-autofill::first-line,input[type=email]:-webkit-autofill::first-line,input[type=file]:-webkit-autofill::first-line,input[type=number]:-webkit-autofill::first-line,input[type=password]:-webkit-autofill::first-line,input[type=search]:-webkit-autofill::first-line,input[type=tel]:-webkit-autofill::first-line,input[type=text]:-webkit-autofill::first-line,input[type=url]:-webkit-autofill::first-line,select:-webkit-autofill::first-line,textarea:-webkit-autofill::first-line{font-weight:300;font-size:16px}input[type=email],input[type=url]{direction:ltr}input[type=email]::placeholder,input[type=url]::placeholder{text-align:left;direction:ltr}select{background:0 0;-webkit-appearance:none;background-image:var(--config-console-nav-switch-arrow);background-position:right 15px top 50%;background-repeat:no-repeat;background-color:var(--config-color-background-input);width:calc(100% - 62px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:45px}select:-webkit-autofill{background-image:url("data:image/svg+xml;utf8,")!important;background-position:100% 50%!important;background-repeat:no-repeat!important}input[type=search],input[type=search].strip{background:0 0;-webkit-appearance:none;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAdZJREFUWIXt1s2LjWEYBvDfnDMzFpNIamZIFrMiJYMyFmKhZKfOwoiFr2LFn2BByG6WVrKwMcjWxgoLIlKIUk6RrzAjZWZ8LO731FlwvB+PUbjq6X0X7/VeV/d9P9fz8IdRL8Hpw3x8w0xaOz9GNxq4gJeZcGs1cRab0fU7xLfgMSYzoT3YgNXYhIO4iM+4iTWphGs4jikcFSXvhEGczr4/UFW8C2N4jXUFudvwCYeqGNgnSr6yJH8rpkWLCqMfE9hdUryFE3iC3qLEk7ij+kT34Q32FiHV8Qr7K4q3cArXihCGxd5elMjARnzBvE4f1dreV+AtnicycC/7/7K8BhaIvqXCO3zFwrwGZtCT0EAtW9N5DTSxWGR/CizNns/yEgbFEK5NZGCnaEPHE7e9Ai9wA6OJDIzistgJubFdxHB/RfFVYgCHixJruI5x5dNwDm6J47sUhkTvjpUw0Y1zeOrXR3hHjOA9zmBuTs4Arog4/yhuUZWwHPdFMh7280BZgiP4ILJ/UuymqRQmejPxphiquzgvKnMJDzOxB9glZqiRiecykbfHdawX98EhcdxO4BGu4nYm2EJDzEKPSMIdYrBnFYUq8d/EP2di1gey3cS4ErflvxffASbhcakIINaMAAAAAElFTkSuQmCC);background-color:var(--config-color-background-input);background-position:left 15px top 50%;background-repeat:no-repeat;background-size:20px 20px;width:calc(100% - 60px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-left:45px}select[multiple]{min-height:75px;padding:5px 10px!important;padding-right:50px!important}select[multiple] option{padding:10px 4px;border-bottom:solid 1px #f1f1f1}select[multiple] option:last-child{border-bottom:none}textarea{min-height:75px;resize:vertical;line-height:32px;padding:5px 15px}textarea.tall{min-height:180px}fieldset{border:none;margin:0;padding:0}.counter{font-size:13px;text-align:right;color:var(--config-color-fade);margin-top:-20px;margin-bottom:20px}.file-preview{background:var(--config-color-background-input) url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAIElEQVQoU2NkYGAwZsAEZ9GFGIeIQix+wfQgyDODXSEAcUwGCrDSHgkAAAAASUVORK5CYII=)!important;border:solid 1px #e2e2e2;box-shadow:inset 0 0 3px #a0a0a0;border-radius:8px;width:calc(100% - 2px);max-height:180px;visibility:visible!important}.video-preview{padding-top:56%;position:relative;border-radius:10px;background:#e7e7e7;overflow:hidden;margin:0}.video-preview iframe{position:absolute;top:0;width:100%;height:100%;border:none}.map-preview{padding-top:50%;position:relative;margin-bottom:10px;border-radius:10px;background:#e7e7e7;overflow:hidden;box-shadow:0 0 30px rgba(218,218,218,.5)}.map-preview iframe{position:absolute;top:0;width:100%;height:100%;border:none}.tooltip{position:relative}.tooltip.large:hover:after{white-space:normal;width:280px}.tooltip.small:hover:after{white-space:normal;width:180px}.tooltip:hover:after{white-space:nowrap;background:var(--config-color-tooltip-background);border-radius:5px;bottom:26px;color:var(--config-color-tooltip-text);content:attr(data-tooltip);padding:5px 15px;position:absolute;font-size:13px;line-height:20px;z-index:98;left:20%;margin-left:-30px;word-break:break-word}.tooltip:hover:before{border:solid;border-color:var(--config-color-tooltip-background) transparent;border-width:6px 6px 0 6px;bottom:20px;content:"";position:absolute;z-index:99;left:5px}.tooltip.down:hover:after{top:26px;bottom:inherit}.tooltip.down:hover:before{top:20px;border-width:0 6px 6px 6px;bottom:inherit}.tag{display:inline-block;background:var(--config-color-fade-light);color:var(--config-color-fade);border-radius:12px;line-height:24px;padding:0 8px;font-size:12px;box-shadow:none!important;border:none;height:auto;width:auto;white-space:nowrap;text-overflow:ellipsis}.tag:hover{border:none}.tag.green{background:var(--config-color-success);color:#fff}.tag.red{background:var(--config-color-danger);color:#fff}.tag.yellow{background:#ffe28b;color:#494949}.tag.focus{background:var(--config-color-focus);color:#fff}.tag.dark{background:var(--config-color-dark);color:#e7e7e7}.tag.blue{background:var(--config-color-info);color:#fff}.tag.link{background:var(--config-color-link);color:#fff}input[type=checkbox],input[type=radio]{width:26px;height:16px;position:relative;-webkit-appearance:none;border-radius:0;border:none;background:0 0;vertical-align:middle;margin:0}input[type=checkbox]:after,input[type=radio]:after{content:"";display:block;width:20px;height:20px;background:var(--config-color-background-fade);top:-5px;border-radius:50%;position:absolute;border:solid 3px var(--config-color-focus);vertical-align:middle}input[type=checkbox]:checked:after,input[type=radio]:checked:after{text-align:center;font-family:fontello;content:'\e83d';font-size:16px;line-height:20px;color:var(--config-color-background-fade);background:var(--config-color-focus)}input[type=checkbox][type=radio]:checked:after,input[type=radio][type=radio]:checked:after{content:'';display:block;width:10px;height:10px;border-radius:50%;background:var(--config-color-background-fade);border:solid 8px var(--config-color-focus)}input[type=checkbox]:focus,input[type=radio]:focus{outline:0}input[type=checkbox]:focus:after,input[type=checkbox]:hover:after,input[type=radio]:focus:after,input[type=radio]:hover:after{outline:0;border-color:#000}input[type=checkbox]:checked:focus:after,input[type=checkbox]:checked:hover:after,input[type=radio]:checked:focus:after,input[type=radio]:checked:hover:after{border-color:var(--config-color-focus)}.input-copy{position:relative}.input-copy input,.input-copy textarea{padding-right:65px;width:calc(100% - 82px);resize:none}.input-copy .copy{position:absolute;top:0;right:0;border-left:solid 1px var(--config-color-fade-light);height:calc(100% - 2px);width:50px;line-height:50px;text-align:center;background:var(--config-color-background-focus);margin:1px;border-radius:0 10px 10px 0}.paging{color:var(--config-color-fade);padding:5px 15px;font-size:12px}.paging form{display:inline-block}.paging button:disabled{color:var(--config-color-background-fade);opacity:.6}.blue-snap iframe{-webkit-appearance:none;-moz-appearance:none;-webkit-transform:translateZ(0);box-sizing:content-box;color:#313131;height:40px;line-height:40px;border:solid 1px var(--config-color-fade-light);border-radius:10px;padding:5px 15px;font-size:16px;display:block;width:calc(100% - 32px);margin-bottom:30px;float:none!important;height:40px!important;width:calc(100% - 32px)!important;border:solid 1px #e2e2e2!important;background:0 0!important;position:static!important}.blue-snap iframe[type=file]{line-height:0;padding:15px;height:auto}.blue-snap iframe:focus{outline:0;border-color:#b3d7fd}.blue-snap iframe:disabled{color:var(--config-color-normal);background:var(--config-color-fade-super);opacity:1!important}.blue-snap iframe.strip{border:none;border-radius:0;padding:5px 0;width:100%;background-color:transparent;background-position:right 2px top 50%;border-bottom:solid 1px var(--config-color-fade-light);color:var(--config-color-placeholder)}.blue-snap iframe.strip:focus{border-color:#b3d7fd}.blue-snap iframe:-webkit-autofill::first-line{font-weight:300;font-size:16px}.blue-snap .error{font-size:12px;margin-top:-25px;color:var(--config-color-danger);height:40px;padding-left:2px}.pell{height:auto;padding-bottom:0;margin-bottom:0;padding-top:0;background:var(--config-color-background-input);line-height:normal!important;position:relative}.pell.hide{padding:0!important;height:1px;min-height:1px;max-height:1px;border:none;box-shadow:none;margin-bottom:20px;opacity:0}.pell [contenteditable=true]:empty:before{content:attr(placeholder);display:block;color:var(--config-color-placeholder)}.pell .pell-actionbar{border-bottom:solid 1px var(--config-color-fade-light);margin:0 -15px 15px -15px;padding:10px 15px;position:sticky;top:70px;background:var(--config-color-background-input);border-radius:10px 10px 0 0}.pell .pell-content{min-height:100px;display:block;padding:10px;margin:-10px;cursor:text}.pell .pell-content:focus{outline:0}.pell button{background:inherit;color:inherit;margin:0;padding:0;padding-right:15px;height:40px;line-height:40px;box-shadow:none;cursor:pointer;font-size:13px;border-radius:0}.pell button.pell-button-selected,.pell button:focus,.pell button:hover{color:var(--config-color-link)}.pell h1,.pell h2,.pell h3,.pell h4,.pell h5,.pell h6{text-align:inherit;margin-bottom:30px}.pell b,.pell strong{font-weight:700}.pell ol,.pell ul{margin:0 0 20px 0}.pell ol li,.pell ul li{display:list-item!important;list-style:inherit;list-style-position:inside!important;margin:0 20px 2px 20px}.pell ol li p,.pell ul li p{margin:0;display:inline}.pell ol li{list-style:decimal}.pell ol li::before{content:'';display:none}label.switch{line-height:42px}.switch,input[type=checkbox].button.switch,input[type=checkbox].switch{width:52px;height:32px;line-height:32px;border-radius:21px;background:var(--config-color-fade);display:inline-block;margin:0;padding:5px;padding-left:5px;padding-right:30px}.switch.on,.switch:checked,input[type=checkbox].button.switch.on,input[type=checkbox].button.switch:checked,input[type=checkbox].switch.on,input[type=checkbox].switch:checked{background-color:var(--config-color-success);padding-left:25px;padding-right:5px}.switch.on:focus,.switch.on:hover,.switch:checked:focus,.switch:checked:hover,input[type=checkbox].button.switch.on:focus,input[type=checkbox].button.switch.on:hover,input[type=checkbox].button.switch:checked:focus,input[type=checkbox].button.switch:checked:hover,input[type=checkbox].switch.on:focus,input[type=checkbox].switch.on:hover,input[type=checkbox].switch:checked:focus,input[type=checkbox].switch:checked:hover{background:var(--config-color-success)}.switch:focus,.switch:hover,input[type=checkbox].button.switch:focus,input[type=checkbox].button.switch:hover,input[type=checkbox].switch:focus,input[type=checkbox].switch:hover{background:var(--config-color-fade)}.switch:focus:after,.switch:hover:after,input[type=checkbox].button.switch:focus:after,input[type=checkbox].button.switch:hover:after,input[type=checkbox].switch:focus:after,input[type=checkbox].switch:hover:after{background:#fff}.switch:after,input[type=checkbox].button.switch:after,input[type=checkbox].switch:after{content:"";display:block;width:22px;height:22px;background:#fff;border-radius:50%;border:none;position:static;top:0}.password-meter{margin:-41px 10px 30px 10px;height:2px;background:0 0;max-width:100%;z-index:2;position:relative}.password-meter.weak{background:var(--config-color-danger)}.password-meter.medium{background:var(--config-color-success)}.password-meter.strong{background:var(--config-color-success)}.color-input:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.color-input .color-preview{width:53px;height:53px;float:left;margin-right:10px;background:#000;border-radius:10px;box-shadow:inset 0 0 3px #a0a0a0;position:relative}.color-input .color-preview input{opacity:0;position:absolute;top:0;bottom:0;left:0;right:0;width:100%;height:100%;cursor:pointer}.color-input input{text-transform:uppercase;float:left;width:calc(100% - 95px)}.grecaptcha-badge{box-shadow:none!important;border-radius:10px!important;overflow:hidden!important;background:#4d92df!important;bottom:25px}.grecaptcha-badge:hover{width:256px!important}.back{font-size:15px;line-height:24px;height:24px;margin-left:-15px;margin-top:-25px;margin-bottom:20px}.back span{font-weight:inherit!important}@media only screen and (max-width:550px){.back{margin-left:-5px}}hr{height:1px;background:var(--config-border-color)!important;border:none}hr.fade{opacity:.7}.upload{position:relative}.upload:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.upload input{position:absolute;top:0;left:0;opacity:0;cursor:pointer}.upload.single .preview{height:0;position:relative;padding-top:100%;width:100%;margin-bottom:15px!important}.upload.single .preview li{position:absolute;top:0;width:calc(100% - 20px);height:calc(100% - 20px);margin-right:0!important;margin-bottom:0!important}.upload .button{float:left;margin-right:10px!important}.upload .button.disabled,.upload .button.disabled:hover{background:0 0;color:inherit;border-color:inherit}.upload .count{float:left;line-height:52px}.upload .progress{background:var(--config-color-success);height:6px;border-radius:3px;margin-bottom:15px!important}.upload .preview:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.upload .preview li{float:left;margin-right:20px!important;margin-bottom:15px!important;background:var(--config-color-background-fade-super);width:150px;height:150px;line-height:148px;text-align:center;border-radius:20px;overflow:hidden;position:relative;cursor:pointer;border:solid 1px var(--config-color-background-dark)}.upload .preview li:hover:before{background:var(--config-color-focus)}.upload .preview li:before{content:'\e807';font-family:fontello;font-size:12px;position:absolute;width:20px;height:20px;display:block;top:8px;right:8px;text-align:center;line-height:20px;vertical-align:middle;border-radius:50%;background:#484848;color:#fff;z-index:1}.upload .preview li img{vertical-align:middle;max-height:150px;max-width:150px;-webkit-filter:drop-shadow(0 0 6px rgba(0, 0, 0, .3));filter:drop-shadow(0 0 1px rgba(0, 0, 0, .3))}.upload.wide .preview li{height:0;width:100%;position:relative;padding-top:30.547%;background:#e7e7e7;border-radius:10px;overflow:hidden;border:solid 1px #f9f9f9;margin:0}.upload.wide .preview li img{border-radius:10px;position:absolute;top:0;width:100%;display:block;opacity:1;max-width:inherit;max-height:inherit}ol{list-style:none;counter-reset:x-counter;padding:0}ol li{counter-increment:x-counter;line-height:30px;margin-bottom:30px;margin-left:45px}ol li::before{display:inline-block;content:counter(x-counter);color:var(--config-color-background-fade);background:var(--config-color-focus);border:solid 2px var(--config-color-focus);margin-right:15px;margin-left:-45px;width:26px;height:26px;border-radius:50%;text-align:center;line-height:26px}.required{color:var(--config-color-danger);font-size:8px;position:relative;top:-8px}.drop-list{position:relative;outline:0}.drop-list.open ul{display:block}.drop-list ul{position:relative;background:var(--config-color-background-fade);border-radius:10px;box-shadow:0 0 3px rgba(0,0,0,.05);padding:30px;display:block;border-bottom:none;box-shadow:0 0 6px rgba(0,0,0,.1);display:none;position:absolute;bottom:calc(100% + 10px);z-index:2;padding:0;left:-10px;max-width:280px;min-width:240px}.drop-list ul.padding-small{padding:15px}.drop-list ul.y-scroll{overflow-y:auto}.drop-list ul.danger{background:var(--config-color-danger);color:#fff}.drop-list ul.danger .box{color:var(--config-color-normal);background:var(--config-color-background-fade)}.drop-list ul.danger>.button,.drop-list ul.danger>button{background:#fff;color:var(--config-color-danger)}.drop-list ul.note{background:var(--config-note-background)}.drop-list ul.focus{background:var(--config-color-focus);color:var(--config-color-background-fade)}.drop-list ul.focus .button,.drop-list ul.focus button{background:var(--config-color-background-fade);color:var(--config-color-focus)}.drop-list ul.line{background:0 0;border:solid 1px var(--config-color-background-dark);box-shadow:none}.drop-list ul.warning{background:var(--config-color-success);color:#2d2d2d}.drop-list ul.warning .button,.drop-list ul.warning button{background:rgba(45,45,45,.8);color:var(--config-color-success)}.drop-list ul .tabs{border-bottom:solid 1px var(--config-border-color);margin:0 -30px;padding:0 30px!important}.drop-list ul>footer{margin:0 -30px -30px -30px;padding:15px 30px;background:var(--config-color-background-fade);border:solid 1px var(--config-border-color);border-radius:0 0 10px 10px}.drop-list ul hr{height:1px;background:var(--config-console-background);border:none;margin:30px -30px}.drop-list ul .label{position:absolute;top:10px;z-index:2;right:10px}.drop-list ul.fade-bottom{position:relative;overflow:hidden}.drop-list ul.fade-bottom:after{content:"";position:absolute;display:block;bottom:15px;width:100%;background:#000;background:linear-gradient(180deg,rgba(0,0,0,0) 0,var(--config-color-background-fade) 80%);height:100px;margin:0 -15px}.drop-list ul .header{position:static;height:40px;padding:20px 30px 20px 30px;margin-bottom:30px;margin:-30px -30px 20px -30px;background:var(--config-color-background-fade);border-bottom:solid 1px #efefef}.drop-list ul ul.numbers>li{position:relative;margin-left:30px;margin-right:50px}.drop-list ul ul.numbers>li hr{margin-left:-60px;margin-right:-80px}.drop-list ul ul.numbers>li .settings{position:absolute;top:3px;right:-50px}.drop-list ul ul.numbers>li::after{display:block;width:25px;height:25px;line-height:25px;font-size:13px;font-weight:500;border-radius:50%;background:var(--config-color-focus);color:var(--config-color-background);counter-increment:section;content:counter(section);text-align:center;position:absolute;top:3px;left:-45px}.drop-list ul .scroll{margin:0 -30px;overflow-y:scroll}.drop-list ul .scroll table{width:100%;margin:0}.drop-list ul ul.sortable{counter-reset:section}.drop-list ul ul.sortable>li [data-move-down].round,.drop-list ul ul.sortable>li [data-move-up].round,.drop-list ul ul.sortable>li [data-remove].round{background:var(--config-color-focus);color:var(--config-color-background-fade);width:25px;height:25px;line-height:25px;display:inline-block;text-align:center;padding:0;margin-right:5px}.drop-list ul ul.sortable>li [data-move-down].round:disabled,.drop-list ul ul.sortable>li [data-move-up].round:disabled,.drop-list ul ul.sortable>li [data-remove].round:disabled{display:none}.drop-list ul ul.sortable>li:first-child [data-move-up]{display:none}.drop-list ul ul.sortable>li:first-child [data-move-up]:disabled{display:inline-block;background:var(--config-color-background)}.drop-list ul ul.sortable>li:last-child [data-move-down]{display:none}.drop-list ul ul.sortable>li:last-child [data-move-down]:disabled{display:inline-block;background:var(--config-color-background)}.drop-list ul .toggle{position:relative;border-top:1px solid var(--config-console-background);border-bottom:1px solid var(--config-console-background);margin:0 -30px;padding:30px 30px 0 30px;height:65px;overflow:hidden}.drop-list ul .toggle.list{border-bottom:none}.drop-list ul .toggle.sorts button.ls-ui-open{width:calc(100% - 100px)}.drop-list ul .toggle button.ls-ui-open{right:0;position:absolute;top:0;width:100%;height:95px;background:0 0;opacity:.5;border-radius:0}.drop-list ul .toggle .icon-minus,.drop-list ul .toggle .icon-up-open{display:none}.drop-list ul .toggle .content{display:none}.drop-list ul .toggle.open{height:auto}.drop-list ul .toggle.open .icon-minus,.drop-list ul .toggle.open .icon-up-open{display:block}.drop-list ul .toggle.open .icon-down-open,.drop-list ul .toggle.open .icon-plus{display:none}.drop-list ul .toggle.open .content{display:block}.drop-list ul .list li{border-bottom:solid 2px var(--config-border-color);margin:0 -30px 30px -30px;padding:0 30px 30px 30px}.drop-list ul .list li:last-child{padding-bottom:0;margin-bottom:0;border-bottom:none}@media only screen and (max-width:550px){.drop-list ul .list li .actions{float:none}}.drop-list ul.new{text-align:center}.drop-list ul.new i{font-size:80px;line-height:80px;font-family:Poppins,sans-serif;font-style:normal;font-weight:300}.drop-list ul.new b{margin-top:20px;display:block}.drop-list ul .info{margin:0 -30px;padding:20px 30px;background:var(--config-modal-note-background);color:var(--config-modal-note-color);border-top:solid 1px var(--config-modal-note-border);border-bottom:solid 1px var(--config-modal-note-border)}.drop-list ul .info hr{background:var(--config-modal-note-border)!important}.drop-list ul .table-wrap{margin:0 -30px;overflow-y:scroll}.drop-list ul .table-wrap table{margin:0}.drop-list ul:before{border:solid;border-color:var(--config-color-background-fade) transparent;border-width:8px 8px 0 8px;bottom:-8px;content:"";position:absolute;z-index:99;left:30px}.drop-list ul.arrow-end:before{right:30px;left:unset}.drop-list ul li{border-bottom:solid 1px var(--config-color-fade-super);margin:0;padding:0}.drop-list ul li:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.drop-list ul li:first-child{border-radius:10px 10px 0 0}.drop-list ul li:last-child{border-radius:0 0 10px 10px}.drop-list ul li:hover{background:var(--config-color-fade-super)}.drop-list ul li:first-child:hover,.drop-list ul li:last-child:hover{border-color:transparent}.drop-list ul li .link,.drop-list ul li a,.drop-list ul li button.link{display:block;vertical-align:middle;height:auto;line-height:30px;display:inline-block;padding:10px 15px!important;color:inherit;font-size:14px;border:none;cursor:pointer;width:calc(100% - 30px);text-align:left;box-sizing:content-box}.drop-list ul li.disabled .link:hover,.drop-list ul li.disabled a:hover{background:0 0}.drop-list ul li .avatar{width:30px;height:30px;margin-right:10px;float:left}.drop-list ul li:last-child{border-bottom:none}.drop-list.bottom ul{bottom:auto;margin-top:-2px}.drop-list.bottom ul:before{bottom:auto;top:-8px;border-width:0 8px 8px 8px}.drop-list.end ul{right:-10px;left:auto}.disabled{opacity:.2;cursor:default}.disabled .button,.disabled .link,.disabled a,.disabled button{cursor:default!important}.disabled .button:hover,.disabled .link:hover,.disabled a:hover,.disabled button:hover{background:0 0}.tags{-webkit-appearance:none;-moz-appearance:none;-webkit-transform:translateZ(0);box-sizing:content-box;color:#313131;height:40px;line-height:40px;border:solid 1px var(--config-color-fade-light);border-radius:10px;padding:5px 15px;font-size:16px;display:block;width:calc(100% - 32px);margin-bottom:30px;background:var(--config-color-background-input);min-height:42px;height:auto;cursor:text}.tags[type=file]{line-height:0;padding:15px;height:auto}.tags:focus{outline:0;border-color:#b3d7fd}.tags:disabled{color:var(--config-color-normal);background:var(--config-color-fade-super);opacity:1!important}.tags.strip{border:none;border-radius:0;padding:5px 0;width:100%;background-color:transparent;background-position:right 2px top 50%;border-bottom:solid 1px var(--config-color-fade-light);color:var(--config-color-placeholder)}.tags.strip:focus{border-color:#b3d7fd}.tags:-webkit-autofill::first-line{font-weight:300;font-size:16px}.tags .add{display:inline-block!important;border:none;padding:0;width:auto;margin:0;max-width:100%;min-width:200px}.tags ul.tags-list{display:inline;white-space:pre-line}.tags ul.tags-list li{display:inline-block!important;margin-right:10px;font-size:16px;padding:5px 10px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.tags ul.tags-list li::before{float:right;content:'\e807';font-family:fontello;font-style:normal;display:inline-block;text-align:center;line-height:16px;width:16px;height:16px;font-size:12px;background:#000;color:#fff;border-radius:50%;margin-top:4px;margin-bottom:4px;margin-left:6px;margin-right:0}.switch-theme{background:var(--config-switch-background);border-radius:19px;height:26px;width:44px;margin:9px 0}.switch-theme button{padding:3px;display:block;background:0 0;height:26px;width:100%}.switch-theme i{background:var(--config-color-background-fade);border-radius:50%;height:18px;width:18px;line-height:18px;font-size:12px;padding:0;margin:0;color:var(--config-color-fade)}.switch-theme i.force-light{float:right}.switch-theme i.force-dark{float:left}.console{width:100%;padding:0;overscroll-behavior:none}.console body{position:relative;width:calc(100% - 320px);padding-top:70px;padding-bottom:0;padding-right:50px;padding-left:270px;margin:0;color:var(--config-color-normal);background:var(--config-console-background)}.console body .project-only{display:none!important}.console body.show-nav .project-only{display:inline-block!important}.console body.hide-nav{padding-left:50px;width:calc(100% - 100px)}.console body.hide-nav header{width:calc(100% - 50px)}.console body.hide-nav header .logo{display:inline-block}.console body.hide-nav .console-back{display:block}.console body.hide-nav .console-index{display:none}.console body.hide-nav .account{display:none}.console body.index .console-back{display:none}.console body.index .console-index{display:block}.console body.index .account{display:block}.console body .console-index{display:block}.console body .console-back{display:none}.console main{min-height:480px}.console header{position:fixed;top:0;width:calc(100% - 280px);height:40px;line-height:40px;padding:15px 30px;background:var(--config-color-background-fade);box-shadow:0 0 2px rgba(0,0,0,.1);margin:0 -50px;z-index:2;font-size:14px}.console header .logo{display:none;border:none}.console header .logo:hover{border:none;opacity:.8}.console header .logo img{height:26px;margin:7px 0}.console header .setup-new{width:40px;height:40px;line-height:40px}.console header .list{width:240px}.console header .list select{height:40px;line-height:40px;padding-top:0;padding-bottom:0;border:none;border-radius:26px;background-color:var(--config-console-nav-switch-background);color:var(--config-console-nav-switch-color)}.console header .account{margin-left:25px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.console header .switch-theme{margin:2px 0}.console header .avatar{height:40px;width:40px}.console header .account-button{background:0 0;position:absolute;width:100%;height:40px;border-radius:0;z-index:1}.console header .notifications{position:relative;font-size:20px}.console header .notifications a{color:#1b3445}.console header .notifications:after{position:absolute;content:"";display:block;background:var(--config-color-danger);width:8px;height:8px;border-radius:50%;top:3px;right:3px}.console header nav{background:#1b3445;background:linear-gradient(var(--config-console-nav-start),var(--config-console-nav-end));color:#788c99;position:fixed;height:100%;width:220px;top:0;left:0}.console header nav .logo{height:39px;padding:15px 20px;display:block}.console header nav .logo img{display:inline-block;margin-top:7px;margin-bottom:14px}.console header nav .logo svg g{fill:var(--config-color-focus)}.console header nav .icon{display:block;border:none;margin:18px 10px 50px 10px}.console header nav .icon img{display:block}.console header nav .icon:hover{border-bottom:none}.console header nav .icon:hover svg g{fill:var(--config-color-focus)}.console header nav .container{overflow:auto;height:calc(100% - 133px);width:100%}.console header nav .project-box{padding:20px;text-align:center;display:block;border:none;line-height:100px;height:100px}.console header nav .project-box img{max-height:80px;max-width:80%;display:inline-block;vertical-align:middle}.console header nav .project{display:block;padding:85px 25px 20px 25px;color:#788c99;position:relative;border:none;height:20px}.console header nav .project:hover{border-bottom:none}.console header nav .project .name{height:20px;line-height:20px;margin:0;padding:0;display:inline-block;max-width:100%}.console header nav .project .arrow{display:block;position:absolute;right:5px;top:10px;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #788c99;transform:rotate(225deg)}.console header nav .project img{position:absolute;bottom:40px;display:block;margin-bottom:10px;max-height:35px;max-width:40%}.console header nav .subtitle{padding:0 30px;display:block;font-size:12px;font-weight:300}.console header nav .links{margin-bottom:15px!important}.console header nav .links.top{border:none;padding-bottom:0;margin-bottom:5px!important}.console header nav .links.bottom{position:absolute;bottom:0;left:0;right:0;padding-bottom:0;border:none;margin-bottom:0!important;box-shadow:0 0 10px rgba(0,0,0,.1)}.console header nav .links.bottom a{border-top:solid 1px var(--config-console-nav-border);border-bottom:none}.console header nav .links .sub{display:inline-block;border:none;width:25px;height:25px;line-height:25px;border-radius:50%;padding:0;background:var(--config-color-focus);color:#fff;text-align:center;font-size:12px;margin:18px}.console header nav .links .sub i{width:auto;margin:0}.console header nav .links .sub:hover{border:none}.console header nav .links a{padding:8px 20px;border:none;display:block;color:#87a5b9;font-weight:400;border-left:solid 5px transparent;font-size:13px}.console header nav .links a i{margin-right:8px;width:22px;display:inline-block}.console header nav .links a.selected,.console header nav .links a:hover{color:#e4e4e4}.console header nav:after{content:'';display:block;position:absolute;background:#302839;height:100px;width:100%;bottom:-100px}.console>footer{width:calc(100% + 100px);margin:0 -50px;box-sizing:border-box;background:0 0;padding-right:30px;padding-left:30px}.console>footer ul{float:none;text-align:center}.console>footer ul li{float:none;display:inline-block}.console .projects{position:relative}.console .projects:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.console .projects li{float:left;margin-right:50px;margin-bottom:50px;width:270px}.console .projects li:nth-child(3n){margin-right:0}.console .dashboard{padding:20px;min-height:95px;overflow:hidden;position:relative;z-index:1}.console .dashboard hr{margin:20px -20px;height:2px;background:var(--config-console-background)}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.console .dashboard hr{height:3px}}.console .dashboard footer{margin:-20px;padding:20px;background:#fcfeff;border:none;color:var(--config-color-link)}.console .dashboard .col{position:relative}.console .dashboard .col:last-child:after{display:none}.console .dashboard .col:after{content:"";display:block;width:2px;background:var(--config-console-background);height:calc(100% + 110px);position:absolute;top:-20px;bottom:-20px;right:24px}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.console .dashboard .col:after{width:calc(100% + 40px);height:3px;position:static;margin:20px -20px}}.console .dashboard .value{color:var(--config-color-focus);vertical-align:bottom;line-height:45px}.console .dashboard .value .sum{font-size:45px;line-height:45px;font-weight:700;vertical-align:bottom}.console .dashboard .unit{font-weight:500;line-height:20px;vertical-align:bottom;font-size:16px;display:inline-block;margin-bottom:5px;margin-left:5px;color:var(--config-color-focus)}.console .dashboard .metric{color:var(--config-color-focus);font-weight:400;font-size:13px;line-height:16px}.console .dashboard .range{color:var(--config-color-fade);font-weight:400;font-size:14px;line-height:16px}.console .dashboard a{display:block;font-weight:400;font-size:14px;line-height:16px;padding:0;border:none}.console .dashboard .chart-metric{width:19%}@media only screen and (min-width:551px) and (max-width:1198px),only screen and (max-width:550px){.console .dashboard .chart-metric{width:100%}}.console .dashboard .chart{width:80%;position:relative;height:0;padding-top:20px;padding-bottom:26%;margin-right:-2px;overflow:hidden;background-color:var(--config-color-background-fade);background-image:linear-gradient(transparent 1px,transparent 1px),linear-gradient(90deg,transparent 1px,transparent 1px),linear-gradient(var(--config-border-color) 1px,transparent 1px),linear-gradient(90deg,var(--config-border-color) 1px,transparent 1px);background-size:100px 100px,100px 100px,20px 20px,20px 20px;background-position:-2px -2px,-2px -2px,-1px -1px,-1px -1px;background-repeat:round;border:solid 1px var(--config-border-color);border-right:solid 1px transparent;border-bottom:solid 1px transparent}@media only screen and (min-width:551px) and (max-width:1198px),only screen and (max-width:550px){.console .dashboard .chart{width:100%;padding-bottom:32%;float:none;margin-bottom:20px}}.console .dashboard .chart canvas{position:absolute;bottom:0;display:block;height:100%;width:100%}.console .community a{padding:0 10px;display:inline-block}.console .link-list li{margin-bottom:15px}.console .link-list i{display:inline-block;width:30px;height:30px;line-height:30px;text-align:center;background:var(--config-color-fade);color:var(--config-color-fade-super);border-radius:50%;margin-right:15px}.console .link-list i.fade{background:0 0;color:var(--config-color-fade)}.console .provider{width:50px;height:50px;background:#f5f5f5;color:#868686;line-height:50px;text-align:center;font-size:25px;border-radius:50%}.console .provider.facebook{color:#fff;background:#3b5998}.console .provider.twitter{color:#fff;background:#55beff}.console .provider.telegram{color:#fff;background:#3ba9e1}.console .provider.github{color:#fff;background:#24292e}.console .provider.whatsapp{color:#fff;background:#25d366}.console .provider.linkedin{color:#fff;background:#1074af}.console .provider.microsoft{color:#fff;background:#137ad4}.console .provider.google{color:#fff;background:#4489f1}.console .provider.bitbucket{color:#fff;background:#2a88fb}.console .provider.gitlab{color:#faa238;background:#30353e}.console .provider.instagram{color:#fff;background:radial-gradient(circle at 30% 107%,#fdf497 0,#fdf497 5%,#fd5949 45%,#d6249f 60%,#285aeb 90%)}.console .premium{z-index:3;margin-top:320px}.console .premium .message{height:190px;overflow:hidden;position:absolute;top:-280px}.console .premium:after{content:'';position:absolute;top:0;left:-20px;right:-20px;bottom:-20px;background:var(--config-color-background);opacity:.7;z-index:300}.console .app-section{height:90px}.console .confirm{background:var(--config-color-link);color:#fff;border-radius:25px;padding:12px;line-height:28px;text-align:center}.console .confirm .action{font-weight:500;cursor:pointer}.console .platforms{overflow:hidden}.console .platforms .box{overflow:hidden}.console .platforms .box img{width:50px;margin:0 auto;margin-bottom:20px}.console .platforms .box .cover{margin:-30px -30px 30px -30px;padding:30px}.console .platforms .box .cover.android{background:#a4ca24}.console .platforms .box .cover.android h1{color:#fff;font-size:18px;margin-top:20px}.console .platforms .col{text-align:center;line-height:30px}.console .platforms a{display:block;margin:-20px;padding:20px}.console .platforms a:hover{background:#fbfeff}.console .platforms img{display:block;margin:0 30px;width:calc(100% - 60px);border-radius:50%;margin-bottom:20px}.console .document-nav{display:none;position:sticky;top:90px}@media only screen and (min-width:1380px){.console .document-nav{display:block}}.console .document-nav ul{position:absolute;width:200px;left:-260px}.console .document-nav ul li{margin-bottom:20px}.console .document-nav ul li .selected{font-weight:500}.console .scroll-to{display:none}@media only screen and (min-width:1199px){.console .logo .top{display:none!important}}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.console>header{width:calc(100% - 30px)!important;margin:0 -30px;padding:15px}.console>header nav{width:100%;height:70px;overflow:hidden}.console>header nav.close{background:0 0}.console>header nav.close .logo .nav{display:none!important}.console>header nav.open{height:100%}.console>header nav.open .logo .top{display:none!important}.console>header nav.open .bottom{display:block!important}.console>header nav.open button{color:#87a5b9}.console>header nav button{margin:9px;background:0 0;color:var(--config-color-normal)}.console>header nav button:focus,.console>header nav button:hover{background:0 0}.console>header nav .logo{display:block!important;position:absolute;top:0;left:50%;margin:auto;transform:translateX(-50%)}.console>header nav .bottom{display:none!important}.console>footer{width:auto;margin:50px -30px 0 -30px!important;padding:0 30px 30px 30px}.console body{height:"calc(100% - 70px)"!important;width:calc(100% - 60px)!important;padding:70px 30px 0 30px!important}.console .cover{padding:25px 30px;margin:0 -30px}}@media only screen and (max-width:550px){.console body{height:"calc(100% - 70px)"!important;width:calc(100% - 40px)!important;padding:70px 20px 0 20px!important}.console .cover{padding:20px 20px;margin:0 -20px}.console>header{margin:0 -20px}.console>header .list{width:175px;font-size:14px}.console>footer{margin:50px -20px 0 -20px!important;padding:0 20px 20px 20px}}.dev-feature{display:none}.prod-feature{display:none}.development .dev-feature{display:block;opacity:.6!important;outline:solid #ff0 3px;outline-offset:3px}.development .dev-feature.dev-inline{display:inline-block}.development .prod-feature{display:none}.production .dev-feature{display:none}.production .prod-feature{display:block}.search{opacity:1!important}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.search button{margin-top:20px}}html.home body{padding:0 50px;color:var(--config-color-normal)}html.home .logo a{display:block}html.home .logo a:hover{opacity:.8}html.home .logo img{max-height:35px;width:198px;margin:45px auto 25px auto}html.home footer{background:0 0;text-align:center}html.home main{min-height:400px}.alerts ul{width:100%;visibility:hidden;position:fixed;padding:0;right:0;left:0;color:var(--config-color-normal);z-index:1002;margin:0 auto;bottom:15px;max-width:560px}.alerts ul li{margin:10px 0 0 0;padding:0}.alerts ul li div.message{position:relative;padding:12px 35px;margin:0 auto;list-style:none;background:var(--config-color-background-dark);text-align:center;font-size:14px;border-radius:10px;line-height:16px;min-height:16px;box-shadow:0 0 10px rgba(0,0,0,.05);opacity:.95}.alerts ul li div.message a,.alerts ul li div.message span{font-weight:600}.alerts ul li div.message i{cursor:pointer;position:absolute;font-size:14px;line-height:22px;top:8px;left:8px}.alerts ul li div.message.error{color:#fff;background:var(--config-color-danger)}.alerts ul li div.message.success{color:#fff;background:var(--config-color-success)}.alerts ul li div.message.warning{color:#fff;background:var(--config-color-success)}.alerts ul li div.message.open{display:block}.alerts ul li div.message.close{display:none}.alerts .cookie-alert{background:var(--config-color-focus-fade)!important;color:var(--config-color-focus)}.alerts .cookie-alert a{color:var(--config-color-focus);font-weight:400;border-bottom:dotted 1px var(--config-color-focus)}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.alerts ul{top:auto;bottom:0;max-width:100%}.alerts ul li{margin:5px 0 0 0}.alerts ul li div.message{border-radius:0}}article{overflow-wrap:break-word;word-wrap:break-word}article h1{font-size:36px}article h2{font-size:24px}article h3{font-size:20px}article h4{font-size:20px}article h5{font-size:18px}article h6{font-size:16px}article h1,article h2,article h3,article h4,article h5,article h6{margin-top:30px!important;margin-bottom:30px!important}article p{line-height:32px;font-size:16px}article .update{display:block;margin-top:50px!important}article table{width:100%;margin:0;margin-bottom:30px!important;border-radius:0;border-bottom:solid 1px var(--config-border-color)}article table thead td{font-weight:500;padding:5px 15px}article table td,article table th{padding:15px;height:auto}article table td:first-child,article table th:first-child{padding-left:10px}article table td:last-child,article table th:last-child{padding-right:10px}article table td p,article table th p{font-size:inherit;line-height:inherit}article table td p:last-child,article table th p:last-child{margin:0}.avatar-container{position:relative}.avatar-container .corner{position:absolute;bottom:-3px;right:-3px}.avatar{width:60px;height:60px;border-radius:50%;background:var(--config-color-background-focus);display:inline-block;overflow:hidden;box-shadow:0 0 6px rgba(0,0,0,.09);position:relative;z-index:1;opacity:1!important}.avatar:before{content:"";position:absolute;width:100%;height:100%;z-index:0;background:var(--config-color-background-focus)}.avatar.inline{display:inline-block;vertical-align:middle}.avatar.trans{background:0 0}.avatar .no-shadow{box-shadow:none}.avatar.xs{width:30px;height:30px}.avatar.xxs{width:20px;height:20px}.avatar.small{width:50px;height:50px}.avatar.big{width:100px;height:100px}.avatar.huge{width:150px;height:150px}.box{position:relative;background:var(--config-color-background-fade);border-radius:10px;box-shadow:0 0 3px rgba(0,0,0,.05);padding:30px;display:block;border-bottom:none}.box.padding-small{padding:15px}.box.y-scroll{overflow-y:auto}.box.danger{background:var(--config-color-danger);color:#fff}.box.danger .box{color:var(--config-color-normal);background:var(--config-color-background-fade)}.box.danger>.button,.box.danger>button{background:#fff;color:var(--config-color-danger)}.box.note{background:var(--config-note-background)}.box.focus{background:var(--config-color-focus);color:var(--config-color-background-fade)}.box.focus .button,.box.focus button{background:var(--config-color-background-fade);color:var(--config-color-focus)}.box.line{background:0 0;border:solid 1px var(--config-color-background-dark);box-shadow:none}.box.warning{background:var(--config-color-success);color:#2d2d2d}.box.warning .button,.box.warning button{background:rgba(45,45,45,.8);color:var(--config-color-success)}.box .tabs{border-bottom:solid 1px var(--config-border-color);margin:0 -30px;padding:0 30px!important}.box>footer{margin:0 -30px -30px -30px;padding:15px 30px;background:var(--config-color-background-fade);border:solid 1px var(--config-border-color);border-radius:0 0 10px 10px}.box hr{height:1px;background:var(--config-console-background);border:none;margin:30px -30px}.box .label{position:absolute;top:10px;z-index:2;right:10px}.box.fade-bottom{position:relative;overflow:hidden}.box.fade-bottom:after{content:"";position:absolute;display:block;bottom:15px;width:100%;background:#000;background:linear-gradient(180deg,rgba(0,0,0,0) 0,var(--config-color-background-fade) 80%);height:100px;margin:0 -15px}.box .header{position:static;height:40px;padding:20px 30px 20px 30px;margin-bottom:30px;margin:-30px -30px 20px -30px;background:var(--config-color-background-fade);border-bottom:solid 1px #efefef}.box ul.numbers>li{position:relative;margin-left:30px;margin-right:50px}.box ul.numbers>li hr{margin-left:-60px;margin-right:-80px}.box ul.numbers>li .settings{position:absolute;top:3px;right:-50px}.box ul.numbers>li::after{display:block;width:25px;height:25px;line-height:25px;font-size:13px;font-weight:500;border-radius:50%;background:var(--config-color-focus);color:var(--config-color-background);counter-increment:section;content:counter(section);text-align:center;position:absolute;top:3px;left:-45px}.box .scroll{margin:0 -30px;overflow-y:scroll}.box .scroll table{width:100%;margin:0}.box ul.sortable{counter-reset:section}.box ul.sortable>li [data-move-down].round,.box ul.sortable>li [data-move-up].round,.box ul.sortable>li [data-remove].round{background:var(--config-color-focus);color:var(--config-color-background-fade);width:25px;height:25px;line-height:25px;display:inline-block;text-align:center;padding:0;margin-right:5px}.box ul.sortable>li [data-move-down].round:disabled,.box ul.sortable>li [data-move-up].round:disabled,.box ul.sortable>li [data-remove].round:disabled{display:none}.box ul.sortable>li:first-child [data-move-up]{display:none}.box ul.sortable>li:first-child [data-move-up]:disabled{display:inline-block;background:var(--config-color-background)}.box ul.sortable>li:last-child [data-move-down]{display:none}.box ul.sortable>li:last-child [data-move-down]:disabled{display:inline-block;background:var(--config-color-background)}.box .toggle{position:relative;border-top:1px solid var(--config-console-background);border-bottom:1px solid var(--config-console-background);margin:0 -30px;padding:30px 30px 0 30px;height:65px;overflow:hidden}.box .toggle.list{border-bottom:none}.box .toggle.sorts button.ls-ui-open{width:calc(100% - 100px)}.box .toggle button.ls-ui-open{right:0;position:absolute;top:0;width:100%;height:95px;background:0 0;opacity:.5;border-radius:0}.box .toggle .icon-minus,.box .toggle .icon-up-open{display:none}.box .toggle .content{display:none}.box .toggle.open{height:auto}.box .toggle.open .icon-minus,.box .toggle.open .icon-up-open{display:block}.box .toggle.open .icon-down-open,.box .toggle.open .icon-plus{display:none}.box .toggle.open .content{display:block}.box .list li{border-bottom:solid 2px var(--config-border-color);margin:0 -30px 30px -30px;padding:0 30px 30px 30px}.box .list li:last-child{padding-bottom:0;margin-bottom:0;border-bottom:none}@media only screen and (max-width:550px){.box .list li .actions{float:none}}.box.new{text-align:center}.box.new i{font-size:80px;line-height:80px;font-family:Poppins,sans-serif;font-style:normal;font-weight:300}.box.new b{margin-top:20px;display:block}.box .info{margin:0 -30px;padding:20px 30px;background:var(--config-modal-note-background);color:var(--config-modal-note-color);border-top:solid 1px var(--config-modal-note-border);border-bottom:solid 1px var(--config-modal-note-border)}.box .info hr{background:var(--config-modal-note-border)!important}.box .table-wrap{margin:0 -30px;overflow-y:scroll}.box .table-wrap table{margin:0}a.box{border-right:none;border-left:none}a.box:hover{box-shadow:0 0 1px rgba(0,0,0,.2);opacity:.7}.box-asidex{padding-right:25px!important;padding-left:70px;right:0;background:#f9f9f9;border-radius:0 10px 10px 0;height:calc(100% - 30px);position:absolute;padding-top:30px}.box-asidex:after{content:"";display:block;position:absolute;height:100%;width:51px;background:#fff;top:0;bottom:0;left:-6px}.cover{background:var(--config-color-focus-fade);padding:30px 50px;margin:0 -50px;position:relative}.cover .title,.cover h1,.cover h2,.cover h3,.cover h4{color:var(--config-color-focus);font-weight:600;margin-bottom:50px!important;font-size:28px;line-height:42px}.cover .title span,.cover h1 span,.cover h2 span,.cover h3 span,.cover h4 span{font-weight:600}.cover i:before{margin:0!important}.cover p{color:var(--config-color-fade)}.cover .button{color:#fff}.cover .link,.cover a{color:var(--config-color-focus);border-left:none;border-right:none;cursor:pointer}.cover .link:hover,.cover a:hover{border-bottom-color:var(--config-color-focus)}.console .database .row .col{height:452px}.console .database .row .col:after{width:2px;right:20px}.console .database hr{margin:0 -20px;background:var(--config-color-background);height:1px}.console .database h3{font-size:13px;line-height:20px;height:20px;background-color:var(--config-color-fade-super);margin:-20px -20px 0 -20px;padding:10px 20px;border-bottom:solid 1px var(--config-color-background);font-weight:600}.console .database .empty{height:162px;font-size:12px;text-align:center;margin:50px 0}.console .database .empty h4{font-size:13px;font-weight:600;line-height:120px}.console .database .search{background-color:var(--config-color-fade-super);margin:0 -20px 0 -20px;padding:10px 15px}.console .database .search input{height:40px;background-color:#fff;border-radius:25px;padding-top:0;padding-bottom:0}.console .database .code{height:411px;background:var(--config-color-fade-super);margin:0 -20px -20px -20px;padding:20px;width:calc(100% - 10px)}.console .database .code .ide{overflow:scroll;height:451px;margin:-20px;box-shadow:none;border-radius:0}.console .database .paging{background:var(--config-color-fade-super);margin:0 -20px -20px -20px;padding:20px}.console .database .button{margin:0 -20px;padding:0 20px!important;text-align:inherit;color:var(--config-color-focus);width:100%;font-size:15px;line-height:55px;box-sizing:content-box}.console .database .button i{margin-right:8px}.console .database .button:hover{border:none;background:var(--config-color-focus-fade)}.console .database .items{margin:0 -20px;height:262px;overflow-x:hidden;overflow-y:scroll}.console .database .items form{opacity:0;position:relative}.console .database .items form button{position:absolute;top:0;bottom:0;left:0;right:0;width:100%;height:45px;border-radius:0;cursor:pointer}.console .database .items li{padding:0;margin:0 0;line-height:45px;font-size:15px;padding-left:50px;padding-right:30px;position:relative}.console .database .items li i{position:absolute;display:none;right:10px}.console .database .items li .name{display:inline-block;width:100%;height:28px}.console .database .items li.selected,.console .database .items li:hover{background:#f5f5f5}.console .database .items li.selected i,.console .database .items li:hover i{display:block}.console .database .items li:last-child{border-bottom:none}body>footer{color:var(--config-color-fade);line-height:40px;margin:0 -50px;padding:12px 50px;font-size:13px;width:100%;background:#f1f1f1;position:relative;margin-top:80px!important}body>footer:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}body>footer .logo img{height:22px;padding-top:12px}body>footer a{color:var(--config-color-fade);font-size:13px}body>footer a:hover{border-bottom-color:var(--config-color-fade)}body>footer ul:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}body>footer ul li{font-size:13px;float:left;margin-right:20px!important}body>footer .copyright{padding-left:2px}[data-ls-if]{display:none}[data-service]{opacity:0}.load-service-start{opacity:0}.load-service-end{opacity:1;transition:opacity .5s ease-out;-moz-transition:opacity .5s ease-out;-webkit-transition:opacity .5s ease-out;-o-transition:opacity .5s ease-out}.load-screen{z-index:100000;position:fixed;height:100%;width:100%;background-color:var(--config-color-background-focus);top:0;left:0}.load-screen.loaded{transition:opacity 1s ease-in-out,top 1s .7s;opacity:0;top:-100%}.load-screen .animation{position:absolute;top:45%;left:50%;transform:translate(-50%,-50%) translateZ(1px);width:140px;height:140px}.load-screen .animation div{box-sizing:border-box;display:block;position:absolute;width:124px;height:124px;margin:10px;border:10px solid var(--config-color-focus);border-radius:50%;animation:animation 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:var(--config-color-focus) transparent transparent transparent}.load-screen .animation div:nth-child(1){animation-delay:-.45s}.load-screen .animation div:nth-child(2){animation-delay:-.3s}.load-screen .animation div:nth-child(3){animation-delay:-.15s}@keyframes animation{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.load-screen img{position:absolute;height:20px;bottom:60px;left:50%;transform:translate(-50%,-50%)}.modal-open .modal-bg,.modal-open body .modal-bg{position:fixed;content:'';display:block;width:100%;height:100%;left:0;right:0;top:0;bottom:0;background:#0c0c0c;opacity:.5;z-index:4}.modal{overflow:auto;display:none;position:fixed;transform:translate3d(0,0,0);width:100%;max-height:90%;max-width:640px;background:var(--config-color-background-fade);z-index:1000;box-shadow:0 0 4px rgba(0,0,0,.25);padding:30px;left:50%;top:50%;transform:translate(-50%,-50%);border-radius:10px;box-sizing:border-box;text-align:left;white-space:initial;line-height:normal}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.modal{width:calc(100% - 20px)}}.modal.full{max-width:none;max-height:none;height:100%;border-radius:0;padding:80px 120px}.modal.full h1{font-weight:700}.modal.padding-small{padding:15px}.modal.height-tiny>form{height:100px}.modal.height-small>form{height:220px}.modal.width-small{max-width:400px}.modal.width-medium{max-width:500px}.modal.width-large{max-width:800px}.modal.open{display:block}.modalbutton.close{display:none}.modal.fill{height:95%;max-height:95%;max-width:75%}.modal h1,.modal h2{margin-bottom:25px;margin-top:0;font-size:20px;text-align:left}.modal h1,.modal h2,.modal h3,.modal h4,.modal h5,.modal h6{color:inherit!important;line-height:35px}.modal .main,.modal>form{position:relative;border-top:solid 1px var(--config-border-color);padding:30px 30px 0 30px;margin:0 -30px}.modal .main.strip,.modal>form.strip{border:none;padding:0;margin:0}.modal .separator{margin:20px -30px}.modal .bullets{padding-left:40px}.modal .bullets li{margin-bottom:30px!important}.modal .bullets li:before{position:absolute}.modal .info{margin:0 -30px;padding:20px 30px;background:var(--config-modal-note-background);color:var(--config-modal-note-color);border-top:solid 1px var(--config-modal-note-border);border-bottom:solid 1px var(--config-modal-note-border)}.modal .ide.strech{box-shadow:none;border-radius:0;margin:0 -30px}.modal button.close{width:30px;height:30px;line-height:30px;padding:0;margin:0;background:var(--config-color-normal);color:var(--config-color-background-fade);border-radius:50%}.modal .paging form{padding:0;margin:0;border-top:none}.modal.sticky-footer form footer{margin:-30px}.modal.sticky-footer footer{position:sticky;bottom:-30px;background:var(--config-color-background-fade-super);height:50px;z-index:1;padding:30px;box-shadow:0 0 1px rgba(0,0,0,.15)}.modal.sticky-footer footer form{display:inline-block}[data-views-current="0"] .scroll-to,[data-views-current="1"] .scroll-to{opacity:0!important}.scroll-to-bottom .scroll-to,.scroll-to-top .scroll-to{opacity:1}.scroll-to{opacity:0;display:block;width:40px;height:40px;line-height:40px;border-radius:50%;position:fixed;transform:translateZ(0);margin:30px;padding:0;bottom:0;font-size:18px;z-index:100000;transition:opacity .15s ease-in-out;right:0}.phases{list-style:none;margin:0;padding:0;position:relative}.phases li{display:none}.phases li li{display:block}.phases li.selected{display:block}.phases .number{display:none}.phases h2,.phases h3,.phases h4,.phases h5,.phases h6{margin:0 0 30px 0;text-align:inherit}.container{position:relative}.container .tabs{height:55px;line-height:55px;list-style:none;padding:0;margin-bottom:50px!important;margin-top:-55px;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.container .tabs:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.container .tabs .selected{font-weight:400;color:var(--config-color-focus);position:relative;opacity:1}.container .tabs .selected:after{content:"";display:block;height:2px;background:var(--config-color-focus);width:calc(100% + 6px);margin:0 -3px;position:absolute;bottom:0;border-radius:2px}.container .tabs .number{display:none}.container .tabs li{float:left;margin-right:50px;color:var(--config-color-focus);opacity:.9;cursor:pointer}.container .tabs li:focus{outline:0}@media only screen and (max-width:550px){.container .tabs li{margin-right:25px}}.container .icon{display:none}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.container .tabs{width:auto;overflow-x:scroll;overflow-y:hidden;white-space:nowrap}.container .tabs li{display:inline-block;float:none}}.ide{background-color:var(--config-prism-background);overflow:hidden;position:relative;z-index:1;box-shadow:0 2px 4px 0 rgba(50,50,93,.3);border-radius:10px;margin-bottom:30px}.ide *{font-family:'Source Code Pro',monospace}.ide[data-lang]::after{content:attr(data-lang-label);display:inline-block;background:#fff;color:#000;position:absolute;top:15px;padding:5px 10px;border-radius:15px;font-size:10px;right:10px;opacity:.95}.ide[data-lang=bash]::after{background:var(--config-language-bash);color:var(--config-language-bash-contrast)}.ide[data-lang=javascript]::after{background:var(--config-language-javascript);color:var(--config-language-javascript-contrast)}.ide[data-lang=web]::after{background:var(--config-language-web);color:var(--config-language-web-contrast)}.ide[data-lang=html]::after{background:var(--config-language-html);color:var(--config-language-html-contrast)}.ide[data-lang=php]::after{background:var(--config-language-php);color:var(--config-language-php-contrast)}.ide[data-lang=nodejs]::after{background:var(--config-language-nodejs);color:var(--config-language-nodejs-contrast)}.ide[data-lang=ruby]::after{background:var(--config-language-ruby);color:var(--config-language-ruby-contrast)}.ide[data-lang=python]::after{background:var(--config-language-python);color:var(--config-language-python-contrast)}.ide[data-lang=go]::after{background:var(--config-language-go);color:var(--config-language-go-contrast)}.ide[data-lang=dart]::after{background:var(--config-language-dart);color:var(--config-language-dart-contrast)}.ide[data-lang=flutter]::after{background:var(--config-language-flutter);color:var(--config-language-flutter-contrast)}.ide[data-lang=yaml]::after{background:var(--config-language-yaml);color:var(--config-language-yaml-contrast)}.ide .tag{color:inherit!important;background:0 0!important;padding:inherit!important;font-size:inherit!important;line-height:14px}.ide .copy{cursor:pointer;content:attr(data-lang);display:inline-block;background:#fff;color:#000;position:absolute;transform:translateX(-50%);bottom:-20px;padding:5px 10px;border-radius:15px;font-size:10px;font-style:normal;left:50%;opacity:0;transition:bottom .3s,opacity .3s;line-height:normal;font-family:Poppins,sans-serif}.ide .copy::before{padding-right:5px}.ide:hover .copy{transition:bottom .3s,opacity .3s;opacity:.9;bottom:16px}.ide pre{-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;color:#e6ebf1;font-weight:400;line-height:20px;font-size:13px;margin:0;padding:20px;padding-left:60px}.ide.light{box-shadow:0 2px 4px 0 rgba(50,50,93,.1);background-color:#fff}.ide.light pre{color:#414770}.ide.light .token.cdata,.ide.light .token.comment,.ide.light .token.doctype,.ide.light .token.prolog{color:#91a2b0}.ide.light .token.attr-name,.ide.light .token.builtin,.ide.light .token.char,.ide.light .token.inserted,.ide.light .token.selector,.ide.light .token.string{color:#149570}.ide.light .token.punctuation{color:#414770}.ide.light .language-css .token.string,.ide.light .style .token.string,.ide.light .token.entity,.ide.light .token.operator,.ide.light .token.url,.ide.light .token.variable{color:#414770}.ide.light .line-numbers .line-numbers-rows{background:#f2feef}.ide.light .line-numbers-rows>span:before{color:#5dc79e}.ide.light .token.keyword{color:#6772e4;font-weight:500}code[class*=language-],pre[class*=language-]{text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4}pre[class*=language-]{overflow:auto}:not(pre)>code[class*=language-]{padding:.1em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#6b7c93}.token.punctuation{color:#f8f8f2}.namespace{opacity:.7}.token.constant,.token.deleted,.token.property,.token.symbol,.token.tag{color:#f92672}.token.boolean,.token.number{color:#f79a59}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#3ecf8e}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url,.token.variable{color:#f8f8f2}.token.atrule,.token.attr-value,.token.class-name,.token.function{color:#45b2e8}.token.keyword{color:#7795f8}.token.important,.token.regex{color:#fd971f}.token.italic{font-style:italic}.token.entity{cursor:help}pre[class*=language-].line-numbers{position:relative;padding-left:60px;counter-reset:linenumber}pre[class*=language-].line-numbers>code{position:relative;white-space:inherit}.line-numbers .line-numbers-rows{background:var(--config-prism-numbers);position:absolute;pointer-events:none;top:-20px;bottom:-21px;padding:20px 0;font-size:100%;left:-60px;width:40px;letter-spacing:-1px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.line-numbers-rows>span{padding-right:5px;pointer-events:none;display:block;counter-increment:linenumber}.line-numbers-rows>span:before{content:counter(linenumber);color:#636365;display:block;padding-right:.8em;text-align:right}html{padding:0;margin:0;direction:ltr}body{margin:0;background:var(--config-console-background) no-repeat fixed;min-width:300px}ul{padding:0;margin:0}ul li{margin:0;list-style:none} \ No newline at end of file +.pull-start{float:left}.pull-end{float:right}img[src=""]{visibility:hidden;display:inline-block}:root{--config-width:910px;--config-width-xxl:1000px;--config-width-xl:910px;--config-width-large:700px;--config-width-medium:550px;--config-width-small:320px;--config-color-link:#1e849e;--config-color-background:#eceff1;--config-color-background-dark:#dfe2e4;--config-color-background-fade:#ffffff;--config-color-background-fade-super:#fdfdfd;--config-color-background-focus:#f5f5f5;--config-color-background-input:#ffffff;--config-color-placeholder:#868686;--config-color-tooltip-text:#dce8f5;--config-color-tooltip-background:#333333;--config-color-focus:#f02e65;--config-color-focus-fade:#fef8fa;--config-color-focus-hover:#ff729b;--config-color-focus-glow:#fce5ec;--config-color-focus-dark:#c52653;--config-color-normal:#40404c;--config-color-dark:#313131;--config-color-fade:#8f8f8f;--config-color-fade-light:#e2e2e2;--config-color-fade-super:#f1f3f5;--config-color-danger:#f53d3d;--config-color-success:#1bbf61;--config-color-warning:#ffed4d;--config-color-info:#386fd2;--config-border-color:#f5f5f5;--config-border-fade:#e0e3e4;--config-border-radius:10px;--config-prism-background:#373738;--config-prism-numbers:#39393c;--config-note-background:#f1fbff;--config-note-border:#5bceff;--config-warning-background:#fdf7d9;--config-warning-border:#f8e380;--config-social-twitter:#1da1f2;--config-social-github:#000000;--config-social-discord:#7189dc;--config-social-facebook:#4070b4;--config-language-bash:#2b2626;--config-language-bash-contrast:#fff;--config-language-javascript:#fff054;--config-language-javascript-contrast:#333232;--config-language-web:#fff054;--config-language-web-contrast:#333232;--config-language-html:#ff895b;--config-language-html-contrast:#ffffff;--config-language-yaml:#ca3333;--config-language-yaml-contrast:#ffffff;--config-language-php:#6182bb;--config-language-php-contrast:#ffffff;--config-language-nodejs:#8cc500;--config-language-nodejs-contrast:#ffffff;--config-language-ruby:#fc3f48;--config-language-ruby-contrast:#ffffff;--config-language-python:#3873a2;--config-language-python-contrast:#ffffff;--config-language-go:#00add8;--config-language-go-contrast:#ffffff;--config-language-dart:#035698;--config-language-dart-contrast:#ffffff;--config-language-flutter:#035698;--config-language-flutter-contrast:#ffffff;--config-modal-note-background:#f5fbff;--config-modal-note-border:#eaf2f7;--config-modal-note-color:#3b5d73;--config-switch-background:#e2e2e2;--config-console-background:#eceff1;--config-console-nav-start:#143650;--config-console-nav-end:#302839;--config-console-nav-border:#2a253a;--config-console-nav-switch-background:#ececec;--config-console-nav-switch-color:#868686;--config-console-nav-switch-arrow:url("data:image/svg+xml;utf8,")}:root .theme-dark{--config-color-background:#061F2F;--config-color-background-dark:#262d50;--config-color-background-fade:#1c223a;--config-color-background-fade-super:#1a1f35;--config-color-background-focus:#1a1f35;--config-color-background-input:#dce8f5;--config-color-tooltip-text:#061F2F;--config-color-tooltip-background:#dce8f5;--config-color-link:#4caedb;--config-color-placeholder:#9ea1af;--config-color-focus:#c7d8eb;--config-color-focus-fade:#1e233e;--config-color-focus-hover:#d3deea;--config-color-focus-glow:#d3deea;--config-color-focus-dark:#657586;--config-color-normal:#c7d8eb;--config-color-dark:#c7d8eb;--config-color-fade:#bec3e0;--config-color-fade-light:#181818;--config-color-fade-super:#262D50;--config-color-danger:#d84a4a;--config-color-success:#34b86d;--config-color-warning:#e0d56d;--config-color-info:#386fd2;--config-border-color:#262D50;--config-border-fade:#19203a;--config-prism-background:#1F253F;--config-prism-numbers:#1F253F;--config-note-background:#171e33;--config-note-border:#262D50;--config-warning-background:#1F253F;--config-warning-border:#262D50;--config-social-twitter:var(--config-color-normal);--config-social-github:var(--config-color-normal);--config-social-discord:var(--config-color-normal);--config-social-facebook:var(--config-color-normal);--config-language-bash:var(--config-color-normal);--config-language-bash-contrast:var(--config-color-background);--config-language-javascript:var(--config-color-normal);--config-language-javascript-contrast:var(--config-color-background);--config-language-web:var(--config-color-normal);--config-language-web-contrast:var(--config-color-background);--config-language-yaml:var(--config-color-normal);--config-language-yaml-contrast:var(--config-color-background);--config-language-html:var(--config-color-normal);--config-language-html-contrast:var(--config-color-background);--config-language-php:var(--config-color-normal);--config-language-php-contrast:var(--config-color-background);--config-language-nodejs:var(--config-color-normal);--config-language-nodejs-contrast:var(--config-color-background);--config-language-ruby:var(--config-color-normal);--config-language-ruby-contrast:var(--config-color-background);--config-language-python:var(--config-color-normal);--config-language-python-contrast:var(--config-color-background);--config-language-go:var(--config-color-normal);--config-language-go-contrast:var(--config-color-background);--config-language-dart:var(--config-color-normal);--config-language-dart-contrast:var(--config-color-background);--config-language-flutter:var(--config-color-normal);--config-language-flutter-contrast:var(--config-color-background);--config-modal-note-background:#15192b;--config-modal-note-border:#161b31;--config-modal-note-color:var(--config-color-normal);--config-switch-background:var(--config-color-normal);--config-console-background:#20263f;--config-console-nav-start:#1c2139;--config-console-nav-end:#151929;--config-console-nav-border:#171b30;--config-console-nav-switch-background:var(--config-color-focus);--config-console-nav-switch-color:var(--config-color-background);--config-console-nav-switch-arrow:url("data:image/svg+xml;utf8,")}.theme-light .force-light{display:block!important}.theme-dark .force-dark{display:block!important}.force-dark{display:none!important}.force-light{display:none!important}@font-face{font-family:Poppins;font-style:normal;font-weight:100;src:url(/fonts/poppins-v9-latin-100.eot);src:local('Poppins Thin'),local('Poppins-Thin'),url(/fonts/poppins-v9-latin-100.eot?#iefix) format('embedded-opentype'),url(/fonts/poppins-v9-latin-100.woff2) format('woff2'),url(/fonts/poppins-v9-latin-100.woff) format('woff'),url(/fonts/poppins-v9-latin-100.ttf) format('truetype'),url(/fonts/poppins-v9-latin-100.svg#Poppins) format('svg')}@font-face{font-family:Poppins;font-style:normal;font-weight:300;src:url(/fonts/poppins-v9-latin-300.eot);src:local('Poppins Light'),local('Poppins-Light'),url(/fonts/poppins-v9-latin-300.eot?#iefix) format('embedded-opentype'),url(/fonts/poppins-v9-latin-300.woff2) format('woff2'),url(/fonts/poppins-v9-latin-300.woff) format('woff'),url(/fonts/poppins-v9-latin-300.ttf) format('truetype'),url(/fonts/poppins-v9-latin-300.svg#Poppins) format('svg')}@font-face{font-family:Poppins;font-style:normal;font-weight:400;src:url(/fonts/poppins-v9-latin-regular.eot);src:local('Poppins Regular'),local('Poppins-Regular'),url(/fonts/poppins-v9-latin-regular.eot?#iefix) format('embedded-opentype'),url(/fonts/poppins-v9-latin-regular.woff2) format('woff2'),url(/fonts/poppins-v9-latin-regular.woff) format('woff'),url(/fonts/poppins-v9-latin-regular.ttf) format('truetype'),url(/fonts/poppins-v9-latin-regular.svg#Poppins) format('svg')}@font-face{font-family:Poppins;font-style:normal;font-weight:500;src:url(/fonts/poppins-v9-latin-500.eot);src:local('Poppins Medium'),local('Poppins-Medium'),url(/fonts/poppins-v9-latin-500.eot?#iefix) format('embedded-opentype'),url(/fonts/poppins-v9-latin-500.woff2) format('woff2'),url(/fonts/poppins-v9-latin-500.woff) format('woff'),url(/fonts/poppins-v9-latin-500.ttf) format('truetype'),url(/fonts/poppins-v9-latin-500.svg#Poppins) format('svg')}@font-face{font-family:Poppins;font-style:normal;font-weight:600;src:url(/fonts/poppins-v9-latin-600.eot);src:local('Poppins SemiBold'),local('Poppins-SemiBold'),url(/fonts/poppins-v9-latin-600.eot?#iefix) format('embedded-opentype'),url(/fonts/poppins-v9-latin-600.woff2) format('woff2'),url(/fonts/poppins-v9-latin-600.woff) format('woff'),url(/fonts/poppins-v9-latin-600.ttf) format('truetype'),url(/fonts/poppins-v9-latin-600.svg#Poppins) format('svg')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url(/fonts/source-code-pro-v11-latin-regular.eot);src:local('Source Code Pro Regular'),local('SourceCodePro-Regular'),url(/fonts/source-code-pro-v11-latin-regular.eot?#iefix) format('embedded-opentype'),url(/fonts/source-code-pro-v11-latin-regular.woff2) format('woff2'),url(/fonts/source-code-pro-v11-latin-regular.woff) format('woff'),url(/fonts/source-code-pro-v11-latin-regular.ttf) format('truetype'),url(/fonts/source-code-pro-v11-latin-regular.svg#SourceCodePro) format('svg')}.padding{padding:30px}.padding-top{padding-top:30px!important}.padding-top-large{padding-top:50px!important}.padding-top-xl{padding-top:80px!important}.padding-bottom{padding-bottom:30px!important}.padding-bottom-large{padding-bottom:50px!important}.padding-bottom-xl{padding-bottom:80px!important}.margin-end{margin-right:20px!important}.margin-start{margin-left:20px!important}.margin-end-small{margin-right:10px!important}.margin-start-small{margin-left:10px!important}.margin-end-large{margin-right:50px!important}.margin-start-large{margin-left:50px!important}.margin-end-no{margin-right:0!important}.margin-start-no{margin-left:0!important}.margin-end-negative{margin-right:-30px!important}.margin-start-negative{margin-left:-30px!important}.margin-end-negative-small{margin-right:-15px!important}.margin-start-negative-small{margin-left:-15px!important}.margin-end-negative-tiny{margin-right:-5px!important}.margin-start-negative-tiny{margin-left:-5px!important}.margin-top{margin-top:30px!important}.margin-bottom{margin-bottom:30px!important}.margin-top-no{margin-top:0!important}.margin-bottom-no{margin-bottom:0!important}.margin-top-xxl{margin-top:140px!important}.margin-top-xl{margin-top:80px!important}.margin-top-large{margin-top:50px!important}.margin-top-small{margin-top:15px!important}.margin-top-tiny{margin-top:5px!important}.margin-top-negative{margin-top:-30px!important}.margin-top-negative-tiny{margin-top:-5px!important}.margin-top-negative-small{margin-top:-15px!important}.margin-top-negative-large{margin-top:-50px!important}.margin-top-negative-xl{margin-top:-80px!important}.margin-top-negative-xxl{margin-top:-100px!important}.margin-top-negative-xxxl{margin-top:-150px!important}.margin-bottom-xxl{margin-bottom:140px!important}.margin-bottom-xl{margin-bottom:80px!important}.margin-bottom-large{margin-bottom:50px!important}.margin-bottom-small{margin-bottom:15px!important}.margin-bottom-tiny{margin-bottom:5px!important}.margin-bottom-negative{margin-bottom:-30px!important}.margin-bottom-negative-tiny{margin-bottom:-5px!important}.margin-bottom-negative-small{margin-bottom:-15px!important}.margin-bottom-negative-large{margin-bottom:-50px!important}.margin-bottom-negative-xl{margin-bottom:-80px!important}.margin-bottom-negative-xl{margin-bottom:-100px!important}.force-left,.ide{direction:ltr;text-align:left}.force-right{direction:rtl;text-align:right}.pull-left{float:left}.pull-right{float:right}.ratio-wide{height:0;overflow:hidden;padding-top:56%;position:relative;width:100%}.ratio-wide>*{position:absolute;top:0;left:0;width:100%;height:100%}.ratio-square{height:0;overflow:hidden;padding-top:56%;position:relative;width:100%}.ratio-square>*{position:absolute;top:0;left:0;width:100%;height:100%}.clear:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.phones-only{display:none}@media only screen and (max-width:550px){.phones-only{display:inherit!important}}.tablets-only{display:none}@media only screen and (min-width:551px) and (max-width:1198px){.tablets-only{display:inherit!important}}.desktops-only{display:none}@media only screen and (min-width:1199px){.desktops-only{display:inherit!important}}.phones-only-inline{display:none}@media only screen and (max-width:550px){.phones-only-inline{display:inline-block!important}}.tablets-only-inline{display:none}@media only screen and (min-width:551px) and (max-width:1198px){.tablets-only-inline{display:inline-block!important}}.desktops-only-inline{display:none}@media only screen and (min-width:1199px){.desktops-only-inline{display:inline-block!important}}*{font-family:Poppins,sans-serif;-webkit-font-smoothing:antialiased;font-weight:300}h1,h2,h3,h4,h5,h6{margin:0}h4,h5,h6{font-weight:400}.link,a{color:var(--config-color-link);text-decoration:none;border-left:2px solid transparent;border-right:2px solid transparent;transition:.2s;cursor:pointer}.link.disabled,a.disabled{opacity:.5}.link.tag:hover,a.tag:hover{opacity:.9}.link.danger,a.danger{color:var(--config-color-danger)}.link.link-animation-enabled,a.link-animation-enabled{display:inline-block}.link.link-animation-enabled:hover,a.link-animation-enabled:hover{transform:translateY(-2px)}.link-return-animation--start>i{display:inline-block;transition:.2s}.link-return-animation--start:hover>i{transform:translateX(-2px)}.link-return-animation--end>i{display:inline-block;transition:.2s}.link-return-animation--end:hover>i{transform:translateX(2px)}b,strong{font-weight:500}p{margin:0 0 20px 0;line-height:26px}small{font-size:16px;color:var(--config-color-fade)}.text-size-small{font-size:13px}.text-size-xs{font-size:10px}.text-size-normal{font-size:16px}.text-height-large{height:30px;line-height:30px}.text-height-small{line-height:13px}.text-one-liner{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text-bold{font-weight:400!important}.text-bold-large{font-weight:500!important}.text-bold-xl{font-weight:600!important}.text-danger{color:var(--config-color-danger)!important}.text-success{color:var(--config-color-success)!important}.text-upper{text-transform:uppercase}.text-warning{color:var(--config-color-warning)}.text-focus{color:var(--config-color-focus)}.text-fade{color:var(--config-color-fade)}.text-green{color:var(--config-color-success)}.text-red{color:var(--config-color-danger)}.text-info{color:var(--config-color-info)}.text-yellow{color:#ffe28b}.text-disclaimer{font-size:11px;color:var(--config-color-fade)}.text-fade-extra{color:var(--config-color-fade);opacity:.5}.text-line-high-large{line-height:30px}.text-line-high-xl{line-height:40px}.text-sign{margin:5px 0;font-size:25px;width:25px;height:25px;line-height:25px;display:inline-block}.text-align-center{text-align:center}.text-align-start{text-align:left}.text-align-end{text-align:right}.text-align-left{text-align:left}.text-align-right{text-align:right}.text-dir-ltr{direction:ltr;display:inline-block}.text-dir-rtl{direction:rtl;display:inline-block}.icon-dot-3:before{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-o-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}i[class*=' icon-']:before,i[class^=icon-]:before{display:inline;line-height:unset}table{width:calc(100% + 60px);border-collapse:collapse;margin:-30px;border-radius:10px;overflow:hidden;position:relative;table-layout:fixed}table.y-scroll{overflow-y:auto}table thead{box-shadow:0 0 2px rgba(0,0,0,.25);border-bottom:solid 1px var(--config-color-fade-super);font-size:14px}table.small{font-size:14px}table.open-end tbody tr:last-child{border-bottom:none;font-weight:700;background:#f7fbf7}table.full tbody td,table.full tbody th{vertical-align:top;white-space:normal;overflow:auto;line-height:24px;padding-top:20px;padding-bottom:20px;height:auto}table .avatar{width:30px;height:30px}table tr{border-bottom:solid 1px var(--config-color-fade-super)}table tr:last-child{border-bottom:none}table tr:nth-child(even){background:var(--config-color-background-fade-super)}table tr.selected{background:var(--config-note-background)}table tr.selected td,table tr.selected td span{font-weight:500}table th{text-align:left;font-weight:400}table th i{color:var(--config-color-fade);font-size:10px;display:inline-block;vertical-align:top;line-height:16px;padding:0 3px}table td,table th{height:65px;padding:0 15px;line-height:50px}table td:first-child,table th:first-child{padding-left:30px}table td:last-child,table th:last-child{padding-right:30px}table td,table th{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){table.vertical{border-top:solid 1px var(--config-color-fade-super);display:block;overflow:hidden;padding-top:12px}table.vertical .hide{display:none}table.vertical tbody,table.vertical td,table.vertical th,table.vertical thead,table.vertical tr{width:100%;display:block}table.vertical th,table.vertical tr{padding-top:12px;padding-bottom:12px}table.vertical th:first-child,table.vertical tr:first-child{padding-top:0}table.vertical td,table.vertical th{padding:5px 20px!important;text-overflow:ellipsis;white-space:normal;height:40px;line-height:40px;width:calc(100% - 40px)}table.vertical td:first-child,table.vertical td:last-child,table.vertical th:first-child,table.vertical th:last-child{padding:0 10px}table.vertical td:last-child,table.vertical th:last-child{padding-bottom:0}table.vertical td p,table.vertical th p{display:inline-block;width:calc(100% - 40px)}table.vertical td:not([data-title=""]):before{content:attr(data-title);margin-right:4px;font-weight:400}table.vertical thead{display:none}}.zone{max-width:var(--config-width-xl);margin:0 auto 40px auto}.zone.xxxl{max-width:calc(1400px - 100px)}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.zone.xxxl{max-width:100%}}.zone.xxl{max-width:var(--config-width-xxl)}.zone.xl{max-width:var(--config-width-xl)}.zone.large{max-width:var(--config-width-large)}.zone.medium{max-width:var(--config-width-medium)}.zone.small{max-width:var(--config-width-small)}.row{position:relative;margin:0 -50px;padding-left:50px}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.row{margin:0 -30px;padding-left:30px}}.row.force-ltr>.col{float:left}.row.force-rtl>.col{float:right}.row.force-reverse>.col{float:right}.row.wide{margin:0 -100px;padding-left:100px}.row.wide>.span-1{width:calc(8.33333333% * 1 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-2{width:calc(8.33333333% * 2 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-3{width:calc(8.33333333% * 3 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-4{width:calc(8.33333333% * 4 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-5{width:calc(8.33333333% * 5 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-6{width:calc(8.33333333% * 6 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-7{width:calc(8.33333333% * 7 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-8{width:calc(8.33333333% * 8 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-9{width:calc(8.33333333% * 9 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-10{width:calc(8.33333333% * 10 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-11{width:calc(8.33333333% * 11 - 100px);box-sizing:content-box;padding-right:100px}.row.wide>.span-12{width:calc(8.33333333% * 12 - 100px);box-sizing:content-box;padding-right:100px}.row.thin{margin:0 -20px;padding-left:20px}.row.thin>.span-1{width:calc(8.33333333% * 1 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-2{width:calc(8.33333333% * 2 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-3{width:calc(8.33333333% * 3 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-4{width:calc(8.33333333% * 4 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-5{width:calc(8.33333333% * 5 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-6{width:calc(8.33333333% * 6 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-7{width:calc(8.33333333% * 7 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-8{width:calc(8.33333333% * 8 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-9{width:calc(8.33333333% * 9 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-10{width:calc(8.33333333% * 10 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-11{width:calc(8.33333333% * 11 - 20px);box-sizing:content-box;padding-right:20px}.row.thin>.span-12{width:calc(8.33333333% * 12 - 20px);box-sizing:content-box;padding-right:20px}.row.modalize{margin:0 -30px;padding-left:30px}.row.modalize>.span-1{width:calc(8.33333333% * 1 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-2{width:calc(8.33333333% * 2 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-3{width:calc(8.33333333% * 3 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-4{width:calc(8.33333333% * 4 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-5{width:calc(8.33333333% * 5 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-6{width:calc(8.33333333% * 6 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-7{width:calc(8.33333333% * 7 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-8{width:calc(8.33333333% * 8 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-9{width:calc(8.33333333% * 9 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-10{width:calc(8.33333333% * 10 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-11{width:calc(8.33333333% * 11 - 30px);box-sizing:content-box;padding-right:30px}.row.modalize>.span-12{width:calc(8.33333333% * 12 - 30px);box-sizing:content-box;padding-right:30px}.row:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.row .col{float:left;box-sizing:border-box}.row .col.sticky-top{position:sticky;top:90px}.row .col.sticky-bottom{position:sticky;bottom:0}.row .span-1{width:calc(8.33333333% * 1 - 40px);box-sizing:content-box;padding-right:40px}.row .span-2{width:calc(8.33333333% * 2 - 40px);box-sizing:content-box;padding-right:40px}.row .span-3{width:calc(8.33333333% * 3 - 40px);box-sizing:content-box;padding-right:40px}.row .span-4{width:calc(8.33333333% * 4 - 40px);box-sizing:content-box;padding-right:40px}.row .span-5{width:calc(8.33333333% * 5 - 40px);box-sizing:content-box;padding-right:40px}.row .span-6{width:calc(8.33333333% * 6 - 40px);box-sizing:content-box;padding-right:40px}.row .span-7{width:calc(8.33333333% * 7 - 40px);box-sizing:content-box;padding-right:40px}.row .span-8{width:calc(8.33333333% * 8 - 40px);box-sizing:content-box;padding-right:40px}.row .span-9{width:calc(8.33333333% * 9 - 40px);box-sizing:content-box;padding-right:40px}.row .span-10{width:calc(8.33333333% * 10 - 40px);box-sizing:content-box;padding-right:40px}.row .span-11{width:calc(8.33333333% * 11 - 40px);box-sizing:content-box;padding-right:40px}.row .span-12{width:calc(8.33333333% * 12 - 40px);box-sizing:content-box;padding-right:40px}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.row.responsive{width:100%;padding:0;margin:0}.row.responsive>.span-1,.row.responsive>.span-10,.row.responsive>.span-11,.row.responsive>.span-12,.row.responsive>.span-2,.row.responsive>.span-3,.row.responsive>.span-4,.row.responsive>.span-5,.row.responsive>.span-6,.row.responsive>.span-7,.row.responsive>.span-8,.row.responsive>.span-9{width:calc(8.33333333% * 12 - 0px)!important;box-sizing:content-box!important;padding-right:0!important;width:100%!important}}.tiles{position:relative}.tiles:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.tiles>*{margin-right:50px!important;float:left;width:calc(33.3333% - 33.3333px)}.tiles>* .photo-title{width:calc(100% + 30px);height:15px;margin:-15px -15px 10px -15px;border-radius:10px 10px 0 0;background:var(--config-color-fade-super);border-bottom:solid 1px var(--config-color-fade-super)}.tiles>:nth-child(3n){margin-right:0!important}@media only screen and (min-width:551px) and (max-width:1198px){.tiles>li{width:calc(50% - 25px)}.tiles>li:nth-child(3n){margin-right:50px!important}.tiles>li:nth-child(2n){margin-right:0!important}}@media only screen and (max-width:550px){.tiles>li{width:100%;margin-right:0!important}}@font-face{font-family:fontello;src:url(data:application/octet-stream;base64,d09GRgABAAAAAFqcAA8AAAAAjUAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABWAAAADsAAABUIIslek9TLzIAAAGUAAAAQwAAAFY+UFR4Y21hcAAAAdgAAAMCAAAIVGsHIX1jdnQgAAAE3AAAABMAAAAgBzP+pGZwZ20AAATwAAAFkAAAC3CKkZBZZ2FzcAAACoAAAAAIAAAACAAAABBnbHlmAAAKiAAASOkAAGyevKUl9mhlYWQAAFN0AAAAMgAAADYauqkaaGhlYQAAU6gAAAAgAAAAJAgaBKBobXR4AABTyAAAANQAAAHAgvP/gWxvY2EAAFScAAAA4gAAAOKlpIsybWF4cAAAVYAAAAAgAAAAIAJcDRRuYW1lAABVoAAAAXQAAALNzZ0XGHBvc3QAAFcUAA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UZhOCMgPCM4GyEgIEYjR7ABKyNhOCFZsSsBFCstsEIssDUrLrErARQrLbBDLLA2KyEjICA8sAQjQiM4sSsBFCuwBEMusCsrLbBELLAAFSBHsAAjQrIAAQEVFBMusDEqLbBFLLAAFSBHsAAjQrIAAQEVFBMusDEqLbBGLLEAARQTsDIqLbBHLLA0Ki2wSCywABZFIyAuIEaKI2E4sSsBFCstsEkssAgjQrBIKy2wSiyyAABBKy2wSyyyAAFBKy2wTCyyAQBBKy2wTSyyAQFBKy2wTiyyAABCKy2wTyyyAAFCKy2wUCyyAQBCKy2wUSyyAQFCKy2wUiyyAAA+Ky2wUyyyAAE+Ky2wVCyyAQA+Ky2wVSyyAQE+Ky2wViyyAABAKy2wVyyyAAFAKy2wWCyyAQBAKy2wWSyyAQFAKy2wWiyyAABDKy2wWyyyAAFDKy2wXCyyAQBDKy2wXSyyAQFDKy2wXiyyAAA/Ky2wXyyyAAE/Ky2wYCyyAQA/Ky2wYSyyAQE/Ky2wYiywNysusSsBFCstsGMssDcrsDsrLbBkLLA3K7A8Ky2wZSywABawNyuwPSstsGYssDgrLrErARQrLbBnLLA4K7A7Ky2waCywOCuwPCstsGkssDgrsD0rLbBqLLA5Ky6xKwEUKy2wayywOSuwOystsGwssDkrsDwrLbBtLLA5K7A9Ky2wbiywOisusSsBFCstsG8ssDorsDsrLbBwLLA6K7A8Ky2wcSywOiuwPSstsHIsswkEAgNFWCEbIyFZQiuwCGWwAyRQeLABFTAtAEu4AMhSWLEBAY5ZsAG5CAAIAGNwsQAFQrIAAQAqsQAFQrMKAgEIKrEABUKzDgABCCqxAAZCugLAAAEACSqxAAdCugBAAAEACSqxAwBEsSQBiFFYsECIWLEDZESxJgGIUVi6CIAAAQRAiGNUWLEDAERZWVlZswwCAQwquAH/hbAEjbECAEQAAA==) format('truetype')}[class*=" icon-"]:before,[class^=icon-]:before{font-family:fontello;font-style:normal;font-weight:400;speak:never;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em}.icon-user:before{content:'\e800'}.icon-folder:before{content:'\e801'}.icon-list:before{content:'\e802'}.icon-login:before{content:'\e803'}.icon-cog:before{content:'\e804'}.icon-twitter:before{content:'\e805'}.icon-article-alt:before{content:'\e806'}.icon-cancel:before{content:'\e807'}.icon-home:before{content:'\e808'}.icon-down-dir:before{content:'\e809'}.icon-facebook:before{content:'\e80a'}.icon-asterisk:before{content:'\e80b'}.icon-upload:before{content:'\e80c'}.icon-stopwatch:before{content:'\e80d'}.icon-export:before{content:'\e80e'}.icon-heart:before{content:'\e80f'}.icon-plus:before{content:'\e810'}.icon-up-dir:before{content:'\e811'}.icon-menu:before{content:'\e812'}.icon-left-open:before{content:'\e813'}.icon-right-open:before{content:'\e814'}.icon-inbox:before{content:'\e815'}.icon-wrench:before{content:'\e816'}.icon-comment:before{content:'\e817'}.icon-stackoverflow:before{content:'\e818'}.icon-question:before{content:'\e819'}.icon-ok-circled:before{content:'\e81a'}.icon-warning:before{content:'\e81b'}.icon-mail:before{content:'\e81c'}.icon-link:before{content:'\e81d'}.icon-key-inv:before{content:'\e81e'}.icon-trash:before{content:'\e81f'}.icon-download:before{content:'\e820'}.icon-glasses:before{content:'\e821'}.icon-qrcode:before{content:'\e822'}.icon-shuffle:before{content:'\e823'}.icon-eye:before{content:'\e824'}.icon-lock:before{content:'\e825'}.icon-search:before{content:'\e826'}.icon-bell:before{content:'\e827'}.icon-users:before{content:'\e828'}.icon-location:before{content:'\e829'}.icon-briefcase:before{content:'\e82a'}.icon-instagram:before{content:'\e82b'}.icon-clock:before{content:'\e82c'}.icon-phone:before{content:'\e82d'}.icon-calendar:before{content:'\e82e'}.icon-print:before{content:'\e82f'}.icon-edit:before{content:'\e830'}.icon-bold:before{content:'\e831'}.icon-italic:before{content:'\e832'}.icon-rocket:before{content:'\e833'}.icon-whatsapp:before{content:'\e834'}.icon-dot-3:before{content:'\e835'}.icon-info-circled:before{content:'\e836'}.icon-videocam:before{content:'\e837'}.icon-quote-right:before{content:'\e838'}.icon-picture:before{content:'\e839'}.icon-palette:before{content:'\e83a'}.icon-lamp:before{content:'\e83b'}.icon-book-open:before{content:'\e83c'}.icon-ok:before{content:'\e83d'}.icon-chat-alt:before{content:'\e83e'}.icon-archive:before{content:'\e83f'}.icon-play:before{content:'\e840'}.icon-pause:before{content:'\e841'}.icon-down-open:before{content:'\e842'}.icon-up-open:before{content:'\e843'}.icon-minus:before{content:'\e844'}.icon-exchange:before{content:'\e845'}.icon-network:before{content:'\e846'}.icon-discord:before{content:'\e847'}.icon-moon-inv:before{content:'\e848'}.icon-sun-inv:before{content:'\e849'}.icon-cancel-circled:before{content:'\e84a'}.icon-lightning:before{content:'\e84b'}.icon-dev:before{content:'\e84c'}.icon-right-dir:before{content:'\e84d'}.icon-left-dir:before{content:'\e84e'}.icon-fire:before{content:'\e84f'}.icon-link-ext:before{content:'\f08e'}.icon-github-circled:before{content:'\f09b'}.icon-filter:before{content:'\f0b0'}.icon-docs:before{content:'\f0c5'}.icon-list-bullet:before{content:'\f0ca'}.icon-list-numbered:before{content:'\f0cb'}.icon-underline:before{content:'\f0cd'}.icon-sort:before{content:'\f0dc'}.icon-linkedin:before{content:'\f0e1'}.icon-smile:before{content:'\f118'}.icon-keyboard:before{content:'\f11c'}.icon-code:before{content:'\f121'}.icon-shield:before{content:'\f132'}.icon-angle-circled-left:before{content:'\f137'}.icon-angle-circled-right:before{content:'\f138'}.icon-bitbucket:before{content:'\f171'}.icon-windows:before{content:'\f17a'}.icon-dot-circled:before{content:'\f192'}.icon-wheelchair:before{content:'\f193'}.icon-bank:before{content:'\f19c'}.icon-google:before{content:'\f1a0'}.icon-building-filled:before{content:'\f1ad'}.icon-database:before{content:'\f1c0'}.icon-lifebuoy:before{content:'\f1cd'}.icon-header:before{content:'\f1dc'}.icon-binoculars:before{content:'\f1e5'}.icon-chart-area:before{content:'\f1fe'}.icon-pinterest:before{content:'\f231'}.icon-medium:before{content:'\f23a'}.icon-gitlab:before{content:'\f296'}.icon-telegram:before{content:'\f2c6'}.datalist-polyfill{list-style:none;display:none;background:#fff;box-shadow:0 2px 2px #999;position:absolute;left:0;top:0;margin:0;padding:0;max-height:300px;overflow-y:auto}.datalist-polyfill:empty{display:none!important}.datalist-polyfill>li{padding:3px;font:13px "Lucida Grande",Sans-Serif}.datalist-polyfill__active{background:#3875d7;color:#fff}date-input-polyfill{z-index:1000!important;max-width:320px!important;width:320px!important}date-input-polyfill .monthSelect-wrapper,date-input-polyfill .yearSelect-wrapper{height:50px;line-height:50px;padding:0;width:40%!important;margin-bottom:10px!important}date-input-polyfill .monthSelect-wrapper select,date-input-polyfill .yearSelect-wrapper select{padding:0 12px;height:50px;line-height:50px;box-sizing:border-box}date-input-polyfill .yearSelect-wrapper{width:35%!important}date-input-polyfill table{width:100%!important;max-width:100%!important;padding:0 12px 12px 12px!important;box-sizing:border-box;margin:0}date-input-polyfill table td:first-child,date-input-polyfill table td:last-child,date-input-polyfill table th:first-child,date-input-polyfill table th:last-child{width:32px!important;padding:4px!important}date-input-polyfill select{margin-bottom:10px}date-input-polyfill button{width:25%!important;height:50px!important;line-height:50px!important;margin-bottom:10px!important;background:inherit;position:relative;color:inherit;padding:inherit;box-sizing:inherit;border-radius:inherit;font-size:inherit;box-shadow:none;border:none;border-bottom:none!important}::placeholder{color:var(--config-color-placeholder);text-align:left}::-webkit-input-placeholder{text-align:left}input:-moz-placeholder{text-align:left}form.inline{display:inline-block}input,textarea{background:var(--config-color-background-input)}input[type=file],input[type=file]::-webkit-file-upload-button{cursor:pointer}.button,button{display:inline-block;background:var(--config-color-focus);border-radius:26px;border:none;color:var(--config-color-background-fade);height:52px;line-height:52px;padding:0 25px;cursor:pointer;font-size:16px;box-sizing:border-box;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.button:focus,.button:hover,button:focus,button:hover{background:var(--config-color-focus-hover)}.button.fly,button.fly{position:fixed;z-index:2;bottom:30px;right:30px}@media only screen and (max-width:550px){.button.fly,button.fly{right:15px}}.button.fill,button.fill{display:block;width:100%;text-align:center;padding:0 10px!important}.button.fill-aligned,button.fill-aligned{display:block;width:100%;text-align:left;padding:0 20px!important}.button.icon,button.icon{padding-right:30px!important}.button.icon-reduce,button.icon-reduce{padding-left:15px!important}.button.reverse,button.reverse{background:0 0;height:50px;line-height:48px;padding:0 23px;color:var(--config-color-focus);border:solid 2px var(--config-color-focus)}.button.reverse:focus,.button.reverse:hover,button.reverse:focus,button.reverse:hover{color:var(--config-color-focus-hover);border-color:var(--config-color-focus-hover)}.button.small,button.small{padding:0 15px;height:40px;line-height:36px;font-size:13px}.button.tick,button.tick{background:var(--config-color-fade-light);color:var(--config-color-dark);border-radius:20px;padding:0 10px;line-height:30px;height:30px;font-size:12px;display:inline-block}.button.tick.selected,button.tick.selected{background:var(--config-color-dark);color:var(--config-color-fade)}.button.round,button.round{width:52px;padding:0}.button.round.small,button.round.small{font-size:12px;width:30px;height:30px;line-height:30px}.button.white,button.white{background:#fff;color:var(--config-color-focus)}.button.white.reverse,button.white.reverse{color:#fff;background:0 0;border:solid 2px #fff}.button.trans,button.trans{background:0 0!important}.button.trans.reverse,button.trans.reverse{background:0 0!important}.button.success,button.success{background:var(--config-color-success)}.button.success.reverse,button.success.reverse{color:var(--config-color-success);background:#fff;border:solid 2px var(--config-color-success)}.button.danger,button.danger{background:var(--config-color-danger);color:#fff}.button.danger.reverse,button.danger.reverse{color:var(--config-color-danger);background:var(--config-color-background-fade);border:solid 2px var(--config-color-danger)}.button.dark,button.dark{background:var(--config-color-dark);color:var(--config-color-background-fade)}.button.dark.reverse,button.dark.reverse{color:var(--config-color-dark);background:var(--config-color-background-fade);border:solid 2px var(--config-color-dark)}.button .disabled,.button.disabled,.button:disabled,button .disabled,button.disabled,button:disabled{color:var(--config-color-normal);background:var(--config-color-background-dark);opacity:.6;cursor:default}.button.link,button.link{background:0 0;border-radius:0;color:var(--config-color-link);height:auto;line-height:normal;padding:0;padding-right:0!important}.button.link:focus,button.link:focus{box-shadow:inherit}.button.strip,button.strip{background:0 0;height:auto;line-height:16px;color:inherit;padding:0 5px}.button.facebook,button.facebook{color:#fff!important;background:#4070b4!important}.button.twitter,button.twitter{color:#fff!important;background:#56c2ea!important}.button.linkedin,button.linkedin{color:#fff!important;background:#0076b5!important}.button.github,button.github{color:#fff!important;background:#7e7c7c!important}.button:focus,button:focus{outline:0}label{margin-bottom:15px;display:block;line-height:normal}.input,input[type=date],input[type=datetime-local],input[type=email],input[type=file],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=url],select,textarea{-webkit-appearance:none;-moz-appearance:none;-webkit-transform:translateZ(0);box-sizing:content-box;color:#313131;height:40px;line-height:40px;border:solid 1px var(--config-color-fade-light);border-radius:10px;padding:5px 15px;font-size:16px;display:block;width:calc(100% - 32px);margin-bottom:30px}.input[type=file],input[type=date][type=file],input[type=datetime-local][type=file],input[type=email][type=file],input[type=file][type=file],input[type=number][type=file],input[type=password][type=file],input[type=search][type=file],input[type=tel][type=file],input[type=text][type=file],input[type=url][type=file],select[type=file],textarea[type=file]{line-height:0;padding:15px;height:auto}.input:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=email]:focus,input[type=file]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=url]:focus,select:focus,textarea:focus{outline:0;border-color:#b3d7fd}.input:disabled,input[type=date]:disabled,input[type=datetime-local]:disabled,input[type=email]:disabled,input[type=file]:disabled,input[type=number]:disabled,input[type=password]:disabled,input[type=search]:disabled,input[type=tel]:disabled,input[type=text]:disabled,input[type=url]:disabled,select:disabled,textarea:disabled{color:var(--config-color-normal);background:var(--config-color-fade-super);opacity:1!important}.input.strip,input[type=date].strip,input[type=datetime-local].strip,input[type=email].strip,input[type=file].strip,input[type=number].strip,input[type=password].strip,input[type=search].strip,input[type=tel].strip,input[type=text].strip,input[type=url].strip,select.strip,textarea.strip{border:none;border-radius:0;padding:5px 0;width:100%;background-color:transparent;background-position:right 2px top 50%;border-bottom:solid 1px var(--config-color-fade-light);color:var(--config-color-placeholder)}.input.strip:focus,input[type=date].strip:focus,input[type=datetime-local].strip:focus,input[type=email].strip:focus,input[type=file].strip:focus,input[type=number].strip:focus,input[type=password].strip:focus,input[type=search].strip:focus,input[type=tel].strip:focus,input[type=text].strip:focus,input[type=url].strip:focus,select.strip:focus,textarea.strip:focus{border-color:#b3d7fd}.input:-webkit-autofill::first-line,input[type=date]:-webkit-autofill::first-line,input[type=datetime-local]:-webkit-autofill::first-line,input[type=email]:-webkit-autofill::first-line,input[type=file]:-webkit-autofill::first-line,input[type=number]:-webkit-autofill::first-line,input[type=password]:-webkit-autofill::first-line,input[type=search]:-webkit-autofill::first-line,input[type=tel]:-webkit-autofill::first-line,input[type=text]:-webkit-autofill::first-line,input[type=url]:-webkit-autofill::first-line,select:-webkit-autofill::first-line,textarea:-webkit-autofill::first-line{font-weight:300;font-size:16px}input[type=email],input[type=url]{direction:ltr}input[type=email]::placeholder,input[type=url]::placeholder{text-align:left;direction:ltr}select{background:0 0;-webkit-appearance:none;background-image:var(--config-console-nav-switch-arrow);background-position:right 15px top 50%;background-repeat:no-repeat;background-color:var(--config-color-background-input);width:calc(100% - 62px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:45px}select:-webkit-autofill{background-image:url("data:image/svg+xml;utf8,")!important;background-position:100% 50%!important;background-repeat:no-repeat!important}input[type=search],input[type=search].strip{background:0 0;-webkit-appearance:none;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAdZJREFUWIXt1s2LjWEYBvDfnDMzFpNIamZIFrMiJYMyFmKhZKfOwoiFr2LFn2BByG6WVrKwMcjWxgoLIlKIUk6RrzAjZWZ8LO731FlwvB+PUbjq6X0X7/VeV/d9P9fz8IdRL8Hpw3x8w0xaOz9GNxq4gJeZcGs1cRab0fU7xLfgMSYzoT3YgNXYhIO4iM+4iTWphGs4jikcFSXvhEGczr4/UFW8C2N4jXUFudvwCYeqGNgnSr6yJH8rpkWLCqMfE9hdUryFE3iC3qLEk7ij+kT34Q32FiHV8Qr7K4q3cArXihCGxd5elMjARnzBvE4f1dreV+AtnicycC/7/7K8BhaIvqXCO3zFwrwGZtCT0EAtW9N5DTSxWGR/CizNns/yEgbFEK5NZGCnaEPHE7e9Ai9wA6OJDIzistgJubFdxHB/RfFVYgCHixJruI5x5dNwDm6J47sUhkTvjpUw0Y1zeOrXR3hHjOA9zmBuTs4Arog4/yhuUZWwHPdFMh7280BZgiP4ILJ/UuymqRQmejPxphiquzgvKnMJDzOxB9glZqiRiecykbfHdawX98EhcdxO4BGu4nYm2EJDzEKPSMIdYrBnFYUq8d/EP2di1gey3cS4ErflvxffASbhcakIINaMAAAAAElFTkSuQmCC);background-color:var(--config-color-background-input);background-position:left 15px top 50%;background-repeat:no-repeat;background-size:20px 20px;width:calc(100% - 60px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-left:45px}select[multiple]{min-height:75px;padding:5px 10px!important;padding-right:50px!important}select[multiple] option{padding:10px 4px;border-bottom:solid 1px #f1f1f1}select[multiple] option:last-child{border-bottom:none}textarea{min-height:75px;resize:vertical;line-height:32px;padding:5px 15px}textarea.tall{min-height:180px}fieldset{border:none;margin:0;padding:0}.counter{font-size:13px;text-align:right;color:var(--config-color-fade);margin-top:-20px;margin-bottom:20px}.file-preview{background:var(--config-color-background-input) url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAIElEQVQoU2NkYGAwZsAEZ9GFGIeIQix+wfQgyDODXSEAcUwGCrDSHgkAAAAASUVORK5CYII=)!important;border:solid 1px #e2e2e2;box-shadow:inset 0 0 3px #a0a0a0;border-radius:8px;width:calc(100% - 2px);max-height:180px;visibility:visible!important}.video-preview{padding-top:56%;position:relative;border-radius:10px;background:#e7e7e7;overflow:hidden;margin:0}.video-preview iframe{position:absolute;top:0;width:100%;height:100%;border:none}.map-preview{padding-top:50%;position:relative;margin-bottom:10px;border-radius:10px;background:#e7e7e7;overflow:hidden;box-shadow:0 0 30px rgba(218,218,218,.5)}.map-preview iframe{position:absolute;top:0;width:100%;height:100%;border:none}.tooltip{position:relative}.tooltip.large:hover:after{white-space:normal;width:280px}.tooltip.small:hover:after{white-space:normal;width:180px}.tooltip:hover:after{white-space:nowrap;background:var(--config-color-tooltip-background);border-radius:5px;bottom:26px;color:var(--config-color-tooltip-text);content:attr(data-tooltip);padding:5px 15px;position:absolute;font-size:13px;line-height:20px;z-index:98;left:20%;margin-left:-30px;word-break:break-word}.tooltip:hover:before{border:solid;border-color:var(--config-color-tooltip-background) transparent;border-width:6px 6px 0 6px;bottom:20px;content:"";position:absolute;z-index:99;left:5px}.tooltip.down:hover:after{top:26px;bottom:inherit}.tooltip.down:hover:before{top:20px;border-width:0 6px 6px 6px;bottom:inherit}.tag{display:inline-block;background:var(--config-color-fade-light);color:var(--config-color-fade);border-radius:12px;line-height:24px;padding:0 8px;font-size:12px;box-shadow:none!important;border:none;height:auto;width:auto;white-space:nowrap;text-overflow:ellipsis}.tag:hover{border:none}.tag.green{background:var(--config-color-success);color:#fff}.tag.red{background:var(--config-color-danger);color:#fff}.tag.yellow{background:#ffe28b;color:#494949}.tag.focus{background:var(--config-color-focus);color:#fff}.tag.dark{background:var(--config-color-dark);color:#e7e7e7}.tag.blue{background:var(--config-color-info);color:#fff}.tag.link{background:var(--config-color-link);color:#fff}input[type=checkbox],input[type=radio]{width:26px;height:16px;position:relative;-webkit-appearance:none;border-radius:0;border:none;background:0 0;vertical-align:middle;margin:0}input[type=checkbox]:after,input[type=radio]:after{content:"";display:block;width:20px;height:20px;background:var(--config-color-background-fade);top:-5px;border-radius:50%;position:absolute;border:solid 3px var(--config-color-focus);vertical-align:middle}input[type=checkbox]:checked:after,input[type=radio]:checked:after{text-align:center;font-family:fontello;content:'\e83d';font-size:16px;line-height:20px;color:var(--config-color-background-fade);background:var(--config-color-focus)}input[type=checkbox][type=radio]:checked:after,input[type=radio][type=radio]:checked:after{content:'';display:block;width:10px;height:10px;border-radius:50%;background:var(--config-color-background-fade);border:solid 8px var(--config-color-focus)}input[type=checkbox]:focus,input[type=radio]:focus{outline:0}input[type=checkbox]:focus:after,input[type=checkbox]:hover:after,input[type=radio]:focus:after,input[type=radio]:hover:after{outline:0;border-color:#000}input[type=checkbox]:checked:focus:after,input[type=checkbox]:checked:hover:after,input[type=radio]:checked:focus:after,input[type=radio]:checked:hover:after{border-color:var(--config-color-focus)}.input-copy{position:relative}.input-copy input,.input-copy textarea{padding-right:65px;width:calc(100% - 82px);resize:none}.input-copy .copy{position:absolute;top:0;right:0;border-left:solid 1px var(--config-color-fade-light);height:calc(100% - 2px);width:50px;line-height:50px;text-align:center;background:var(--config-color-background-focus);margin:1px;border-radius:0 10px 10px 0}.paging{color:var(--config-color-fade);padding:5px 15px;font-size:12px}.paging form{display:inline-block}.paging button:disabled{color:var(--config-color-background-fade);opacity:.6}.blue-snap iframe{-webkit-appearance:none;-moz-appearance:none;-webkit-transform:translateZ(0);box-sizing:content-box;color:#313131;height:40px;line-height:40px;border:solid 1px var(--config-color-fade-light);border-radius:10px;padding:5px 15px;font-size:16px;display:block;width:calc(100% - 32px);margin-bottom:30px;float:none!important;height:40px!important;width:calc(100% - 32px)!important;border:solid 1px #e2e2e2!important;background:0 0!important;position:static!important}.blue-snap iframe[type=file]{line-height:0;padding:15px;height:auto}.blue-snap iframe:focus{outline:0;border-color:#b3d7fd}.blue-snap iframe:disabled{color:var(--config-color-normal);background:var(--config-color-fade-super);opacity:1!important}.blue-snap iframe.strip{border:none;border-radius:0;padding:5px 0;width:100%;background-color:transparent;background-position:right 2px top 50%;border-bottom:solid 1px var(--config-color-fade-light);color:var(--config-color-placeholder)}.blue-snap iframe.strip:focus{border-color:#b3d7fd}.blue-snap iframe:-webkit-autofill::first-line{font-weight:300;font-size:16px}.blue-snap .error{font-size:12px;margin-top:-25px;color:var(--config-color-danger);height:40px;padding-left:2px}.pell{height:auto;padding-bottom:0;margin-bottom:0;padding-top:0;background:var(--config-color-background-input);line-height:normal!important;position:relative}.pell.hide{padding:0!important;height:1px;min-height:1px;max-height:1px;border:none;box-shadow:none;margin-bottom:20px;opacity:0}.pell [contenteditable=true]:empty:before{content:attr(placeholder);display:block;color:var(--config-color-placeholder)}.pell .pell-actionbar{border-bottom:solid 1px var(--config-color-fade-light);margin:0 -15px 15px -15px;padding:10px 15px;position:sticky;top:70px;background:var(--config-color-background-input);border-radius:10px 10px 0 0}.pell .pell-content{min-height:100px;display:block;padding:10px;margin:-10px;cursor:text}.pell .pell-content:focus{outline:0}.pell button{background:inherit;color:inherit;margin:0;padding:0;padding-right:15px;height:40px;line-height:40px;box-shadow:none;cursor:pointer;font-size:13px;border-radius:0}.pell button.pell-button-selected,.pell button:focus,.pell button:hover{color:var(--config-color-link)}.pell h1,.pell h2,.pell h3,.pell h4,.pell h5,.pell h6{text-align:inherit;margin-bottom:30px}.pell b,.pell strong{font-weight:700}.pell ol,.pell ul{margin:0 0 20px 0}.pell ol li,.pell ul li{display:list-item!important;list-style:inherit;list-style-position:inside!important;margin:0 20px 2px 20px}.pell ol li p,.pell ul li p{margin:0;display:inline}.pell ol li{list-style:decimal}.pell ol li::before{content:'';display:none}label.switch{line-height:42px}.switch,input[type=checkbox].button.switch,input[type=checkbox].switch{width:52px;height:32px;line-height:32px;border-radius:21px;background:var(--config-color-fade);display:inline-block;margin:0;padding:5px;padding-left:5px;padding-right:30px}.switch.on,.switch:checked,input[type=checkbox].button.switch.on,input[type=checkbox].button.switch:checked,input[type=checkbox].switch.on,input[type=checkbox].switch:checked{background-color:var(--config-color-success);padding-left:25px;padding-right:5px}.switch.on:focus,.switch.on:hover,.switch:checked:focus,.switch:checked:hover,input[type=checkbox].button.switch.on:focus,input[type=checkbox].button.switch.on:hover,input[type=checkbox].button.switch:checked:focus,input[type=checkbox].button.switch:checked:hover,input[type=checkbox].switch.on:focus,input[type=checkbox].switch.on:hover,input[type=checkbox].switch:checked:focus,input[type=checkbox].switch:checked:hover{background:var(--config-color-success)}.switch:focus,.switch:hover,input[type=checkbox].button.switch:focus,input[type=checkbox].button.switch:hover,input[type=checkbox].switch:focus,input[type=checkbox].switch:hover{background:var(--config-color-fade)}.switch:focus:after,.switch:hover:after,input[type=checkbox].button.switch:focus:after,input[type=checkbox].button.switch:hover:after,input[type=checkbox].switch:focus:after,input[type=checkbox].switch:hover:after{background:#fff}.switch:after,input[type=checkbox].button.switch:after,input[type=checkbox].switch:after{content:"";display:block;width:22px;height:22px;background:#fff;border-radius:50%;border:none;position:static;top:0}.password-meter{margin:-41px 10px 30px 10px;height:2px;background:0 0;max-width:100%;z-index:2;position:relative}.password-meter.weak{background:var(--config-color-danger)}.password-meter.medium{background:var(--config-color-success)}.password-meter.strong{background:var(--config-color-success)}.color-input:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.color-input .color-preview{width:53px;height:53px;float:left;margin-right:10px;background:#000;border-radius:10px;box-shadow:inset 0 0 3px #a0a0a0;position:relative}.color-input .color-preview input{opacity:0;position:absolute;top:0;bottom:0;left:0;right:0;width:100%;height:100%;cursor:pointer}.color-input input{text-transform:uppercase;float:left;width:calc(100% - 95px)}.grecaptcha-badge{box-shadow:none!important;border-radius:10px!important;overflow:hidden!important;background:#4d92df!important;bottom:25px}.grecaptcha-badge:hover{width:256px!important}.back{font-size:15px;line-height:24px;height:24px;margin-left:-15px;margin-top:-25px;margin-bottom:20px}.back span{font-weight:inherit!important}@media only screen and (max-width:550px){.back{margin-left:-5px}}hr{height:1px;background:var(--config-border-color)!important;border:none}hr.fade{opacity:.7}.upload{position:relative}.upload:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.upload input{position:absolute;top:0;left:0;opacity:0;cursor:pointer}.upload.single .preview{height:0;position:relative;padding-top:100%;width:100%;margin-bottom:15px!important}.upload.single .preview li{position:absolute;top:0;width:calc(100% - 20px);height:calc(100% - 20px);margin-right:0!important;margin-bottom:0!important}.upload .button{float:left;margin-right:10px!important}.upload .button.disabled,.upload .button.disabled:hover{background:0 0;color:inherit;border-color:inherit}.upload .count{float:left;line-height:52px}.upload .progress{background:var(--config-color-success);height:6px;border-radius:3px;margin-bottom:15px!important}.upload .preview:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.upload .preview li{float:left;margin-right:20px!important;margin-bottom:15px!important;background:var(--config-color-background-fade-super);width:150px;height:150px;line-height:148px;text-align:center;border-radius:20px;overflow:hidden;position:relative;cursor:pointer;border:solid 1px var(--config-color-background-dark)}.upload .preview li:hover:before{background:var(--config-color-focus)}.upload .preview li:before{content:'\e807';font-family:fontello;font-size:12px;position:absolute;width:20px;height:20px;display:block;top:8px;right:8px;text-align:center;line-height:20px;vertical-align:middle;border-radius:50%;background:#484848;color:#fff;z-index:1}.upload .preview li img{vertical-align:middle;max-height:150px;max-width:150px;-webkit-filter:drop-shadow(0 0 6px rgba(0, 0, 0, .3));filter:drop-shadow(0 0 1px rgba(0, 0, 0, .3))}.upload.wide .preview li{height:0;width:100%;position:relative;padding-top:30.547%;background:#e7e7e7;border-radius:10px;overflow:hidden;border:solid 1px #f9f9f9;margin:0}.upload.wide .preview li img{border-radius:10px;position:absolute;top:0;width:100%;display:block;opacity:1;max-width:inherit;max-height:inherit}ol{list-style:none;counter-reset:x-counter;padding:0}ol li{counter-increment:x-counter;line-height:30px;margin-bottom:30px;margin-left:45px}ol li::before{display:inline-block;content:counter(x-counter);color:var(--config-color-background-fade);background:var(--config-color-focus);border:solid 2px var(--config-color-focus);margin-right:15px;margin-left:-45px;width:26px;height:26px;border-radius:50%;text-align:center;line-height:26px}.required{color:var(--config-color-danger);font-size:8px;position:relative;top:-8px}.drop-list{position:relative;outline:0}.drop-list.open ul{display:block}.drop-list ul{position:relative;background:var(--config-color-background-fade);border-radius:10px;box-shadow:0 0 3px rgba(0,0,0,.05);padding:30px;display:block;border-bottom:none;box-shadow:0 0 6px rgba(0,0,0,.1);display:none;position:absolute;bottom:calc(100% + 10px);z-index:2;padding:0;left:-10px;max-width:280px;min-width:240px}.drop-list ul.padding-small{padding:15px}.drop-list ul.y-scroll{overflow-y:auto}.drop-list ul.danger{background:var(--config-color-danger);color:#fff}.drop-list ul.danger .box{color:var(--config-color-normal);background:var(--config-color-background-fade)}.drop-list ul.danger>.button,.drop-list ul.danger>button{background:#fff;color:var(--config-color-danger)}.drop-list ul.note{background:var(--config-note-background)}.drop-list ul.focus{background:var(--config-color-focus);color:var(--config-color-background-fade)}.drop-list ul.focus .button,.drop-list ul.focus button{background:var(--config-color-background-fade);color:var(--config-color-focus)}.drop-list ul.line{background:0 0;border:solid 1px var(--config-color-background-dark);box-shadow:none}.drop-list ul.warning{background:var(--config-color-success);color:#2d2d2d}.drop-list ul.warning .button,.drop-list ul.warning button{background:rgba(45,45,45,.8);color:var(--config-color-success)}.drop-list ul .tabs{border-bottom:solid 1px var(--config-border-color);margin:0 -30px;padding:0 30px!important}.drop-list ul>footer{margin:0 -30px -30px -30px;padding:15px 30px;background:var(--config-color-background-fade);border:solid 1px var(--config-border-color);border-radius:0 0 10px 10px}.drop-list ul hr{height:1px;background:var(--config-console-background);border:none;margin:30px -30px}.drop-list ul .label{position:absolute;top:10px;z-index:2;right:10px}.drop-list ul.fade-bottom{position:relative;overflow:hidden}.drop-list ul.fade-bottom:after{content:"";position:absolute;display:block;bottom:15px;width:100%;background:#000;background:linear-gradient(180deg,rgba(0,0,0,0) 0,var(--config-color-background-fade) 80%);height:100px;margin:0 -15px}.drop-list ul .header{position:static;height:40px;padding:20px 30px 20px 30px;margin-bottom:30px;margin:-30px -30px 20px -30px;background:var(--config-color-background-fade);border-bottom:solid 1px #efefef}.drop-list ul ul.numbers>li{position:relative;margin-left:30px;margin-right:50px}.drop-list ul ul.numbers>li hr{margin-left:-60px;margin-right:-80px}.drop-list ul ul.numbers>li .settings{position:absolute;top:3px;right:-50px}.drop-list ul ul.numbers>li::after{display:block;width:25px;height:25px;line-height:25px;font-size:13px;font-weight:500;border-radius:50%;background:var(--config-color-focus);color:var(--config-color-background);counter-increment:section;content:counter(section);text-align:center;position:absolute;top:3px;left:-45px}.drop-list ul .scroll{margin:0 -30px;overflow-y:scroll}.drop-list ul .scroll table{width:100%;margin:0}.drop-list ul ul.sortable{counter-reset:section}.drop-list ul ul.sortable>li [data-move-down].round,.drop-list ul ul.sortable>li [data-move-up].round,.drop-list ul ul.sortable>li [data-remove].round{background:var(--config-color-focus);color:var(--config-color-background-fade);width:25px;height:25px;line-height:25px;display:inline-block;text-align:center;padding:0;margin-right:5px}.drop-list ul ul.sortable>li [data-move-down].round:disabled,.drop-list ul ul.sortable>li [data-move-up].round:disabled,.drop-list ul ul.sortable>li [data-remove].round:disabled{display:none}.drop-list ul ul.sortable>li:first-child [data-move-up]{display:none}.drop-list ul ul.sortable>li:first-child [data-move-up]:disabled{display:inline-block;background:var(--config-color-background)}.drop-list ul ul.sortable>li:last-child [data-move-down]{display:none}.drop-list ul ul.sortable>li:last-child [data-move-down]:disabled{display:inline-block;background:var(--config-color-background)}.drop-list ul .toggle{position:relative;border-top:1px solid var(--config-console-background);border-bottom:1px solid var(--config-console-background);margin:0 -30px;padding:30px 30px 0 30px;height:65px;overflow:hidden}.drop-list ul .toggle.list{border-bottom:none}.drop-list ul .toggle.sorts button.ls-ui-open{width:calc(100% - 100px)}.drop-list ul .toggle button.ls-ui-open{right:0;position:absolute;top:0;width:100%;height:95px;background:0 0;opacity:.5;border-radius:0}.drop-list ul .toggle .icon-minus,.drop-list ul .toggle .icon-up-open{display:none}.drop-list ul .toggle .content{display:none}.drop-list ul .toggle.open{height:auto}.drop-list ul .toggle.open .icon-minus,.drop-list ul .toggle.open .icon-up-open{display:block}.drop-list ul .toggle.open .icon-down-open,.drop-list ul .toggle.open .icon-plus{display:none}.drop-list ul .toggle.open .content{display:block}.drop-list ul .list li{border-bottom:solid 2px var(--config-border-color);margin:0 -30px 30px -30px;padding:0 30px 30px 30px}.drop-list ul .list li:last-child{padding-bottom:0;margin-bottom:0;border-bottom:none}@media only screen and (max-width:550px){.drop-list ul .list li .actions{float:none}}.drop-list ul .list li .avatar{display:block}.drop-list ul .list li .avatar.inline{display:inline-block}.drop-list ul.new{text-align:center}.drop-list ul.new i{font-size:80px;line-height:80px;font-family:Poppins,sans-serif;font-style:normal;font-weight:300}.drop-list ul.new b{margin-top:20px;display:block}.drop-list ul .info{margin:0 -30px;padding:20px 30px;background:var(--config-modal-note-background);color:var(--config-modal-note-color);border-top:solid 1px var(--config-modal-note-border);border-bottom:solid 1px var(--config-modal-note-border)}.drop-list ul .info hr{background:var(--config-modal-note-border)!important}.drop-list ul .table-wrap{margin:0 -30px;overflow-y:scroll}.drop-list ul .table-wrap table{margin:0}.drop-list ul:before{border:solid;border-color:var(--config-color-background-fade) transparent;border-width:8px 8px 0 8px;bottom:-8px;content:"";position:absolute;z-index:99;left:30px}.drop-list ul.arrow-end:before{right:30px;left:unset}.drop-list ul li{border-bottom:solid 1px var(--config-color-fade-super);margin:0;padding:0}.drop-list ul li:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.drop-list ul li:first-child{border-radius:10px 10px 0 0}.drop-list ul li:last-child{border-radius:0 0 10px 10px}.drop-list ul li:hover{background:var(--config-color-fade-super)}.drop-list ul li:first-child:hover,.drop-list ul li:last-child:hover{border-color:transparent}.drop-list ul li .link,.drop-list ul li a,.drop-list ul li button.link{display:block;vertical-align:middle;height:auto;line-height:30px;display:inline-block;padding:10px 15px!important;color:inherit;font-size:14px;border:none;cursor:pointer;width:calc(100% - 30px);text-align:left;box-sizing:content-box}.drop-list ul li.disabled .link:hover,.drop-list ul li.disabled a:hover{background:0 0}.drop-list ul li .avatar{width:30px;height:30px;margin-right:10px;float:left}.drop-list ul li:last-child{border-bottom:none}.drop-list.bottom ul{bottom:auto;margin-top:-2px}.drop-list.bottom ul:before{bottom:auto;top:-8px;border-width:0 8px 8px 8px}.drop-list.end ul{right:-10px;left:auto}.disabled{opacity:.2;cursor:default}.disabled .button,.disabled .link,.disabled a,.disabled button{cursor:default!important}.disabled .button:hover,.disabled .link:hover,.disabled a:hover,.disabled button:hover{background:0 0}.tags{-webkit-appearance:none;-moz-appearance:none;-webkit-transform:translateZ(0);box-sizing:content-box;color:#313131;height:40px;line-height:40px;border:solid 1px var(--config-color-fade-light);border-radius:10px;padding:5px 15px;font-size:16px;display:block;width:calc(100% - 32px);margin-bottom:30px;background:var(--config-color-background-input);min-height:42px;height:auto;cursor:text}.tags[type=file]{line-height:0;padding:15px;height:auto}.tags:focus{outline:0;border-color:#b3d7fd}.tags:disabled{color:var(--config-color-normal);background:var(--config-color-fade-super);opacity:1!important}.tags.strip{border:none;border-radius:0;padding:5px 0;width:100%;background-color:transparent;background-position:right 2px top 50%;border-bottom:solid 1px var(--config-color-fade-light);color:var(--config-color-placeholder)}.tags.strip:focus{border-color:#b3d7fd}.tags:-webkit-autofill::first-line{font-weight:300;font-size:16px}.tags .add{display:inline-block!important;border:none;padding:0;width:auto;margin:0;max-width:100%;min-width:200px}.tags ul.tags-list{display:inline;white-space:pre-line}.tags ul.tags-list li{display:inline-block!important;margin-right:10px;font-size:16px;padding:5px 10px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.tags ul.tags-list li::before{float:right;content:'\e807';font-family:fontello;font-style:normal;display:inline-block;text-align:center;line-height:16px;width:16px;height:16px;font-size:12px;background:#000;color:#fff;border-radius:50%;margin-top:4px;margin-bottom:4px;margin-left:6px;margin-right:0}.switch-theme{background:var(--config-switch-background);border-radius:19px;height:26px;width:44px;margin:9px 0}.switch-theme button{padding:3px;display:block;background:0 0;height:26px;width:100%}.switch-theme i{background:var(--config-color-background-fade);border-radius:50%;height:18px;width:18px;line-height:18px;font-size:12px;padding:0;margin:0;color:var(--config-color-fade)}.switch-theme i.force-light{float:right}.switch-theme i.force-dark{float:left}.dot{width:20px;height:20px;background:var(--config-color-fade);border-radius:50%;display:inline-block;vertical-align:middle;margin:0!important;padding:0!important}.dot.danger{background:var(--config-color-danger)!important}.dot.success{background:var(--config-color-success)!important}.dot.warning{background:var(--config-color-warning)!important}.dot.info{background:var(--config-color-info)!important}.console{width:100%;padding:0;overscroll-behavior:none}.console body{position:relative;width:calc(100% - 320px);padding-top:70px;padding-bottom:0;padding-right:50px;padding-left:270px;margin:0;color:var(--config-color-normal);background:var(--config-console-background)}.console body .project-only{display:none!important}.console body.show-nav .project-only{display:inline-block!important}.console body.hide-nav{padding-left:50px;width:calc(100% - 100px)}.console body.hide-nav header{width:calc(100% - 50px)}.console body.hide-nav header .logo{display:inline-block}.console body.hide-nav .console-back{display:block}.console body.hide-nav .console-index{display:none}.console body.hide-nav .account{display:none}.console body.index .console-back{display:none}.console body.index .console-index{display:block}.console body.index .account{display:block}.console body .console-index{display:block}.console body .console-back{display:none}.console main{min-height:480px}.console header{position:fixed;top:0;width:calc(100% - 280px);height:40px;line-height:40px;padding:15px 30px;background:var(--config-color-background-fade);box-shadow:0 0 2px rgba(0,0,0,.1);margin:0 -50px;z-index:2;font-size:14px}.console header .logo{display:none;border:none}.console header .logo:hover{border:none;opacity:.8}.console header .logo img{height:26px;margin:7px 0}.console header .setup-new{width:40px;height:40px;line-height:40px}.console header .list{width:240px}.console header .list select{height:40px;line-height:40px;padding-top:0;padding-bottom:0;border:none;border-radius:26px;background-color:var(--config-console-nav-switch-background);color:var(--config-console-nav-switch-color)}.console header .account{margin-left:25px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.console header .switch-theme{margin:2px 0}.console header .avatar{height:40px;width:40px}.console header .account-button{background:0 0;position:absolute;width:100%;height:40px;border-radius:0;z-index:1}.console header .notifications{position:relative;font-size:20px}.console header .notifications a{color:#1b3445}.console header .notifications:after{position:absolute;content:"";display:block;background:var(--config-color-danger);width:8px;height:8px;border-radius:50%;top:3px;right:3px}.console header nav{background:#1b3445;background:linear-gradient(var(--config-console-nav-start),var(--config-console-nav-end));color:#788c99;position:fixed;height:100%;width:220px;top:0;left:0}.console header nav .logo{height:39px;padding:15px 20px;display:block}.console header nav .logo img{display:inline-block;margin-top:7px;margin-bottom:14px}.console header nav .logo svg g{fill:var(--config-color-focus)}.console header nav .icon{display:block;border:none;margin:18px 10px 50px 10px}.console header nav .icon img{display:block}.console header nav .icon:hover{border-bottom:none}.console header nav .icon:hover svg g{fill:var(--config-color-focus)}.console header nav .container{overflow:auto;height:calc(100% - 133px);width:100%}.console header nav .project-box{padding:20px;text-align:center;display:block;border:none;line-height:100px;height:100px}.console header nav .project-box img{max-height:80px;max-width:80%;display:inline-block;vertical-align:middle}.console header nav .project{display:block;padding:85px 25px 20px 25px;color:#788c99;position:relative;border:none;height:20px}.console header nav .project:hover{border-bottom:none}.console header nav .project .name{height:20px;line-height:20px;margin:0;padding:0;display:inline-block;max-width:100%}.console header nav .project .arrow{display:block;position:absolute;right:5px;top:10px;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #788c99;transform:rotate(225deg)}.console header nav .project img{position:absolute;bottom:40px;display:block;margin-bottom:10px;max-height:35px;max-width:40%}.console header nav .subtitle{padding:0 30px;display:block;font-size:12px;font-weight:300}.console header nav .links{margin-bottom:15px!important}.console header nav .links.top{border:none;padding-bottom:0;margin-bottom:5px!important}.console header nav .links.bottom{position:absolute;bottom:0;left:0;right:0;padding-bottom:0;border:none;margin-bottom:0!important;box-shadow:0 0 10px rgba(0,0,0,.1)}.console header nav .links.bottom a{border-top:solid 1px var(--config-console-nav-border);border-bottom:none}.console header nav .links .sub{display:inline-block;border:none;width:25px;height:25px;line-height:25px;border-radius:50%;padding:0;background:var(--config-color-focus);color:#fff;text-align:center;font-size:12px;margin:18px}.console header nav .links .sub i{width:auto;margin:0}.console header nav .links .sub:hover{border:none}.console header nav .links a{padding:8px 20px;border:none;display:block;color:#87a5b9;font-weight:400;border-left:solid 5px transparent;font-size:13px}.console header nav .links a i{margin-right:8px;width:22px;display:inline-block}.console header nav .links a.selected,.console header nav .links a:hover{color:#e4e4e4}.console header nav:after{content:'';display:block;position:absolute;background:#302839;height:100px;width:100%;bottom:-100px}.console>footer{width:calc(100% + 100px);margin:0 -50px;box-sizing:border-box;background:0 0;padding-right:30px;padding-left:30px}.console>footer ul{float:none;text-align:center}.console>footer ul li{float:none;display:inline-block}.console .projects{position:relative}.console .projects:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.console .projects li{float:left;margin-right:50px;margin-bottom:50px;width:270px}.console .projects li:nth-child(3n){margin-right:0}.console .dashboard{padding:20px;overflow:hidden;position:relative;z-index:1;margin-bottom:2px}.console .dashboard .chart{width:80%}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.console .dashboard .chart{width:100%}}.console .dashboard hr{margin:20px -25px;height:2px;background:var(--config-console-background)}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.console .dashboard hr{height:3px}}.console .dashboard footer{margin:-20px;padding:20px;background:#fcfeff;border:none;color:var(--config-color-link)}.console .dashboard .col{position:relative}.console .dashboard .col:last-child:after{display:none}.console .dashboard .col:after{content:"";display:block;width:2px;background:var(--config-console-background);position:absolute;top:-20px;bottom:-20px;right:24px}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.console .dashboard .col:after{width:calc(100% + 40px);height:3px;position:static;margin:20px -20px}}.console .dashboard .value{color:var(--config-color-focus);vertical-align:bottom;line-height:45px}.console .dashboard .value.small{line-height:35px}.console .dashboard .value .sum{font-size:45px;line-height:45px;font-weight:700;vertical-align:bottom}.console .dashboard .value .sum.small{font-size:25px;line-height:25px}.console .dashboard .unit{font-weight:500;line-height:20px;vertical-align:bottom;font-size:16px;display:inline-block;margin-bottom:5px;margin-left:5px;color:var(--config-color-focus)}.console .dashboard .metric{color:var(--config-color-focus);font-weight:400;font-size:13px;line-height:16px}.console .dashboard .range{color:var(--config-color-fade);font-weight:400;font-size:14px;line-height:16px}.console .dashboard a{display:block;font-weight:400;font-size:14px;line-height:16px;padding:0;border:none}.console .chart-metric{width:19%}@media only screen and (min-width:551px) and (max-width:1198px),only screen and (max-width:550px){.console .chart-metric{width:100%}}.console .chart{width:100%;position:relative;height:0;padding-top:20px;padding-bottom:26%;margin-right:-2px;overflow:hidden;background-color:var(--config-color-background-fade);background-image:linear-gradient(transparent 1px,transparent 1px),linear-gradient(90deg,transparent 1px,transparent 1px),linear-gradient(var(--config-border-color) 1px,transparent 1px),linear-gradient(90deg,var(--config-border-color) 1px,transparent 1px);background-size:100px 100px,100px 100px,20px 20px,20px 20px;background-position:-2px -2px,-2px -2px,-1px -1px,-1px -1px;background-repeat:round;border:solid 1px var(--config-border-color);border-right:solid 1px transparent;border-bottom:solid 1px transparent}@media only screen and (min-width:551px) and (max-width:1198px),only screen and (max-width:550px){.console .chart{width:100%;padding-bottom:32%;float:none;margin-bottom:20px}}.console .chart canvas{position:absolute;bottom:0;display:block;height:100%;width:100%}.console .chart-notes{font-size:12px}.console .chart-notes li{line-height:20px;display:inline-block;margin-right:15px}.console .chart-notes li::before{display:inline-block;content:'';width:14px;height:14px;background:var(--config-color-normal);border-radius:50%;margin-right:8px;vertical-align:middle}.console .chart-notes li.blue,.console .chart-notes li:nth-child(1){color:#29b5d9}.console .chart-notes li.blue::before,.console .chart-notes li:nth-child(1)::before{background:#29b5d9}.console .chart-notes li.green,.console .chart-notes li:nth-child(2){color:#4eb55b}.console .chart-notes li.green::before,.console .chart-notes li:nth-child(2)::before{background:#4eb55b}.console .chart-notes li.orange,.console .chart-notes li:nth-child(3){color:#ec9323}.console .chart-notes li.orange::before,.console .chart-notes li:nth-child(3)::before{background:#ec9323}.console .chart-notes li.red,.console .chart-notes li:nth-child(4){color:#dc3232}.console .chart-notes li.red::before,.console .chart-notes li:nth-child(4)::before{background:#dc3232}.console .community a{padding:0 10px;display:inline-block}.console .link-list li{margin-bottom:15px}.console .link-list i{display:inline-block;width:30px;height:30px;line-height:30px;text-align:center;background:var(--config-color-fade);color:var(--config-color-fade-super);border-radius:50%;margin-right:15px}.console .link-list i.fade{background:0 0;color:var(--config-color-fade)}.console .provider{width:50px;height:50px;background:#f5f5f5;color:#868686;line-height:50px;text-align:center;font-size:25px;border-radius:50%}.console .provider.facebook{color:#fff;background:#3b5998}.console .provider.twitter{color:#fff;background:#55beff}.console .provider.telegram{color:#fff;background:#3ba9e1}.console .provider.github{color:#fff;background:#24292e}.console .provider.whatsapp{color:#fff;background:#25d366}.console .provider.linkedin{color:#fff;background:#1074af}.console .provider.microsoft{color:#fff;background:#137ad4}.console .provider.google{color:#fff;background:#4489f1}.console .provider.bitbucket{color:#fff;background:#2a88fb}.console .provider.gitlab{color:#faa238;background:#30353e}.console .provider.instagram{color:#fff;background:radial-gradient(circle at 30% 107%,#fdf497 0,#fdf497 5%,#fd5949 45%,#d6249f 60%,#285aeb 90%)}.console .premium{z-index:3;margin-top:320px}.console .premium .message{height:190px;overflow:hidden;position:absolute;top:-280px}.console .premium:after{content:'';position:absolute;top:0;left:-20px;right:-20px;bottom:-20px;background:var(--config-color-background);opacity:.7;z-index:300}.console .app-section{height:90px}.console .confirm{background:var(--config-color-link);color:#fff;border-radius:25px;padding:12px;line-height:28px;text-align:center}.console .confirm .action{font-weight:500;cursor:pointer}.console .platforms{overflow:hidden}.console .platforms .box{overflow:hidden}.console .platforms .box img{width:50px;margin:0 auto;margin-bottom:20px}.console .platforms .box .cover{margin:-30px -30px 30px -30px;padding:30px}.console .platforms .box .cover.android{background:#a4ca24}.console .platforms .box .cover.android h1{color:#fff;font-size:18px;margin-top:20px}.console .platforms .col{text-align:center;line-height:30px}.console .platforms a{display:block;margin:-20px;padding:20px}.console .platforms a:hover{background:#fbfeff}.console .platforms img{display:block;margin:0 30px;width:calc(100% - 60px);border-radius:50%;margin-bottom:20px}.console .document-nav{display:none;position:sticky;top:90px}@media only screen and (min-width:1380px){.console .document-nav{display:block}}.console .document-nav ul{position:absolute;width:200px;left:-260px}.console .document-nav ul li{margin-bottom:20px}.console .document-nav ul li .selected{font-weight:500}.console .scroll-to{display:none}@media only screen and (min-width:1199px){.console .logo .top{display:none!important}}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.console>header{width:calc(100% - 30px)!important;margin:0 -30px;padding:15px}.console>header nav{width:100%;height:70px;overflow:hidden}.console>header nav.close{background:0 0}.console>header nav.close .logo .nav{display:none!important}.console>header nav.open{height:100%}.console>header nav.open .logo .top{display:none!important}.console>header nav.open .bottom{display:block!important}.console>header nav.open button{color:#87a5b9}.console>header nav button{margin:9px;background:0 0;color:var(--config-color-normal)}.console>header nav button:focus,.console>header nav button:hover{background:0 0}.console>header nav .logo{display:block!important;position:absolute;top:0;left:50%;margin:auto;transform:translateX(-50%)}.console>header nav .bottom{display:none!important}.console>footer{width:auto;margin:50px -30px 0 -30px!important;padding:0 30px 30px 30px}.console body{height:"calc(100% - 70px)"!important;width:calc(100% - 60px)!important;padding:70px 30px 0 30px!important}.console .cover{padding:25px 30px;margin:0 -30px}}@media only screen and (max-width:550px){.console body{height:"calc(100% - 70px)"!important;width:calc(100% - 40px)!important;padding:70px 20px 0 20px!important}.console .cover{padding:20px 20px;margin:0 -20px}.console>header{margin:0 -20px}.console>header .list{width:175px;font-size:14px}.console>footer{margin:50px -20px 0 -20px!important;padding:0 20px 20px 20px}}.dev-feature{display:none}.prod-feature{display:none}.development .dev-feature{display:block;opacity:.6!important;outline:solid #ff0 3px;outline-offset:3px}.development .dev-feature.dev-inline{display:inline-block}.development .prod-feature{display:none}.production .dev-feature{display:none}.production .prod-feature{display:block}.search{opacity:1!important}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.search button{margin-top:20px}}html.home body{padding:0 50px;color:var(--config-color-normal)}html.home .logo a{display:block}html.home .logo a:hover{opacity:.8}html.home .logo img{max-height:35px;width:198px;margin:45px auto 25px auto}html.home footer{background:0 0;text-align:center}html.home main{min-height:400px}.alerts ul{width:100%;visibility:hidden;position:fixed;padding:0;right:0;left:0;color:var(--config-color-normal);z-index:4;margin:0 auto;bottom:15px;max-width:560px}.alerts ul li{margin:10px 0 0 0;padding:0}.alerts ul li div.message{position:relative;padding:12px 35px;margin:0 auto;list-style:none;background:var(--config-color-background-dark);text-align:center;font-size:14px;border-radius:10px;line-height:16px;min-height:16px;box-shadow:0 0 10px rgba(0,0,0,.05);opacity:.95}.alerts ul li div.message a,.alerts ul li div.message span{font-weight:600}.alerts ul li div.message a{border-bottom:dotted 1px var(--config-color-normal)}.alerts ul li div.message i{cursor:pointer;position:absolute;font-size:14px;line-height:20px;top:9px;left:9px;color:var(--config-color-background-dark);background:var(--config-color-normal);width:22px;height:22px;border-radius:50%}.alerts ul li div.message.error{color:#fff!important;background:var(--config-color-danger)!important}.alerts ul li div.message.error a{color:#fff!important;border-bottom:dotted 1px #fff!important}.alerts ul li div.message.error i{color:var(--config-color-danger);background:#fff}.alerts ul li div.message.success{color:#fff!important;background:var(--config-color-success)!important}.alerts ul li div.message.success a{color:#fff;border-bottom:dotted 1px #fff}.alerts ul li div.message.success i{color:var(--config-color-success);background:#fff}.alerts ul li div.message.warning{color:var(--config-color-normal)!important;background:var(--config-color-warning)!important}.alerts ul li div.message.warning a{color:var(--config-color-normal)!important;border-bottom:dotted 1px var(--config-color-normal)!important}.alerts ul li div.message.warning i{color:#fff;background:var(--config-color-normal)!important}.alerts ul li div.message.open{display:block}.alerts ul li div.message.close{display:none}.alerts .cookie-alert{background:var(--config-color-focus-fade)!important;color:var(--config-color-focus)}.alerts .cookie-alert a{color:var(--config-color-focus);font-weight:400;border-bottom:dotted 1px var(--config-color-focus)!important}.alerts .cookie-alert i{color:var(--config-color-focus-fade)!important;background:var(--config-color-focus)!important}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.alerts ul{top:auto;bottom:0;max-width:100%;left:0}.alerts ul li{margin:5px 0 0 0}.alerts ul li div.message{border-radius:0}}.show-nav .alerts ul{left:220px}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.show-nav .alerts ul{left:0}}article{overflow-wrap:break-word;word-wrap:break-word}article h1{font-size:36px}article h2{font-size:24px}article h3{font-size:20px}article h4{font-size:20px}article h5{font-size:18px}article h6{font-size:16px}article h1,article h2,article h3,article h4,article h5,article h6{margin-top:30px!important;margin-bottom:30px!important}article p{line-height:32px;font-size:16px}article .update{display:block;margin-top:50px!important}article table{width:100%;margin:0;margin-bottom:30px!important;border-radius:0;border-bottom:solid 1px var(--config-border-color)}article table thead td{font-weight:500;padding:5px 15px}article table td,article table th{padding:15px;height:auto}article table td:first-child,article table th:first-child{padding-left:10px}article table td:last-child,article table th:last-child{padding-right:10px}article table td p,article table th p{font-size:inherit;line-height:inherit}article table td p:last-child,article table th p:last-child{margin:0}.avatar-container{position:relative}.avatar-container .corner{position:absolute;bottom:-3px;right:-3px}.avatar{width:60px;height:60px;border-radius:50%;background:var(--config-color-background-focus);display:inline-block;overflow:hidden;box-shadow:0 0 6px rgba(0,0,0,.09);position:relative;z-index:1;opacity:1!important}.avatar:before{content:"";position:absolute;width:100%;height:100%;z-index:0;background:var(--config-color-background-focus)}.avatar.inline{display:inline-block;vertical-align:middle}.avatar.trans{background:0 0}.avatar .no-shadow{box-shadow:none}.avatar.xs{width:30px;height:30px}.avatar.xxs{width:20px;height:20px}.avatar.small{width:50px;height:50px}.avatar.big{width:100px;height:100px}.avatar.huge{width:150px;height:150px}.box{position:relative;background:var(--config-color-background-fade);border-radius:10px;box-shadow:0 0 3px rgba(0,0,0,.05);padding:30px;display:block;border-bottom:none}.box.padding-small{padding:15px}.box.y-scroll{overflow-y:auto}.box.danger{background:var(--config-color-danger);color:#fff}.box.danger .box{color:var(--config-color-normal);background:var(--config-color-background-fade)}.box.danger>.button,.box.danger>button{background:#fff;color:var(--config-color-danger)}.box.note{background:var(--config-note-background)}.box.focus{background:var(--config-color-focus);color:var(--config-color-background-fade)}.box.focus .button,.box.focus button{background:var(--config-color-background-fade);color:var(--config-color-focus)}.box.line{background:0 0;border:solid 1px var(--config-color-background-dark);box-shadow:none}.box.warning{background:var(--config-color-success);color:#2d2d2d}.box.warning .button,.box.warning button{background:rgba(45,45,45,.8);color:var(--config-color-success)}.box .tabs{border-bottom:solid 1px var(--config-border-color);margin:0 -30px;padding:0 30px!important}.box>footer{margin:0 -30px -30px -30px;padding:15px 30px;background:var(--config-color-background-fade);border:solid 1px var(--config-border-color);border-radius:0 0 10px 10px}.box hr{height:1px;background:var(--config-console-background);border:none;margin:30px -30px}.box .label{position:absolute;top:10px;z-index:2;right:10px}.box.fade-bottom{position:relative;overflow:hidden}.box.fade-bottom:after{content:"";position:absolute;display:block;bottom:15px;width:100%;background:#000;background:linear-gradient(180deg,rgba(0,0,0,0) 0,var(--config-color-background-fade) 80%);height:100px;margin:0 -15px}.box .header{position:static;height:40px;padding:20px 30px 20px 30px;margin-bottom:30px;margin:-30px -30px 20px -30px;background:var(--config-color-background-fade);border-bottom:solid 1px #efefef}.box ul.numbers>li{position:relative;margin-left:30px;margin-right:50px}.box ul.numbers>li hr{margin-left:-60px;margin-right:-80px}.box ul.numbers>li .settings{position:absolute;top:3px;right:-50px}.box ul.numbers>li::after{display:block;width:25px;height:25px;line-height:25px;font-size:13px;font-weight:500;border-radius:50%;background:var(--config-color-focus);color:var(--config-color-background);counter-increment:section;content:counter(section);text-align:center;position:absolute;top:3px;left:-45px}.box .scroll{margin:0 -30px;overflow-y:scroll}.box .scroll table{width:100%;margin:0}.box ul.sortable{counter-reset:section}.box ul.sortable>li [data-move-down].round,.box ul.sortable>li [data-move-up].round,.box ul.sortable>li [data-remove].round{background:var(--config-color-focus);color:var(--config-color-background-fade);width:25px;height:25px;line-height:25px;display:inline-block;text-align:center;padding:0;margin-right:5px}.box ul.sortable>li [data-move-down].round:disabled,.box ul.sortable>li [data-move-up].round:disabled,.box ul.sortable>li [data-remove].round:disabled{display:none}.box ul.sortable>li:first-child [data-move-up]{display:none}.box ul.sortable>li:first-child [data-move-up]:disabled{display:inline-block;background:var(--config-color-background)}.box ul.sortable>li:last-child [data-move-down]{display:none}.box ul.sortable>li:last-child [data-move-down]:disabled{display:inline-block;background:var(--config-color-background)}.box .toggle{position:relative;border-top:1px solid var(--config-console-background);border-bottom:1px solid var(--config-console-background);margin:0 -30px;padding:30px 30px 0 30px;height:65px;overflow:hidden}.box .toggle.list{border-bottom:none}.box .toggle.sorts button.ls-ui-open{width:calc(100% - 100px)}.box .toggle button.ls-ui-open{right:0;position:absolute;top:0;width:100%;height:95px;background:0 0;opacity:.5;border-radius:0}.box .toggle .icon-minus,.box .toggle .icon-up-open{display:none}.box .toggle .content{display:none}.box .toggle.open{height:auto}.box .toggle.open .icon-minus,.box .toggle.open .icon-up-open{display:block}.box .toggle.open .icon-down-open,.box .toggle.open .icon-plus{display:none}.box .toggle.open .content{display:block}.box .list li{border-bottom:solid 2px var(--config-border-color);margin:0 -30px 30px -30px;padding:0 30px 30px 30px}.box .list li:last-child{padding-bottom:0;margin-bottom:0;border-bottom:none}@media only screen and (max-width:550px){.box .list li .actions{float:none}}.box .list li .avatar{display:block}.box .list li .avatar.inline{display:inline-block}.box.new{text-align:center}.box.new i{font-size:80px;line-height:80px;font-family:Poppins,sans-serif;font-style:normal;font-weight:300}.box.new b{margin-top:20px;display:block}.box .info{margin:0 -30px;padding:20px 30px;background:var(--config-modal-note-background);color:var(--config-modal-note-color);border-top:solid 1px var(--config-modal-note-border);border-bottom:solid 1px var(--config-modal-note-border)}.box .info hr{background:var(--config-modal-note-border)!important}.box .table-wrap{margin:0 -30px;overflow-y:scroll}.box .table-wrap table{margin:0}a.box{border-right:none;border-left:none}a.box:hover{box-shadow:0 0 1px rgba(0,0,0,.2);opacity:.7}.box-asidex{padding-right:25px!important;padding-left:70px;right:0;background:#f9f9f9;border-radius:0 10px 10px 0;height:calc(100% - 30px);position:absolute;padding-top:30px}.box-asidex:after{content:"";display:block;position:absolute;height:100%;width:51px;background:#fff;top:0;bottom:0;left:-6px}.cover{background:var(--config-color-focus-fade);padding:30px 50px;margin:0 -50px;position:relative;border-bottom:solid 1px var(--config-border-fade)}.cover .title,.cover h1,.cover h2,.cover h3,.cover h4{color:var(--config-color-focus);font-weight:600;margin-bottom:50px!important;font-size:28px;line-height:42px}.cover .title span,.cover h1 span,.cover h2 span,.cover h3 span,.cover h4 span{font-weight:600}.cover i:before{margin:0!important}.cover p{color:var(--config-color-fade)}.cover .button{color:#fff}.cover .link,.cover a{color:var(--config-color-focus);border-left:none;border-right:none;cursor:pointer}.cover .link:hover,.cover a:hover{border-bottom-color:var(--config-color-focus)}.console .database .row .col{height:452px}.console .database .row .col:after{width:2px;right:20px}.console .database hr{margin:0 -20px;background:var(--config-color-background);height:1px}.console .database h3{font-size:13px;line-height:20px;height:20px;background-color:var(--config-color-fade-super);margin:-20px -20px 0 -20px;padding:10px 20px;border-bottom:solid 1px var(--config-color-background);font-weight:600}.console .database .empty{height:162px;font-size:12px;text-align:center;margin:50px 0}.console .database .empty h4{font-size:13px;font-weight:600;line-height:120px}.console .database .search{background-color:var(--config-color-fade-super);margin:0 -20px 0 -20px;padding:10px 15px}.console .database .search input{height:40px;background-color:#fff;border-radius:25px;padding-top:0;padding-bottom:0}.console .database .code{height:411px;background:var(--config-color-fade-super);margin:0 -20px -20px -20px;padding:20px;width:calc(100% - 10px)}.console .database .code .ide{overflow:scroll;height:451px;margin:-20px;box-shadow:none;border-radius:0}.console .database .paging{background:var(--config-color-fade-super);margin:0 -20px -20px -20px;padding:20px}.console .database .button{margin:0 -20px;padding:0 20px!important;text-align:inherit;color:var(--config-color-focus);width:100%;font-size:15px;line-height:55px;box-sizing:content-box}.console .database .button i{margin-right:8px}.console .database .button:hover{border:none;background:var(--config-color-focus-fade)}.console .database .items{margin:0 -20px;height:262px;overflow-x:hidden;overflow-y:scroll}.console .database .items form{opacity:0;position:relative}.console .database .items form button{position:absolute;top:0;bottom:0;left:0;right:0;width:100%;height:45px;border-radius:0;cursor:pointer}.console .database .items li{padding:0;margin:0 0;line-height:45px;font-size:15px;padding-left:50px;padding-right:30px;position:relative}.console .database .items li i{position:absolute;display:none;right:10px}.console .database .items li .name{display:inline-block;width:100%;height:28px}.console .database .items li.selected,.console .database .items li:hover{background:#f5f5f5}.console .database .items li.selected i,.console .database .items li:hover i{display:block}.console .database .items li:last-child{border-bottom:none}body>footer{color:var(--config-color-fade);line-height:40px;margin:0 -50px;padding:12px 50px;font-size:13px;width:100%;background:#f1f1f1;position:relative;margin-top:80px!important}body>footer:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}body>footer .logo img{height:22px;padding-top:12px}body>footer a{color:var(--config-color-fade);font-size:13px}body>footer a:hover{border-bottom-color:var(--config-color-fade)}body>footer ul:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}body>footer ul li{font-size:13px;float:left;margin-right:20px!important}body>footer .copyright{padding-left:2px}[data-ls-if]{display:none}[data-service]{opacity:0}.load-service-start{opacity:0}.load-service-end{opacity:1;transition:opacity .5s ease-out;-moz-transition:opacity .5s ease-out;-webkit-transition:opacity .5s ease-out;-o-transition:opacity .5s ease-out}.load-screen{z-index:100000;position:fixed;height:100%;width:100%;background-color:var(--config-color-background-focus);top:0;left:0}.load-screen.loaded{transition:opacity 1s ease-in-out,top 1s .7s;opacity:0;top:-100%}.load-screen .animation{position:absolute;top:45%;left:50%;transform:translate(-50%,-50%) translateZ(1px);width:140px;height:140px}.load-screen .animation div{box-sizing:border-box;display:block;position:absolute;width:124px;height:124px;margin:10px;border:10px solid var(--config-color-focus);border-radius:50%;animation:animation 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:var(--config-color-focus) transparent transparent transparent}.load-screen .animation div:nth-child(1){animation-delay:-.45s}.load-screen .animation div:nth-child(2){animation-delay:-.3s}.load-screen .animation div:nth-child(3){animation-delay:-.15s}@keyframes animation{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.load-screen img{position:absolute;height:20px;bottom:60px;left:50%;transform:translate(-50%,-50%)}.modal-open .modal-bg,.modal-open body .modal-bg{position:fixed;content:'';display:block;width:100%;height:100%;left:0;right:0;top:0;bottom:0;background:#0c0c0c;opacity:.75;z-index:5}.modal{overflow:auto;display:none;position:fixed;transform:translate3d(0,0,0);width:100%;max-height:90%;max-width:640px;background:var(--config-color-background-fade);z-index:1000;box-shadow:0 0 4px rgba(0,0,0,.25);padding:30px;left:50%;top:50%;transform:translate(-50%,-50%);border-radius:10px;box-sizing:border-box;text-align:left;white-space:initial;line-height:normal}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.modal{width:calc(100% - 20px)}}.modal.full{max-width:none;max-height:none;height:100%;border-radius:0;padding:80px 120px}.modal.full h1{font-weight:700}.modal.padding-small{padding:15px}.modal.height-tiny>form{height:100px}.modal.height-small>form{height:220px}.modal.width-small{max-width:400px}.modal.width-medium{max-width:500px}.modal.width-large{max-width:800px}.modal.open{display:block}.modalbutton.close{display:none}.modal.fill{height:95%;max-height:95%;max-width:75%}.modal h1,.modal h2{margin-bottom:25px;margin-top:0;font-size:20px;text-align:left}.modal h1,.modal h2,.modal h3,.modal h4,.modal h5,.modal h6{color:inherit!important;line-height:35px}.modal .main,.modal>form{position:relative;border-top:solid 1px var(--config-border-color);padding:30px 30px 0 30px;margin:0 -30px}.modal .main.strip,.modal>form.strip{border:none;padding:0;margin:0}.modal .separator{margin:20px -30px}.modal .bullets{padding-left:40px}.modal .bullets li{margin-bottom:30px!important}.modal .bullets li:before{position:absolute}.modal .info{margin:0 -30px;padding:20px 30px;background:var(--config-modal-note-background);color:var(--config-modal-note-color);border-top:solid 1px var(--config-modal-note-border);border-bottom:solid 1px var(--config-modal-note-border)}.modal .ide.strech{box-shadow:none;border-radius:0;margin:0 -30px}.modal button.close{width:30px;height:30px;line-height:30px;padding:0;margin:0;background:var(--config-color-normal);color:var(--config-color-background-fade);border-radius:50%}.modal .paging form{padding:0;margin:0;border-top:none}.modal.sticky-footer form footer{margin:-30px}.modal.sticky-footer footer{position:sticky;bottom:-30px;background:var(--config-color-background-fade-super);height:50px;z-index:1;padding:30px;box-shadow:0 0 1px rgba(0,0,0,.15)}.modal.sticky-footer footer form{display:inline-block}[data-views-current="0"] .scroll-to,[data-views-current="1"] .scroll-to{opacity:0!important}.scroll-to-bottom .scroll-to,.scroll-to-top .scroll-to{opacity:1}.scroll-to{opacity:0;display:block;width:40px;height:40px;line-height:40px;border-radius:50%;position:fixed;transform:translateZ(0);margin:30px;padding:0;bottom:0;font-size:18px;z-index:100000;transition:opacity .15s ease-in-out;right:0}.phases{list-style:none;margin:0;padding:0;position:relative}.phases li{display:none}.phases li li{display:block}.phases li.selected{display:block}.phases .number{display:none}.phases h2,.phases h3,.phases h4,.phases h5,.phases h6{margin:0 0 30px 0;text-align:inherit}.container{position:relative}.container .tabs{height:55px;line-height:55px;list-style:none;padding:0;margin-bottom:50px!important;margin-top:-55px;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.container .tabs:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.container .tabs .selected{font-weight:400;color:var(--config-color-focus);position:relative;opacity:1}.container .tabs .selected:after{content:"";display:block;height:2px;background:var(--config-color-focus);width:calc(100% + 6px);margin:0 -3px;position:absolute;bottom:0;border-radius:2px}.container .tabs .number{display:none}.container .tabs li{float:left;margin-right:50px;color:var(--config-color-focus);opacity:.9;cursor:pointer}.container .tabs li:focus{outline:0}@media only screen and (max-width:550px){.container .tabs li{margin-right:25px}}.container .icon{display:none}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.container .tabs{width:auto;overflow-x:scroll;overflow-y:hidden;white-space:nowrap}.container .tabs li{display:inline-block;float:none}}.ide{background-color:var(--config-prism-background);overflow:hidden;position:relative;z-index:1;box-shadow:0 2px 4px 0 rgba(50,50,93,.3);border-radius:10px;margin-bottom:30px}.ide *{font-family:'Source Code Pro',monospace}.ide[data-lang]::after{content:attr(data-lang-label);display:inline-block;background:#fff;color:#000;position:absolute;top:15px;padding:5px 10px;border-radius:15px;font-size:10px;right:10px;opacity:.95}.ide[data-lang=bash]::after{background:var(--config-language-bash);color:var(--config-language-bash-contrast)}.ide[data-lang=javascript]::after{background:var(--config-language-javascript);color:var(--config-language-javascript-contrast)}.ide[data-lang=web]::after{background:var(--config-language-web);color:var(--config-language-web-contrast)}.ide[data-lang=html]::after{background:var(--config-language-html);color:var(--config-language-html-contrast)}.ide[data-lang=php]::after{background:var(--config-language-php);color:var(--config-language-php-contrast)}.ide[data-lang=nodejs]::after{background:var(--config-language-nodejs);color:var(--config-language-nodejs-contrast)}.ide[data-lang=ruby]::after{background:var(--config-language-ruby);color:var(--config-language-ruby-contrast)}.ide[data-lang=python]::after{background:var(--config-language-python);color:var(--config-language-python-contrast)}.ide[data-lang=go]::after{background:var(--config-language-go);color:var(--config-language-go-contrast)}.ide[data-lang=dart]::after{background:var(--config-language-dart);color:var(--config-language-dart-contrast)}.ide[data-lang=flutter]::after{background:var(--config-language-flutter);color:var(--config-language-flutter-contrast)}.ide[data-lang=yaml]::after{background:var(--config-language-yaml);color:var(--config-language-yaml-contrast)}.ide .tag{color:inherit!important;background:0 0!important;padding:inherit!important;font-size:inherit!important;line-height:14px}.ide .copy{cursor:pointer;content:attr(data-lang);display:inline-block;background:#fff;color:#000;position:absolute;transform:translateX(-50%);bottom:-20px;padding:5px 10px;border-radius:15px;font-size:10px;font-style:normal;left:50%;opacity:0;transition:bottom .3s,opacity .3s;line-height:normal;font-family:Poppins,sans-serif}.ide .copy::before{padding-right:5px}.ide:hover .copy{transition:bottom .3s,opacity .3s;opacity:.9;bottom:16px}.ide pre{-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;color:#e6ebf1;font-weight:400;line-height:20px;font-size:13px;margin:0;padding:20px;padding-left:60px}.ide.light{box-shadow:0 2px 4px 0 rgba(50,50,93,.1);background-color:#fff}.ide.light pre{color:#414770}.ide.light .token.cdata,.ide.light .token.comment,.ide.light .token.doctype,.ide.light .token.prolog{color:#91a2b0}.ide.light .token.attr-name,.ide.light .token.builtin,.ide.light .token.char,.ide.light .token.inserted,.ide.light .token.selector,.ide.light .token.string{color:#149570}.ide.light .token.punctuation{color:#414770}.ide.light .language-css .token.string,.ide.light .style .token.string,.ide.light .token.entity,.ide.light .token.operator,.ide.light .token.url,.ide.light .token.variable{color:#414770}.ide.light .line-numbers .line-numbers-rows{background:#f2feef}.ide.light .line-numbers-rows>span:before{color:#5dc79e}.ide.light .token.keyword{color:#6772e4;font-weight:500}code[class*=language-],pre[class*=language-]{text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4}pre[class*=language-]{overflow:auto}:not(pre)>code[class*=language-]{padding:.1em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#6b7c93}.token.punctuation{color:#f8f8f2}.namespace{opacity:.7}.token.constant,.token.deleted,.token.property,.token.symbol,.token.tag{color:#f92672}.token.boolean,.token.number{color:#f79a59}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#3ecf8e}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url,.token.variable{color:#f8f8f2}.token.atrule,.token.attr-value,.token.class-name,.token.function{color:#45b2e8}.token.keyword{color:#7795f8}.token.important,.token.regex{color:#fd971f}.token.italic{font-style:italic}.token.entity{cursor:help}pre[class*=language-].line-numbers{position:relative;padding-left:60px;counter-reset:linenumber}pre[class*=language-].line-numbers>code{position:relative;white-space:inherit}.line-numbers .line-numbers-rows{background:var(--config-prism-numbers);position:absolute;pointer-events:none;top:-20px;bottom:-21px;padding:20px 0;font-size:100%;left:-60px;width:40px;letter-spacing:-1px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.line-numbers-rows>span{padding-right:5px;pointer-events:none;display:block;counter-increment:linenumber}.line-numbers-rows>span:before{content:counter(linenumber);color:#636365;display:block;padding-right:.8em;text-align:right}html{padding:0;margin:0;direction:ltr}body{margin:0;background:var(--config-console-background) no-repeat fixed;min-width:300px}ul{padding:0;margin:0}ul li{margin:0;list-style:none} \ No newline at end of file diff --git a/public/dist/styles/default-rtl.css b/public/dist/styles/default-rtl.css index 594940608c..a9dd36a932 100644 --- a/public/dist/styles/default-rtl.css +++ b/public/dist/styles/default-rtl.css @@ -1 +1 @@ -.pull-start{float:right}.pull-end{float:left}img[src=""]{visibility:hidden;display:inline-block}:root{--config-width:910px;--config-width-xxl:1000px;--config-width-xl:910px;--config-width-large:700px;--config-width-medium:550px;--config-width-small:320px;--config-color-link:#1e849e;--config-color-background:#eceff1;--config-color-background-dark:#dfe2e4;--config-color-background-fade:#ffffff;--config-color-background-fade-super:#fdfdfd;--config-color-background-focus:#f5f5f5;--config-color-background-input:#ffffff;--config-color-placeholder:#868686;--config-color-tooltip-text:#dce8f5;--config-color-tooltip-background:#333333;--config-color-focus:#f02e65;--config-color-focus-fade:#fef8fa;--config-color-focus-hover:#ff729b;--config-color-focus-glow:#fce5ec;--config-color-focus-dark:#c52653;--config-color-normal:#40404c;--config-color-dark:#313131;--config-color-fade:#8f8f8f;--config-color-fade-light:#e2e2e2;--config-color-fade-super:#f1f3f5;--config-color-danger:#f53d3d;--config-color-success:#1bbf61;--config-color-warning:#ffed4d;--config-color-info:#386fd2;--config-border-color:#f5f5f5;--config-border-radius:10px;--config-prism-background:#373738;--config-prism-numbers:#39393c;--config-note-background:#f1fbff;--config-note-border:#5bceff;--config-warning-background:#fdf7d9;--config-warning-border:#f8e380;--config-social-twitter:#1da1f2;--config-social-github:#000000;--config-social-discord:#7189dc;--config-social-facebook:#4070b4;--config-language-bash:#2b2626;--config-language-bash-contrast:#fff;--config-language-javascript:#fff054;--config-language-javascript-contrast:#333232;--config-language-web:#fff054;--config-language-web-contrast:#333232;--config-language-html:#ff895b;--config-language-html-contrast:#ffffff;--config-language-yaml:#ca3333;--config-language-yaml-contrast:#ffffff;--config-language-php:#6182bb;--config-language-php-contrast:#ffffff;--config-language-nodejs:#8cc500;--config-language-nodejs-contrast:#ffffff;--config-language-ruby:#fc3f48;--config-language-ruby-contrast:#ffffff;--config-language-python:#3873a2;--config-language-python-contrast:#ffffff;--config-language-go:#00add8;--config-language-go-contrast:#ffffff;--config-language-dart:#035698;--config-language-dart-contrast:#ffffff;--config-language-flutter:#035698;--config-language-flutter-contrast:#ffffff;--config-modal-note-background:#f5fbff;--config-modal-note-border:#eaf2f7;--config-modal-note-color:#3b5d73;--config-switch-background:#e2e2e2;--config-console-background:#eceff1;--config-console-nav-start:#143650;--config-console-nav-end:#302839;--config-console-nav-border:#2a253a;--config-console-nav-switch-background:#ececec;--config-console-nav-switch-color:#868686;--config-console-nav-switch-arrow:url("data:image/svg+xml;utf8,")}:root .theme-dark{--config-color-background:#061F2F;--config-color-background-dark:#262d50;--config-color-background-fade:#1c223a;--config-color-background-fade-super:#1a1f35;--config-color-background-focus:#1a1f35;--config-color-background-input:#dce8f5;--config-color-tooltip-text:#061F2F;--config-color-tooltip-background:#dce8f5;--config-color-link:#4caedb;--config-color-placeholder:#9ea1af;--config-color-focus:#c7d8eb;--config-color-focus-fade:#1e233e;--config-color-focus-hover:#d3deea;--config-color-focus-glow:#d3deea;--config-color-focus-dark:#657586;--config-color-normal:#c7d8eb;--config-color-dark:#c7d8eb;--config-color-fade:#bec3e0;--config-color-fade-light:#181818;--config-color-fade-super:#262D50;--config-color-danger:#d84a4a;--config-color-success:#34b86d;--config-color-warning:#e0d56d;--config-color-info:#386fd2;--config-border-color:#262D50;--config-prism-background:#1F253F;--config-prism-numbers:#1F253F;--config-note-background:#171e33;--config-note-border:#262D50;--config-warning-background:#1F253F;--config-warning-border:#262D50;--config-social-twitter:var(--config-color-normal);--config-social-github:var(--config-color-normal);--config-social-discord:var(--config-color-normal);--config-social-facebook:var(--config-color-normal);--config-language-bash:var(--config-color-normal);--config-language-bash-contrast:var(--config-color-background);--config-language-javascript:var(--config-color-normal);--config-language-javascript-contrast:var(--config-color-background);--config-language-web:var(--config-color-normal);--config-language-web-contrast:var(--config-color-background);--config-language-yaml:var(--config-color-normal);--config-language-yaml-contrast:var(--config-color-background);--config-language-html:var(--config-color-normal);--config-language-html-contrast:var(--config-color-background);--config-language-php:var(--config-color-normal);--config-language-php-contrast:var(--config-color-background);--config-language-nodejs:var(--config-color-normal);--config-language-nodejs-contrast:var(--config-color-background);--config-language-ruby:var(--config-color-normal);--config-language-ruby-contrast:var(--config-color-background);--config-language-python:var(--config-color-normal);--config-language-python-contrast:var(--config-color-background);--config-language-go:var(--config-color-normal);--config-language-go-contrast:var(--config-color-background);--config-language-dart:var(--config-color-normal);--config-language-dart-contrast:var(--config-color-background);--config-language-flutter:var(--config-color-normal);--config-language-flutter-contrast:var(--config-color-background);--config-modal-note-background:#15192b;--config-modal-note-border:#161b31;--config-modal-note-color:var(--config-color-normal);--config-switch-background:var(--config-color-normal);--config-console-background:#20263f;--config-console-nav-start:#1c2139;--config-console-nav-end:#151929;--config-console-nav-border:#171b30;--config-console-nav-switch-background:var(--config-color-focus);--config-console-nav-switch-color:var(--config-color-background);--config-console-nav-switch-arrow:url("data:image/svg+xml;utf8,")}.theme-light .force-light{display:block!important}.theme-dark .force-dark{display:block!important}.force-dark{display:none!important}.force-light{display:none!important}@font-face{font-family:Poppins;font-style:normal;font-weight:100;src:url(/fonts/poppins-v9-latin-100.eot);src:local('Poppins Thin'),local('Poppins-Thin'),url(/fonts/poppins-v9-latin-100.eot?#iefix) format('embedded-opentype'),url(/fonts/poppins-v9-latin-100.woff2) format('woff2'),url(/fonts/poppins-v9-latin-100.woff) format('woff'),url(/fonts/poppins-v9-latin-100.ttf) format('truetype'),url(/fonts/poppins-v9-latin-100.svg#Poppins) format('svg')}@font-face{font-family:Poppins;font-style:normal;font-weight:300;src:url(/fonts/poppins-v9-latin-300.eot);src:local('Poppins Light'),local('Poppins-Light'),url(/fonts/poppins-v9-latin-300.eot?#iefix) format('embedded-opentype'),url(/fonts/poppins-v9-latin-300.woff2) format('woff2'),url(/fonts/poppins-v9-latin-300.woff) format('woff'),url(/fonts/poppins-v9-latin-300.ttf) format('truetype'),url(/fonts/poppins-v9-latin-300.svg#Poppins) format('svg')}@font-face{font-family:Poppins;font-style:normal;font-weight:400;src:url(/fonts/poppins-v9-latin-regular.eot);src:local('Poppins Regular'),local('Poppins-Regular'),url(/fonts/poppins-v9-latin-regular.eot?#iefix) format('embedded-opentype'),url(/fonts/poppins-v9-latin-regular.woff2) format('woff2'),url(/fonts/poppins-v9-latin-regular.woff) format('woff'),url(/fonts/poppins-v9-latin-regular.ttf) format('truetype'),url(/fonts/poppins-v9-latin-regular.svg#Poppins) format('svg')}@font-face{font-family:Poppins;font-style:normal;font-weight:500;src:url(/fonts/poppins-v9-latin-500.eot);src:local('Poppins Medium'),local('Poppins-Medium'),url(/fonts/poppins-v9-latin-500.eot?#iefix) format('embedded-opentype'),url(/fonts/poppins-v9-latin-500.woff2) format('woff2'),url(/fonts/poppins-v9-latin-500.woff) format('woff'),url(/fonts/poppins-v9-latin-500.ttf) format('truetype'),url(/fonts/poppins-v9-latin-500.svg#Poppins) format('svg')}@font-face{font-family:Poppins;font-style:normal;font-weight:600;src:url(/fonts/poppins-v9-latin-600.eot);src:local('Poppins SemiBold'),local('Poppins-SemiBold'),url(/fonts/poppins-v9-latin-600.eot?#iefix) format('embedded-opentype'),url(/fonts/poppins-v9-latin-600.woff2) format('woff2'),url(/fonts/poppins-v9-latin-600.woff) format('woff'),url(/fonts/poppins-v9-latin-600.ttf) format('truetype'),url(/fonts/poppins-v9-latin-600.svg#Poppins) format('svg')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url(/fonts/source-code-pro-v11-latin-regular.eot);src:local('Source Code Pro Regular'),local('SourceCodePro-Regular'),url(/fonts/source-code-pro-v11-latin-regular.eot?#iefix) format('embedded-opentype'),url(/fonts/source-code-pro-v11-latin-regular.woff2) format('woff2'),url(/fonts/source-code-pro-v11-latin-regular.woff) format('woff'),url(/fonts/source-code-pro-v11-latin-regular.ttf) format('truetype'),url(/fonts/source-code-pro-v11-latin-regular.svg#SourceCodePro) format('svg')}.padding{padding:30px}.padding-top{padding-top:30px!important}.padding-top-large{padding-top:50px!important}.padding-top-xl{padding-top:80px!important}.padding-bottom{padding-bottom:30px!important}.padding-bottom-large{padding-bottom:50px!important}.padding-bottom-xl{padding-bottom:80px!important}.margin-end{margin-left:20px!important}.margin-start{margin-right:20px!important}.margin-end-small{margin-left:10px!important}.margin-start-small{margin-right:10px!important}.margin-end-large{margin-left:50px!important}.margin-start-large{margin-right:50px!important}.margin-end-no{margin-left:0!important}.margin-start-no{margin-right:0!important}.margin-end-negative{margin-left:-30px!important}.margin-start-negative{margin-right:-30px!important}.margin-end-negative-small{margin-left:-15px!important}.margin-start-negative-small{margin-right:-15px!important}.margin-end-negative-tiny{margin-left:-5px!important}.margin-start-negative-tiny{margin-right:-5px!important}.margin-top{margin-top:30px!important}.margin-bottom{margin-bottom:30px!important}.margin-top-no{margin-top:0!important}.margin-bottom-no{margin-bottom:0!important}.margin-top-xxl{margin-top:140px!important}.margin-top-xl{margin-top:80px!important}.margin-top-large{margin-top:50px!important}.margin-top-small{margin-top:15px!important}.margin-top-tiny{margin-top:5px!important}.margin-top-negative{margin-top:-30px!important}.margin-top-negative-tiny{margin-top:-5px!important}.margin-top-negative-small{margin-top:-15px!important}.margin-top-negative-large{margin-top:-50px!important}.margin-top-negative-xl{margin-top:-80px!important}.margin-top-negative-xxl{margin-top:-100px!important}.margin-bottom-xxl{margin-bottom:140px!important}.margin-bottom-xl{margin-bottom:80px!important}.margin-bottom-large{margin-bottom:50px!important}.margin-bottom-small{margin-bottom:15px!important}.margin-bottom-tiny{margin-bottom:5px!important}.margin-bottom-negative{margin-bottom:-30px!important}.margin-bottom-negative-tiny{margin-bottom:-5px!important}.margin-bottom-negative-small{margin-bottom:-15px!important}.margin-bottom-negative-large{margin-bottom:-50px!important}.margin-bottom-negative-xl{margin-bottom:-80px!important}.margin-bottom-negative-xl{margin-bottom:-100px!important}.force-left,.ide{direction:ltr;text-align:left}.force-right{direction:rtl;text-align:right}.pull-left{float:left}.pull-right{float:right}.ratio-wide{height:0;overflow:hidden;padding-top:56%;position:relative;width:100%}.ratio-wide>*{position:absolute;top:0;left:0;width:100%;height:100%}.ratio-square{height:0;overflow:hidden;padding-top:56%;position:relative;width:100%}.ratio-square>*{position:absolute;top:0;left:0;width:100%;height:100%}.clear:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.phones-only{display:none}@media only screen and (max-width:550px){.phones-only{display:inherit!important}}.tablets-only{display:none}@media only screen and (min-width:551px) and (max-width:1198px){.tablets-only{display:inherit!important}}.desktops-only{display:none}@media only screen and (min-width:1199px){.desktops-only{display:inherit!important}}.phones-only-inline{display:none}@media only screen and (max-width:550px){.phones-only-inline{display:inline-block!important}}.tablets-only-inline{display:none}@media only screen and (min-width:551px) and (max-width:1198px){.tablets-only-inline{display:inline-block!important}}.desktops-only-inline{display:none}@media only screen and (min-width:1199px){.desktops-only-inline{display:inline-block!important}}*{font-family:Poppins,sans-serif;-webkit-font-smoothing:antialiased;font-weight:300}h1,h2,h3,h4,h5,h6{margin:0}h4,h5,h6{font-weight:400}.link,a{color:var(--config-color-link);text-decoration:none;border-left:2px solid transparent;border-right:2px solid transparent;transition:.2s;cursor:pointer}.link.disabled,a.disabled{opacity:.5}.link.tag:hover,a.tag:hover{opacity:.9}.link.danger,a.danger{color:var(--config-color-danger)}.link.link-animation-enabled,a.link-animation-enabled{display:inline-block}.link.link-animation-enabled:hover,a.link-animation-enabled:hover{transform:translateY(-2px)}.link-return-animation--start>i{display:inline-block;transition:.2s}.link-return-animation--start:hover>i{transform:translateX(2px)}.link-return-animation--end>i{display:inline-block;transition:.2s}.link-return-animation--end:hover>i{transform:translateX(-2px)}b,strong{font-weight:500}p{margin:0 0 20px 0;line-height:26px}small{font-size:16px;color:var(--config-color-fade)}.text-size-small{font-size:13px}.text-size-xs{font-size:10px}.text-size-normal{font-size:16px}.text-height-large{height:30px;line-height:30px}.text-height-small{line-height:13px}.text-one-liner{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text-bold{font-weight:400!important}.text-bold-large{font-weight:500!important}.text-bold-xl{font-weight:600!important}.text-danger{color:var(--config-color-danger)!important}.text-success{color:var(--config-color-success)!important}.text-upper{text-transform:uppercase}.text-warning{color:var(--config-color-warning)}.text-focus{color:var(--config-color-focus)}.text-fade{color:var(--config-color-fade)}.text-green{color:var(--config-color-success)}.text-red{color:var(--config-color-danger)}.text-info{color:var(--config-color-info)}.text-yellow{color:#ffe28b}.text-disclaimer{font-size:11px;color:var(--config-color-fade)}.text-fade-extra{color:var(--config-color-fade);opacity:.5}.text-line-high-large{line-height:30px}.text-line-high-xl{line-height:40px}.text-sign{margin:5px 0;font-size:25px;width:25px;height:25px;line-height:25px;display:inline-block}.text-align-center{text-align:center}.text-align-start{text-align:right}.text-align-end{text-align:left}.text-align-left{text-align:left}.text-align-right{text-align:right}.text-dir-ltr{direction:ltr;display:inline-block}.text-dir-rtl{direction:rtl;display:inline-block}.icon-dot-3:before{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-o-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}i[class*=' icon-']:before,i[class^=icon-]:before{display:inline;line-height:unset}table{width:calc(100% + 60px);border-collapse:collapse;margin:-30px;border-radius:10px;overflow:hidden;position:relative;table-layout:fixed}table.y-scroll{overflow-y:auto}table thead{box-shadow:0 0 2px rgba(0,0,0,.25);border-bottom:solid 1px var(--config-color-fade-super);font-size:14px}table.small{font-size:14px}table.open-end tbody tr:last-child{border-bottom:none;font-weight:700;background:#f7fbf7}table.full tbody td,table.full tbody th{vertical-align:top;white-space:normal;overflow:auto;line-height:24px;padding-top:20px;padding-bottom:20px;height:auto}table .avatar{width:30px;height:30px}table tr{border-bottom:solid 1px var(--config-color-fade-super)}table tr:last-child{border-bottom:none}table tr:nth-child(even){background:var(--config-color-background-fade-super)}table tr.selected{background:var(--config-note-background)}table tr.selected td,table tr.selected td span{font-weight:500}table th{text-align:right;font-weight:400}table th i{color:var(--config-color-fade);font-size:10px;display:inline-block;vertical-align:top;line-height:16px;padding:0 3px}table td,table th{height:65px;padding:0 15px;line-height:50px}table td:first-child,table th:first-child{padding-right:30px}table td:last-child,table th:last-child{padding-left:30px}table td,table th{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){table.vertical{border-top:solid 1px var(--config-color-fade-super);display:block;overflow:hidden;padding-top:12px}table.vertical .hide{display:none}table.vertical tbody,table.vertical td,table.vertical th,table.vertical thead,table.vertical tr{width:100%;display:block}table.vertical th,table.vertical tr{padding-top:12px;padding-bottom:12px}table.vertical th:first-child,table.vertical tr:first-child{padding-top:0}table.vertical td,table.vertical th{padding:5px 20px!important;text-overflow:ellipsis;white-space:normal;height:40px;line-height:40px;width:calc(100% - 40px)}table.vertical td:first-child,table.vertical td:last-child,table.vertical th:first-child,table.vertical th:last-child{padding:0 10px}table.vertical td:last-child,table.vertical th:last-child{padding-bottom:0}table.vertical td p,table.vertical th p{display:inline-block;width:calc(100% - 40px)}table.vertical td:not([data-title=""]):before{content:attr(data-title);margin-right:4px;font-weight:400}table.vertical thead{display:none}}.zone{max-width:var(--config-width-xl);margin:0 auto 40px auto}.zone.xxxl{max-width:calc(1400px - 100px)}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.zone.xxxl{max-width:100%}}.zone.xxl{max-width:var(--config-width-xxl)}.zone.xl{max-width:var(--config-width-xl)}.zone.large{max-width:var(--config-width-large)}.zone.medium{max-width:var(--config-width-medium)}.zone.small{max-width:var(--config-width-small)}.row{position:relative;margin:0 -50px;padding-right:50px}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.row{margin:0 -30px;padding-right:30px}}.row.force-ltr>.col{float:left}.row.force-rtl>.col{float:right}.row.force-reverse>.col{float:left}.row.wide{margin:0 -100px;padding-right:100px}.row.wide>.span-1{width:calc(8.33333333% * 1 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-2{width:calc(8.33333333% * 2 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-3{width:calc(8.33333333% * 3 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-4{width:calc(8.33333333% * 4 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-5{width:calc(8.33333333% * 5 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-6{width:calc(8.33333333% * 6 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-7{width:calc(8.33333333% * 7 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-8{width:calc(8.33333333% * 8 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-9{width:calc(8.33333333% * 9 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-10{width:calc(8.33333333% * 10 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-11{width:calc(8.33333333% * 11 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-12{width:calc(8.33333333% * 12 - 100px);box-sizing:content-box;padding-left:100px}.row.thin{margin:0 -20px;padding-right:20px}.row.thin>.span-1{width:calc(8.33333333% * 1 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-2{width:calc(8.33333333% * 2 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-3{width:calc(8.33333333% * 3 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-4{width:calc(8.33333333% * 4 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-5{width:calc(8.33333333% * 5 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-6{width:calc(8.33333333% * 6 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-7{width:calc(8.33333333% * 7 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-8{width:calc(8.33333333% * 8 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-9{width:calc(8.33333333% * 9 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-10{width:calc(8.33333333% * 10 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-11{width:calc(8.33333333% * 11 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-12{width:calc(8.33333333% * 12 - 20px);box-sizing:content-box;padding-left:20px}.row.modalize{margin:0 -30px;padding-right:30px}.row.modalize>.span-1{width:calc(8.33333333% * 1 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-2{width:calc(8.33333333% * 2 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-3{width:calc(8.33333333% * 3 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-4{width:calc(8.33333333% * 4 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-5{width:calc(8.33333333% * 5 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-6{width:calc(8.33333333% * 6 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-7{width:calc(8.33333333% * 7 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-8{width:calc(8.33333333% * 8 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-9{width:calc(8.33333333% * 9 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-10{width:calc(8.33333333% * 10 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-11{width:calc(8.33333333% * 11 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-12{width:calc(8.33333333% * 12 - 30px);box-sizing:content-box;padding-left:30px}.row:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.row .col{float:right;box-sizing:border-box}.row .col.sticky-top{position:sticky;top:90px}.row .col.sticky-bottom{position:sticky;bottom:0}.row .span-1{width:calc(8.33333333% * 1 - 40px);box-sizing:content-box;padding-left:40px}.row .span-2{width:calc(8.33333333% * 2 - 40px);box-sizing:content-box;padding-left:40px}.row .span-3{width:calc(8.33333333% * 3 - 40px);box-sizing:content-box;padding-left:40px}.row .span-4{width:calc(8.33333333% * 4 - 40px);box-sizing:content-box;padding-left:40px}.row .span-5{width:calc(8.33333333% * 5 - 40px);box-sizing:content-box;padding-left:40px}.row .span-6{width:calc(8.33333333% * 6 - 40px);box-sizing:content-box;padding-left:40px}.row .span-7{width:calc(8.33333333% * 7 - 40px);box-sizing:content-box;padding-left:40px}.row .span-8{width:calc(8.33333333% * 8 - 40px);box-sizing:content-box;padding-left:40px}.row .span-9{width:calc(8.33333333% * 9 - 40px);box-sizing:content-box;padding-left:40px}.row .span-10{width:calc(8.33333333% * 10 - 40px);box-sizing:content-box;padding-left:40px}.row .span-11{width:calc(8.33333333% * 11 - 40px);box-sizing:content-box;padding-left:40px}.row .span-12{width:calc(8.33333333% * 12 - 40px);box-sizing:content-box;padding-left:40px}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.row.responsive{width:100%;padding:0;margin:0}.row.responsive>.span-1,.row.responsive>.span-10,.row.responsive>.span-11,.row.responsive>.span-12,.row.responsive>.span-2,.row.responsive>.span-3,.row.responsive>.span-4,.row.responsive>.span-5,.row.responsive>.span-6,.row.responsive>.span-7,.row.responsive>.span-8,.row.responsive>.span-9{width:calc(8.33333333% * 12 - 0px)!important;box-sizing:content-box!important;padding-left:0!important;width:100%!important}}.tiles{position:relative}.tiles:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.tiles>*{margin-left:50px!important;float:right;width:calc(33.3333% - 33.3333px)}.tiles>* .photo-title{width:calc(100% + 30px);height:15px;margin:-15px -15px 10px -15px;border-radius:10px 10px 0 0;background:var(--config-color-fade-super);border-bottom:solid 1px var(--config-color-fade-super)}.tiles>:nth-child(3n){margin-left:0!important}@media only screen and (min-width:551px) and (max-width:1198px){.tiles>li{width:calc(50% - 25px)}.tiles>li:nth-child(3n){margin-left:50px!important}.tiles>li:nth-child(2n){margin-left:0!important}}@media only screen and (max-width:550px){.tiles>li{width:100%;margin-left:0!important}}@font-face{font-family:fontello;src:url(data:application/octet-stream;base64,d09GRgABAAAAAFmMAA8AAAAAi8QAAQAAA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jR7ABKyNhOC2wOSywABawAyWwAiVHI0cjYbAAVFguIDwjIRuwAiWwAiVHI0cjYSCwBSWwBCVHI0cjYbAGJbAFJUmwAiVhuQgACABjYyMgWGIbIVljuAQAYiCwAFBYsEBgWWawAWNgIy4jICA8ijgjIVktsDossAAWILAIQyAuRyNHI2EgYLAgYGawAmIgsABQWLBAYFlmsAFjIyAgPIo4LbA7LCMgLkawAiVGUlggPFkusSsBFCstsDwsIyAuRrACJUZQWCA8WS6xKwEUKy2wPSwjIC5GsAIlRlJYIDxZIyAuRrACJUZQWCA8WS6xKwEUKy2wPiywNSsjIC5GsAIlRlJYIDxZLrErARQrLbA/LLA2K4ogIDywBCNCijgjIC5GsAIlRlJYIDxZLrErARQrsARDLrArKy2wQCywABawBCWwBCYgLkcjRyNhsAlDKyMgPCAuIzixKwEUKy2wQSyxCAQlQrAAFrAEJbAEJSAuRyNHI2EgsAQjQrAJQysgsGBQWCCwQFFYswIgAyAbswImAxpZQkIjIEewBEOwAmIgsABQWLBAYFlmsAFjYCCwASsgiophILACQ2BkI7ADQ2FkUFiwAkNhG7ADQ2BZsAMlsAJiILAAUFiwQGBZZrABY2GwAiVGYTgjIDwjOBshICBGI0ewASsjYTghWbErARQrLbBCLLA1Ky6xKwEUKy2wQyywNishIyAgPLAEI0IjOLErARQrsARDLrArKy2wRCywABUgR7AAI0KyAAEBFRQTLrAxKi2wRSywABUgR7AAI0KyAAEBFRQTLrAxKi2wRiyxAAEUE7AyKi2wRyywNCotsEgssAAWRSMgLiBGiiNhOLErARQrLbBJLLAII0KwSCstsEossgAAQSstsEsssgABQSstsEwssgEAQSstsE0ssgEBQSstsE4ssgAAQistsE8ssgABQistsFAssgEAQistsFEssgEBQistsFIssgAAPistsFMssgABPistsFQssgEAPistsFUssgEBPistsFYssgAAQCstsFcssgABQCstsFgssgEAQCstsFkssgEBQCstsFossgAAQystsFsssgABQystsFwssgEAQystsF0ssgEBQystsF4ssgAAPystsF8ssgABPystsGAssgEAPystsGEssgEBPystsGIssDcrLrErARQrLbBjLLA3K7A7Ky2wZCywNyuwPCstsGUssAAWsDcrsD0rLbBmLLA4Ky6xKwEUKy2wZyywOCuwOystsGgssDgrsDwrLbBpLLA4K7A9Ky2waiywOSsusSsBFCstsGsssDkrsDsrLbBsLLA5K7A8Ky2wbSywOSuwPSstsG4ssDorLrErARQrLbBvLLA6K7A7Ky2wcCywOiuwPCstsHEssDorsD0rLbByLLMJBAIDRVghGyMhWUIrsAhlsAMkUHiwARUwLQBLuADIUlixAQGOWbABuQgACABjcLEABUKyAAEAKrEABUKzCgIBCCqxAAVCsw4AAQgqsQAGQroCwAABAAkqsQAHQroAQAABAAkqsQMARLEkAYhRWLBAiFixA2REsSYBiFFYugiAAAEEQIhjVFixAwBEWVlZWbMMAgEMKrgB/4WwBI2xAgBEAAA=) format('truetype')}[class*=" icon-"]:before,[class^=icon-]:before{font-family:fontello;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em}.icon-user:before{content:'\e800'}.icon-folder:before{content:'\e801'}.icon-list:before{content:'\e802'}.icon-login:before{content:'\e803'}.icon-cog:before{content:'\e804'}.icon-twitter:before{content:'\e805'}.icon-article-alt:before{content:'\e806'}.icon-cancel:before{content:'\e807'}.icon-home:before{content:'\e808'}.icon-down-dir:before{content:'\e809'}.icon-facebook:before{content:'\e80a'}.icon-asterisk:before{content:'\e80b'}.icon-upload:before{content:'\e80c'}.icon-stopwatch:before{content:'\e80d'}.icon-export:before{content:'\e80e'}.icon-heart:before{content:'\e80f'}.icon-plus:before{content:'\e810'}.icon-up-dir:before{content:'\e811'}.icon-menu:before{content:'\e812'}.icon-left-open:before{content:'\e813'}.icon-right-open:before{content:'\e814'}.icon-inbox:before{content:'\e815'}.icon-wrench:before{content:'\e816'}.icon-comment:before{content:'\e817'}.icon-stackoverflow:before{content:'\e818'}.icon-question:before{content:'\e819'}.icon-ok-circled:before{content:'\e81a'}.icon-warning:before{content:'\e81b'}.icon-mail:before{content:'\e81c'}.icon-link:before{content:'\e81d'}.icon-key-inv:before{content:'\e81e'}.icon-trash:before{content:'\e81f'}.icon-download:before{content:'\e820'}.icon-glasses:before{content:'\e821'}.icon-qrcode:before{content:'\e822'}.icon-shuffle:before{content:'\e823'}.icon-eye:before{content:'\e824'}.icon-lock:before{content:'\e825'}.icon-search:before{content:'\e826'}.icon-bell:before{content:'\e827'}.icon-users:before{content:'\e828'}.icon-location:before{content:'\e829'}.icon-briefcase:before{content:'\e82a'}.icon-instagram:before{content:'\e82b'}.icon-clock:before{content:'\e82c'}.icon-phone:before{content:'\e82d'}.icon-calendar:before{content:'\e82e'}.icon-print:before{content:'\e82f'}.icon-edit:before{content:'\e830'}.icon-bold:before{content:'\e831'}.icon-italic:before{content:'\e832'}.icon-rocket:before{content:'\e833'}.icon-whatsapp:before{content:'\e834'}.icon-dot-3:before{content:'\e835'}.icon-info-circled:before{content:'\e836'}.icon-videocam:before{content:'\e837'}.icon-quote-right:before{content:'\e838'}.icon-picture:before{content:'\e839'}.icon-palette:before{content:'\e83a'}.icon-lamp:before{content:'\e83b'}.icon-book-open:before{content:'\e83c'}.icon-ok:before{content:'\e83d'}.icon-chat-alt:before{content:'\e83e'}.icon-archive:before{content:'\e83f'}.icon-play:before{content:'\e840'}.icon-pause:before{content:'\e841'}.icon-down-open:before{content:'\e842'}.icon-up-open:before{content:'\e843'}.icon-minus:before{content:'\e844'}.icon-exchange:before{content:'\e845'}.icon-network:before{content:'\e846'}.icon-discord:before{content:'\e847'}.icon-moon-inv:before{content:'\e848'}.icon-sun-inv:before{content:'\e849'}.icon-cancel-circled:before{content:'\e84a'}.icon-lightning:before{content:'\e84b'}.icon-dev:before{content:'\e84c'}.icon-link-ext:before{content:'\f08e'}.icon-github-circled:before{content:'\f09b'}.icon-filter:before{content:'\f0b0'}.icon-docs:before{content:'\f0c5'}.icon-list-bullet:before{content:'\f0ca'}.icon-list-numbered:before{content:'\f0cb'}.icon-underline:before{content:'\f0cd'}.icon-sort:before{content:'\f0dc'}.icon-linkedin:before{content:'\f0e1'}.icon-smile:before{content:'\f118'}.icon-keyboard:before{content:'\f11c'}.icon-code:before{content:'\f121'}.icon-shield:before{content:'\f132'}.icon-angle-circled-left:before{content:'\f137'}.icon-angle-circled-right:before{content:'\f138'}.icon-bitbucket:before{content:'\f171'}.icon-windows:before{content:'\f17a'}.icon-dot-circled:before{content:'\f192'}.icon-wheelchair:before{content:'\f193'}.icon-bank:before{content:'\f19c'}.icon-google:before{content:'\f1a0'}.icon-building-filled:before{content:'\f1ad'}.icon-database:before{content:'\f1c0'}.icon-lifebuoy:before{content:'\f1cd'}.icon-header:before{content:'\f1dc'}.icon-binoculars:before{content:'\f1e5'}.icon-chart-area:before{content:'\f1fe'}.icon-pinterest:before{content:'\f231'}.icon-medium:before{content:'\f23a'}.icon-gitlab:before{content:'\f296'}.icon-telegram:before{content:'\f2c6'}.datalist-polyfill{list-style:none;display:none;background:#fff;box-shadow:0 2px 2px #999;position:absolute;left:0;top:0;margin:0;padding:0;max-height:300px;overflow-y:auto}.datalist-polyfill:empty{display:none!important}.datalist-polyfill>li{padding:3px;font:13px "Lucida Grande",Sans-Serif}.datalist-polyfill__active{background:#3875d7;color:#fff}date-input-polyfill{z-index:1000!important;max-width:320px!important;width:320px!important}date-input-polyfill .monthSelect-wrapper,date-input-polyfill .yearSelect-wrapper{height:50px;line-height:50px;padding:0;width:40%!important;margin-bottom:10px!important}date-input-polyfill .monthSelect-wrapper select,date-input-polyfill .yearSelect-wrapper select{padding:0 12px;height:50px;line-height:50px;box-sizing:border-box}date-input-polyfill .yearSelect-wrapper{width:35%!important}date-input-polyfill table{width:100%!important;max-width:100%!important;padding:0 12px 12px 12px!important;box-sizing:border-box;margin:0}date-input-polyfill table td:first-child,date-input-polyfill table td:last-child,date-input-polyfill table th:first-child,date-input-polyfill table th:last-child{width:32px!important;padding:4px!important}date-input-polyfill select{margin-bottom:10px}date-input-polyfill button{width:25%!important;height:50px!important;line-height:50px!important;margin-bottom:10px!important;background:inherit;position:relative;color:inherit;padding:inherit;box-sizing:inherit;border-radius:inherit;font-size:inherit;box-shadow:none;border:none;border-bottom:none!important}::placeholder{color:var(--config-color-placeholder);text-align:right}::-webkit-input-placeholder{text-align:right}input:-moz-placeholder{text-align:right}input,textarea{background:var(--config-color-background-input)}input[type=file],input[type=file]::-webkit-file-upload-button{cursor:pointer}.button,button{display:inline-block;background:var(--config-color-focus);border-radius:26px;border:none;color:var(--config-color-background-fade);height:52px;line-height:52px;padding:0 25px;cursor:pointer;font-size:16px;box-sizing:border-box;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.button:focus,.button:hover,button:focus,button:hover{background:var(--config-color-focus-hover)}.button.fly,button.fly{position:fixed;z-index:2;bottom:30px;left:30px}@media only screen and (max-width:550px){.button.fly,button.fly{left:15px}}.button.fill,button.fill{display:block;width:100%;text-align:center;padding:0 10px!important}.button.fill-aligned,button.fill-aligned{display:block;width:100%;text-align:right;padding:0 20px!important}.button.icon,button.icon{padding-left:30px!important}.button.icon-reduce,button.icon-reduce{padding-right:15px!important}.button.reverse,button.reverse{background:0 0;height:50px;line-height:48px;padding:0 23px;color:var(--config-color-focus);border:solid 2px var(--config-color-focus)}.button.reverse:focus,.button.reverse:hover,button.reverse:focus,button.reverse:hover{color:var(--config-color-focus-hover);border-color:var(--config-color-focus-hover)}.button.small,button.small{padding:0 15px;height:40px;line-height:36px;font-size:13px}.button.round,button.round{width:52px;padding:0}.button.round.small,button.round.small{font-size:12px;width:30px;height:30px;line-height:30px}.button.white,button.white{background:#fff;color:var(--config-color-focus)}.button.white.reverse,button.white.reverse{color:#fff;background:0 0;border:solid 2px #fff}.button.trans,button.trans{background:0 0!important}.button.trans.reverse,button.trans.reverse{background:0 0!important}.button.success,button.success{background:var(--config-color-success)}.button.success.reverse,button.success.reverse{color:var(--config-color-success);background:#fff;border:solid 2px var(--config-color-success)}.button.danger,button.danger{background:var(--config-color-danger);color:#fff}.button.danger.reverse,button.danger.reverse{color:var(--config-color-danger);background:var(--config-color-background-fade);border:solid 2px var(--config-color-danger)}.button.dark,button.dark{background:var(--config-color-dark);color:var(--config-color-background-fade)}.button.dark.reverse,button.dark.reverse{color:var(--config-color-dark);background:var(--config-color-background-fade);border:solid 2px var(--config-color-dark)}.button .disabled,.button.disabled,.button:disabled,button .disabled,button.disabled,button:disabled{color:var(--config-color-normal);background:var(--config-color-background-dark);opacity:.6;cursor:default}.button.link,button.link{background:0 0;border-radius:0;color:var(--config-color-link);height:auto;line-height:normal;padding:0;padding-left:0!important}.button.link:focus,button.link:focus{box-shadow:inherit}.button.strip,button.strip{background:0 0;height:auto;line-height:16px;color:inherit;padding:0 5px}.button.facebook,button.facebook{color:#fff!important;background:#4070b4!important}.button.twitter,button.twitter{color:#fff!important;background:#56c2ea!important}.button.linkedin,button.linkedin{color:#fff!important;background:#0076b5!important}.button.github,button.github{color:#fff!important;background:#7e7c7c!important}.button:focus,button:focus{outline:0}label{margin-bottom:15px;display:block;line-height:normal}.input,input[type=date],input[type=datetime-local],input[type=email],input[type=file],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=url],select,textarea{-webkit-appearance:none;-moz-appearance:none;-webkit-transform:translateZ(0);box-sizing:content-box;color:#313131;height:40px;line-height:40px;border:solid 1px var(--config-color-fade-light);border-radius:10px;padding:5px 15px;font-size:16px;display:block;width:calc(100% - 32px);margin-bottom:30px}.input[type=file],input[type=date][type=file],input[type=datetime-local][type=file],input[type=email][type=file],input[type=file][type=file],input[type=number][type=file],input[type=password][type=file],input[type=search][type=file],input[type=tel][type=file],input[type=text][type=file],input[type=url][type=file],select[type=file],textarea[type=file]{line-height:0;padding:15px;height:auto}.input:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=email]:focus,input[type=file]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=url]:focus,select:focus,textarea:focus{outline:0;border-color:#b3d7fd}.input:disabled,input[type=date]:disabled,input[type=datetime-local]:disabled,input[type=email]:disabled,input[type=file]:disabled,input[type=number]:disabled,input[type=password]:disabled,input[type=search]:disabled,input[type=tel]:disabled,input[type=text]:disabled,input[type=url]:disabled,select:disabled,textarea:disabled{color:var(--config-color-normal);background:var(--config-color-fade-super);opacity:1!important}.input.strip,input[type=date].strip,input[type=datetime-local].strip,input[type=email].strip,input[type=file].strip,input[type=number].strip,input[type=password].strip,input[type=search].strip,input[type=tel].strip,input[type=text].strip,input[type=url].strip,select.strip,textarea.strip{border:none;border-radius:0;padding:5px 0;width:100%;background-color:transparent;background-position:left 2px top 50%;border-bottom:solid 1px var(--config-color-fade-light);color:var(--config-color-placeholder)}.input.strip:focus,input[type=date].strip:focus,input[type=datetime-local].strip:focus,input[type=email].strip:focus,input[type=file].strip:focus,input[type=number].strip:focus,input[type=password].strip:focus,input[type=search].strip:focus,input[type=tel].strip:focus,input[type=text].strip:focus,input[type=url].strip:focus,select.strip:focus,textarea.strip:focus{border-color:#b3d7fd}.input:-webkit-autofill::first-line,input[type=date]:-webkit-autofill::first-line,input[type=datetime-local]:-webkit-autofill::first-line,input[type=email]:-webkit-autofill::first-line,input[type=file]:-webkit-autofill::first-line,input[type=number]:-webkit-autofill::first-line,input[type=password]:-webkit-autofill::first-line,input[type=search]:-webkit-autofill::first-line,input[type=tel]:-webkit-autofill::first-line,input[type=text]:-webkit-autofill::first-line,input[type=url]:-webkit-autofill::first-line,select:-webkit-autofill::first-line,textarea:-webkit-autofill::first-line{font-weight:300;font-size:16px}input[type=email],input[type=url]{direction:ltr}input[type=email]::placeholder,input[type=url]::placeholder{text-align:left;direction:ltr}select{background:0 0;-webkit-appearance:none;background-image:var(--config-console-nav-switch-arrow);background-position:left 15px top 50%;background-repeat:no-repeat;background-color:var(--config-color-background-input);width:calc(100% - 62px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-left:45px}select:-webkit-autofill{background-image:url("data:image/svg+xml;utf8,")!important;background-position:100% 50%!important;background-repeat:no-repeat!important}input[type=search],input[type=search].strip{background:0 0;-webkit-appearance:none;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAdZJREFUWIXt1s2LjWEYBvDfnDMzFpNIamZIFrMiJYMyFmKhZKfOwoiFr2LFn2BByG6WVrKwMcjWxgoLIlKIUk6RrzAjZWZ8LO731FlwvB+PUbjq6X0X7/VeV/d9P9fz8IdRL8Hpw3x8w0xaOz9GNxq4gJeZcGs1cRab0fU7xLfgMSYzoT3YgNXYhIO4iM+4iTWphGs4jikcFSXvhEGczr4/UFW8C2N4jXUFudvwCYeqGNgnSr6yJH8rpkWLCqMfE9hdUryFE3iC3qLEk7ij+kT34Q32FiHV8Qr7K4q3cArXihCGxd5elMjARnzBvE4f1dreV+AtnicycC/7/7K8BhaIvqXCO3zFwrwGZtCT0EAtW9N5DTSxWGR/CizNns/yEgbFEK5NZGCnaEPHE7e9Ai9wA6OJDIzistgJubFdxHB/RfFVYgCHixJruI5x5dNwDm6J47sUhkTvjpUw0Y1zeOrXR3hHjOA9zmBuTs4Arog4/yhuUZWwHPdFMh7280BZgiP4ILJ/UuymqRQmejPxphiquzgvKnMJDzOxB9glZqiRiecykbfHdawX98EhcdxO4BGu4nYm2EJDzEKPSMIdYrBnFYUq8d/EP2di1gey3cS4ErflvxffASbhcakIINaMAAAAAElFTkSuQmCC);background-color:var(--config-color-background-input);background-position:right 15px top 50%;background-repeat:no-repeat;background-size:20px 20px;width:calc(100% - 60px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:45px}select[multiple]{min-height:75px;padding:5px 10px!important;padding-left:50px!important}select[multiple] option{padding:10px 4px;border-bottom:solid 1px #f1f1f1}select[multiple] option:last-child{border-bottom:none}textarea{min-height:75px;resize:vertical;line-height:32px;padding:5px 15px}textarea.tall{min-height:180px}fieldset{border:none;margin:0;padding:0}.counter{font-size:13px;text-align:left;color:var(--config-color-fade);margin-top:-20px;margin-bottom:20px}.file-preview{background:var(--config-color-background-input) url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAIElEQVQoU2NkYGAwZsAEZ9GFGIeIQix+wfQgyDODXSEAcUwGCrDSHgkAAAAASUVORK5CYII=)!important;border:solid 1px #e2e2e2;box-shadow:inset 0 0 3px #a0a0a0;border-radius:8px;width:calc(100% - 2px);max-height:180px;visibility:visible!important}.video-preview{padding-top:56%;position:relative;border-radius:10px;background:#e7e7e7;overflow:hidden;margin:0}.video-preview iframe{position:absolute;top:0;width:100%;height:100%;border:none}.map-preview{padding-top:50%;position:relative;margin-bottom:10px;border-radius:10px;background:#e7e7e7;overflow:hidden;box-shadow:0 0 30px rgba(218,218,218,.5)}.map-preview iframe{position:absolute;top:0;width:100%;height:100%;border:none}.tooltip{position:relative}.tooltip.large:hover:after{white-space:normal;width:280px}.tooltip.small:hover:after{white-space:normal;width:180px}.tooltip:hover:after{white-space:nowrap;background:var(--config-color-tooltip-background);border-radius:5px;bottom:26px;color:var(--config-color-tooltip-text);content:attr(data-tooltip);padding:5px 15px;position:absolute;font-size:13px;line-height:20px;z-index:98;right:20%;margin-right:-30px;word-break:break-word}.tooltip:hover:before{border:solid;border-color:var(--config-color-tooltip-background) transparent;border-width:6px 6px 0 6px;bottom:20px;content:"";position:absolute;z-index:99;right:5px}.tooltip.down:hover:after{top:26px;bottom:inherit}.tooltip.down:hover:before{top:20px;border-width:0 6px 6px 6px;bottom:inherit}.tag{display:inline-block;background:var(--config-color-fade-light);color:var(--config-color-fade);border-radius:12px;line-height:24px;padding:0 8px;font-size:12px;box-shadow:none!important;border:none;height:auto;width:auto;white-space:nowrap;text-overflow:ellipsis}.tag:hover{border:none}.tag.green{background:var(--config-color-success);color:#fff}.tag.red{background:var(--config-color-danger);color:#fff}.tag.yellow{background:#ffe28b;color:#494949}.tag.focus{background:var(--config-color-focus);color:#fff}.tag.dark{background:var(--config-color-dark);color:#e7e7e7}.tag.blue{background:var(--config-color-info);color:#fff}.tag.link{background:var(--config-color-link);color:#fff}input[type=checkbox],input[type=radio]{width:26px;height:16px;position:relative;-webkit-appearance:none;border-radius:0;border:none;background:0 0;vertical-align:middle;margin:0}input[type=checkbox]:after,input[type=radio]:after{content:"";display:block;width:20px;height:20px;background:var(--config-color-background-fade);top:-5px;border-radius:50%;position:absolute;border:solid 3px var(--config-color-focus);vertical-align:middle}input[type=checkbox]:checked:after,input[type=radio]:checked:after{text-align:center;font-family:fontello;content:'\e83d';font-size:16px;line-height:20px;color:var(--config-color-background-fade);background:var(--config-color-focus)}input[type=checkbox][type=radio]:checked:after,input[type=radio][type=radio]:checked:after{content:'';display:block;width:10px;height:10px;border-radius:50%;background:var(--config-color-background-fade);border:solid 8px var(--config-color-focus)}input[type=checkbox]:focus,input[type=radio]:focus{outline:0}input[type=checkbox]:focus:after,input[type=checkbox]:hover:after,input[type=radio]:focus:after,input[type=radio]:hover:after{outline:0;border-color:#000}input[type=checkbox]:checked:focus:after,input[type=checkbox]:checked:hover:after,input[type=radio]:checked:focus:after,input[type=radio]:checked:hover:after{border-color:var(--config-color-focus)}.input-copy{position:relative}.input-copy input,.input-copy textarea{padding-left:65px;width:calc(100% - 82px);resize:none}.input-copy .copy{position:absolute;top:0;left:0;border-right:solid 1px var(--config-color-fade-light);height:calc(100% - 2px);width:50px;line-height:50px;text-align:center;background:var(--config-color-background-focus);margin:1px;border-radius:0 10px 10px 0}.paging{color:var(--config-color-fade);padding:5px 15px;font-size:12px}.paging form{display:inline-block}.paging button:disabled{color:var(--config-color-background-fade);opacity:.6}.blue-snap iframe{-webkit-appearance:none;-moz-appearance:none;-webkit-transform:translateZ(0);box-sizing:content-box;color:#313131;height:40px;line-height:40px;border:solid 1px var(--config-color-fade-light);border-radius:10px;padding:5px 15px;font-size:16px;display:block;width:calc(100% - 32px);margin-bottom:30px;float:none!important;height:40px!important;width:calc(100% - 32px)!important;border:solid 1px #e2e2e2!important;background:0 0!important;position:static!important}.blue-snap iframe[type=file]{line-height:0;padding:15px;height:auto}.blue-snap iframe:focus{outline:0;border-color:#b3d7fd}.blue-snap iframe:disabled{color:var(--config-color-normal);background:var(--config-color-fade-super);opacity:1!important}.blue-snap iframe.strip{border:none;border-radius:0;padding:5px 0;width:100%;background-color:transparent;background-position:left 2px top 50%;border-bottom:solid 1px var(--config-color-fade-light);color:var(--config-color-placeholder)}.blue-snap iframe.strip:focus{border-color:#b3d7fd}.blue-snap iframe:-webkit-autofill::first-line{font-weight:300;font-size:16px}.blue-snap .error{font-size:12px;margin-top:-25px;color:var(--config-color-danger);height:40px;padding-right:2px}.pell{height:auto;padding-bottom:0;margin-bottom:0;padding-top:0;background:var(--config-color-background-input);line-height:normal!important;position:relative}.pell.hide{padding:0!important;height:1px;min-height:1px;max-height:1px;border:none;box-shadow:none;margin-bottom:20px;opacity:0}.pell [contenteditable=true]:empty:before{content:attr(placeholder);display:block;color:var(--config-color-placeholder)}.pell .pell-actionbar{border-bottom:solid 1px var(--config-color-fade-light);margin:0 -15px 15px -15px;padding:10px 15px;position:sticky;top:70px;background:var(--config-color-background-input);border-radius:10px 10px 0 0}.pell .pell-content{min-height:100px;display:block;padding:10px;margin:-10px;cursor:text}.pell .pell-content:focus{outline:0}.pell button{background:inherit;color:inherit;margin:0;padding:0;padding-left:15px;height:40px;line-height:40px;box-shadow:none;cursor:pointer;font-size:13px;border-radius:0}.pell button.pell-button-selected,.pell button:focus,.pell button:hover{color:var(--config-color-link)}.pell h1,.pell h2,.pell h3,.pell h4,.pell h5,.pell h6{text-align:inherit;margin-bottom:30px}.pell b,.pell strong{font-weight:700}.pell ol,.pell ul{margin:0 0 20px 0}.pell ol li,.pell ul li{display:list-item!important;list-style:inherit;list-style-position:inside!important;margin:0 20px 2px 20px}.pell ol li p,.pell ul li p{margin:0;display:inline}.pell ol li{list-style:decimal}.pell ol li::before{content:'';display:none}label.switch{line-height:42px}.switch,input[type=checkbox].button.switch,input[type=checkbox].switch{width:52px;height:32px;line-height:32px;border-radius:21px;background:var(--config-color-fade);display:inline-block;margin:0;padding:5px;padding-right:5px;padding-left:30px}.switch.on,.switch:checked,input[type=checkbox].button.switch.on,input[type=checkbox].button.switch:checked,input[type=checkbox].switch.on,input[type=checkbox].switch:checked{background-color:var(--config-color-success);padding-right:25px;padding-left:5px}.switch.on:focus,.switch.on:hover,.switch:checked:focus,.switch:checked:hover,input[type=checkbox].button.switch.on:focus,input[type=checkbox].button.switch.on:hover,input[type=checkbox].button.switch:checked:focus,input[type=checkbox].button.switch:checked:hover,input[type=checkbox].switch.on:focus,input[type=checkbox].switch.on:hover,input[type=checkbox].switch:checked:focus,input[type=checkbox].switch:checked:hover{background:var(--config-color-success)}.switch:focus,.switch:hover,input[type=checkbox].button.switch:focus,input[type=checkbox].button.switch:hover,input[type=checkbox].switch:focus,input[type=checkbox].switch:hover{background:var(--config-color-fade)}.switch:focus:after,.switch:hover:after,input[type=checkbox].button.switch:focus:after,input[type=checkbox].button.switch:hover:after,input[type=checkbox].switch:focus:after,input[type=checkbox].switch:hover:after{background:#fff}.switch:after,input[type=checkbox].button.switch:after,input[type=checkbox].switch:after{content:"";display:block;width:22px;height:22px;background:#fff;border-radius:50%;border:none;position:static;top:0}.password-meter{margin:-41px 10px 30px 10px;height:2px;background:0 0;max-width:100%;z-index:2;position:relative}.password-meter.weak{background:var(--config-color-danger)}.password-meter.medium{background:var(--config-color-success)}.password-meter.strong{background:var(--config-color-success)}.color-input:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.color-input .color-preview{width:53px;height:53px;float:right;margin-left:10px;background:#000;border-radius:10px;box-shadow:inset 0 0 3px #a0a0a0;position:relative}.color-input .color-preview input{opacity:0;position:absolute;top:0;bottom:0;left:0;right:0;width:100%;height:100%;cursor:pointer}.color-input input{text-transform:uppercase;float:right;width:calc(100% - 95px)}.grecaptcha-badge{box-shadow:none!important;border-radius:10px!important;overflow:hidden!important;background:#4d92df!important;bottom:25px}.grecaptcha-badge:hover{width:256px!important}.back{font-size:15px;line-height:24px;height:24px;margin-right:-15px;margin-top:-25px;margin-bottom:20px}.back span{font-weight:inherit!important}@media only screen and (max-width:550px){.back{margin-right:-5px}}hr{height:1px;background:var(--config-border-color)!important;border:none}hr.fade{opacity:.7}.upload{position:relative}.upload:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.upload input{position:absolute;top:0;right:0;opacity:0;cursor:pointer}.upload.single .preview{height:0;position:relative;padding-top:100%;width:100%;margin-bottom:15px!important}.upload.single .preview li{position:absolute;top:0;width:calc(100% - 20px);height:calc(100% - 20px);margin-left:0!important;margin-bottom:0!important}.upload .button{float:right;margin-left:10px!important}.upload .button.disabled,.upload .button.disabled:hover{background:0 0;color:inherit;border-color:inherit}.upload .count{float:right;line-height:52px}.upload .progress{background:var(--config-color-success);height:6px;border-radius:3px;margin-bottom:15px!important}.upload .preview:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.upload .preview li{float:right;margin-left:20px!important;margin-bottom:15px!important;background:var(--config-color-background-fade-super);width:150px;height:150px;line-height:148px;text-align:center;border-radius:20px;overflow:hidden;position:relative;cursor:pointer;border:solid 1px var(--config-color-background-dark)}.upload .preview li:hover:before{background:var(--config-color-focus)}.upload .preview li:before{content:'\e807';font-family:fontello;font-size:12px;position:absolute;width:20px;height:20px;display:block;top:8px;left:8px;text-align:center;line-height:20px;vertical-align:middle;border-radius:50%;background:#484848;color:#fff;z-index:1}.upload .preview li img{vertical-align:middle;max-height:150px;max-width:150px;-webkit-filter:drop-shadow(0 0 6px rgba(0, 0, 0, .3));filter:drop-shadow(0 0 1px rgba(0, 0, 0, .3))}.upload.wide .preview li{height:0;width:100%;position:relative;padding-top:30.547%;background:#e7e7e7;border-radius:10px;overflow:hidden;border:solid 1px #f9f9f9;margin:0}.upload.wide .preview li img{border-radius:10px;position:absolute;top:0;width:100%;display:block;opacity:1;max-width:inherit;max-height:inherit}ol{list-style:none;counter-reset:x-counter;padding:0}ol li{counter-increment:x-counter;line-height:30px;margin-bottom:30px;margin-right:45px}ol li::before{display:inline-block;content:counter(x-counter);color:var(--config-color-background-fade);background:var(--config-color-focus);border:solid 2px var(--config-color-focus);margin-left:15px;margin-right:-45px;width:26px;height:26px;border-radius:50%;text-align:center;line-height:26px}.required{color:var(--config-color-danger);font-size:8px;position:relative;top:-8px}.drop-list{position:relative;outline:0}.drop-list.open ul{display:block}.drop-list ul{position:relative;background:var(--config-color-background-fade);border-radius:10px;box-shadow:0 0 3px rgba(0,0,0,.05);padding:30px;display:block;border-bottom:none;box-shadow:0 0 6px rgba(0,0,0,.1);display:none;position:absolute;bottom:calc(100% + 10px);z-index:2;padding:0;right:-10px;max-width:280px;min-width:240px}.drop-list ul.padding-small{padding:15px}.drop-list ul.y-scroll{overflow-y:auto}.drop-list ul.danger{background:var(--config-color-danger);color:#fff}.drop-list ul.danger .box{color:var(--config-color-normal);background:var(--config-color-background-fade)}.drop-list ul.danger>.button,.drop-list ul.danger>button{background:#fff;color:var(--config-color-danger)}.drop-list ul.note{background:var(--config-note-background)}.drop-list ul.focus{background:var(--config-color-focus);color:var(--config-color-background-fade)}.drop-list ul.focus .button,.drop-list ul.focus button{background:var(--config-color-background-fade);color:var(--config-color-focus)}.drop-list ul.line{background:0 0;border:solid 1px var(--config-color-background-dark);box-shadow:none}.drop-list ul.warning{background:var(--config-color-success);color:#2d2d2d}.drop-list ul.warning .button,.drop-list ul.warning button{background:rgba(45,45,45,.8);color:var(--config-color-success)}.drop-list ul .tabs{border-bottom:solid 1px var(--config-border-color);margin:0 -30px;padding:0 30px!important}.drop-list ul>footer{margin:0 -30px -30px -30px;padding:15px 30px;background:var(--config-color-background-fade);border:solid 1px var(--config-border-color);border-radius:0 0 10px 10px}.drop-list ul hr{height:1px;background:var(--config-console-background);border:none;margin:30px -30px}.drop-list ul .label{position:absolute;top:10px;z-index:2;left:10px}.drop-list ul.fade-bottom{position:relative;overflow:hidden}.drop-list ul.fade-bottom:after{content:"";position:absolute;display:block;bottom:15px;width:100%;background:#000;background:linear-gradient(180deg,rgba(0,0,0,0) 0,var(--config-color-background-fade) 80%);height:100px;margin:0 -15px}.drop-list ul .header{position:static;height:40px;padding:20px 30px 20px 30px;margin-bottom:30px;margin:-30px -30px 20px -30px;background:var(--config-color-background-fade);border-bottom:solid 1px #efefef}.drop-list ul ul.numbers>li{position:relative;margin-right:30px;margin-left:50px}.drop-list ul ul.numbers>li hr{margin-right:-60px;margin-left:-80px}.drop-list ul ul.numbers>li .settings{position:absolute;top:3px;left:-50px}.drop-list ul ul.numbers>li::after{display:block;width:25px;height:25px;line-height:25px;font-size:13px;font-weight:500;border-radius:50%;background:var(--config-color-focus);color:var(--config-color-background);counter-increment:section;content:counter(section);text-align:center;position:absolute;top:3px;right:-45px}.drop-list ul .scroll{margin:0 -30px;overflow-y:scroll}.drop-list ul .scroll table{width:100%;margin:0}.drop-list ul ul.sortable{counter-reset:section}.drop-list ul ul.sortable>li [data-move-down].round,.drop-list ul ul.sortable>li [data-move-up].round,.drop-list ul ul.sortable>li [data-remove].round{background:var(--config-color-focus);color:var(--config-color-background-fade);width:25px;height:25px;line-height:25px;display:inline-block;text-align:center;padding:0;margin-left:5px}.drop-list ul ul.sortable>li [data-move-down].round:disabled,.drop-list ul ul.sortable>li [data-move-up].round:disabled,.drop-list ul ul.sortable>li [data-remove].round:disabled{display:none}.drop-list ul ul.sortable>li:first-child [data-move-up]{display:none}.drop-list ul ul.sortable>li:first-child [data-move-up]:disabled{display:inline-block;background:var(--config-color-background)}.drop-list ul ul.sortable>li:last-child [data-move-down]{display:none}.drop-list ul ul.sortable>li:last-child [data-move-down]:disabled{display:inline-block;background:var(--config-color-background)}.drop-list ul .toggle{position:relative;border-top:1px solid var(--config-console-background);border-bottom:1px solid var(--config-console-background);margin:0 -30px;padding:30px 30px 0 30px;height:65px;overflow:hidden}.drop-list ul .toggle.list{border-bottom:none}.drop-list ul .toggle.sorts button.ls-ui-open{width:calc(100% - 100px)}.drop-list ul .toggle button.ls-ui-open{left:0;position:absolute;top:0;width:100%;height:95px;background:0 0;opacity:.5;border-radius:0}.drop-list ul .toggle .icon-minus,.drop-list ul .toggle .icon-up-open{display:none}.drop-list ul .toggle .content{display:none}.drop-list ul .toggle.open{height:auto}.drop-list ul .toggle.open .icon-minus,.drop-list ul .toggle.open .icon-up-open{display:block}.drop-list ul .toggle.open .icon-down-open,.drop-list ul .toggle.open .icon-plus{display:none}.drop-list ul .toggle.open .content{display:block}.drop-list ul .list li{border-bottom:solid 2px var(--config-border-color);margin:0 -30px 30px -30px;padding:0 30px 30px 30px}.drop-list ul .list li:last-child{padding-bottom:0;margin-bottom:0;border-bottom:none}@media only screen and (max-width:550px){.drop-list ul .list li .actions{float:none}}.drop-list ul.new{text-align:center}.drop-list ul.new i{font-size:80px;line-height:80px;font-family:Poppins,sans-serif;font-style:normal;font-weight:300}.drop-list ul.new b{margin-top:20px;display:block}.drop-list ul .info{margin:0 -30px;padding:20px 30px;background:var(--config-modal-note-background);color:var(--config-modal-note-color);border-top:solid 1px var(--config-modal-note-border);border-bottom:solid 1px var(--config-modal-note-border)}.drop-list ul .info hr{background:var(--config-modal-note-border)!important}.drop-list ul .table-wrap{margin:0 -30px;overflow-y:scroll}.drop-list ul .table-wrap table{margin:0}.drop-list ul:before{border:solid;border-color:var(--config-color-background-fade) transparent;border-width:8px 8px 0 8px;bottom:-8px;content:"";position:absolute;z-index:99;right:30px}.drop-list ul.arrow-end:before{left:30px;right:unset}.drop-list ul li{border-bottom:solid 1px var(--config-color-fade-super);margin:0;padding:0}.drop-list ul li:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.drop-list ul li:first-child{border-radius:10px 10px 0 0}.drop-list ul li:last-child{border-radius:0 0 10px 10px}.drop-list ul li:hover{background:var(--config-color-fade-super)}.drop-list ul li:first-child:hover,.drop-list ul li:last-child:hover{border-color:transparent}.drop-list ul li .link,.drop-list ul li a,.drop-list ul li button.link{display:block;vertical-align:middle;height:auto;line-height:30px;display:inline-block;padding:10px 15px!important;color:inherit;font-size:14px;border:none;cursor:pointer;width:calc(100% - 30px);text-align:right;box-sizing:content-box}.drop-list ul li.disabled .link:hover,.drop-list ul li.disabled a:hover{background:0 0}.drop-list ul li .avatar{width:30px;height:30px;margin-left:10px;float:right}.drop-list ul li:last-child{border-bottom:none}.drop-list.bottom ul{bottom:auto;margin-top:-2px}.drop-list.bottom ul:before{bottom:auto;top:-8px;border-width:0 8px 8px 8px}.drop-list.end ul{left:-10px;right:auto}.disabled{opacity:.2;cursor:default}.disabled .button,.disabled .link,.disabled a,.disabled button{cursor:default!important}.disabled .button:hover,.disabled .link:hover,.disabled a:hover,.disabled button:hover{background:0 0}.tags{-webkit-appearance:none;-moz-appearance:none;-webkit-transform:translateZ(0);box-sizing:content-box;color:#313131;height:40px;line-height:40px;border:solid 1px var(--config-color-fade-light);border-radius:10px;padding:5px 15px;font-size:16px;display:block;width:calc(100% - 32px);margin-bottom:30px;background:var(--config-color-background-input);min-height:42px;height:auto;cursor:text}.tags[type=file]{line-height:0;padding:15px;height:auto}.tags:focus{outline:0;border-color:#b3d7fd}.tags:disabled{color:var(--config-color-normal);background:var(--config-color-fade-super);opacity:1!important}.tags.strip{border:none;border-radius:0;padding:5px 0;width:100%;background-color:transparent;background-position:left 2px top 50%;border-bottom:solid 1px var(--config-color-fade-light);color:var(--config-color-placeholder)}.tags.strip:focus{border-color:#b3d7fd}.tags:-webkit-autofill::first-line{font-weight:300;font-size:16px}.tags .add{display:inline-block!important;border:none;padding:0;width:auto;margin:0;max-width:100%;min-width:200px}.tags ul.tags-list{display:inline;white-space:pre-line}.tags ul.tags-list li{display:inline-block!important;margin-left:10px;font-size:16px;padding:5px 10px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.tags ul.tags-list li::before{float:left;content:'\e807';font-family:fontello;font-style:normal;display:inline-block;text-align:center;line-height:16px;width:16px;height:16px;font-size:12px;background:#000;color:#fff;border-radius:50%;margin-top:4px;margin-bottom:4px;margin-right:6px;margin-left:0}.switch-theme{background:var(--config-switch-background);border-radius:19px;height:26px;width:44px;margin:9px 0}.switch-theme button{padding:3px;display:block;background:0 0;height:26px;width:100%}.switch-theme i{background:var(--config-color-background-fade);border-radius:50%;height:18px;width:18px;line-height:18px;font-size:12px;padding:0;margin:0;color:var(--config-color-fade)}.switch-theme i.force-light{float:left}.switch-theme i.force-dark{float:right}.console{width:100%;padding:0;overscroll-behavior:none}.console body{position:relative;width:calc(100% - 320px);padding-top:70px;padding-bottom:0;padding-left:50px;padding-right:270px;margin:0;color:var(--config-color-normal);background:var(--config-console-background)}.console body .project-only{display:none!important}.console body.show-nav .project-only{display:inline-block!important}.console body.hide-nav{padding-right:50px;width:calc(100% - 100px)}.console body.hide-nav header{width:calc(100% - 50px)}.console body.hide-nav header .logo{display:inline-block}.console body.hide-nav .console-back{display:block}.console body.hide-nav .console-index{display:none}.console body.hide-nav .account{display:none}.console body.index .console-back{display:none}.console body.index .console-index{display:block}.console body.index .account{display:block}.console body .console-index{display:block}.console body .console-back{display:none}.console main{min-height:480px}.console header{position:fixed;top:0;width:calc(100% - 280px);height:40px;line-height:40px;padding:15px 30px;background:var(--config-color-background-fade);box-shadow:0 0 2px rgba(0,0,0,.1);margin:0 -50px;z-index:2;font-size:14px}.console header .logo{display:none;border:none}.console header .logo:hover{border:none;opacity:.8}.console header .logo img{height:26px;margin:7px 0}.console header .setup-new{width:40px;height:40px;line-height:40px}.console header .list{width:240px}.console header .list select{height:40px;line-height:40px;padding-top:0;padding-bottom:0;border:none;border-radius:26px;background-color:var(--config-console-nav-switch-background);color:var(--config-console-nav-switch-color)}.console header .account{margin-right:25px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.console header .switch-theme{margin:2px 0}.console header .avatar{height:40px;width:40px}.console header .account-button{background:0 0;position:absolute;width:100%;height:40px;border-radius:0;z-index:1}.console header .notifications{position:relative;font-size:20px}.console header .notifications a{color:#1b3445}.console header .notifications:after{position:absolute;content:"";display:block;background:var(--config-color-danger);width:8px;height:8px;border-radius:50%;top:3px;left:3px}.console header nav{background:#1b3445;background:linear-gradient(var(--config-console-nav-start),var(--config-console-nav-end));color:#788c99;position:fixed;height:100%;width:220px;top:0;right:0}.console header nav .logo{height:39px;padding:15px 20px;display:block}.console header nav .logo img{display:inline-block;margin-top:7px;margin-bottom:14px}.console header nav .logo svg g{fill:var(--config-color-focus)}.console header nav .icon{display:block;border:none;margin:18px 10px 50px 10px}.console header nav .icon img{display:block}.console header nav .icon:hover{border-bottom:none}.console header nav .icon:hover svg g{fill:var(--config-color-focus)}.console header nav .container{overflow:auto;height:calc(100% - 133px);width:100%}.console header nav .project-box{padding:20px;text-align:center;display:block;border:none;line-height:100px;height:100px}.console header nav .project-box img{max-height:80px;max-width:80%;display:inline-block;vertical-align:middle}.console header nav .project{display:block;padding:85px 25px 20px 25px;color:#788c99;position:relative;border:none;height:20px}.console header nav .project:hover{border-bottom:none}.console header nav .project .name{height:20px;line-height:20px;margin:0;padding:0;display:inline-block;max-width:100%}.console header nav .project .arrow{display:block;position:absolute;left:5px;top:10px;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #788c99;transform:rotate(225deg)}.console header nav .project img{position:absolute;bottom:40px;display:block;margin-bottom:10px;max-height:35px;max-width:40%}.console header nav .subtitle{padding:0 30px;display:block;font-size:12px;font-weight:300}.console header nav .links{margin-bottom:15px!important}.console header nav .links.top{border:none;padding-bottom:0;margin-bottom:5px!important}.console header nav .links.bottom{position:absolute;bottom:0;left:0;right:0;padding-bottom:0;border:none;margin-bottom:0!important;box-shadow:0 0 10px rgba(0,0,0,.1)}.console header nav .links.bottom a{border-top:solid 1px var(--config-console-nav-border);border-bottom:none}.console header nav .links .sub{display:inline-block;border:none;width:25px;height:25px;line-height:25px;border-radius:50%;padding:0;background:var(--config-color-focus);color:#fff;text-align:center;font-size:12px;margin:18px}.console header nav .links .sub i{width:auto;margin:0}.console header nav .links .sub:hover{border:none}.console header nav .links a{padding:8px 20px;border:none;display:block;color:#87a5b9;font-weight:400;border-right:solid 5px transparent;font-size:13px}.console header nav .links a i{margin-left:8px;width:22px;display:inline-block}.console header nav .links a.selected,.console header nav .links a:hover{color:#e4e4e4}.console header nav:after{content:'';display:block;position:absolute;background:#302839;height:100px;width:100%;bottom:-100px}.console>footer{width:calc(100% + 100px);margin:0 -50px;box-sizing:border-box;background:0 0;padding-left:30px;padding-right:30px}.console>footer ul{float:none;text-align:center}.console>footer ul li{float:none;display:inline-block}.console .projects{position:relative}.console .projects:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.console .projects li{float:right;margin-left:50px;margin-bottom:50px;width:270px}.console .projects li:nth-child(3n){margin-left:0}.console .dashboard{padding:20px;min-height:95px;overflow:hidden;position:relative;z-index:1}.console .dashboard hr{margin:20px -20px;height:2px;background:var(--config-console-background)}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.console .dashboard hr{height:3px}}.console .dashboard footer{margin:-20px;padding:20px;background:#fcfeff;border:none;color:var(--config-color-link)}.console .dashboard .col{position:relative}.console .dashboard .col:last-child:after{display:none}.console .dashboard .col:after{content:"";display:block;width:2px;background:var(--config-console-background);height:calc(100% + 110px);position:absolute;top:-20px;bottom:-20px;left:24px}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.console .dashboard .col:after{width:calc(100% + 40px);height:3px;position:static;margin:20px -20px}}.console .dashboard .value{color:var(--config-color-focus);vertical-align:bottom;line-height:45px}.console .dashboard .value .sum{font-size:45px;line-height:45px;font-weight:700;vertical-align:bottom}.console .dashboard .unit{font-weight:500;line-height:20px;vertical-align:bottom;font-size:16px;display:inline-block;margin-bottom:5px;margin-right:5px;color:var(--config-color-focus)}.console .dashboard .metric{color:var(--config-color-focus);font-weight:400;font-size:13px;line-height:16px}.console .dashboard .range{color:var(--config-color-fade);font-weight:400;font-size:14px;line-height:16px}.console .dashboard a{display:block;font-weight:400;font-size:14px;line-height:16px;padding:0;border:none}.console .dashboard .chart-metric{width:19%}@media only screen and (min-width:551px) and (max-width:1198px),only screen and (max-width:550px){.console .dashboard .chart-metric{width:100%}}.console .dashboard .chart{width:80%;position:relative;height:0;padding-top:20px;padding-bottom:26%;margin-left:-2px;overflow:hidden;background-color:var(--config-color-background-fade);background-image:linear-gradient(transparent 1px,transparent 1px),linear-gradient(90deg,transparent 1px,transparent 1px),linear-gradient(var(--config-border-color) 1px,transparent 1px),linear-gradient(90deg,var(--config-border-color) 1px,transparent 1px);background-size:100px 100px,100px 100px,20px 20px,20px 20px;background-position:-2px -2px,-2px -2px,-1px -1px,-1px -1px;background-repeat:round;border:solid 1px var(--config-border-color);border-right:solid 1px transparent;border-bottom:solid 1px transparent}@media only screen and (min-width:551px) and (max-width:1198px),only screen and (max-width:550px){.console .dashboard .chart{width:100%;padding-bottom:32%;float:none;margin-bottom:20px}}.console .dashboard .chart canvas{position:absolute;bottom:0;display:block;height:100%;width:100%}.console .community a{padding:0 10px;display:inline-block}.console .link-list li{margin-bottom:15px}.console .link-list i{display:inline-block;width:30px;height:30px;line-height:30px;text-align:center;background:var(--config-color-fade);color:var(--config-color-fade-super);border-radius:50%;margin-left:15px}.console .link-list i.fade{background:0 0;color:var(--config-color-fade)}.console .provider{width:50px;height:50px;background:#f5f5f5;color:#868686;line-height:50px;text-align:center;font-size:25px;border-radius:50%}.console .provider.facebook{color:#fff;background:#3b5998}.console .provider.twitter{color:#fff;background:#55beff}.console .provider.telegram{color:#fff;background:#3ba9e1}.console .provider.github{color:#fff;background:#24292e}.console .provider.whatsapp{color:#fff;background:#25d366}.console .provider.linkedin{color:#fff;background:#1074af}.console .provider.microsoft{color:#fff;background:#137ad4}.console .provider.google{color:#fff;background:#4489f1}.console .provider.bitbucket{color:#fff;background:#2a88fb}.console .provider.gitlab{color:#faa238;background:#30353e}.console .provider.instagram{color:#fff;background:radial-gradient(circle at 30% 107%,#fdf497 0,#fdf497 5%,#fd5949 45%,#d6249f 60%,#285aeb 90%)}.console .premium{z-index:3;margin-top:320px}.console .premium .message{height:190px;overflow:hidden;position:absolute;top:-280px}.console .premium:after{content:'';position:absolute;top:0;left:-20px;right:-20px;bottom:-20px;background:var(--config-color-background);opacity:.7;z-index:300}.console .app-section{height:90px}.console .confirm{background:var(--config-color-link);color:#fff;border-radius:25px;padding:12px;line-height:28px;text-align:center}.console .confirm .action{font-weight:500;cursor:pointer}.console .platforms{overflow:hidden}.console .platforms .box{overflow:hidden}.console .platforms .box img{width:50px;margin:0 auto;margin-bottom:20px}.console .platforms .box .cover{margin:-30px -30px 30px -30px;padding:30px}.console .platforms .box .cover.android{background:#a4ca24}.console .platforms .box .cover.android h1{color:#fff;font-size:18px;margin-top:20px}.console .platforms .col{text-align:center;line-height:30px}.console .platforms a{display:block;margin:-20px;padding:20px}.console .platforms a:hover{background:#fbfeff}.console .platforms img{display:block;margin:0 30px;width:calc(100% - 60px);border-radius:50%;margin-bottom:20px}.console .document-nav{display:none;position:sticky;top:90px}@media only screen and (min-width:1380px){.console .document-nav{display:block}}.console .document-nav ul{position:absolute;width:200px;right:-260px}.console .document-nav ul li{margin-bottom:20px}.console .document-nav ul li .selected{font-weight:500}.console .scroll-to{display:none}@media only screen and (min-width:1199px){.console .logo .top{display:none!important}}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.console>header{width:calc(100% - 30px)!important;margin:0 -30px;padding:15px}.console>header nav{width:100%;height:70px;overflow:hidden}.console>header nav.close{background:0 0}.console>header nav.close .logo .nav{display:none!important}.console>header nav.open{height:100%}.console>header nav.open .logo .top{display:none!important}.console>header nav.open .bottom{display:block!important}.console>header nav.open button{color:#87a5b9}.console>header nav button{margin:9px;background:0 0;color:var(--config-color-normal)}.console>header nav button:focus,.console>header nav button:hover{background:0 0}.console>header nav .logo{display:block!important;position:absolute;top:0;left:50%;margin:auto;transform:translateX(-50%)}.console>header nav .bottom{display:none!important}.console>footer{width:auto;margin:50px -30px 0 -30px!important;padding:0 30px 30px 30px}.console body{height:"calc(100% - 70px)"!important;width:calc(100% - 60px)!important;padding:70px 30px 0 30px!important}.console .cover{padding:25px 30px;margin:0 -30px}}@media only screen and (max-width:550px){.console body{height:"calc(100% - 70px)"!important;width:calc(100% - 40px)!important;padding:70px 20px 0 20px!important}.console .cover{padding:20px 20px;margin:0 -20px}.console>header{margin:0 -20px}.console>header .list{width:175px;font-size:14px}.console>footer{margin:50px -20px 0 -20px!important;padding:0 20px 20px 20px}}.dev-feature{display:none}.prod-feature{display:none}.development .dev-feature{display:block;opacity:.6!important;outline:solid #ff0 3px;outline-offset:3px}.development .dev-feature.dev-inline{display:inline-block}.development .prod-feature{display:none}.production .dev-feature{display:none}.production .prod-feature{display:block}.search{opacity:1!important}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.search button{margin-top:20px}}html.home body{padding:0 50px;color:var(--config-color-normal)}html.home .logo a{display:block}html.home .logo a:hover{opacity:.8}html.home .logo img{max-height:35px;width:198px;margin:45px auto 25px auto}html.home footer{background:0 0;text-align:center}html.home main{min-height:400px}.alerts ul{width:100%;visibility:hidden;position:fixed;padding:0;right:0;left:0;color:var(--config-color-normal);z-index:1002;margin:0 auto;bottom:15px;max-width:560px}.alerts ul li{margin:10px 0 0 0;padding:0}.alerts ul li div.message{position:relative;padding:12px 35px;margin:0 auto;list-style:none;background:var(--config-color-background-dark);text-align:center;font-size:14px;border-radius:10px;line-height:16px;min-height:16px;box-shadow:0 0 10px rgba(0,0,0,.05);opacity:.95}.alerts ul li div.message a,.alerts ul li div.message span{font-weight:600}.alerts ul li div.message i{cursor:pointer;position:absolute;font-size:14px;line-height:22px;top:8px;right:8px}.alerts ul li div.message.error{color:#fff;background:var(--config-color-danger)}.alerts ul li div.message.success{color:#fff;background:var(--config-color-success)}.alerts ul li div.message.warning{color:#fff;background:var(--config-color-success)}.alerts ul li div.message.open{display:block}.alerts ul li div.message.close{display:none}.alerts .cookie-alert{background:var(--config-color-focus-fade)!important;color:var(--config-color-focus)}.alerts .cookie-alert a{color:var(--config-color-focus);font-weight:400;border-bottom:dotted 1px var(--config-color-focus)}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.alerts ul{top:auto;bottom:0;max-width:100%}.alerts ul li{margin:5px 0 0 0}.alerts ul li div.message{border-radius:0}}article{overflow-wrap:break-word;word-wrap:break-word}article h1{font-size:36px}article h2{font-size:24px}article h3{font-size:20px}article h4{font-size:20px}article h5{font-size:18px}article h6{font-size:16px}article h1,article h2,article h3,article h4,article h5,article h6{margin-top:30px!important;margin-bottom:30px!important}article p{line-height:32px;font-size:16px}article .update{display:block;margin-top:50px!important}article table{width:100%;margin:0;margin-bottom:30px!important;border-radius:0;border-bottom:solid 1px var(--config-border-color)}article table thead td{font-weight:500;padding:5px 15px}article table td,article table th{padding:15px;height:auto}article table td:first-child,article table th:first-child{padding-right:10px}article table td:last-child,article table th:last-child{padding-left:10px}article table td p,article table th p{font-size:inherit;line-height:inherit}article table td p:last-child,article table th p:last-child{margin:0}.avatar-container{position:relative}.avatar-container .corner{position:absolute;bottom:-3px;left:-3px}.avatar{width:60px;height:60px;border-radius:50%;background:var(--config-color-background-focus);display:inline-block;overflow:hidden;box-shadow:0 0 6px rgba(0,0,0,.09);position:relative;z-index:1;opacity:1!important}.avatar:before{content:"";position:absolute;width:100%;height:100%;z-index:0;background:var(--config-color-background-focus)}.avatar.inline{display:inline-block;vertical-align:middle}.avatar.trans{background:0 0}.avatar .no-shadow{box-shadow:none}.avatar.xs{width:30px;height:30px}.avatar.xxs{width:20px;height:20px}.avatar.small{width:50px;height:50px}.avatar.big{width:100px;height:100px}.avatar.huge{width:150px;height:150px}.box{position:relative;background:var(--config-color-background-fade);border-radius:10px;box-shadow:0 0 3px rgba(0,0,0,.05);padding:30px;display:block;border-bottom:none}.box.padding-small{padding:15px}.box.y-scroll{overflow-y:auto}.box.danger{background:var(--config-color-danger);color:#fff}.box.danger .box{color:var(--config-color-normal);background:var(--config-color-background-fade)}.box.danger>.button,.box.danger>button{background:#fff;color:var(--config-color-danger)}.box.note{background:var(--config-note-background)}.box.focus{background:var(--config-color-focus);color:var(--config-color-background-fade)}.box.focus .button,.box.focus button{background:var(--config-color-background-fade);color:var(--config-color-focus)}.box.line{background:0 0;border:solid 1px var(--config-color-background-dark);box-shadow:none}.box.warning{background:var(--config-color-success);color:#2d2d2d}.box.warning .button,.box.warning button{background:rgba(45,45,45,.8);color:var(--config-color-success)}.box .tabs{border-bottom:solid 1px var(--config-border-color);margin:0 -30px;padding:0 30px!important}.box>footer{margin:0 -30px -30px -30px;padding:15px 30px;background:var(--config-color-background-fade);border:solid 1px var(--config-border-color);border-radius:0 0 10px 10px}.box hr{height:1px;background:var(--config-console-background);border:none;margin:30px -30px}.box .label{position:absolute;top:10px;z-index:2;left:10px}.box.fade-bottom{position:relative;overflow:hidden}.box.fade-bottom:after{content:"";position:absolute;display:block;bottom:15px;width:100%;background:#000;background:linear-gradient(180deg,rgba(0,0,0,0) 0,var(--config-color-background-fade) 80%);height:100px;margin:0 -15px}.box .header{position:static;height:40px;padding:20px 30px 20px 30px;margin-bottom:30px;margin:-30px -30px 20px -30px;background:var(--config-color-background-fade);border-bottom:solid 1px #efefef}.box ul.numbers>li{position:relative;margin-right:30px;margin-left:50px}.box ul.numbers>li hr{margin-right:-60px;margin-left:-80px}.box ul.numbers>li .settings{position:absolute;top:3px;left:-50px}.box ul.numbers>li::after{display:block;width:25px;height:25px;line-height:25px;font-size:13px;font-weight:500;border-radius:50%;background:var(--config-color-focus);color:var(--config-color-background);counter-increment:section;content:counter(section);text-align:center;position:absolute;top:3px;right:-45px}.box .scroll{margin:0 -30px;overflow-y:scroll}.box .scroll table{width:100%;margin:0}.box ul.sortable{counter-reset:section}.box ul.sortable>li [data-move-down].round,.box ul.sortable>li [data-move-up].round,.box ul.sortable>li [data-remove].round{background:var(--config-color-focus);color:var(--config-color-background-fade);width:25px;height:25px;line-height:25px;display:inline-block;text-align:center;padding:0;margin-left:5px}.box ul.sortable>li [data-move-down].round:disabled,.box ul.sortable>li [data-move-up].round:disabled,.box ul.sortable>li [data-remove].round:disabled{display:none}.box ul.sortable>li:first-child [data-move-up]{display:none}.box ul.sortable>li:first-child [data-move-up]:disabled{display:inline-block;background:var(--config-color-background)}.box ul.sortable>li:last-child [data-move-down]{display:none}.box ul.sortable>li:last-child [data-move-down]:disabled{display:inline-block;background:var(--config-color-background)}.box .toggle{position:relative;border-top:1px solid var(--config-console-background);border-bottom:1px solid var(--config-console-background);margin:0 -30px;padding:30px 30px 0 30px;height:65px;overflow:hidden}.box .toggle.list{border-bottom:none}.box .toggle.sorts button.ls-ui-open{width:calc(100% - 100px)}.box .toggle button.ls-ui-open{left:0;position:absolute;top:0;width:100%;height:95px;background:0 0;opacity:.5;border-radius:0}.box .toggle .icon-minus,.box .toggle .icon-up-open{display:none}.box .toggle .content{display:none}.box .toggle.open{height:auto}.box .toggle.open .icon-minus,.box .toggle.open .icon-up-open{display:block}.box .toggle.open .icon-down-open,.box .toggle.open .icon-plus{display:none}.box .toggle.open .content{display:block}.box .list li{border-bottom:solid 2px var(--config-border-color);margin:0 -30px 30px -30px;padding:0 30px 30px 30px}.box .list li:last-child{padding-bottom:0;margin-bottom:0;border-bottom:none}@media only screen and (max-width:550px){.box .list li .actions{float:none}}.box.new{text-align:center}.box.new i{font-size:80px;line-height:80px;font-family:Poppins,sans-serif;font-style:normal;font-weight:300}.box.new b{margin-top:20px;display:block}.box .info{margin:0 -30px;padding:20px 30px;background:var(--config-modal-note-background);color:var(--config-modal-note-color);border-top:solid 1px var(--config-modal-note-border);border-bottom:solid 1px var(--config-modal-note-border)}.box .info hr{background:var(--config-modal-note-border)!important}.box .table-wrap{margin:0 -30px;overflow-y:scroll}.box .table-wrap table{margin:0}a.box{border-right:none;border-left:none}a.box:hover{box-shadow:0 0 1px rgba(0,0,0,.2);opacity:.7}.box-asidex{padding-left:25px!important;padding-right:70px;left:0;background:#f9f9f9;border-radius:0 10px 10px 0;height:calc(100% - 30px);position:absolute;padding-top:30px}.box-asidex:after{content:"";display:block;position:absolute;height:100%;width:51px;background:#fff;top:0;bottom:0;right:-6px}.cover{background:var(--config-color-focus-fade);padding:30px 50px;margin:0 -50px;position:relative}.cover .title,.cover h1,.cover h2,.cover h3,.cover h4{color:var(--config-color-focus);font-weight:600;margin-bottom:50px!important;font-size:28px;line-height:42px}.cover .title span,.cover h1 span,.cover h2 span,.cover h3 span,.cover h4 span{font-weight:600}.cover i:before{margin:0!important}.cover p{color:var(--config-color-fade)}.cover .button{color:#fff}.cover .link,.cover a{color:var(--config-color-focus);border-left:none;border-right:none;cursor:pointer}.cover .link:hover,.cover a:hover{border-bottom-color:var(--config-color-focus)}.console .database .row .col{height:452px}.console .database .row .col:after{width:2px;left:20px}.console .database hr{margin:0 -20px;background:var(--config-color-background);height:1px}.console .database h3{font-size:13px;line-height:20px;height:20px;background-color:var(--config-color-fade-super);margin:-20px -20px 0 -20px;padding:10px 20px;border-bottom:solid 1px var(--config-color-background);font-weight:600}.console .database .empty{height:162px;font-size:12px;text-align:center;margin:50px 0}.console .database .empty h4{font-size:13px;font-weight:600;line-height:120px}.console .database .search{background-color:var(--config-color-fade-super);margin:0 -20px 0 -20px;padding:10px 15px}.console .database .search input{height:40px;background-color:#fff;border-radius:25px;padding-top:0;padding-bottom:0}.console .database .code{height:411px;background:var(--config-color-fade-super);margin:0 -20px -20px -20px;padding:20px;width:calc(100% - 10px)}.console .database .code .ide{overflow:scroll;height:451px;margin:-20px;box-shadow:none;border-radius:0}.console .database .paging{background:var(--config-color-fade-super);margin:0 -20px -20px -20px;padding:20px}.console .database .button{margin:0 -20px;padding:0 20px!important;text-align:inherit;color:var(--config-color-focus);width:100%;font-size:15px;line-height:55px;box-sizing:content-box}.console .database .button i{margin-left:8px}.console .database .button:hover{border:none;background:var(--config-color-focus-fade)}.console .database .items{margin:0 -20px;height:262px;overflow-x:hidden;overflow-y:scroll}.console .database .items form{opacity:0;position:relative}.console .database .items form button{position:absolute;top:0;bottom:0;right:0;left:0;width:100%;height:45px;border-radius:0;cursor:pointer}.console .database .items li{padding:0;margin:0 0;line-height:45px;font-size:15px;padding-right:50px;padding-left:30px;position:relative}.console .database .items li i{position:absolute;display:none;left:10px}.console .database .items li .name{display:inline-block;width:100%;height:28px}.console .database .items li.selected,.console .database .items li:hover{background:#f5f5f5}.console .database .items li.selected i,.console .database .items li:hover i{display:block}.console .database .items li:last-child{border-bottom:none}body>footer{color:var(--config-color-fade);line-height:40px;margin:0 -50px;padding:12px 50px;font-size:13px;width:100%;background:#f1f1f1;position:relative;margin-top:80px!important}body>footer:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}body>footer .logo img{height:22px;padding-top:12px}body>footer a{color:var(--config-color-fade);font-size:13px}body>footer a:hover{border-bottom-color:var(--config-color-fade)}body>footer ul:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}body>footer ul li{font-size:13px;float:right;margin-left:20px!important}body>footer .copyright{padding-right:2px}[data-ls-if]{display:none}[data-service]{opacity:0}.load-service-start{opacity:0}.load-service-end{opacity:1;transition:opacity .5s ease-out;-moz-transition:opacity .5s ease-out;-webkit-transition:opacity .5s ease-out;-o-transition:opacity .5s ease-out}.load-screen{z-index:100000;position:fixed;height:100%;width:100%;background-color:var(--config-color-background-focus);top:0;right:0}.load-screen.loaded{transition:opacity 1s ease-in-out,top 1s .7s;opacity:0;top:-100%}.load-screen .animation{position:absolute;top:45%;left:50%;transform:translate(-50%,-50%) translateZ(1px);width:140px;height:140px}.load-screen .animation div{box-sizing:border-box;display:block;position:absolute;width:124px;height:124px;margin:10px;border:10px solid var(--config-color-focus);border-radius:50%;animation:animation 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:var(--config-color-focus) transparent transparent transparent}.load-screen .animation div:nth-child(1){animation-delay:-.45s}.load-screen .animation div:nth-child(2){animation-delay:-.3s}.load-screen .animation div:nth-child(3){animation-delay:-.15s}@keyframes animation{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.load-screen img{position:absolute;height:20px;bottom:60px;left:50%;transform:translate(-50%,-50%)}.modal-open .modal-bg,.modal-open body .modal-bg{position:fixed;content:'';display:block;width:100%;height:100%;left:0;right:0;top:0;bottom:0;background:#0c0c0c;opacity:.5;z-index:4}.modal{overflow:auto;display:none;position:fixed;transform:translate3d(0,0,0);width:100%;max-height:90%;max-width:640px;background:var(--config-color-background-fade);z-index:1000;box-shadow:0 0 4px rgba(0,0,0,.25);padding:30px;left:50%;top:50%;transform:translate(-50%,-50%);border-radius:10px;box-sizing:border-box;text-align:right;white-space:initial;line-height:normal}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.modal{width:calc(100% - 20px)}}.modal.full{max-width:none;max-height:none;height:100%;border-radius:0;padding:80px 120px}.modal.full h1{font-weight:700}.modal.padding-small{padding:15px}.modal.height-tiny>form{height:100px}.modal.height-small>form{height:220px}.modal.width-small{max-width:400px}.modal.width-medium{max-width:500px}.modal.width-large{max-width:800px}.modal.open{display:block}.modalbutton.close{display:none}.modal.fill{height:95%;max-height:95%;max-width:75%}.modal h1,.modal h2{margin-bottom:25px;margin-top:0;font-size:20px;text-align:right}.modal h1,.modal h2,.modal h3,.modal h4,.modal h5,.modal h6{color:inherit!important;line-height:35px}.modal .main,.modal>form{position:relative;border-top:solid 1px var(--config-border-color);padding:30px 30px 0 30px;margin:0 -30px}.modal .main.strip,.modal>form.strip{border:none;padding:0;margin:0}.modal .separator{margin:20px -30px}.modal .bullets{padding-right:40px}.modal .bullets li{margin-bottom:30px!important}.modal .bullets li:before{position:absolute}.modal .info{margin:0 -30px;padding:20px 30px;background:var(--config-modal-note-background);color:var(--config-modal-note-color);border-top:solid 1px var(--config-modal-note-border);border-bottom:solid 1px var(--config-modal-note-border)}.modal .ide.strech{box-shadow:none;border-radius:0;margin:0 -30px}.modal button.close{width:30px;height:30px;line-height:30px;padding:0;margin:0;background:var(--config-color-normal);color:var(--config-color-background-fade);border-radius:50%}.modal .paging form{padding:0;margin:0;border-top:none}.modal.sticky-footer form footer{margin:-30px}.modal.sticky-footer footer{position:sticky;bottom:-30px;background:var(--config-color-background-fade-super);height:50px;z-index:1;padding:30px;box-shadow:0 0 1px rgba(0,0,0,.15)}.modal.sticky-footer footer form{display:inline-block}[data-views-current="0"] .scroll-to,[data-views-current="1"] .scroll-to{opacity:0!important}.scroll-to-bottom .scroll-to,.scroll-to-top .scroll-to{opacity:1}.scroll-to{opacity:0;display:block;width:40px;height:40px;line-height:40px;border-radius:50%;position:fixed;transform:translateZ(0);margin:30px;padding:0;bottom:0;font-size:18px;z-index:100000;transition:opacity .15s ease-in-out;left:0}.phases{list-style:none;margin:0;padding:0;position:relative}.phases li{display:none}.phases li li{display:block}.phases li.selected{display:block}.phases .number{display:none}.phases h2,.phases h3,.phases h4,.phases h5,.phases h6{margin:0 0 30px 0;text-align:inherit}.container{position:relative}.container .tabs{height:55px;line-height:55px;list-style:none;padding:0;margin-bottom:50px!important;margin-top:-55px;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.container .tabs:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.container .tabs .selected{font-weight:400;color:var(--config-color-focus);position:relative;opacity:1}.container .tabs .selected:after{content:"";display:block;height:2px;background:var(--config-color-focus);width:calc(100% + 6px);margin:0 -3px;position:absolute;bottom:0;border-radius:2px}.container .tabs .number{display:none}.container .tabs li{float:right;margin-left:50px;color:var(--config-color-focus);opacity:.9;cursor:pointer}.container .tabs li:focus{outline:0}@media only screen and (max-width:550px){.container .tabs li{margin-left:25px}}.container .icon{display:none}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.container .tabs{width:auto;overflow-x:scroll;overflow-y:hidden;white-space:nowrap}.container .tabs li{display:inline-block;float:none}}.ide{background-color:var(--config-prism-background);overflow:hidden;position:relative;z-index:1;box-shadow:0 2px 4px 0 rgba(50,50,93,.3);border-radius:10px;margin-bottom:30px}.ide *{font-family:'Source Code Pro',monospace}.ide[data-lang]::after{content:attr(data-lang-label);display:inline-block;background:#fff;color:#000;position:absolute;top:15px;padding:5px 10px;border-radius:15px;font-size:10px;left:10px;opacity:.95}.ide[data-lang=bash]::after{background:var(--config-language-bash);color:var(--config-language-bash-contrast)}.ide[data-lang=javascript]::after{background:var(--config-language-javascript);color:var(--config-language-javascript-contrast)}.ide[data-lang=web]::after{background:var(--config-language-web);color:var(--config-language-web-contrast)}.ide[data-lang=html]::after{background:var(--config-language-html);color:var(--config-language-html-contrast)}.ide[data-lang=php]::after{background:var(--config-language-php);color:var(--config-language-php-contrast)}.ide[data-lang=nodejs]::after{background:var(--config-language-nodejs);color:var(--config-language-nodejs-contrast)}.ide[data-lang=ruby]::after{background:var(--config-language-ruby);color:var(--config-language-ruby-contrast)}.ide[data-lang=python]::after{background:var(--config-language-python);color:var(--config-language-python-contrast)}.ide[data-lang=go]::after{background:var(--config-language-go);color:var(--config-language-go-contrast)}.ide[data-lang=dart]::after{background:var(--config-language-dart);color:var(--config-language-dart-contrast)}.ide[data-lang=flutter]::after{background:var(--config-language-flutter);color:var(--config-language-flutter-contrast)}.ide[data-lang=yaml]::after{background:var(--config-language-yaml);color:var(--config-language-yaml-contrast)}.ide .tag{color:inherit!important;background:0 0!important;padding:inherit!important;font-size:inherit!important;line-height:14px}.ide .copy{cursor:pointer;content:attr(data-lang);display:inline-block;background:#fff;color:#000;position:absolute;transform:translateX(-50%);bottom:-20px;padding:5px 10px;border-radius:15px;font-size:10px;font-style:normal;right:50%;opacity:0;transition:bottom .3s,opacity .3s;line-height:normal;font-family:Poppins,sans-serif}.ide .copy::before{padding-left:5px}.ide:hover .copy{transition:bottom .3s,opacity .3s;opacity:.9;bottom:16px}.ide pre{-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;color:#e6ebf1;font-weight:400;line-height:20px;font-size:13px;margin:0;padding:20px;padding-left:60px}.ide.light{box-shadow:0 2px 4px 0 rgba(50,50,93,.1);background-color:#fff}.ide.light pre{color:#414770}.ide.light .token.cdata,.ide.light .token.comment,.ide.light .token.doctype,.ide.light .token.prolog{color:#91a2b0}.ide.light .token.attr-name,.ide.light .token.builtin,.ide.light .token.char,.ide.light .token.inserted,.ide.light .token.selector,.ide.light .token.string{color:#149570}.ide.light .token.punctuation{color:#414770}.ide.light .language-css .token.string,.ide.light .style .token.string,.ide.light .token.entity,.ide.light .token.operator,.ide.light .token.url,.ide.light .token.variable{color:#414770}.ide.light .line-numbers .line-numbers-rows{background:#f2feef}.ide.light .line-numbers-rows>span:before{color:#5dc79e}.ide.light .token.keyword{color:#6772e4;font-weight:500}code[class*=language-],pre[class*=language-]{text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4}pre[class*=language-]{overflow:auto}:not(pre)>code[class*=language-]{padding:.1em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#6b7c93}.token.punctuation{color:#f8f8f2}.namespace{opacity:.7}.token.constant,.token.deleted,.token.property,.token.symbol,.token.tag{color:#f92672}.token.boolean,.token.number{color:#f79a59}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#3ecf8e}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url,.token.variable{color:#f8f8f2}.token.atrule,.token.attr-value,.token.class-name,.token.function{color:#45b2e8}.token.keyword{color:#7795f8}.token.important,.token.regex{color:#fd971f}.token.italic{font-style:italic}.token.entity{cursor:help}pre[class*=language-].line-numbers{position:relative;padding-left:60px;counter-reset:linenumber}pre[class*=language-].line-numbers>code{position:relative;white-space:inherit}.line-numbers .line-numbers-rows{background:var(--config-prism-numbers);position:absolute;pointer-events:none;top:-20px;bottom:-21px;padding:20px 0;font-size:100%;left:-60px;width:40px;letter-spacing:-1px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.line-numbers-rows>span{padding-left:5px;pointer-events:none;display:block;counter-increment:linenumber}.line-numbers-rows>span:before{content:counter(linenumber);color:#636365;display:block;padding-right:.8em;text-align:right}html{padding:0;margin:0;direction:rtl}body{margin:0;background:var(--config-console-background) no-repeat fixed;min-width:300px}ul{padding:0;margin:0}ul li{margin:0;list-style:none}.icon-left-open:before{content:'\e814'!important}.icon-right-open:before{content:'\e813'!important}.icon-link-ext:before{-moz-transform:scaleX(-1);-o-transform:scaleX(-1);-webkit-transform:scaleX(-1);transform:scaleX(-1)}.icon-article-alt:before{-moz-transform:scaleX(-1);-o-transform:scaleX(-1);-webkit-transform:scaleX(-1);transform:scaleX(-1)}.copy{border-radius:10px 0 0 10px!important} \ No newline at end of file +.pull-start{float:right}.pull-end{float:left}img[src=""]{visibility:hidden;display:inline-block}:root{--config-width:910px;--config-width-xxl:1000px;--config-width-xl:910px;--config-width-large:700px;--config-width-medium:550px;--config-width-small:320px;--config-color-link:#1e849e;--config-color-background:#eceff1;--config-color-background-dark:#dfe2e4;--config-color-background-fade:#ffffff;--config-color-background-fade-super:#fdfdfd;--config-color-background-focus:#f5f5f5;--config-color-background-input:#ffffff;--config-color-placeholder:#868686;--config-color-tooltip-text:#dce8f5;--config-color-tooltip-background:#333333;--config-color-focus:#f02e65;--config-color-focus-fade:#fef8fa;--config-color-focus-hover:#ff729b;--config-color-focus-glow:#fce5ec;--config-color-focus-dark:#c52653;--config-color-normal:#40404c;--config-color-dark:#313131;--config-color-fade:#8f8f8f;--config-color-fade-light:#e2e2e2;--config-color-fade-super:#f1f3f5;--config-color-danger:#f53d3d;--config-color-success:#1bbf61;--config-color-warning:#ffed4d;--config-color-info:#386fd2;--config-border-color:#f5f5f5;--config-border-fade:#e0e3e4;--config-border-radius:10px;--config-prism-background:#373738;--config-prism-numbers:#39393c;--config-note-background:#f1fbff;--config-note-border:#5bceff;--config-warning-background:#fdf7d9;--config-warning-border:#f8e380;--config-social-twitter:#1da1f2;--config-social-github:#000000;--config-social-discord:#7189dc;--config-social-facebook:#4070b4;--config-language-bash:#2b2626;--config-language-bash-contrast:#fff;--config-language-javascript:#fff054;--config-language-javascript-contrast:#333232;--config-language-web:#fff054;--config-language-web-contrast:#333232;--config-language-html:#ff895b;--config-language-html-contrast:#ffffff;--config-language-yaml:#ca3333;--config-language-yaml-contrast:#ffffff;--config-language-php:#6182bb;--config-language-php-contrast:#ffffff;--config-language-nodejs:#8cc500;--config-language-nodejs-contrast:#ffffff;--config-language-ruby:#fc3f48;--config-language-ruby-contrast:#ffffff;--config-language-python:#3873a2;--config-language-python-contrast:#ffffff;--config-language-go:#00add8;--config-language-go-contrast:#ffffff;--config-language-dart:#035698;--config-language-dart-contrast:#ffffff;--config-language-flutter:#035698;--config-language-flutter-contrast:#ffffff;--config-modal-note-background:#f5fbff;--config-modal-note-border:#eaf2f7;--config-modal-note-color:#3b5d73;--config-switch-background:#e2e2e2;--config-console-background:#eceff1;--config-console-nav-start:#143650;--config-console-nav-end:#302839;--config-console-nav-border:#2a253a;--config-console-nav-switch-background:#ececec;--config-console-nav-switch-color:#868686;--config-console-nav-switch-arrow:url("data:image/svg+xml;utf8,")}:root .theme-dark{--config-color-background:#061F2F;--config-color-background-dark:#262d50;--config-color-background-fade:#1c223a;--config-color-background-fade-super:#1a1f35;--config-color-background-focus:#1a1f35;--config-color-background-input:#dce8f5;--config-color-tooltip-text:#061F2F;--config-color-tooltip-background:#dce8f5;--config-color-link:#4caedb;--config-color-placeholder:#9ea1af;--config-color-focus:#c7d8eb;--config-color-focus-fade:#1e233e;--config-color-focus-hover:#d3deea;--config-color-focus-glow:#d3deea;--config-color-focus-dark:#657586;--config-color-normal:#c7d8eb;--config-color-dark:#c7d8eb;--config-color-fade:#bec3e0;--config-color-fade-light:#181818;--config-color-fade-super:#262D50;--config-color-danger:#d84a4a;--config-color-success:#34b86d;--config-color-warning:#e0d56d;--config-color-info:#386fd2;--config-border-color:#262D50;--config-border-fade:#19203a;--config-prism-background:#1F253F;--config-prism-numbers:#1F253F;--config-note-background:#171e33;--config-note-border:#262D50;--config-warning-background:#1F253F;--config-warning-border:#262D50;--config-social-twitter:var(--config-color-normal);--config-social-github:var(--config-color-normal);--config-social-discord:var(--config-color-normal);--config-social-facebook:var(--config-color-normal);--config-language-bash:var(--config-color-normal);--config-language-bash-contrast:var(--config-color-background);--config-language-javascript:var(--config-color-normal);--config-language-javascript-contrast:var(--config-color-background);--config-language-web:var(--config-color-normal);--config-language-web-contrast:var(--config-color-background);--config-language-yaml:var(--config-color-normal);--config-language-yaml-contrast:var(--config-color-background);--config-language-html:var(--config-color-normal);--config-language-html-contrast:var(--config-color-background);--config-language-php:var(--config-color-normal);--config-language-php-contrast:var(--config-color-background);--config-language-nodejs:var(--config-color-normal);--config-language-nodejs-contrast:var(--config-color-background);--config-language-ruby:var(--config-color-normal);--config-language-ruby-contrast:var(--config-color-background);--config-language-python:var(--config-color-normal);--config-language-python-contrast:var(--config-color-background);--config-language-go:var(--config-color-normal);--config-language-go-contrast:var(--config-color-background);--config-language-dart:var(--config-color-normal);--config-language-dart-contrast:var(--config-color-background);--config-language-flutter:var(--config-color-normal);--config-language-flutter-contrast:var(--config-color-background);--config-modal-note-background:#15192b;--config-modal-note-border:#161b31;--config-modal-note-color:var(--config-color-normal);--config-switch-background:var(--config-color-normal);--config-console-background:#20263f;--config-console-nav-start:#1c2139;--config-console-nav-end:#151929;--config-console-nav-border:#171b30;--config-console-nav-switch-background:var(--config-color-focus);--config-console-nav-switch-color:var(--config-color-background);--config-console-nav-switch-arrow:url("data:image/svg+xml;utf8,")}.theme-light .force-light{display:block!important}.theme-dark .force-dark{display:block!important}.force-dark{display:none!important}.force-light{display:none!important}@font-face{font-family:Poppins;font-style:normal;font-weight:100;src:url(/fonts/poppins-v9-latin-100.eot);src:local('Poppins Thin'),local('Poppins-Thin'),url(/fonts/poppins-v9-latin-100.eot?#iefix) format('embedded-opentype'),url(/fonts/poppins-v9-latin-100.woff2) format('woff2'),url(/fonts/poppins-v9-latin-100.woff) format('woff'),url(/fonts/poppins-v9-latin-100.ttf) format('truetype'),url(/fonts/poppins-v9-latin-100.svg#Poppins) format('svg')}@font-face{font-family:Poppins;font-style:normal;font-weight:300;src:url(/fonts/poppins-v9-latin-300.eot);src:local('Poppins Light'),local('Poppins-Light'),url(/fonts/poppins-v9-latin-300.eot?#iefix) format('embedded-opentype'),url(/fonts/poppins-v9-latin-300.woff2) format('woff2'),url(/fonts/poppins-v9-latin-300.woff) format('woff'),url(/fonts/poppins-v9-latin-300.ttf) format('truetype'),url(/fonts/poppins-v9-latin-300.svg#Poppins) format('svg')}@font-face{font-family:Poppins;font-style:normal;font-weight:400;src:url(/fonts/poppins-v9-latin-regular.eot);src:local('Poppins Regular'),local('Poppins-Regular'),url(/fonts/poppins-v9-latin-regular.eot?#iefix) format('embedded-opentype'),url(/fonts/poppins-v9-latin-regular.woff2) format('woff2'),url(/fonts/poppins-v9-latin-regular.woff) format('woff'),url(/fonts/poppins-v9-latin-regular.ttf) format('truetype'),url(/fonts/poppins-v9-latin-regular.svg#Poppins) format('svg')}@font-face{font-family:Poppins;font-style:normal;font-weight:500;src:url(/fonts/poppins-v9-latin-500.eot);src:local('Poppins Medium'),local('Poppins-Medium'),url(/fonts/poppins-v9-latin-500.eot?#iefix) format('embedded-opentype'),url(/fonts/poppins-v9-latin-500.woff2) format('woff2'),url(/fonts/poppins-v9-latin-500.woff) format('woff'),url(/fonts/poppins-v9-latin-500.ttf) format('truetype'),url(/fonts/poppins-v9-latin-500.svg#Poppins) format('svg')}@font-face{font-family:Poppins;font-style:normal;font-weight:600;src:url(/fonts/poppins-v9-latin-600.eot);src:local('Poppins SemiBold'),local('Poppins-SemiBold'),url(/fonts/poppins-v9-latin-600.eot?#iefix) format('embedded-opentype'),url(/fonts/poppins-v9-latin-600.woff2) format('woff2'),url(/fonts/poppins-v9-latin-600.woff) format('woff'),url(/fonts/poppins-v9-latin-600.ttf) format('truetype'),url(/fonts/poppins-v9-latin-600.svg#Poppins) format('svg')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url(/fonts/source-code-pro-v11-latin-regular.eot);src:local('Source Code Pro Regular'),local('SourceCodePro-Regular'),url(/fonts/source-code-pro-v11-latin-regular.eot?#iefix) format('embedded-opentype'),url(/fonts/source-code-pro-v11-latin-regular.woff2) format('woff2'),url(/fonts/source-code-pro-v11-latin-regular.woff) format('woff'),url(/fonts/source-code-pro-v11-latin-regular.ttf) format('truetype'),url(/fonts/source-code-pro-v11-latin-regular.svg#SourceCodePro) format('svg')}.padding{padding:30px}.padding-top{padding-top:30px!important}.padding-top-large{padding-top:50px!important}.padding-top-xl{padding-top:80px!important}.padding-bottom{padding-bottom:30px!important}.padding-bottom-large{padding-bottom:50px!important}.padding-bottom-xl{padding-bottom:80px!important}.margin-end{margin-left:20px!important}.margin-start{margin-right:20px!important}.margin-end-small{margin-left:10px!important}.margin-start-small{margin-right:10px!important}.margin-end-large{margin-left:50px!important}.margin-start-large{margin-right:50px!important}.margin-end-no{margin-left:0!important}.margin-start-no{margin-right:0!important}.margin-end-negative{margin-left:-30px!important}.margin-start-negative{margin-right:-30px!important}.margin-end-negative-small{margin-left:-15px!important}.margin-start-negative-small{margin-right:-15px!important}.margin-end-negative-tiny{margin-left:-5px!important}.margin-start-negative-tiny{margin-right:-5px!important}.margin-top{margin-top:30px!important}.margin-bottom{margin-bottom:30px!important}.margin-top-no{margin-top:0!important}.margin-bottom-no{margin-bottom:0!important}.margin-top-xxl{margin-top:140px!important}.margin-top-xl{margin-top:80px!important}.margin-top-large{margin-top:50px!important}.margin-top-small{margin-top:15px!important}.margin-top-tiny{margin-top:5px!important}.margin-top-negative{margin-top:-30px!important}.margin-top-negative-tiny{margin-top:-5px!important}.margin-top-negative-small{margin-top:-15px!important}.margin-top-negative-large{margin-top:-50px!important}.margin-top-negative-xl{margin-top:-80px!important}.margin-top-negative-xxl{margin-top:-100px!important}.margin-top-negative-xxxl{margin-top:-150px!important}.margin-bottom-xxl{margin-bottom:140px!important}.margin-bottom-xl{margin-bottom:80px!important}.margin-bottom-large{margin-bottom:50px!important}.margin-bottom-small{margin-bottom:15px!important}.margin-bottom-tiny{margin-bottom:5px!important}.margin-bottom-negative{margin-bottom:-30px!important}.margin-bottom-negative-tiny{margin-bottom:-5px!important}.margin-bottom-negative-small{margin-bottom:-15px!important}.margin-bottom-negative-large{margin-bottom:-50px!important}.margin-bottom-negative-xl{margin-bottom:-80px!important}.margin-bottom-negative-xl{margin-bottom:-100px!important}.force-left,.ide{direction:ltr;text-align:left}.force-right{direction:rtl;text-align:right}.pull-left{float:left}.pull-right{float:right}.ratio-wide{height:0;overflow:hidden;padding-top:56%;position:relative;width:100%}.ratio-wide>*{position:absolute;top:0;left:0;width:100%;height:100%}.ratio-square{height:0;overflow:hidden;padding-top:56%;position:relative;width:100%}.ratio-square>*{position:absolute;top:0;left:0;width:100%;height:100%}.clear:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.phones-only{display:none}@media only screen and (max-width:550px){.phones-only{display:inherit!important}}.tablets-only{display:none}@media only screen and (min-width:551px) and (max-width:1198px){.tablets-only{display:inherit!important}}.desktops-only{display:none}@media only screen and (min-width:1199px){.desktops-only{display:inherit!important}}.phones-only-inline{display:none}@media only screen and (max-width:550px){.phones-only-inline{display:inline-block!important}}.tablets-only-inline{display:none}@media only screen and (min-width:551px) and (max-width:1198px){.tablets-only-inline{display:inline-block!important}}.desktops-only-inline{display:none}@media only screen and (min-width:1199px){.desktops-only-inline{display:inline-block!important}}*{font-family:Poppins,sans-serif;-webkit-font-smoothing:antialiased;font-weight:300}h1,h2,h3,h4,h5,h6{margin:0}h4,h5,h6{font-weight:400}.link,a{color:var(--config-color-link);text-decoration:none;border-left:2px solid transparent;border-right:2px solid transparent;transition:.2s;cursor:pointer}.link.disabled,a.disabled{opacity:.5}.link.tag:hover,a.tag:hover{opacity:.9}.link.danger,a.danger{color:var(--config-color-danger)}.link.link-animation-enabled,a.link-animation-enabled{display:inline-block}.link.link-animation-enabled:hover,a.link-animation-enabled:hover{transform:translateY(-2px)}.link-return-animation--start>i{display:inline-block;transition:.2s}.link-return-animation--start:hover>i{transform:translateX(2px)}.link-return-animation--end>i{display:inline-block;transition:.2s}.link-return-animation--end:hover>i{transform:translateX(-2px)}b,strong{font-weight:500}p{margin:0 0 20px 0;line-height:26px}small{font-size:16px;color:var(--config-color-fade)}.text-size-small{font-size:13px}.text-size-xs{font-size:10px}.text-size-normal{font-size:16px}.text-height-large{height:30px;line-height:30px}.text-height-small{line-height:13px}.text-one-liner{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text-bold{font-weight:400!important}.text-bold-large{font-weight:500!important}.text-bold-xl{font-weight:600!important}.text-danger{color:var(--config-color-danger)!important}.text-success{color:var(--config-color-success)!important}.text-upper{text-transform:uppercase}.text-warning{color:var(--config-color-warning)}.text-focus{color:var(--config-color-focus)}.text-fade{color:var(--config-color-fade)}.text-green{color:var(--config-color-success)}.text-red{color:var(--config-color-danger)}.text-info{color:var(--config-color-info)}.text-yellow{color:#ffe28b}.text-disclaimer{font-size:11px;color:var(--config-color-fade)}.text-fade-extra{color:var(--config-color-fade);opacity:.5}.text-line-high-large{line-height:30px}.text-line-high-xl{line-height:40px}.text-sign{margin:5px 0;font-size:25px;width:25px;height:25px;line-height:25px;display:inline-block}.text-align-center{text-align:center}.text-align-start{text-align:right}.text-align-end{text-align:left}.text-align-left{text-align:left}.text-align-right{text-align:right}.text-dir-ltr{direction:ltr;display:inline-block}.text-dir-rtl{direction:rtl;display:inline-block}.icon-dot-3:before{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-o-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}i[class*=' icon-']:before,i[class^=icon-]:before{display:inline;line-height:unset}table{width:calc(100% + 60px);border-collapse:collapse;margin:-30px;border-radius:10px;overflow:hidden;position:relative;table-layout:fixed}table.y-scroll{overflow-y:auto}table thead{box-shadow:0 0 2px rgba(0,0,0,.25);border-bottom:solid 1px var(--config-color-fade-super);font-size:14px}table.small{font-size:14px}table.open-end tbody tr:last-child{border-bottom:none;font-weight:700;background:#f7fbf7}table.full tbody td,table.full tbody th{vertical-align:top;white-space:normal;overflow:auto;line-height:24px;padding-top:20px;padding-bottom:20px;height:auto}table .avatar{width:30px;height:30px}table tr{border-bottom:solid 1px var(--config-color-fade-super)}table tr:last-child{border-bottom:none}table tr:nth-child(even){background:var(--config-color-background-fade-super)}table tr.selected{background:var(--config-note-background)}table tr.selected td,table tr.selected td span{font-weight:500}table th{text-align:right;font-weight:400}table th i{color:var(--config-color-fade);font-size:10px;display:inline-block;vertical-align:top;line-height:16px;padding:0 3px}table td,table th{height:65px;padding:0 15px;line-height:50px}table td:first-child,table th:first-child{padding-right:30px}table td:last-child,table th:last-child{padding-left:30px}table td,table th{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){table.vertical{border-top:solid 1px var(--config-color-fade-super);display:block;overflow:hidden;padding-top:12px}table.vertical .hide{display:none}table.vertical tbody,table.vertical td,table.vertical th,table.vertical thead,table.vertical tr{width:100%;display:block}table.vertical th,table.vertical tr{padding-top:12px;padding-bottom:12px}table.vertical th:first-child,table.vertical tr:first-child{padding-top:0}table.vertical td,table.vertical th{padding:5px 20px!important;text-overflow:ellipsis;white-space:normal;height:40px;line-height:40px;width:calc(100% - 40px)}table.vertical td:first-child,table.vertical td:last-child,table.vertical th:first-child,table.vertical th:last-child{padding:0 10px}table.vertical td:last-child,table.vertical th:last-child{padding-bottom:0}table.vertical td p,table.vertical th p{display:inline-block;width:calc(100% - 40px)}table.vertical td:not([data-title=""]):before{content:attr(data-title);margin-right:4px;font-weight:400}table.vertical thead{display:none}}.zone{max-width:var(--config-width-xl);margin:0 auto 40px auto}.zone.xxxl{max-width:calc(1400px - 100px)}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.zone.xxxl{max-width:100%}}.zone.xxl{max-width:var(--config-width-xxl)}.zone.xl{max-width:var(--config-width-xl)}.zone.large{max-width:var(--config-width-large)}.zone.medium{max-width:var(--config-width-medium)}.zone.small{max-width:var(--config-width-small)}.row{position:relative;margin:0 -50px;padding-right:50px}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.row{margin:0 -30px;padding-right:30px}}.row.force-ltr>.col{float:left}.row.force-rtl>.col{float:right}.row.force-reverse>.col{float:left}.row.wide{margin:0 -100px;padding-right:100px}.row.wide>.span-1{width:calc(8.33333333% * 1 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-2{width:calc(8.33333333% * 2 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-3{width:calc(8.33333333% * 3 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-4{width:calc(8.33333333% * 4 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-5{width:calc(8.33333333% * 5 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-6{width:calc(8.33333333% * 6 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-7{width:calc(8.33333333% * 7 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-8{width:calc(8.33333333% * 8 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-9{width:calc(8.33333333% * 9 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-10{width:calc(8.33333333% * 10 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-11{width:calc(8.33333333% * 11 - 100px);box-sizing:content-box;padding-left:100px}.row.wide>.span-12{width:calc(8.33333333% * 12 - 100px);box-sizing:content-box;padding-left:100px}.row.thin{margin:0 -20px;padding-right:20px}.row.thin>.span-1{width:calc(8.33333333% * 1 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-2{width:calc(8.33333333% * 2 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-3{width:calc(8.33333333% * 3 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-4{width:calc(8.33333333% * 4 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-5{width:calc(8.33333333% * 5 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-6{width:calc(8.33333333% * 6 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-7{width:calc(8.33333333% * 7 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-8{width:calc(8.33333333% * 8 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-9{width:calc(8.33333333% * 9 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-10{width:calc(8.33333333% * 10 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-11{width:calc(8.33333333% * 11 - 20px);box-sizing:content-box;padding-left:20px}.row.thin>.span-12{width:calc(8.33333333% * 12 - 20px);box-sizing:content-box;padding-left:20px}.row.modalize{margin:0 -30px;padding-right:30px}.row.modalize>.span-1{width:calc(8.33333333% * 1 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-2{width:calc(8.33333333% * 2 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-3{width:calc(8.33333333% * 3 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-4{width:calc(8.33333333% * 4 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-5{width:calc(8.33333333% * 5 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-6{width:calc(8.33333333% * 6 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-7{width:calc(8.33333333% * 7 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-8{width:calc(8.33333333% * 8 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-9{width:calc(8.33333333% * 9 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-10{width:calc(8.33333333% * 10 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-11{width:calc(8.33333333% * 11 - 30px);box-sizing:content-box;padding-left:30px}.row.modalize>.span-12{width:calc(8.33333333% * 12 - 30px);box-sizing:content-box;padding-left:30px}.row:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.row .col{float:right;box-sizing:border-box}.row .col.sticky-top{position:sticky;top:90px}.row .col.sticky-bottom{position:sticky;bottom:0}.row .span-1{width:calc(8.33333333% * 1 - 40px);box-sizing:content-box;padding-left:40px}.row .span-2{width:calc(8.33333333% * 2 - 40px);box-sizing:content-box;padding-left:40px}.row .span-3{width:calc(8.33333333% * 3 - 40px);box-sizing:content-box;padding-left:40px}.row .span-4{width:calc(8.33333333% * 4 - 40px);box-sizing:content-box;padding-left:40px}.row .span-5{width:calc(8.33333333% * 5 - 40px);box-sizing:content-box;padding-left:40px}.row .span-6{width:calc(8.33333333% * 6 - 40px);box-sizing:content-box;padding-left:40px}.row .span-7{width:calc(8.33333333% * 7 - 40px);box-sizing:content-box;padding-left:40px}.row .span-8{width:calc(8.33333333% * 8 - 40px);box-sizing:content-box;padding-left:40px}.row .span-9{width:calc(8.33333333% * 9 - 40px);box-sizing:content-box;padding-left:40px}.row .span-10{width:calc(8.33333333% * 10 - 40px);box-sizing:content-box;padding-left:40px}.row .span-11{width:calc(8.33333333% * 11 - 40px);box-sizing:content-box;padding-left:40px}.row .span-12{width:calc(8.33333333% * 12 - 40px);box-sizing:content-box;padding-left:40px}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.row.responsive{width:100%;padding:0;margin:0}.row.responsive>.span-1,.row.responsive>.span-10,.row.responsive>.span-11,.row.responsive>.span-12,.row.responsive>.span-2,.row.responsive>.span-3,.row.responsive>.span-4,.row.responsive>.span-5,.row.responsive>.span-6,.row.responsive>.span-7,.row.responsive>.span-8,.row.responsive>.span-9{width:calc(8.33333333% * 12 - 0px)!important;box-sizing:content-box!important;padding-left:0!important;width:100%!important}}.tiles{position:relative}.tiles:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.tiles>*{margin-left:50px!important;float:right;width:calc(33.3333% - 33.3333px)}.tiles>* .photo-title{width:calc(100% + 30px);height:15px;margin:-15px -15px 10px -15px;border-radius:10px 10px 0 0;background:var(--config-color-fade-super);border-bottom:solid 1px var(--config-color-fade-super)}.tiles>:nth-child(3n){margin-left:0!important}@media only screen and (min-width:551px) and (max-width:1198px){.tiles>li{width:calc(50% - 25px)}.tiles>li:nth-child(3n){margin-left:50px!important}.tiles>li:nth-child(2n){margin-left:0!important}}@media only screen and (max-width:550px){.tiles>li{width:100%;margin-left:0!important}}@font-face{font-family:fontello;src:url(data:application/octet-stream;base64,d09GRgABAAAAAFqcAA8AAAAAjUAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABWAAAADsAAABUIIslek9TLzIAAAGUAAAAQwAAAFY+UFR4Y21hcAAAAdgAAAMCAAAIVGsHIX1jdnQgAAAE3AAAABMAAAAgBzP+pGZwZ20AAATwAAAFkAAAC3CKkZBZZ2FzcAAACoAAAAAIAAAACAAAABBnbHlmAAAKiAAASOkAAGyevKUl9mhlYWQAAFN0AAAAMgAAADYauqkaaGhlYQAAU6gAAAAgAAAAJAgaBKBobXR4AABTyAAAANQAAAHAgvP/gWxvY2EAAFScAAAA4gAAAOKlpIsybWF4cAAAVYAAAAAgAAAAIAJcDRRuYW1lAABVoAAAAXQAAALNzZ0XGHBvc3QAAFcUAAADCwAABJSPrOZacHJlcAAAWiAAAAB6AAAAhuVBK7x4nGNgZGBg4GIwYLBjYHJx8wlh4MtJLMljkGJgYYAAkDwymzEnMz2RgQPGA8qxgGkOIGaDiAIAJjsFSAB4nGNgZC5hnMDAysDAVMW0h4GBoQdCMz5gMGRkAooysDIzYAUBaa4pDAdeMHw6xhz0P4shirmR4RhQmBEkBwADgA1QAHic3dXJjlVVGMXxf0GBinQ2aIllU6jYN1UIVZS9NEoj2HfYd4CiFaY8hANImMCAFyDhEZjAAFIvYG6IDEjW8Hz3AYB1aq8wINGBzrgnv5t7T+5Ozt351trAEmCxPWej/riaEX9i0TLfHVm4v5hlC/dHRy75+6s86t+Na2/3Z3eiO9Od6y52892gu1xjNV4TNVUzdbiO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AAAAnAADoJwAA6CcAAAAoAADoKAAA6CgAAAApAADoKQAA6CkAAAAqAADoKgAA6CoAAAArAADoKwAA6CsAAAAsAADoLAAA6CwAAAAtAADoLQAA6C0AAAAuAADoLgAA6C4AAAAvAADoLwAA6C8AAAAwAADoMAAA6DAAAAAxAADoMQAA6DEAAAAyAADoMgAA6DIAAAAzAADoMwAA6DMAAAA0AADoNAAA6DQAAAA1AADoNQAA6DUAAAA2AADoNgAA6DYAAAA3AADoNwAA6DcAAAA4AADoOAAA6DgAAAA5AADoOQAA6DkAAAA6AADoOgAA6DoAAAA7AADoOwAA6DsAAAA8AADoPAAA6DwAAAA9AADoPQAA6D0AAAA+AADoPgAA6D4AAAA/AADoPwAA6D8AAABAAADoQAAA6EAAAABBAADoQQAA6EEAAABCAADoQgAA6EIAAABDAADoQwAA6EMAAABEAADoRAAA6EQAAABFAADoRQAA6EUAAABGAADoRgAA6EYAAABHAADoRwAA6EcAAABIAADoSAAA6EgAAABJAADoSQAA6EkAAABKAADoSgAA6EoAAABLAADoSwAA6EsAAABMAADoTAAA6EwAAABNAADoTQAA6E0AAABOAADoTgAA6E4AAABPAADoTwAA6E8AAABQAADwjgAA8I4AAABRAADwmwAA8JsAAABSAADwsAAA8LAAAABTAADwxQAA8MUAAABUAADwygAA8MoAAABVAADwywAA8MsAAABWAADwzQAA8M0AAABXAADw3AAA8NwAAABYAADw4QAA8OEAAABZAADxGAAA8RgAAABaAADxHAAA8RwAAABbAADxIQAA8SEAAABcAADxMgAA8TIAAABdAADxNwAA8TcAAABeAADxOAAA8TgAAABfAADxcQAA8XEAAABgAADxegAA8XoAAABhAADxkgAA8ZIAAABiAADxkwAA8ZMAAABjAADxnAAA8ZwAAABkAADxoAAA8aAAAABlAADxrQAA8a0AAABmAADxwAAA8cAAAABnAADxzQAA8c0AAABoAADx3AAA8dwAAABpAADx5QAA8eUAAABqAADx/gAA8f4AAABrAADyMQAA8jEAAABsAADyOgAA8joAAABtAADylgAA8pYAAABuAADyxg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CyyAQBAKy2wWSyyAQFAKy2wWiyyAABDKy2wWyyyAAFDKy2wXCyyAQBDKy2wXSyyAQFDKy2wXiyyAAA/Ky2wXyyyAAE/Ky2wYCyyAQA/Ky2wYSyyAQE/Ky2wYiywNysusSsBFCstsGMssDcrsDsrLbBkLLA3K7A8Ky2wZSywABawNyuwPSstsGYssDgrLrErARQrLbBnLLA4K7A7Ky2waCywOCuwPCstsGkssDgrsD0rLbBqLLA5Ky6xKwEUKy2wayywOSuwOystsGwssDkrsDwrLbBtLLA5K7A9Ky2wbiywOisusSsBFCstsG8ssDorsDsrLbBwLLA6K7A8Ky2wcSywOiuwPSstsHIsswkEAgNFWCEbIyFZQiuwCGWwAyRQeLABFTAtAEu4AMhSWLEBAY5ZsAG5CAAIAGNwsQAFQrIAAQAqsQAFQrMKAgEIKrEABUKzDgABCCqxAAZCugLAAAEACSqxAAdCugBAAAEACSqxAwBEsSQBiFFYsECIWLEDZESxJgGIUVi6CIAAAQRAiGNUWLEDAERZWVlZswwCAQwquAH/hbAEjbECAEQAAA==) format('truetype')}[class*=" icon-"]:before,[class^=icon-]:before{font-family:fontello;font-style:normal;font-weight:400;speak:never;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em}.icon-user:before{content:'\e800'}.icon-folder:before{content:'\e801'}.icon-list:before{content:'\e802'}.icon-login:before{content:'\e803'}.icon-cog:before{content:'\e804'}.icon-twitter:before{content:'\e805'}.icon-article-alt:before{content:'\e806'}.icon-cancel:before{content:'\e807'}.icon-home:before{content:'\e808'}.icon-down-dir:before{content:'\e809'}.icon-facebook:before{content:'\e80a'}.icon-asterisk:before{content:'\e80b'}.icon-upload:before{content:'\e80c'}.icon-stopwatch:before{content:'\e80d'}.icon-export:before{content:'\e80e'}.icon-heart:before{content:'\e80f'}.icon-plus:before{content:'\e810'}.icon-up-dir:before{content:'\e811'}.icon-menu:before{content:'\e812'}.icon-left-open:before{content:'\e813'}.icon-right-open:before{content:'\e814'}.icon-inbox:before{content:'\e815'}.icon-wrench:before{content:'\e816'}.icon-comment:before{content:'\e817'}.icon-stackoverflow:before{content:'\e818'}.icon-question:before{content:'\e819'}.icon-ok-circled:before{content:'\e81a'}.icon-warning:before{content:'\e81b'}.icon-mail:before{content:'\e81c'}.icon-link:before{content:'\e81d'}.icon-key-inv:before{content:'\e81e'}.icon-trash:before{content:'\e81f'}.icon-download:before{content:'\e820'}.icon-glasses:before{content:'\e821'}.icon-qrcode:before{content:'\e822'}.icon-shuffle:before{content:'\e823'}.icon-eye:before{content:'\e824'}.icon-lock:before{content:'\e825'}.icon-search:before{content:'\e826'}.icon-bell:before{content:'\e827'}.icon-users:before{content:'\e828'}.icon-location:before{content:'\e829'}.icon-briefcase:before{content:'\e82a'}.icon-instagram:before{content:'\e82b'}.icon-clock:before{content:'\e82c'}.icon-phone:before{content:'\e82d'}.icon-calendar:before{content:'\e82e'}.icon-print:before{content:'\e82f'}.icon-edit:before{content:'\e830'}.icon-bold:before{content:'\e831'}.icon-italic:before{content:'\e832'}.icon-rocket:before{content:'\e833'}.icon-whatsapp:before{content:'\e834'}.icon-dot-3:before{content:'\e835'}.icon-info-circled:before{content:'\e836'}.icon-videocam:before{content:'\e837'}.icon-quote-right:before{content:'\e838'}.icon-picture:before{content:'\e839'}.icon-palette:before{content:'\e83a'}.icon-lamp:before{content:'\e83b'}.icon-book-open:before{content:'\e83c'}.icon-ok:before{content:'\e83d'}.icon-chat-alt:before{content:'\e83e'}.icon-archive:before{content:'\e83f'}.icon-play:before{content:'\e840'}.icon-pause:before{content:'\e841'}.icon-down-open:before{content:'\e842'}.icon-up-open:before{content:'\e843'}.icon-minus:before{content:'\e844'}.icon-exchange:before{content:'\e845'}.icon-network:before{content:'\e846'}.icon-discord:before{content:'\e847'}.icon-moon-inv:before{content:'\e848'}.icon-sun-inv:before{content:'\e849'}.icon-cancel-circled:before{content:'\e84a'}.icon-lightning:before{content:'\e84b'}.icon-dev:before{content:'\e84c'}.icon-right-dir:before{content:'\e84d'}.icon-left-dir:before{content:'\e84e'}.icon-fire:before{content:'\e84f'}.icon-link-ext:before{content:'\f08e'}.icon-github-circled:before{content:'\f09b'}.icon-filter:before{content:'\f0b0'}.icon-docs:before{content:'\f0c5'}.icon-list-bullet:before{content:'\f0ca'}.icon-list-numbered:before{content:'\f0cb'}.icon-underline:before{content:'\f0cd'}.icon-sort:before{content:'\f0dc'}.icon-linkedin:before{content:'\f0e1'}.icon-smile:before{content:'\f118'}.icon-keyboard:before{content:'\f11c'}.icon-code:before{content:'\f121'}.icon-shield:before{content:'\f132'}.icon-angle-circled-left:before{content:'\f137'}.icon-angle-circled-right:before{content:'\f138'}.icon-bitbucket:before{content:'\f171'}.icon-windows:before{content:'\f17a'}.icon-dot-circled:before{content:'\f192'}.icon-wheelchair:before{content:'\f193'}.icon-bank:before{content:'\f19c'}.icon-google:before{content:'\f1a0'}.icon-building-filled:before{content:'\f1ad'}.icon-database:before{content:'\f1c0'}.icon-lifebuoy:before{content:'\f1cd'}.icon-header:before{content:'\f1dc'}.icon-binoculars:before{content:'\f1e5'}.icon-chart-area:before{content:'\f1fe'}.icon-pinterest:before{content:'\f231'}.icon-medium:before{content:'\f23a'}.icon-gitlab:before{content:'\f296'}.icon-telegram:before{content:'\f2c6'}.datalist-polyfill{list-style:none;display:none;background:#fff;box-shadow:0 2px 2px #999;position:absolute;left:0;top:0;margin:0;padding:0;max-height:300px;overflow-y:auto}.datalist-polyfill:empty{display:none!important}.datalist-polyfill>li{padding:3px;font:13px "Lucida Grande",Sans-Serif}.datalist-polyfill__active{background:#3875d7;color:#fff}date-input-polyfill{z-index:1000!important;max-width:320px!important;width:320px!important}date-input-polyfill .monthSelect-wrapper,date-input-polyfill .yearSelect-wrapper{height:50px;line-height:50px;padding:0;width:40%!important;margin-bottom:10px!important}date-input-polyfill .monthSelect-wrapper select,date-input-polyfill .yearSelect-wrapper select{padding:0 12px;height:50px;line-height:50px;box-sizing:border-box}date-input-polyfill .yearSelect-wrapper{width:35%!important}date-input-polyfill table{width:100%!important;max-width:100%!important;padding:0 12px 12px 12px!important;box-sizing:border-box;margin:0}date-input-polyfill table td:first-child,date-input-polyfill table td:last-child,date-input-polyfill table th:first-child,date-input-polyfill table th:last-child{width:32px!important;padding:4px!important}date-input-polyfill select{margin-bottom:10px}date-input-polyfill button{width:25%!important;height:50px!important;line-height:50px!important;margin-bottom:10px!important;background:inherit;position:relative;color:inherit;padding:inherit;box-sizing:inherit;border-radius:inherit;font-size:inherit;box-shadow:none;border:none;border-bottom:none!important}::placeholder{color:var(--config-color-placeholder);text-align:right}::-webkit-input-placeholder{text-align:right}input:-moz-placeholder{text-align:right}form.inline{display:inline-block}input,textarea{background:var(--config-color-background-input)}input[type=file],input[type=file]::-webkit-file-upload-button{cursor:pointer}.button,button{display:inline-block;background:var(--config-color-focus);border-radius:26px;border:none;color:var(--config-color-background-fade);height:52px;line-height:52px;padding:0 25px;cursor:pointer;font-size:16px;box-sizing:border-box;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.button:focus,.button:hover,button:focus,button:hover{background:var(--config-color-focus-hover)}.button.fly,button.fly{position:fixed;z-index:2;bottom:30px;left:30px}@media only screen and (max-width:550px){.button.fly,button.fly{left:15px}}.button.fill,button.fill{display:block;width:100%;text-align:center;padding:0 10px!important}.button.fill-aligned,button.fill-aligned{display:block;width:100%;text-align:right;padding:0 20px!important}.button.icon,button.icon{padding-left:30px!important}.button.icon-reduce,button.icon-reduce{padding-right:15px!important}.button.reverse,button.reverse{background:0 0;height:50px;line-height:48px;padding:0 23px;color:var(--config-color-focus);border:solid 2px var(--config-color-focus)}.button.reverse:focus,.button.reverse:hover,button.reverse:focus,button.reverse:hover{color:var(--config-color-focus-hover);border-color:var(--config-color-focus-hover)}.button.small,button.small{padding:0 15px;height:40px;line-height:36px;font-size:13px}.button.tick,button.tick{background:var(--config-color-fade-light);color:var(--config-color-dark);border-radius:20px;padding:0 10px;line-height:30px;height:30px;font-size:12px;display:inline-block}.button.tick.selected,button.tick.selected{background:var(--config-color-dark);color:var(--config-color-fade)}.button.round,button.round{width:52px;padding:0}.button.round.small,button.round.small{font-size:12px;width:30px;height:30px;line-height:30px}.button.white,button.white{background:#fff;color:var(--config-color-focus)}.button.white.reverse,button.white.reverse{color:#fff;background:0 0;border:solid 2px #fff}.button.trans,button.trans{background:0 0!important}.button.trans.reverse,button.trans.reverse{background:0 0!important}.button.success,button.success{background:var(--config-color-success)}.button.success.reverse,button.success.reverse{color:var(--config-color-success);background:#fff;border:solid 2px var(--config-color-success)}.button.danger,button.danger{background:var(--config-color-danger);color:#fff}.button.danger.reverse,button.danger.reverse{color:var(--config-color-danger);background:var(--config-color-background-fade);border:solid 2px var(--config-color-danger)}.button.dark,button.dark{background:var(--config-color-dark);color:var(--config-color-background-fade)}.button.dark.reverse,button.dark.reverse{color:var(--config-color-dark);background:var(--config-color-background-fade);border:solid 2px var(--config-color-dark)}.button .disabled,.button.disabled,.button:disabled,button .disabled,button.disabled,button:disabled{color:var(--config-color-normal);background:var(--config-color-background-dark);opacity:.6;cursor:default}.button.link,button.link{background:0 0;border-radius:0;color:var(--config-color-link);height:auto;line-height:normal;padding:0;padding-left:0!important}.button.link:focus,button.link:focus{box-shadow:inherit}.button.strip,button.strip{background:0 0;height:auto;line-height:16px;color:inherit;padding:0 5px}.button.facebook,button.facebook{color:#fff!important;background:#4070b4!important}.button.twitter,button.twitter{color:#fff!important;background:#56c2ea!important}.button.linkedin,button.linkedin{color:#fff!important;background:#0076b5!important}.button.github,button.github{color:#fff!important;background:#7e7c7c!important}.button:focus,button:focus{outline:0}label{margin-bottom:15px;display:block;line-height:normal}.input,input[type=date],input[type=datetime-local],input[type=email],input[type=file],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=url],select,textarea{-webkit-appearance:none;-moz-appearance:none;-webkit-transform:translateZ(0);box-sizing:content-box;color:#313131;height:40px;line-height:40px;border:solid 1px var(--config-color-fade-light);border-radius:10px;padding:5px 15px;font-size:16px;display:block;width:calc(100% - 32px);margin-bottom:30px}.input[type=file],input[type=date][type=file],input[type=datetime-local][type=file],input[type=email][type=file],input[type=file][type=file],input[type=number][type=file],input[type=password][type=file],input[type=search][type=file],input[type=tel][type=file],input[type=text][type=file],input[type=url][type=file],select[type=file],textarea[type=file]{line-height:0;padding:15px;height:auto}.input:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=email]:focus,input[type=file]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=url]:focus,select:focus,textarea:focus{outline:0;border-color:#b3d7fd}.input:disabled,input[type=date]:disabled,input[type=datetime-local]:disabled,input[type=email]:disabled,input[type=file]:disabled,input[type=number]:disabled,input[type=password]:disabled,input[type=search]:disabled,input[type=tel]:disabled,input[type=text]:disabled,input[type=url]:disabled,select:disabled,textarea:disabled{color:var(--config-color-normal);background:var(--config-color-fade-super);opacity:1!important}.input.strip,input[type=date].strip,input[type=datetime-local].strip,input[type=email].strip,input[type=file].strip,input[type=number].strip,input[type=password].strip,input[type=search].strip,input[type=tel].strip,input[type=text].strip,input[type=url].strip,select.strip,textarea.strip{border:none;border-radius:0;padding:5px 0;width:100%;background-color:transparent;background-position:left 2px top 50%;border-bottom:solid 1px var(--config-color-fade-light);color:var(--config-color-placeholder)}.input.strip:focus,input[type=date].strip:focus,input[type=datetime-local].strip:focus,input[type=email].strip:focus,input[type=file].strip:focus,input[type=number].strip:focus,input[type=password].strip:focus,input[type=search].strip:focus,input[type=tel].strip:focus,input[type=text].strip:focus,input[type=url].strip:focus,select.strip:focus,textarea.strip:focus{border-color:#b3d7fd}.input:-webkit-autofill::first-line,input[type=date]:-webkit-autofill::first-line,input[type=datetime-local]:-webkit-autofill::first-line,input[type=email]:-webkit-autofill::first-line,input[type=file]:-webkit-autofill::first-line,input[type=number]:-webkit-autofill::first-line,input[type=password]:-webkit-autofill::first-line,input[type=search]:-webkit-autofill::first-line,input[type=tel]:-webkit-autofill::first-line,input[type=text]:-webkit-autofill::first-line,input[type=url]:-webkit-autofill::first-line,select:-webkit-autofill::first-line,textarea:-webkit-autofill::first-line{font-weight:300;font-size:16px}input[type=email],input[type=url]{direction:ltr}input[type=email]::placeholder,input[type=url]::placeholder{text-align:left;direction:ltr}select{background:0 0;-webkit-appearance:none;background-image:var(--config-console-nav-switch-arrow);background-position:left 15px top 50%;background-repeat:no-repeat;background-color:var(--config-color-background-input);width:calc(100% - 62px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-left:45px}select:-webkit-autofill{background-image:url("data:image/svg+xml;utf8,")!important;background-position:100% 50%!important;background-repeat:no-repeat!important}input[type=search],input[type=search].strip{background:0 0;-webkit-appearance:none;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAdZJREFUWIXt1s2LjWEYBvDfnDMzFpNIamZIFrMiJYMyFmKhZKfOwoiFr2LFn2BByG6WVrKwMcjWxgoLIlKIUk6RrzAjZWZ8LO731FlwvB+PUbjq6X0X7/VeV/d9P9fz8IdRL8Hpw3x8w0xaOz9GNxq4gJeZcGs1cRab0fU7xLfgMSYzoT3YgNXYhIO4iM+4iTWphGs4jikcFSXvhEGczr4/UFW8C2N4jXUFudvwCYeqGNgnSr6yJH8rpkWLCqMfE9hdUryFE3iC3qLEk7ij+kT34Q32FiHV8Qr7K4q3cArXihCGxd5elMjARnzBvE4f1dreV+AtnicycC/7/7K8BhaIvqXCO3zFwrwGZtCT0EAtW9N5DTSxWGR/CizNns/yEgbFEK5NZGCnaEPHE7e9Ai9wA6OJDIzistgJubFdxHB/RfFVYgCHixJruI5x5dNwDm6J47sUhkTvjpUw0Y1zeOrXR3hHjOA9zmBuTs4Arog4/yhuUZWwHPdFMh7280BZgiP4ILJ/UuymqRQmejPxphiquzgvKnMJDzOxB9glZqiRiecykbfHdawX98EhcdxO4BGu4nYm2EJDzEKPSMIdYrBnFYUq8d/EP2di1gey3cS4ErflvxffASbhcakIINaMAAAAAElFTkSuQmCC);background-color:var(--config-color-background-input);background-position:right 15px top 50%;background-repeat:no-repeat;background-size:20px 20px;width:calc(100% - 60px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:45px}select[multiple]{min-height:75px;padding:5px 10px!important;padding-left:50px!important}select[multiple] option{padding:10px 4px;border-bottom:solid 1px #f1f1f1}select[multiple] option:last-child{border-bottom:none}textarea{min-height:75px;resize:vertical;line-height:32px;padding:5px 15px}textarea.tall{min-height:180px}fieldset{border:none;margin:0;padding:0}.counter{font-size:13px;text-align:left;color:var(--config-color-fade);margin-top:-20px;margin-bottom:20px}.file-preview{background:var(--config-color-background-input) url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAIElEQVQoU2NkYGAwZsAEZ9GFGIeIQix+wfQgyDODXSEAcUwGCrDSHgkAAAAASUVORK5CYII=)!important;border:solid 1px #e2e2e2;box-shadow:inset 0 0 3px #a0a0a0;border-radius:8px;width:calc(100% - 2px);max-height:180px;visibility:visible!important}.video-preview{padding-top:56%;position:relative;border-radius:10px;background:#e7e7e7;overflow:hidden;margin:0}.video-preview iframe{position:absolute;top:0;width:100%;height:100%;border:none}.map-preview{padding-top:50%;position:relative;margin-bottom:10px;border-radius:10px;background:#e7e7e7;overflow:hidden;box-shadow:0 0 30px rgba(218,218,218,.5)}.map-preview iframe{position:absolute;top:0;width:100%;height:100%;border:none}.tooltip{position:relative}.tooltip.large:hover:after{white-space:normal;width:280px}.tooltip.small:hover:after{white-space:normal;width:180px}.tooltip:hover:after{white-space:nowrap;background:var(--config-color-tooltip-background);border-radius:5px;bottom:26px;color:var(--config-color-tooltip-text);content:attr(data-tooltip);padding:5px 15px;position:absolute;font-size:13px;line-height:20px;z-index:98;right:20%;margin-right:-30px;word-break:break-word}.tooltip:hover:before{border:solid;border-color:var(--config-color-tooltip-background) transparent;border-width:6px 6px 0 6px;bottom:20px;content:"";position:absolute;z-index:99;right:5px}.tooltip.down:hover:after{top:26px;bottom:inherit}.tooltip.down:hover:before{top:20px;border-width:0 6px 6px 6px;bottom:inherit}.tag{display:inline-block;background:var(--config-color-fade-light);color:var(--config-color-fade);border-radius:12px;line-height:24px;padding:0 8px;font-size:12px;box-shadow:none!important;border:none;height:auto;width:auto;white-space:nowrap;text-overflow:ellipsis}.tag:hover{border:none}.tag.green{background:var(--config-color-success);color:#fff}.tag.red{background:var(--config-color-danger);color:#fff}.tag.yellow{background:#ffe28b;color:#494949}.tag.focus{background:var(--config-color-focus);color:#fff}.tag.dark{background:var(--config-color-dark);color:#e7e7e7}.tag.blue{background:var(--config-color-info);color:#fff}.tag.link{background:var(--config-color-link);color:#fff}input[type=checkbox],input[type=radio]{width:26px;height:16px;position:relative;-webkit-appearance:none;border-radius:0;border:none;background:0 0;vertical-align:middle;margin:0}input[type=checkbox]:after,input[type=radio]:after{content:"";display:block;width:20px;height:20px;background:var(--config-color-background-fade);top:-5px;border-radius:50%;position:absolute;border:solid 3px var(--config-color-focus);vertical-align:middle}input[type=checkbox]:checked:after,input[type=radio]:checked:after{text-align:center;font-family:fontello;content:'\e83d';font-size:16px;line-height:20px;color:var(--config-color-background-fade);background:var(--config-color-focus)}input[type=checkbox][type=radio]:checked:after,input[type=radio][type=radio]:checked:after{content:'';display:block;width:10px;height:10px;border-radius:50%;background:var(--config-color-background-fade);border:solid 8px var(--config-color-focus)}input[type=checkbox]:focus,input[type=radio]:focus{outline:0}input[type=checkbox]:focus:after,input[type=checkbox]:hover:after,input[type=radio]:focus:after,input[type=radio]:hover:after{outline:0;border-color:#000}input[type=checkbox]:checked:focus:after,input[type=checkbox]:checked:hover:after,input[type=radio]:checked:focus:after,input[type=radio]:checked:hover:after{border-color:var(--config-color-focus)}.input-copy{position:relative}.input-copy input,.input-copy textarea{padding-left:65px;width:calc(100% - 82px);resize:none}.input-copy .copy{position:absolute;top:0;left:0;border-right:solid 1px var(--config-color-fade-light);height:calc(100% - 2px);width:50px;line-height:50px;text-align:center;background:var(--config-color-background-focus);margin:1px;border-radius:0 10px 10px 0}.paging{color:var(--config-color-fade);padding:5px 15px;font-size:12px}.paging form{display:inline-block}.paging button:disabled{color:var(--config-color-background-fade);opacity:.6}.blue-snap iframe{-webkit-appearance:none;-moz-appearance:none;-webkit-transform:translateZ(0);box-sizing:content-box;color:#313131;height:40px;line-height:40px;border:solid 1px var(--config-color-fade-light);border-radius:10px;padding:5px 15px;font-size:16px;display:block;width:calc(100% - 32px);margin-bottom:30px;float:none!important;height:40px!important;width:calc(100% - 32px)!important;border:solid 1px #e2e2e2!important;background:0 0!important;position:static!important}.blue-snap iframe[type=file]{line-height:0;padding:15px;height:auto}.blue-snap iframe:focus{outline:0;border-color:#b3d7fd}.blue-snap iframe:disabled{color:var(--config-color-normal);background:var(--config-color-fade-super);opacity:1!important}.blue-snap iframe.strip{border:none;border-radius:0;padding:5px 0;width:100%;background-color:transparent;background-position:left 2px top 50%;border-bottom:solid 1px var(--config-color-fade-light);color:var(--config-color-placeholder)}.blue-snap iframe.strip:focus{border-color:#b3d7fd}.blue-snap iframe:-webkit-autofill::first-line{font-weight:300;font-size:16px}.blue-snap .error{font-size:12px;margin-top:-25px;color:var(--config-color-danger);height:40px;padding-right:2px}.pell{height:auto;padding-bottom:0;margin-bottom:0;padding-top:0;background:var(--config-color-background-input);line-height:normal!important;position:relative}.pell.hide{padding:0!important;height:1px;min-height:1px;max-height:1px;border:none;box-shadow:none;margin-bottom:20px;opacity:0}.pell [contenteditable=true]:empty:before{content:attr(placeholder);display:block;color:var(--config-color-placeholder)}.pell .pell-actionbar{border-bottom:solid 1px var(--config-color-fade-light);margin:0 -15px 15px -15px;padding:10px 15px;position:sticky;top:70px;background:var(--config-color-background-input);border-radius:10px 10px 0 0}.pell .pell-content{min-height:100px;display:block;padding:10px;margin:-10px;cursor:text}.pell .pell-content:focus{outline:0}.pell button{background:inherit;color:inherit;margin:0;padding:0;padding-left:15px;height:40px;line-height:40px;box-shadow:none;cursor:pointer;font-size:13px;border-radius:0}.pell button.pell-button-selected,.pell button:focus,.pell button:hover{color:var(--config-color-link)}.pell h1,.pell h2,.pell h3,.pell h4,.pell h5,.pell h6{text-align:inherit;margin-bottom:30px}.pell b,.pell strong{font-weight:700}.pell ol,.pell ul{margin:0 0 20px 0}.pell ol li,.pell ul li{display:list-item!important;list-style:inherit;list-style-position:inside!important;margin:0 20px 2px 20px}.pell ol li p,.pell ul li p{margin:0;display:inline}.pell ol li{list-style:decimal}.pell ol li::before{content:'';display:none}label.switch{line-height:42px}.switch,input[type=checkbox].button.switch,input[type=checkbox].switch{width:52px;height:32px;line-height:32px;border-radius:21px;background:var(--config-color-fade);display:inline-block;margin:0;padding:5px;padding-right:5px;padding-left:30px}.switch.on,.switch:checked,input[type=checkbox].button.switch.on,input[type=checkbox].button.switch:checked,input[type=checkbox].switch.on,input[type=checkbox].switch:checked{background-color:var(--config-color-success);padding-right:25px;padding-left:5px}.switch.on:focus,.switch.on:hover,.switch:checked:focus,.switch:checked:hover,input[type=checkbox].button.switch.on:focus,input[type=checkbox].button.switch.on:hover,input[type=checkbox].button.switch:checked:focus,input[type=checkbox].button.switch:checked:hover,input[type=checkbox].switch.on:focus,input[type=checkbox].switch.on:hover,input[type=checkbox].switch:checked:focus,input[type=checkbox].switch:checked:hover{background:var(--config-color-success)}.switch:focus,.switch:hover,input[type=checkbox].button.switch:focus,input[type=checkbox].button.switch:hover,input[type=checkbox].switch:focus,input[type=checkbox].switch:hover{background:var(--config-color-fade)}.switch:focus:after,.switch:hover:after,input[type=checkbox].button.switch:focus:after,input[type=checkbox].button.switch:hover:after,input[type=checkbox].switch:focus:after,input[type=checkbox].switch:hover:after{background:#fff}.switch:after,input[type=checkbox].button.switch:after,input[type=checkbox].switch:after{content:"";display:block;width:22px;height:22px;background:#fff;border-radius:50%;border:none;position:static;top:0}.password-meter{margin:-41px 10px 30px 10px;height:2px;background:0 0;max-width:100%;z-index:2;position:relative}.password-meter.weak{background:var(--config-color-danger)}.password-meter.medium{background:var(--config-color-success)}.password-meter.strong{background:var(--config-color-success)}.color-input:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.color-input .color-preview{width:53px;height:53px;float:right;margin-left:10px;background:#000;border-radius:10px;box-shadow:inset 0 0 3px #a0a0a0;position:relative}.color-input .color-preview input{opacity:0;position:absolute;top:0;bottom:0;left:0;right:0;width:100%;height:100%;cursor:pointer}.color-input input{text-transform:uppercase;float:right;width:calc(100% - 95px)}.grecaptcha-badge{box-shadow:none!important;border-radius:10px!important;overflow:hidden!important;background:#4d92df!important;bottom:25px}.grecaptcha-badge:hover{width:256px!important}.back{font-size:15px;line-height:24px;height:24px;margin-right:-15px;margin-top:-25px;margin-bottom:20px}.back span{font-weight:inherit!important}@media only screen and (max-width:550px){.back{margin-right:-5px}}hr{height:1px;background:var(--config-border-color)!important;border:none}hr.fade{opacity:.7}.upload{position:relative}.upload:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.upload input{position:absolute;top:0;right:0;opacity:0;cursor:pointer}.upload.single .preview{height:0;position:relative;padding-top:100%;width:100%;margin-bottom:15px!important}.upload.single .preview li{position:absolute;top:0;width:calc(100% - 20px);height:calc(100% - 20px);margin-left:0!important;margin-bottom:0!important}.upload .button{float:right;margin-left:10px!important}.upload .button.disabled,.upload .button.disabled:hover{background:0 0;color:inherit;border-color:inherit}.upload .count{float:right;line-height:52px}.upload .progress{background:var(--config-color-success);height:6px;border-radius:3px;margin-bottom:15px!important}.upload .preview:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.upload .preview li{float:right;margin-left:20px!important;margin-bottom:15px!important;background:var(--config-color-background-fade-super);width:150px;height:150px;line-height:148px;text-align:center;border-radius:20px;overflow:hidden;position:relative;cursor:pointer;border:solid 1px var(--config-color-background-dark)}.upload .preview li:hover:before{background:var(--config-color-focus)}.upload .preview li:before{content:'\e807';font-family:fontello;font-size:12px;position:absolute;width:20px;height:20px;display:block;top:8px;left:8px;text-align:center;line-height:20px;vertical-align:middle;border-radius:50%;background:#484848;color:#fff;z-index:1}.upload .preview li img{vertical-align:middle;max-height:150px;max-width:150px;-webkit-filter:drop-shadow(0 0 6px rgba(0, 0, 0, .3));filter:drop-shadow(0 0 1px rgba(0, 0, 0, .3))}.upload.wide .preview li{height:0;width:100%;position:relative;padding-top:30.547%;background:#e7e7e7;border-radius:10px;overflow:hidden;border:solid 1px #f9f9f9;margin:0}.upload.wide .preview li img{border-radius:10px;position:absolute;top:0;width:100%;display:block;opacity:1;max-width:inherit;max-height:inherit}ol{list-style:none;counter-reset:x-counter;padding:0}ol li{counter-increment:x-counter;line-height:30px;margin-bottom:30px;margin-right:45px}ol li::before{display:inline-block;content:counter(x-counter);color:var(--config-color-background-fade);background:var(--config-color-focus);border:solid 2px var(--config-color-focus);margin-left:15px;margin-right:-45px;width:26px;height:26px;border-radius:50%;text-align:center;line-height:26px}.required{color:var(--config-color-danger);font-size:8px;position:relative;top:-8px}.drop-list{position:relative;outline:0}.drop-list.open ul{display:block}.drop-list ul{position:relative;background:var(--config-color-background-fade);border-radius:10px;box-shadow:0 0 3px rgba(0,0,0,.05);padding:30px;display:block;border-bottom:none;box-shadow:0 0 6px rgba(0,0,0,.1);display:none;position:absolute;bottom:calc(100% + 10px);z-index:2;padding:0;right:-10px;max-width:280px;min-width:240px}.drop-list ul.padding-small{padding:15px}.drop-list ul.y-scroll{overflow-y:auto}.drop-list ul.danger{background:var(--config-color-danger);color:#fff}.drop-list ul.danger .box{color:var(--config-color-normal);background:var(--config-color-background-fade)}.drop-list ul.danger>.button,.drop-list ul.danger>button{background:#fff;color:var(--config-color-danger)}.drop-list ul.note{background:var(--config-note-background)}.drop-list ul.focus{background:var(--config-color-focus);color:var(--config-color-background-fade)}.drop-list ul.focus .button,.drop-list ul.focus button{background:var(--config-color-background-fade);color:var(--config-color-focus)}.drop-list ul.line{background:0 0;border:solid 1px var(--config-color-background-dark);box-shadow:none}.drop-list ul.warning{background:var(--config-color-success);color:#2d2d2d}.drop-list ul.warning .button,.drop-list ul.warning button{background:rgba(45,45,45,.8);color:var(--config-color-success)}.drop-list ul .tabs{border-bottom:solid 1px var(--config-border-color);margin:0 -30px;padding:0 30px!important}.drop-list ul>footer{margin:0 -30px -30px -30px;padding:15px 30px;background:var(--config-color-background-fade);border:solid 1px var(--config-border-color);border-radius:0 0 10px 10px}.drop-list ul hr{height:1px;background:var(--config-console-background);border:none;margin:30px -30px}.drop-list ul .label{position:absolute;top:10px;z-index:2;left:10px}.drop-list ul.fade-bottom{position:relative;overflow:hidden}.drop-list ul.fade-bottom:after{content:"";position:absolute;display:block;bottom:15px;width:100%;background:#000;background:linear-gradient(180deg,rgba(0,0,0,0) 0,var(--config-color-background-fade) 80%);height:100px;margin:0 -15px}.drop-list ul .header{position:static;height:40px;padding:20px 30px 20px 30px;margin-bottom:30px;margin:-30px -30px 20px -30px;background:var(--config-color-background-fade);border-bottom:solid 1px #efefef}.drop-list ul ul.numbers>li{position:relative;margin-right:30px;margin-left:50px}.drop-list ul ul.numbers>li hr{margin-right:-60px;margin-left:-80px}.drop-list ul ul.numbers>li .settings{position:absolute;top:3px;left:-50px}.drop-list ul ul.numbers>li::after{display:block;width:25px;height:25px;line-height:25px;font-size:13px;font-weight:500;border-radius:50%;background:var(--config-color-focus);color:var(--config-color-background);counter-increment:section;content:counter(section);text-align:center;position:absolute;top:3px;right:-45px}.drop-list ul .scroll{margin:0 -30px;overflow-y:scroll}.drop-list ul .scroll table{width:100%;margin:0}.drop-list ul ul.sortable{counter-reset:section}.drop-list ul ul.sortable>li [data-move-down].round,.drop-list ul ul.sortable>li [data-move-up].round,.drop-list ul ul.sortable>li [data-remove].round{background:var(--config-color-focus);color:var(--config-color-background-fade);width:25px;height:25px;line-height:25px;display:inline-block;text-align:center;padding:0;margin-left:5px}.drop-list ul ul.sortable>li [data-move-down].round:disabled,.drop-list ul ul.sortable>li [data-move-up].round:disabled,.drop-list ul ul.sortable>li [data-remove].round:disabled{display:none}.drop-list ul ul.sortable>li:first-child [data-move-up]{display:none}.drop-list ul ul.sortable>li:first-child [data-move-up]:disabled{display:inline-block;background:var(--config-color-background)}.drop-list ul ul.sortable>li:last-child [data-move-down]{display:none}.drop-list ul ul.sortable>li:last-child [data-move-down]:disabled{display:inline-block;background:var(--config-color-background)}.drop-list ul .toggle{position:relative;border-top:1px solid var(--config-console-background);border-bottom:1px solid var(--config-console-background);margin:0 -30px;padding:30px 30px 0 30px;height:65px;overflow:hidden}.drop-list ul .toggle.list{border-bottom:none}.drop-list ul .toggle.sorts button.ls-ui-open{width:calc(100% - 100px)}.drop-list ul .toggle button.ls-ui-open{left:0;position:absolute;top:0;width:100%;height:95px;background:0 0;opacity:.5;border-radius:0}.drop-list ul .toggle .icon-minus,.drop-list ul .toggle .icon-up-open{display:none}.drop-list ul .toggle .content{display:none}.drop-list ul .toggle.open{height:auto}.drop-list ul .toggle.open .icon-minus,.drop-list ul .toggle.open .icon-up-open{display:block}.drop-list ul .toggle.open .icon-down-open,.drop-list ul .toggle.open .icon-plus{display:none}.drop-list ul .toggle.open .content{display:block}.drop-list ul .list li{border-bottom:solid 2px var(--config-border-color);margin:0 -30px 30px -30px;padding:0 30px 30px 30px}.drop-list ul .list li:last-child{padding-bottom:0;margin-bottom:0;border-bottom:none}@media only screen and (max-width:550px){.drop-list ul .list li .actions{float:none}}.drop-list ul .list li .avatar{display:block}.drop-list ul .list li .avatar.inline{display:inline-block}.drop-list ul.new{text-align:center}.drop-list ul.new i{font-size:80px;line-height:80px;font-family:Poppins,sans-serif;font-style:normal;font-weight:300}.drop-list ul.new b{margin-top:20px;display:block}.drop-list ul .info{margin:0 -30px;padding:20px 30px;background:var(--config-modal-note-background);color:var(--config-modal-note-color);border-top:solid 1px var(--config-modal-note-border);border-bottom:solid 1px var(--config-modal-note-border)}.drop-list ul .info hr{background:var(--config-modal-note-border)!important}.drop-list ul .table-wrap{margin:0 -30px;overflow-y:scroll}.drop-list ul .table-wrap table{margin:0}.drop-list ul:before{border:solid;border-color:var(--config-color-background-fade) transparent;border-width:8px 8px 0 8px;bottom:-8px;content:"";position:absolute;z-index:99;right:30px}.drop-list ul.arrow-end:before{left:30px;right:unset}.drop-list ul li{border-bottom:solid 1px var(--config-color-fade-super);margin:0;padding:0}.drop-list ul li:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.drop-list ul li:first-child{border-radius:10px 10px 0 0}.drop-list ul li:last-child{border-radius:0 0 10px 10px}.drop-list ul li:hover{background:var(--config-color-fade-super)}.drop-list ul li:first-child:hover,.drop-list ul li:last-child:hover{border-color:transparent}.drop-list ul li .link,.drop-list ul li a,.drop-list ul li button.link{display:block;vertical-align:middle;height:auto;line-height:30px;display:inline-block;padding:10px 15px!important;color:inherit;font-size:14px;border:none;cursor:pointer;width:calc(100% - 30px);text-align:right;box-sizing:content-box}.drop-list ul li.disabled .link:hover,.drop-list ul li.disabled a:hover{background:0 0}.drop-list ul li .avatar{width:30px;height:30px;margin-left:10px;float:right}.drop-list ul li:last-child{border-bottom:none}.drop-list.bottom ul{bottom:auto;margin-top:-2px}.drop-list.bottom ul:before{bottom:auto;top:-8px;border-width:0 8px 8px 8px}.drop-list.end ul{left:-10px;right:auto}.disabled{opacity:.2;cursor:default}.disabled .button,.disabled .link,.disabled a,.disabled button{cursor:default!important}.disabled .button:hover,.disabled .link:hover,.disabled a:hover,.disabled button:hover{background:0 0}.tags{-webkit-appearance:none;-moz-appearance:none;-webkit-transform:translateZ(0);box-sizing:content-box;color:#313131;height:40px;line-height:40px;border:solid 1px var(--config-color-fade-light);border-radius:10px;padding:5px 15px;font-size:16px;display:block;width:calc(100% - 32px);margin-bottom:30px;background:var(--config-color-background-input);min-height:42px;height:auto;cursor:text}.tags[type=file]{line-height:0;padding:15px;height:auto}.tags:focus{outline:0;border-color:#b3d7fd}.tags:disabled{color:var(--config-color-normal);background:var(--config-color-fade-super);opacity:1!important}.tags.strip{border:none;border-radius:0;padding:5px 0;width:100%;background-color:transparent;background-position:left 2px top 50%;border-bottom:solid 1px var(--config-color-fade-light);color:var(--config-color-placeholder)}.tags.strip:focus{border-color:#b3d7fd}.tags:-webkit-autofill::first-line{font-weight:300;font-size:16px}.tags .add{display:inline-block!important;border:none;padding:0;width:auto;margin:0;max-width:100%;min-width:200px}.tags ul.tags-list{display:inline;white-space:pre-line}.tags ul.tags-list li{display:inline-block!important;margin-left:10px;font-size:16px;padding:5px 10px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.tags ul.tags-list li::before{float:left;content:'\e807';font-family:fontello;font-style:normal;display:inline-block;text-align:center;line-height:16px;width:16px;height:16px;font-size:12px;background:#000;color:#fff;border-radius:50%;margin-top:4px;margin-bottom:4px;margin-right:6px;margin-left:0}.switch-theme{background:var(--config-switch-background);border-radius:19px;height:26px;width:44px;margin:9px 0}.switch-theme button{padding:3px;display:block;background:0 0;height:26px;width:100%}.switch-theme i{background:var(--config-color-background-fade);border-radius:50%;height:18px;width:18px;line-height:18px;font-size:12px;padding:0;margin:0;color:var(--config-color-fade)}.switch-theme i.force-light{float:left}.switch-theme i.force-dark{float:right}.dot{width:20px;height:20px;background:var(--config-color-fade);border-radius:50%;display:inline-block;vertical-align:middle;margin:0!important;padding:0!important}.dot.danger{background:var(--config-color-danger)!important}.dot.success{background:var(--config-color-success)!important}.dot.warning{background:var(--config-color-warning)!important}.dot.info{background:var(--config-color-info)!important}.console{width:100%;padding:0;overscroll-behavior:none}.console body{position:relative;width:calc(100% - 320px);padding-top:70px;padding-bottom:0;padding-left:50px;padding-right:270px;margin:0;color:var(--config-color-normal);background:var(--config-console-background)}.console body .project-only{display:none!important}.console body.show-nav .project-only{display:inline-block!important}.console body.hide-nav{padding-right:50px;width:calc(100% - 100px)}.console body.hide-nav header{width:calc(100% - 50px)}.console body.hide-nav header .logo{display:inline-block}.console body.hide-nav .console-back{display:block}.console body.hide-nav .console-index{display:none}.console body.hide-nav .account{display:none}.console body.index .console-back{display:none}.console body.index .console-index{display:block}.console body.index .account{display:block}.console body .console-index{display:block}.console body .console-back{display:none}.console main{min-height:480px}.console header{position:fixed;top:0;width:calc(100% - 280px);height:40px;line-height:40px;padding:15px 30px;background:var(--config-color-background-fade);box-shadow:0 0 2px rgba(0,0,0,.1);margin:0 -50px;z-index:2;font-size:14px}.console header .logo{display:none;border:none}.console header .logo:hover{border:none;opacity:.8}.console header .logo img{height:26px;margin:7px 0}.console header .setup-new{width:40px;height:40px;line-height:40px}.console header .list{width:240px}.console header .list select{height:40px;line-height:40px;padding-top:0;padding-bottom:0;border:none;border-radius:26px;background-color:var(--config-console-nav-switch-background);color:var(--config-console-nav-switch-color)}.console header .account{margin-right:25px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.console header .switch-theme{margin:2px 0}.console header .avatar{height:40px;width:40px}.console header .account-button{background:0 0;position:absolute;width:100%;height:40px;border-radius:0;z-index:1}.console header .notifications{position:relative;font-size:20px}.console header .notifications a{color:#1b3445}.console header .notifications:after{position:absolute;content:"";display:block;background:var(--config-color-danger);width:8px;height:8px;border-radius:50%;top:3px;left:3px}.console header nav{background:#1b3445;background:linear-gradient(var(--config-console-nav-start),var(--config-console-nav-end));color:#788c99;position:fixed;height:100%;width:220px;top:0;right:0}.console header nav .logo{height:39px;padding:15px 20px;display:block}.console header nav .logo img{display:inline-block;margin-top:7px;margin-bottom:14px}.console header nav .logo svg g{fill:var(--config-color-focus)}.console header nav .icon{display:block;border:none;margin:18px 10px 50px 10px}.console header nav .icon img{display:block}.console header nav .icon:hover{border-bottom:none}.console header nav .icon:hover svg g{fill:var(--config-color-focus)}.console header nav .container{overflow:auto;height:calc(100% - 133px);width:100%}.console header nav .project-box{padding:20px;text-align:center;display:block;border:none;line-height:100px;height:100px}.console header nav .project-box img{max-height:80px;max-width:80%;display:inline-block;vertical-align:middle}.console header nav .project{display:block;padding:85px 25px 20px 25px;color:#788c99;position:relative;border:none;height:20px}.console header nav .project:hover{border-bottom:none}.console header nav .project .name{height:20px;line-height:20px;margin:0;padding:0;display:inline-block;max-width:100%}.console header nav .project .arrow{display:block;position:absolute;left:5px;top:10px;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #788c99;transform:rotate(225deg)}.console header nav .project img{position:absolute;bottom:40px;display:block;margin-bottom:10px;max-height:35px;max-width:40%}.console header nav .subtitle{padding:0 30px;display:block;font-size:12px;font-weight:300}.console header nav .links{margin-bottom:15px!important}.console header nav .links.top{border:none;padding-bottom:0;margin-bottom:5px!important}.console header nav .links.bottom{position:absolute;bottom:0;left:0;right:0;padding-bottom:0;border:none;margin-bottom:0!important;box-shadow:0 0 10px rgba(0,0,0,.1)}.console header nav .links.bottom a{border-top:solid 1px var(--config-console-nav-border);border-bottom:none}.console header nav .links .sub{display:inline-block;border:none;width:25px;height:25px;line-height:25px;border-radius:50%;padding:0;background:var(--config-color-focus);color:#fff;text-align:center;font-size:12px;margin:18px}.console header nav .links .sub i{width:auto;margin:0}.console header nav .links .sub:hover{border:none}.console header nav .links a{padding:8px 20px;border:none;display:block;color:#87a5b9;font-weight:400;border-right:solid 5px transparent;font-size:13px}.console header nav .links a i{margin-left:8px;width:22px;display:inline-block}.console header nav .links a.selected,.console header nav .links a:hover{color:#e4e4e4}.console header nav:after{content:'';display:block;position:absolute;background:#302839;height:100px;width:100%;bottom:-100px}.console>footer{width:calc(100% + 100px);margin:0 -50px;box-sizing:border-box;background:0 0;padding-left:30px;padding-right:30px}.console>footer ul{float:none;text-align:center}.console>footer ul li{float:none;display:inline-block}.console .projects{position:relative}.console .projects:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.console .projects li{float:right;margin-left:50px;margin-bottom:50px;width:270px}.console .projects li:nth-child(3n){margin-left:0}.console .dashboard{padding:20px;overflow:hidden;position:relative;z-index:1;margin-bottom:2px}.console .dashboard .chart{width:80%}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.console .dashboard .chart{width:100%}}.console .dashboard hr{margin:20px -25px;height:2px;background:var(--config-console-background)}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.console .dashboard hr{height:3px}}.console .dashboard footer{margin:-20px;padding:20px;background:#fcfeff;border:none;color:var(--config-color-link)}.console .dashboard .col{position:relative}.console .dashboard .col:last-child:after{display:none}.console .dashboard .col:after{content:"";display:block;width:2px;background:var(--config-console-background);position:absolute;top:-20px;bottom:-20px;left:24px}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.console .dashboard .col:after{width:calc(100% + 40px);height:3px;position:static;margin:20px -20px}}.console .dashboard .value{color:var(--config-color-focus);vertical-align:bottom;line-height:45px}.console .dashboard .value.small{line-height:35px}.console .dashboard .value .sum{font-size:45px;line-height:45px;font-weight:700;vertical-align:bottom}.console .dashboard .value .sum.small{font-size:25px;line-height:25px}.console .dashboard .unit{font-weight:500;line-height:20px;vertical-align:bottom;font-size:16px;display:inline-block;margin-bottom:5px;margin-right:5px;color:var(--config-color-focus)}.console .dashboard .metric{color:var(--config-color-focus);font-weight:400;font-size:13px;line-height:16px}.console .dashboard .range{color:var(--config-color-fade);font-weight:400;font-size:14px;line-height:16px}.console .dashboard a{display:block;font-weight:400;font-size:14px;line-height:16px;padding:0;border:none}.console .chart-metric{width:19%}@media only screen and (min-width:551px) and (max-width:1198px),only screen and (max-width:550px){.console .chart-metric{width:100%}}.console .chart{width:100%;position:relative;height:0;padding-top:20px;padding-bottom:26%;margin-left:-2px;overflow:hidden;background-color:var(--config-color-background-fade);background-image:linear-gradient(transparent 1px,transparent 1px),linear-gradient(90deg,transparent 1px,transparent 1px),linear-gradient(var(--config-border-color) 1px,transparent 1px),linear-gradient(90deg,var(--config-border-color) 1px,transparent 1px);background-size:100px 100px,100px 100px,20px 20px,20px 20px;background-position:-2px -2px,-2px -2px,-1px -1px,-1px -1px;background-repeat:round;border:solid 1px var(--config-border-color);border-right:solid 1px transparent;border-bottom:solid 1px transparent}@media only screen and (min-width:551px) and (max-width:1198px),only screen and (max-width:550px){.console .chart{width:100%;padding-bottom:32%;float:none;margin-bottom:20px}}.console .chart canvas{position:absolute;bottom:0;display:block;height:100%;width:100%}.console .chart-notes{font-size:12px}.console .chart-notes li{line-height:20px;display:inline-block;margin-left:15px}.console .chart-notes li::before{display:inline-block;content:'';width:14px;height:14px;background:var(--config-color-normal);border-radius:50%;margin-left:8px;vertical-align:middle}.console .chart-notes li.blue,.console .chart-notes li:nth-child(1){color:#29b5d9}.console .chart-notes li.blue::before,.console .chart-notes li:nth-child(1)::before{background:#29b5d9}.console .chart-notes li.green,.console .chart-notes li:nth-child(2){color:#4eb55b}.console .chart-notes li.green::before,.console .chart-notes li:nth-child(2)::before{background:#4eb55b}.console .chart-notes li.orange,.console .chart-notes li:nth-child(3){color:#ec9323}.console .chart-notes li.orange::before,.console .chart-notes li:nth-child(3)::before{background:#ec9323}.console .chart-notes li.red,.console .chart-notes li:nth-child(4){color:#dc3232}.console .chart-notes li.red::before,.console .chart-notes li:nth-child(4)::before{background:#dc3232}.console .community a{padding:0 10px;display:inline-block}.console .link-list li{margin-bottom:15px}.console .link-list i{display:inline-block;width:30px;height:30px;line-height:30px;text-align:center;background:var(--config-color-fade);color:var(--config-color-fade-super);border-radius:50%;margin-left:15px}.console .link-list i.fade{background:0 0;color:var(--config-color-fade)}.console .provider{width:50px;height:50px;background:#f5f5f5;color:#868686;line-height:50px;text-align:center;font-size:25px;border-radius:50%}.console .provider.facebook{color:#fff;background:#3b5998}.console .provider.twitter{color:#fff;background:#55beff}.console .provider.telegram{color:#fff;background:#3ba9e1}.console .provider.github{color:#fff;background:#24292e}.console .provider.whatsapp{color:#fff;background:#25d366}.console .provider.linkedin{color:#fff;background:#1074af}.console .provider.microsoft{color:#fff;background:#137ad4}.console .provider.google{color:#fff;background:#4489f1}.console .provider.bitbucket{color:#fff;background:#2a88fb}.console .provider.gitlab{color:#faa238;background:#30353e}.console .provider.instagram{color:#fff;background:radial-gradient(circle at 30% 107%,#fdf497 0,#fdf497 5%,#fd5949 45%,#d6249f 60%,#285aeb 90%)}.console .premium{z-index:3;margin-top:320px}.console .premium .message{height:190px;overflow:hidden;position:absolute;top:-280px}.console .premium:after{content:'';position:absolute;top:0;left:-20px;right:-20px;bottom:-20px;background:var(--config-color-background);opacity:.7;z-index:300}.console .app-section{height:90px}.console .confirm{background:var(--config-color-link);color:#fff;border-radius:25px;padding:12px;line-height:28px;text-align:center}.console .confirm .action{font-weight:500;cursor:pointer}.console .platforms{overflow:hidden}.console .platforms .box{overflow:hidden}.console .platforms .box img{width:50px;margin:0 auto;margin-bottom:20px}.console .platforms .box .cover{margin:-30px -30px 30px -30px;padding:30px}.console .platforms .box .cover.android{background:#a4ca24}.console .platforms .box .cover.android h1{color:#fff;font-size:18px;margin-top:20px}.console .platforms .col{text-align:center;line-height:30px}.console .platforms a{display:block;margin:-20px;padding:20px}.console .platforms a:hover{background:#fbfeff}.console .platforms img{display:block;margin:0 30px;width:calc(100% - 60px);border-radius:50%;margin-bottom:20px}.console .document-nav{display:none;position:sticky;top:90px}@media only screen and (min-width:1380px){.console .document-nav{display:block}}.console .document-nav ul{position:absolute;width:200px;right:-260px}.console .document-nav ul li{margin-bottom:20px}.console .document-nav ul li .selected{font-weight:500}.console .scroll-to{display:none}@media only screen and (min-width:1199px){.console .logo .top{display:none!important}}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.console>header{width:calc(100% - 30px)!important;margin:0 -30px;padding:15px}.console>header nav{width:100%;height:70px;overflow:hidden}.console>header nav.close{background:0 0}.console>header nav.close .logo .nav{display:none!important}.console>header nav.open{height:100%}.console>header nav.open .logo .top{display:none!important}.console>header nav.open .bottom{display:block!important}.console>header nav.open button{color:#87a5b9}.console>header nav button{margin:9px;background:0 0;color:var(--config-color-normal)}.console>header nav button:focus,.console>header nav button:hover{background:0 0}.console>header nav .logo{display:block!important;position:absolute;top:0;left:50%;margin:auto;transform:translateX(-50%)}.console>header nav .bottom{display:none!important}.console>footer{width:auto;margin:50px -30px 0 -30px!important;padding:0 30px 30px 30px}.console body{height:"calc(100% - 70px)"!important;width:calc(100% - 60px)!important;padding:70px 30px 0 30px!important}.console .cover{padding:25px 30px;margin:0 -30px}}@media only screen and (max-width:550px){.console body{height:"calc(100% - 70px)"!important;width:calc(100% - 40px)!important;padding:70px 20px 0 20px!important}.console .cover{padding:20px 20px;margin:0 -20px}.console>header{margin:0 -20px}.console>header .list{width:175px;font-size:14px}.console>footer{margin:50px -20px 0 -20px!important;padding:0 20px 20px 20px}}.dev-feature{display:none}.prod-feature{display:none}.development .dev-feature{display:block;opacity:.6!important;outline:solid #ff0 3px;outline-offset:3px}.development .dev-feature.dev-inline{display:inline-block}.development .prod-feature{display:none}.production .dev-feature{display:none}.production .prod-feature{display:block}.search{opacity:1!important}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.search button{margin-top:20px}}html.home body{padding:0 50px;color:var(--config-color-normal)}html.home .logo a{display:block}html.home .logo a:hover{opacity:.8}html.home .logo img{max-height:35px;width:198px;margin:45px auto 25px auto}html.home footer{background:0 0;text-align:center}html.home main{min-height:400px}.alerts ul{width:100%;visibility:hidden;position:fixed;padding:0;left:0;right:0;color:var(--config-color-normal);z-index:4;margin:0 auto;bottom:15px;max-width:560px}.alerts ul li{margin:10px 0 0 0;padding:0}.alerts ul li div.message{position:relative;padding:12px 35px;margin:0 auto;list-style:none;background:var(--config-color-background-dark);text-align:center;font-size:14px;border-radius:10px;line-height:16px;min-height:16px;box-shadow:0 0 10px rgba(0,0,0,.05);opacity:.95}.alerts ul li div.message a,.alerts ul li div.message span{font-weight:600}.alerts ul li div.message a{border-bottom:dotted 1px var(--config-color-normal)}.alerts ul li div.message i{cursor:pointer;position:absolute;font-size:14px;line-height:20px;top:9px;right:9px;color:var(--config-color-background-dark);background:var(--config-color-normal);width:22px;height:22px;border-radius:50%}.alerts ul li div.message.error{color:#fff!important;background:var(--config-color-danger)!important}.alerts ul li div.message.error a{color:#fff!important;border-bottom:dotted 1px #fff!important}.alerts ul li div.message.error i{color:var(--config-color-danger);background:#fff}.alerts ul li div.message.success{color:#fff!important;background:var(--config-color-success)!important}.alerts ul li div.message.success a{color:#fff;border-bottom:dotted 1px #fff}.alerts ul li div.message.success i{color:var(--config-color-success);background:#fff}.alerts ul li div.message.warning{color:var(--config-color-normal)!important;background:var(--config-color-warning)!important}.alerts ul li div.message.warning a{color:var(--config-color-normal)!important;border-bottom:dotted 1px var(--config-color-normal)!important}.alerts ul li div.message.warning i{color:#fff;background:var(--config-color-normal)!important}.alerts ul li div.message.open{display:block}.alerts ul li div.message.close{display:none}.alerts .cookie-alert{background:var(--config-color-focus-fade)!important;color:var(--config-color-focus)}.alerts .cookie-alert a{color:var(--config-color-focus);font-weight:400;border-bottom:dotted 1px var(--config-color-focus)!important}.alerts .cookie-alert i{color:var(--config-color-focus-fade)!important;background:var(--config-color-focus)!important}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.alerts ul{top:auto;bottom:0;max-width:100%;right:0}.alerts ul li{margin:5px 0 0 0}.alerts ul li div.message{border-radius:0}}.show-nav .alerts ul{right:220px}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.show-nav .alerts ul{right:0}}article{overflow-wrap:break-word;word-wrap:break-word}article h1{font-size:36px}article h2{font-size:24px}article h3{font-size:20px}article h4{font-size:20px}article h5{font-size:18px}article h6{font-size:16px}article h1,article h2,article h3,article h4,article h5,article h6{margin-top:30px!important;margin-bottom:30px!important}article p{line-height:32px;font-size:16px}article .update{display:block;margin-top:50px!important}article table{width:100%;margin:0;margin-bottom:30px!important;border-radius:0;border-bottom:solid 1px var(--config-border-color)}article table thead td{font-weight:500;padding:5px 15px}article table td,article table th{padding:15px;height:auto}article table td:first-child,article table th:first-child{padding-right:10px}article table td:last-child,article table th:last-child{padding-left:10px}article table td p,article table th p{font-size:inherit;line-height:inherit}article table td p:last-child,article table th p:last-child{margin:0}.avatar-container{position:relative}.avatar-container .corner{position:absolute;bottom:-3px;left:-3px}.avatar{width:60px;height:60px;border-radius:50%;background:var(--config-color-background-focus);display:inline-block;overflow:hidden;box-shadow:0 0 6px rgba(0,0,0,.09);position:relative;z-index:1;opacity:1!important}.avatar:before{content:"";position:absolute;width:100%;height:100%;z-index:0;background:var(--config-color-background-focus)}.avatar.inline{display:inline-block;vertical-align:middle}.avatar.trans{background:0 0}.avatar .no-shadow{box-shadow:none}.avatar.xs{width:30px;height:30px}.avatar.xxs{width:20px;height:20px}.avatar.small{width:50px;height:50px}.avatar.big{width:100px;height:100px}.avatar.huge{width:150px;height:150px}.box{position:relative;background:var(--config-color-background-fade);border-radius:10px;box-shadow:0 0 3px rgba(0,0,0,.05);padding:30px;display:block;border-bottom:none}.box.padding-small{padding:15px}.box.y-scroll{overflow-y:auto}.box.danger{background:var(--config-color-danger);color:#fff}.box.danger .box{color:var(--config-color-normal);background:var(--config-color-background-fade)}.box.danger>.button,.box.danger>button{background:#fff;color:var(--config-color-danger)}.box.note{background:var(--config-note-background)}.box.focus{background:var(--config-color-focus);color:var(--config-color-background-fade)}.box.focus .button,.box.focus button{background:var(--config-color-background-fade);color:var(--config-color-focus)}.box.line{background:0 0;border:solid 1px var(--config-color-background-dark);box-shadow:none}.box.warning{background:var(--config-color-success);color:#2d2d2d}.box.warning .button,.box.warning button{background:rgba(45,45,45,.8);color:var(--config-color-success)}.box .tabs{border-bottom:solid 1px var(--config-border-color);margin:0 -30px;padding:0 30px!important}.box>footer{margin:0 -30px -30px -30px;padding:15px 30px;background:var(--config-color-background-fade);border:solid 1px var(--config-border-color);border-radius:0 0 10px 10px}.box hr{height:1px;background:var(--config-console-background);border:none;margin:30px -30px}.box .label{position:absolute;top:10px;z-index:2;left:10px}.box.fade-bottom{position:relative;overflow:hidden}.box.fade-bottom:after{content:"";position:absolute;display:block;bottom:15px;width:100%;background:#000;background:linear-gradient(180deg,rgba(0,0,0,0) 0,var(--config-color-background-fade) 80%);height:100px;margin:0 -15px}.box .header{position:static;height:40px;padding:20px 30px 20px 30px;margin-bottom:30px;margin:-30px -30px 20px -30px;background:var(--config-color-background-fade);border-bottom:solid 1px #efefef}.box ul.numbers>li{position:relative;margin-right:30px;margin-left:50px}.box ul.numbers>li hr{margin-right:-60px;margin-left:-80px}.box ul.numbers>li .settings{position:absolute;top:3px;left:-50px}.box ul.numbers>li::after{display:block;width:25px;height:25px;line-height:25px;font-size:13px;font-weight:500;border-radius:50%;background:var(--config-color-focus);color:var(--config-color-background);counter-increment:section;content:counter(section);text-align:center;position:absolute;top:3px;right:-45px}.box .scroll{margin:0 -30px;overflow-y:scroll}.box .scroll table{width:100%;margin:0}.box ul.sortable{counter-reset:section}.box ul.sortable>li [data-move-down].round,.box ul.sortable>li [data-move-up].round,.box ul.sortable>li [data-remove].round{background:var(--config-color-focus);color:var(--config-color-background-fade);width:25px;height:25px;line-height:25px;display:inline-block;text-align:center;padding:0;margin-left:5px}.box ul.sortable>li [data-move-down].round:disabled,.box ul.sortable>li [data-move-up].round:disabled,.box ul.sortable>li [data-remove].round:disabled{display:none}.box ul.sortable>li:first-child [data-move-up]{display:none}.box ul.sortable>li:first-child [data-move-up]:disabled{display:inline-block;background:var(--config-color-background)}.box ul.sortable>li:last-child [data-move-down]{display:none}.box ul.sortable>li:last-child [data-move-down]:disabled{display:inline-block;background:var(--config-color-background)}.box .toggle{position:relative;border-top:1px solid var(--config-console-background);border-bottom:1px solid var(--config-console-background);margin:0 -30px;padding:30px 30px 0 30px;height:65px;overflow:hidden}.box .toggle.list{border-bottom:none}.box .toggle.sorts button.ls-ui-open{width:calc(100% - 100px)}.box .toggle button.ls-ui-open{left:0;position:absolute;top:0;width:100%;height:95px;background:0 0;opacity:.5;border-radius:0}.box .toggle .icon-minus,.box .toggle .icon-up-open{display:none}.box .toggle .content{display:none}.box .toggle.open{height:auto}.box .toggle.open .icon-minus,.box .toggle.open .icon-up-open{display:block}.box .toggle.open .icon-down-open,.box .toggle.open .icon-plus{display:none}.box .toggle.open .content{display:block}.box .list li{border-bottom:solid 2px var(--config-border-color);margin:0 -30px 30px -30px;padding:0 30px 30px 30px}.box .list li:last-child{padding-bottom:0;margin-bottom:0;border-bottom:none}@media only screen and (max-width:550px){.box .list li .actions{float:none}}.box .list li .avatar{display:block}.box .list li .avatar.inline{display:inline-block}.box.new{text-align:center}.box.new i{font-size:80px;line-height:80px;font-family:Poppins,sans-serif;font-style:normal;font-weight:300}.box.new b{margin-top:20px;display:block}.box .info{margin:0 -30px;padding:20px 30px;background:var(--config-modal-note-background);color:var(--config-modal-note-color);border-top:solid 1px var(--config-modal-note-border);border-bottom:solid 1px var(--config-modal-note-border)}.box .info hr{background:var(--config-modal-note-border)!important}.box .table-wrap{margin:0 -30px;overflow-y:scroll}.box .table-wrap table{margin:0}a.box{border-right:none;border-left:none}a.box:hover{box-shadow:0 0 1px rgba(0,0,0,.2);opacity:.7}.box-asidex{padding-left:25px!important;padding-right:70px;left:0;background:#f9f9f9;border-radius:0 10px 10px 0;height:calc(100% - 30px);position:absolute;padding-top:30px}.box-asidex:after{content:"";display:block;position:absolute;height:100%;width:51px;background:#fff;top:0;bottom:0;right:-6px}.cover{background:var(--config-color-focus-fade);padding:30px 50px;margin:0 -50px;position:relative;border-bottom:solid 1px var(--config-border-fade)}.cover .title,.cover h1,.cover h2,.cover h3,.cover h4{color:var(--config-color-focus);font-weight:600;margin-bottom:50px!important;font-size:28px;line-height:42px}.cover .title span,.cover h1 span,.cover h2 span,.cover h3 span,.cover h4 span{font-weight:600}.cover i:before{margin:0!important}.cover p{color:var(--config-color-fade)}.cover .button{color:#fff}.cover .link,.cover a{color:var(--config-color-focus);border-left:none;border-right:none;cursor:pointer}.cover .link:hover,.cover a:hover{border-bottom-color:var(--config-color-focus)}.console .database .row .col{height:452px}.console .database .row .col:after{width:2px;left:20px}.console .database hr{margin:0 -20px;background:var(--config-color-background);height:1px}.console .database h3{font-size:13px;line-height:20px;height:20px;background-color:var(--config-color-fade-super);margin:-20px -20px 0 -20px;padding:10px 20px;border-bottom:solid 1px var(--config-color-background);font-weight:600}.console .database .empty{height:162px;font-size:12px;text-align:center;margin:50px 0}.console .database .empty h4{font-size:13px;font-weight:600;line-height:120px}.console .database .search{background-color:var(--config-color-fade-super);margin:0 -20px 0 -20px;padding:10px 15px}.console .database .search input{height:40px;background-color:#fff;border-radius:25px;padding-top:0;padding-bottom:0}.console .database .code{height:411px;background:var(--config-color-fade-super);margin:0 -20px -20px -20px;padding:20px;width:calc(100% - 10px)}.console .database .code .ide{overflow:scroll;height:451px;margin:-20px;box-shadow:none;border-radius:0}.console .database .paging{background:var(--config-color-fade-super);margin:0 -20px -20px -20px;padding:20px}.console .database .button{margin:0 -20px;padding:0 20px!important;text-align:inherit;color:var(--config-color-focus);width:100%;font-size:15px;line-height:55px;box-sizing:content-box}.console .database .button i{margin-left:8px}.console .database .button:hover{border:none;background:var(--config-color-focus-fade)}.console .database .items{margin:0 -20px;height:262px;overflow-x:hidden;overflow-y:scroll}.console .database .items form{opacity:0;position:relative}.console .database .items form button{position:absolute;top:0;bottom:0;right:0;left:0;width:100%;height:45px;border-radius:0;cursor:pointer}.console .database .items li{padding:0;margin:0 0;line-height:45px;font-size:15px;padding-right:50px;padding-left:30px;position:relative}.console .database .items li i{position:absolute;display:none;left:10px}.console .database .items li .name{display:inline-block;width:100%;height:28px}.console .database .items li.selected,.console .database .items li:hover{background:#f5f5f5}.console .database .items li.selected i,.console .database .items li:hover i{display:block}.console .database .items li:last-child{border-bottom:none}body>footer{color:var(--config-color-fade);line-height:40px;margin:0 -50px;padding:12px 50px;font-size:13px;width:100%;background:#f1f1f1;position:relative;margin-top:80px!important}body>footer:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}body>footer .logo img{height:22px;padding-top:12px}body>footer a{color:var(--config-color-fade);font-size:13px}body>footer a:hover{border-bottom-color:var(--config-color-fade)}body>footer ul:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}body>footer ul li{font-size:13px;float:right;margin-left:20px!important}body>footer .copyright{padding-right:2px}[data-ls-if]{display:none}[data-service]{opacity:0}.load-service-start{opacity:0}.load-service-end{opacity:1;transition:opacity .5s ease-out;-moz-transition:opacity .5s ease-out;-webkit-transition:opacity .5s ease-out;-o-transition:opacity .5s ease-out}.load-screen{z-index:100000;position:fixed;height:100%;width:100%;background-color:var(--config-color-background-focus);top:0;right:0}.load-screen.loaded{transition:opacity 1s ease-in-out,top 1s .7s;opacity:0;top:-100%}.load-screen .animation{position:absolute;top:45%;left:50%;transform:translate(-50%,-50%) translateZ(1px);width:140px;height:140px}.load-screen .animation div{box-sizing:border-box;display:block;position:absolute;width:124px;height:124px;margin:10px;border:10px solid var(--config-color-focus);border-radius:50%;animation:animation 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:var(--config-color-focus) transparent transparent transparent}.load-screen .animation div:nth-child(1){animation-delay:-.45s}.load-screen .animation div:nth-child(2){animation-delay:-.3s}.load-screen .animation div:nth-child(3){animation-delay:-.15s}@keyframes animation{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.load-screen img{position:absolute;height:20px;bottom:60px;left:50%;transform:translate(-50%,-50%)}.modal-open .modal-bg,.modal-open body .modal-bg{position:fixed;content:'';display:block;width:100%;height:100%;left:0;right:0;top:0;bottom:0;background:#0c0c0c;opacity:.75;z-index:5}.modal{overflow:auto;display:none;position:fixed;transform:translate3d(0,0,0);width:100%;max-height:90%;max-width:640px;background:var(--config-color-background-fade);z-index:1000;box-shadow:0 0 4px rgba(0,0,0,.25);padding:30px;left:50%;top:50%;transform:translate(-50%,-50%);border-radius:10px;box-sizing:border-box;text-align:right;white-space:initial;line-height:normal}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.modal{width:calc(100% - 20px)}}.modal.full{max-width:none;max-height:none;height:100%;border-radius:0;padding:80px 120px}.modal.full h1{font-weight:700}.modal.padding-small{padding:15px}.modal.height-tiny>form{height:100px}.modal.height-small>form{height:220px}.modal.width-small{max-width:400px}.modal.width-medium{max-width:500px}.modal.width-large{max-width:800px}.modal.open{display:block}.modalbutton.close{display:none}.modal.fill{height:95%;max-height:95%;max-width:75%}.modal h1,.modal h2{margin-bottom:25px;margin-top:0;font-size:20px;text-align:right}.modal h1,.modal h2,.modal h3,.modal h4,.modal h5,.modal h6{color:inherit!important;line-height:35px}.modal .main,.modal>form{position:relative;border-top:solid 1px var(--config-border-color);padding:30px 30px 0 30px;margin:0 -30px}.modal .main.strip,.modal>form.strip{border:none;padding:0;margin:0}.modal .separator{margin:20px -30px}.modal .bullets{padding-right:40px}.modal .bullets li{margin-bottom:30px!important}.modal .bullets li:before{position:absolute}.modal .info{margin:0 -30px;padding:20px 30px;background:var(--config-modal-note-background);color:var(--config-modal-note-color);border-top:solid 1px var(--config-modal-note-border);border-bottom:solid 1px var(--config-modal-note-border)}.modal .ide.strech{box-shadow:none;border-radius:0;margin:0 -30px}.modal button.close{width:30px;height:30px;line-height:30px;padding:0;margin:0;background:var(--config-color-normal);color:var(--config-color-background-fade);border-radius:50%}.modal .paging form{padding:0;margin:0;border-top:none}.modal.sticky-footer form footer{margin:-30px}.modal.sticky-footer footer{position:sticky;bottom:-30px;background:var(--config-color-background-fade-super);height:50px;z-index:1;padding:30px;box-shadow:0 0 1px rgba(0,0,0,.15)}.modal.sticky-footer footer form{display:inline-block}[data-views-current="0"] .scroll-to,[data-views-current="1"] .scroll-to{opacity:0!important}.scroll-to-bottom .scroll-to,.scroll-to-top .scroll-to{opacity:1}.scroll-to{opacity:0;display:block;width:40px;height:40px;line-height:40px;border-radius:50%;position:fixed;transform:translateZ(0);margin:30px;padding:0;bottom:0;font-size:18px;z-index:100000;transition:opacity .15s ease-in-out;left:0}.phases{list-style:none;margin:0;padding:0;position:relative}.phases li{display:none}.phases li li{display:block}.phases li.selected{display:block}.phases .number{display:none}.phases h2,.phases h3,.phases h4,.phases h5,.phases h6{margin:0 0 30px 0;text-align:inherit}.container{position:relative}.container .tabs{height:55px;line-height:55px;list-style:none;padding:0;margin-bottom:50px!important;margin-top:-55px;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.container .tabs:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.container .tabs .selected{font-weight:400;color:var(--config-color-focus);position:relative;opacity:1}.container .tabs .selected:after{content:"";display:block;height:2px;background:var(--config-color-focus);width:calc(100% + 6px);margin:0 -3px;position:absolute;bottom:0;border-radius:2px}.container .tabs .number{display:none}.container .tabs li{float:right;margin-left:50px;color:var(--config-color-focus);opacity:.9;cursor:pointer}.container .tabs li:focus{outline:0}@media only screen and (max-width:550px){.container .tabs li{margin-left:25px}}.container .icon{display:none}@media only screen and (max-width:550px),only screen and (min-width:551px) and (max-width:1198px){.container .tabs{width:auto;overflow-x:scroll;overflow-y:hidden;white-space:nowrap}.container .tabs li{display:inline-block;float:none}}.ide{background-color:var(--config-prism-background);overflow:hidden;position:relative;z-index:1;box-shadow:0 2px 4px 0 rgba(50,50,93,.3);border-radius:10px;margin-bottom:30px}.ide *{font-family:'Source Code Pro',monospace}.ide[data-lang]::after{content:attr(data-lang-label);display:inline-block;background:#fff;color:#000;position:absolute;top:15px;padding:5px 10px;border-radius:15px;font-size:10px;right:10px;opacity:.95}.ide[data-lang=bash]::after{background:var(--config-language-bash);color:var(--config-language-bash-contrast)}.ide[data-lang=javascript]::after{background:var(--config-language-javascript);color:var(--config-language-javascript-contrast)}.ide[data-lang=web]::after{background:var(--config-language-web);color:var(--config-language-web-contrast)}.ide[data-lang=html]::after{background:var(--config-language-html);color:var(--config-language-html-contrast)}.ide[data-lang=php]::after{background:var(--config-language-php);color:var(--config-language-php-contrast)}.ide[data-lang=nodejs]::after{background:var(--config-language-nodejs);color:var(--config-language-nodejs-contrast)}.ide[data-lang=ruby]::after{background:var(--config-language-ruby);color:var(--config-language-ruby-contrast)}.ide[data-lang=python]::after{background:var(--config-language-python);color:var(--config-language-python-contrast)}.ide[data-lang=go]::after{background:var(--config-language-go);color:var(--config-language-go-contrast)}.ide[data-lang=dart]::after{background:var(--config-language-dart);color:var(--config-language-dart-contrast)}.ide[data-lang=flutter]::after{background:var(--config-language-flutter);color:var(--config-language-flutter-contrast)}.ide[data-lang=yaml]::after{background:var(--config-language-yaml);color:var(--config-language-yaml-contrast)}.ide .tag{color:inherit!important;background:0 0!important;padding:inherit!important;font-size:inherit!important;line-height:14px}.ide .copy{cursor:pointer;content:attr(data-lang);display:inline-block;background:#fff;color:#000;position:absolute;transform:translateX(-50%);bottom:-20px;padding:5px 10px;border-radius:15px;font-size:10px;font-style:normal;right:50%;opacity:0;transition:bottom .3s,opacity .3s;line-height:normal;font-family:Poppins,sans-serif}.ide .copy::before{padding-left:5px}.ide:hover .copy{transition:bottom .3s,opacity .3s;opacity:.9;bottom:16px}.ide pre{-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;color:#e6ebf1;font-weight:400;line-height:20px;font-size:13px;margin:0;padding:20px;padding-left:60px}.ide.light{box-shadow:0 2px 4px 0 rgba(50,50,93,.1);background-color:#fff}.ide.light pre{color:#414770}.ide.light .token.cdata,.ide.light .token.comment,.ide.light .token.doctype,.ide.light .token.prolog{color:#91a2b0}.ide.light .token.attr-name,.ide.light .token.builtin,.ide.light .token.char,.ide.light .token.inserted,.ide.light .token.selector,.ide.light .token.string{color:#149570}.ide.light .token.punctuation{color:#414770}.ide.light .language-css .token.string,.ide.light .style .token.string,.ide.light .token.entity,.ide.light .token.operator,.ide.light .token.url,.ide.light .token.variable{color:#414770}.ide.light .line-numbers .line-numbers-rows{background:#f2feef}.ide.light .line-numbers-rows>span:before{color:#5dc79e}.ide.light .token.keyword{color:#6772e4;font-weight:500}code[class*=language-],pre[class*=language-]{text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4}pre[class*=language-]{overflow:auto}:not(pre)>code[class*=language-]{padding:.1em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#6b7c93}.token.punctuation{color:#f8f8f2}.namespace{opacity:.7}.token.constant,.token.deleted,.token.property,.token.symbol,.token.tag{color:#f92672}.token.boolean,.token.number{color:#f79a59}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#3ecf8e}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url,.token.variable{color:#f8f8f2}.token.atrule,.token.attr-value,.token.class-name,.token.function{color:#45b2e8}.token.keyword{color:#7795f8}.token.important,.token.regex{color:#fd971f}.token.italic{font-style:italic}.token.entity{cursor:help}pre[class*=language-].line-numbers{position:relative;padding-left:60px;counter-reset:linenumber}pre[class*=language-].line-numbers>code{position:relative;white-space:inherit}.line-numbers .line-numbers-rows{background:var(--config-prism-numbers);position:absolute;pointer-events:none;top:-20px;bottom:-21px;padding:20px 0;font-size:100%;left:-60px;width:40px;letter-spacing:-1px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.line-numbers-rows>span{padding-left:5px;pointer-events:none;display:block;counter-increment:linenumber}.line-numbers-rows>span:before{content:counter(linenumber);color:#636365;display:block;padding-right:.8em;text-align:right}html{padding:0;margin:0;direction:rtl}body{margin:0;background:var(--config-console-background) no-repeat fixed;min-width:300px}ul{padding:0;margin:0}ul li{margin:0;list-style:none}.icon-left-open:before{content:'\e814'!important}.icon-right-open:before{content:'\e813'!important}.icon-right-dir:before{content:'\e84e'!important}.icon-left-dir:before{content:'\e84d'!important}.icon-link-ext:before{-moz-transform:scaleX(-1);-o-transform:scaleX(-1);-webkit-transform:scaleX(-1);transform:scaleX(-1)}.icon-article-alt:before{-moz-transform:scaleX(-1);-o-transform:scaleX(-1);-webkit-transform:scaleX(-1);transform:scaleX(-1)}.copy{border-radius:10px 0 0 10px!important} \ No newline at end of file diff --git a/public/images/environments/deno.png b/public/images/environments/deno.png new file mode 100644 index 0000000000..5ff1b53cef Binary files /dev/null and b/public/images/environments/deno.png differ diff --git a/public/images/environments/node.png b/public/images/environments/node.png new file mode 100644 index 0000000000..9004cb15fe Binary files /dev/null and b/public/images/environments/node.png differ diff --git a/public/images/environments/php.png b/public/images/environments/php.png new file mode 100644 index 0000000000..4f7e6067c4 Binary files /dev/null and b/public/images/environments/php.png differ diff --git a/public/images/environments/python.png b/public/images/environments/python.png new file mode 100644 index 0000000000..a705fee274 Binary files /dev/null and b/public/images/environments/python.png differ diff --git a/public/images/environments/ruby.png b/public/images/environments/ruby.png new file mode 100644 index 0000000000..7a9187fed4 Binary files /dev/null and b/public/images/environments/ruby.png differ diff --git a/public/index.php b/public/index.php index c87b14a26e..01f9dbb117 100644 --- a/public/index.php +++ b/public/index.php @@ -8,16 +8,20 @@ * ― Rick Cook, The Wizardry Compiled */ +use Appwrite\Utopia\Response; +use Utopia\App; +use Utopia\Request; + error_reporting(0); ini_set('display_errors', 0); -// ini_set('display_errors', 1); -// ini_set('display_startup_errors', 1); -// error_reporting(E_ALL); +ini_set('display_errors', 1); +ini_set('display_startup_errors', 1); +error_reporting(E_ALL); +//trigger_error('hide errors in prod', E_USER_NOTICE); -$path = (isset($_GET['q'])) ? explode('/', $_GET['q']) : []; +include __DIR__ . '/../app/controllers/general.php'; -array_shift($path); -$version = array_shift($path); +$app = new App('Asia/Tel_Aviv'); -include __DIR__ . '/../app/app.php'; +$app->run(new Request(), new Response()); diff --git a/public/scripts/app.js b/public/scripts/app.js index b9f9ce64b7..b175f3c088 100644 --- a/public/scripts/app.js +++ b/public/scripts/app.js @@ -27,61 +27,6 @@ window.ls.container } } }) - .add({ - selector: "data-forms-headers", - controller: function(element) { - let key = document.createElement("input"); - let value = document.createElement("input"); - let wrap = document.createElement("div"); - let cell1 = document.createElement("div"); - let cell2 = document.createElement("div"); - - key.type = "text"; - key.className = "margin-bottom-no"; - key.placeholder = "Key"; - value.type = "text"; - value.className = "margin-bottom-no"; - value.placeholder = "Value"; - - wrap.className = "row thin margin-bottom-small"; - cell1.className = "col span-6"; - cell2.className = "col span-6"; - - element.parentNode.insertBefore(wrap, element); - cell1.appendChild(key); - cell2.appendChild(value); - wrap.appendChild(cell1); - wrap.appendChild(cell2); - - key.addEventListener("input", function() { - syncA(); - }); - - value.addEventListener("input", function() { - syncA(); - }); - - element.addEventListener("change", function() { - syncB(); - }); - - let syncA = function() { - element.value = - key.value.toLowerCase() + ":" + value.value.toLowerCase(); - }; - - let syncB = function() { - let split = element.value.toLowerCase().split(":"); - key.value = split[0] || ""; - value.value = split[1] || ""; - - key.value = key.value.trim(); - value.value = value.value.trim(); - }; - - syncB(); - } - }) .add({ selector: "data-prism", controller: function(window, document, element, alerts) { @@ -115,82 +60,4 @@ window.ls.container element.parentNode.parentNode.appendChild(copy); } }) - .add({ - selector: "data-ls-ui-chart", - controller: function(element, container, date, document) { - let child = document.createElement("canvas"); - - child.width = 500; - child.height = 175; - - let stats = container.get("usage"); - - if (!stats || !stats["requests"] || !stats["requests"]["data"]) { - return; - } - - let config = { - type: "line", - data: { - labels: [], - datasets: [ - { - label: "Requests", - backgroundColor: "rgba(230, 248, 253, 0.3)", - borderColor: "#29b5d9", - borderWidth: 2, - data: [0, 0, 0, 0, 0, 0, 0], - fill: true - } - ] - }, - options: { - responsive: true, - title: { - display: false, - text: "Stats" - }, - legend: { - display: false - }, - tooltips: { - mode: "index", - intersect: false, - caretPadding: 0 - }, - hover: { - mode: "nearest", - intersect: true - }, - scales: { - xAxes: [ - { - display: false - } - ], - yAxes: [ - { - display: false - } - ] - } - } - }; - - for (let i = 0; i < stats["requests"]["data"].length; i++) { - config.data.datasets[0].data[i] = stats["requests"]["data"][i].value; - config.data.labels[i] = date.format( - "d F Y", - stats["requests"]["data"][i].date - ); - } - - element.innerHTML = ""; - - element.appendChild(child); - - container.set("chart", new Chart(child.getContext("2d"), config), true); - - element.dataset["canvas"] = true; - } - }); +; diff --git a/public/scripts/dependencies/appwrite.js b/public/scripts/dependencies/appwrite.js index 27eb23b742..4c6ac61ee9 100644 --- a/public/scripts/dependencies/appwrite.js +++ b/public/scripts/dependencies/appwrite.js @@ -825,16 +825,17 @@ * Use this endpoint to send a verification message to your user email address * to confirm they are the valid owners of that address. Both the **userId** * and **secret** arguments will be passed as query parameters to the URL you - * have provider to be attached to the verification email. The provided URL - * should redirect the user back for your app and allow you to complete the + * have provided to be attached to the verification email. The provided URL + * should redirect the user back to your app and allow you to complete the * verification process by verifying both the **userId** and **secret** * parameters. Learn more about how to [complete the verification * process](/docs/client/account#updateAccountVerification). * * Please note that in order to avoid a [Redirect - * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) + * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), * the only valid redirect URLs are the ones from domains you have set when * adding your platforms in the console interface. + * * * @param {string} url * @throws {Error} @@ -1267,11 +1268,11 @@ * @param {string} text * @param {number} size * @param {number} margin - * @param {number} download + * @param {boolean} download * @throws {Error} * @return {string} */ - getQR: function(text, size = 400, margin = 1, download = 0) { + getQR: function(text, size = 400, margin = 1, download = false) { if(text === undefined) { throw new Error('Missing required parameter: "text"'); } @@ -1536,18 +1537,16 @@ * * @param {string} collectionId * @param {string[]} filters - * @param {number} offset * @param {number} limit + * @param {number} offset * @param {string} orderField * @param {string} orderType * @param {string} orderCast * @param {string} search - * @param {number} first - * @param {number} last * @throws {Error} * @return {Promise} */ - listDocuments: function(collectionId, filters = [], offset = 0, limit = 50, orderField = '$id', orderType = 'ASC', orderCast = 'string', search = '', first = 0, last = 0) { + listDocuments: function(collectionId, filters = [], limit = 25, offset = 0, orderField = '$id', orderType = 'ASC', orderCast = 'string', search = '') { if(collectionId === undefined) { throw new Error('Missing required parameter: "collectionId"'); } @@ -1560,14 +1559,14 @@ payload['filters'] = filters; } - if(offset) { - payload['offset'] = offset; - } - if(limit) { payload['limit'] = limit; } + if(offset) { + payload['offset'] = offset; + } + if(orderField) { payload['orderField'] = orderField; } @@ -1584,14 +1583,6 @@ payload['search'] = search; } - if(first) { - payload['first'] = first; - } - - if(last) { - payload['last'] = last; - } - return http .get(path, { 'content-type': 'application/json', @@ -1781,25 +1772,496 @@ .delete(path, { 'content-type': 'application/json', }, payload); - }, + } + }; + + let functions = { /** - * Get Collection Logs + * List Functions * * - * @param {string} collectionId + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType * @throws {Error} * @return {Promise} */ - getCollectionLogs: function(collectionId) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - let path = '/database/collections/{collectionId}/logs'.replace(new RegExp('{collectionId}', 'g'), collectionId); + list: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { + let path = '/functions'; let payload = {}; + if(search) { + payload['search'] = search; + } + + if(limit) { + payload['limit'] = limit; + } + + if(offset) { + payload['offset'] = offset; + } + + if(orderType) { + payload['orderType'] = orderType; + } + + return http + .get(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Create Function + * + * + * @param {string} name + * @param {string} env + * @param {object} vars + * @param {string[]} events + * @param {string} schedule + * @param {number} timeout + * @throws {Error} + * @return {Promise} + */ + create: function(name, env, vars = [], events = [], schedule = '', timeout = 15) { + if(name === undefined) { + throw new Error('Missing required parameter: "name"'); + } + + if(env === undefined) { + throw new Error('Missing required parameter: "env"'); + } + + let path = '/functions'; + + let payload = {}; + + if(name) { + payload['name'] = name; + } + + if(env) { + payload['env'] = env; + } + + if(vars) { + payload['vars'] = vars; + } + + if(events) { + payload['events'] = events; + } + + if(schedule) { + payload['schedule'] = schedule; + } + + if(timeout) { + payload['timeout'] = timeout; + } + + return http + .post(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Get Function + * + * + * @param {string} functionId + * @throws {Error} + * @return {Promise} + */ + get: function(functionId) { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + let path = '/functions/{functionId}'.replace(new RegExp('{functionId}', 'g'), functionId); + + let payload = {}; + + return http + .get(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Update Function + * + * + * @param {string} functionId + * @param {string} name + * @param {object} vars + * @param {string[]} events + * @param {string} schedule + * @param {number} timeout + * @throws {Error} + * @return {Promise} + */ + update: function(functionId, name, vars = [], events = [], schedule = '', timeout = 15) { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + if(name === undefined) { + throw new Error('Missing required parameter: "name"'); + } + + let path = '/functions/{functionId}'.replace(new RegExp('{functionId}', 'g'), functionId); + + let payload = {}; + + if(name) { + payload['name'] = name; + } + + if(vars) { + payload['vars'] = vars; + } + + if(events) { + payload['events'] = events; + } + + if(schedule) { + payload['schedule'] = schedule; + } + + if(timeout) { + payload['timeout'] = timeout; + } + + return http + .put(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Delete Function + * + * + * @param {string} functionId + * @throws {Error} + * @return {Promise} + */ + delete: function(functionId) { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + let path = '/functions/{functionId}'.replace(new RegExp('{functionId}', 'g'), functionId); + + let payload = {}; + + return http + .delete(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * List Executions + * + * + * @param {string} functionId + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType + * @throws {Error} + * @return {Promise} + */ + listExecutions: function(functionId, search = '', limit = 25, offset = 0, orderType = 'ASC') { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + let path = '/functions/{functionId}/executions'.replace(new RegExp('{functionId}', 'g'), functionId); + + let payload = {}; + + if(search) { + payload['search'] = search; + } + + if(limit) { + payload['limit'] = limit; + } + + if(offset) { + payload['offset'] = offset; + } + + if(orderType) { + payload['orderType'] = orderType; + } + + return http + .get(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Create Execution + * + * + * @param {string} functionId + * @param {number} async + * @throws {Error} + * @return {Promise} + */ + createExecution: function(functionId, async = 1) { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + let path = '/functions/{functionId}/executions'.replace(new RegExp('{functionId}', 'g'), functionId); + + let payload = {}; + + if(async) { + payload['async'] = async; + } + + return http + .post(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Get Execution + * + * + * @param {string} functionId + * @param {string} executionId + * @throws {Error} + * @return {Promise} + */ + getExecution: function(functionId, executionId) { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + if(executionId === undefined) { + throw new Error('Missing required parameter: "executionId"'); + } + + let path = '/functions/{functionId}/executions/{executionId}'.replace(new RegExp('{functionId}', 'g'), functionId).replace(new RegExp('{executionId}', 'g'), executionId); + + let payload = {}; + + return http + .get(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Update Function Tag + * + * + * @param {string} functionId + * @param {string} tag + * @throws {Error} + * @return {Promise} + */ + updateTag: function(functionId, tag) { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + if(tag === undefined) { + throw new Error('Missing required parameter: "tag"'); + } + + let path = '/functions/{functionId}/tag'.replace(new RegExp('{functionId}', 'g'), functionId); + + let payload = {}; + + if(tag) { + payload['tag'] = tag; + } + + return http + .patch(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * List Tags + * + * + * @param {string} functionId + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType + * @throws {Error} + * @return {Promise} + */ + listTags: function(functionId, search = '', limit = 25, offset = 0, orderType = 'ASC') { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + let path = '/functions/{functionId}/tags'.replace(new RegExp('{functionId}', 'g'), functionId); + + let payload = {}; + + if(search) { + payload['search'] = search; + } + + if(limit) { + payload['limit'] = limit; + } + + if(offset) { + payload['offset'] = offset; + } + + if(orderType) { + payload['orderType'] = orderType; + } + + return http + .get(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Create Tag + * + * + * @param {string} functionId + * @param {string} command + * @param {File} code + * @throws {Error} + * @return {Promise} + */ + createTag: function(functionId, command, code) { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + if(command === undefined) { + throw new Error('Missing required parameter: "command"'); + } + + if(code === undefined) { + throw new Error('Missing required parameter: "code"'); + } + + let path = '/functions/{functionId}/tags'.replace(new RegExp('{functionId}', 'g'), functionId); + + let payload = {}; + + if(command) { + payload['command'] = command; + } + + if(code) { + payload['code'] = code; + } + + return http + .post(path, { + 'content-type': 'multipart/form-data', + }, payload); + }, + + /** + * Get Tag + * + * + * @param {string} functionId + * @param {string} tagId + * @throws {Error} + * @return {Promise} + */ + getTag: function(functionId, tagId) { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + if(tagId === undefined) { + throw new Error('Missing required parameter: "tagId"'); + } + + let path = '/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}', 'g'), functionId).replace(new RegExp('{tagId}', 'g'), tagId); + + let payload = {}; + + return http + .get(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Delete Tag + * + * + * @param {string} functionId + * @param {string} tagId + * @throws {Error} + * @return {Promise} + */ + deleteTag: function(functionId, tagId) { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + if(tagId === undefined) { + throw new Error('Missing required parameter: "tagId"'); + } + + let path = '/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}', 'g'), functionId).replace(new RegExp('{tagId}', 'g'), tagId); + + let payload = {}; + + return http + .delete(path, { + 'content-type': 'application/json', + }, payload); + }, + + /** + * Get Function Usage + * + * + * @param {string} functionId + * @param {string} range + * @throws {Error} + * @return {Promise} + */ + getUsage: function(functionId, range = 'last30') { + if(functionId === undefined) { + throw new Error('Missing required parameter: "functionId"'); + } + + let path = '/functions/{functionId}/usage'.replace(new RegExp('{functionId}', 'g'), functionId); + + let payload = {}; + + if(range) { + payload['range'] = range; + } + return http .get(path, { 'content-type': 'application/json', @@ -2204,14 +2666,34 @@ * List Projects * * + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType * @throws {Error} * @return {Promise} */ - list: function() { + list: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { let path = '/projects'; let payload = {}; + if(search) { + payload['search'] = search; + } + + if(limit) { + payload['limit'] = limit; + } + + if(offset) { + payload['offset'] = offset; + } + + if(orderType) { + payload['orderType'] = orderType; + } + return http .get(path, { 'content-type': 'application/json', @@ -2996,7 +3478,7 @@ * @param {string} name * @param {string} status * @param {string} schedule - * @param {number} security + * @param {boolean} security * @param {string} httpMethod * @param {string} httpUrl * @param {string[]} httpHeaders @@ -3117,7 +3599,7 @@ * @param {string} name * @param {string} status * @param {string} schedule - * @param {number} security + * @param {boolean} security * @param {string} httpMethod * @param {string} httpUrl * @param {string[]} httpHeaders @@ -3292,7 +3774,7 @@ * @param {string} name * @param {string[]} events * @param {string} url - * @param {number} security + * @param {boolean} security * @param {string} httpUser * @param {string} httpPass * @throws {Error} @@ -3390,7 +3872,7 @@ * @param {string} name * @param {string[]} events * @param {string} url - * @param {number} security + * @param {boolean} security * @param {string} httpUser * @param {string} httpPass * @throws {Error} @@ -4498,6 +4980,7 @@ account: account, avatars: avatars, database: database, + functions: functions, health: health, locale: locale, projects: projects, diff --git a/public/scripts/dependencies/chart.js b/public/scripts/dependencies/chart.js index 593791003e..8bfc66d52a 100644 --- a/public/scripts/dependencies/chart.js +++ b/public/scripts/dependencies/chart.js @@ -1,18919 +1,16151 @@ /*! - * Chart.js - * http://chartjs.org/ - * Version: 2.7.2 - * - * Copyright 2018 Chart.js Contributors - * Released under the MIT license - * https://github.com/chartjs/Chart.js/blob/master/LICENSE.md + * Chart.js v2.9.3 + * https://www.chartjs.org + * (c) 2019 Chart.js Contributors + * Released under the MIT License */ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Chart = f()}})(function(){var define,module,exports;return (function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o lum2) { - return (lum1 + 0.05) / (lum2 + 0.05); - } - return (lum2 + 0.05) / (lum1 + 0.05); - }, - - level: function (color2) { - var contrastRatio = this.contrast(color2); - if (contrastRatio >= 7.1) { - return 'AAA'; - } - - return (contrastRatio >= 4.5) ? 'AA' : ''; - }, - - dark: function () { - // YIQ equation from http://24ways.org/2010/calculating-color-contrast - var rgb = this.values.rgb; - var yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000; - return yiq < 128; - }, - - light: function () { - return !this.dark(); - }, - - negate: function () { - var rgb = []; - for (var i = 0; i < 3; i++) { - rgb[i] = 255 - this.values.rgb[i]; - } - this.setValues('rgb', rgb); - return this; - }, - - lighten: function (ratio) { - var hsl = this.values.hsl; - hsl[2] += hsl[2] * ratio; - this.setValues('hsl', hsl); - return this; - }, - - darken: function (ratio) { - var hsl = this.values.hsl; - hsl[2] -= hsl[2] * ratio; - this.setValues('hsl', hsl); - return this; - }, - - saturate: function (ratio) { - var hsl = this.values.hsl; - hsl[1] += hsl[1] * ratio; - this.setValues('hsl', hsl); - return this; - }, - - desaturate: function (ratio) { - var hsl = this.values.hsl; - hsl[1] -= hsl[1] * ratio; - this.setValues('hsl', hsl); - return this; - }, - - whiten: function (ratio) { - var hwb = this.values.hwb; - hwb[1] += hwb[1] * ratio; - this.setValues('hwb', hwb); - return this; - }, - - blacken: function (ratio) { - var hwb = this.values.hwb; - hwb[2] += hwb[2] * ratio; - this.setValues('hwb', hwb); - return this; - }, - - greyscale: function () { - var rgb = this.values.rgb; - // http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale - var val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11; - this.setValues('rgb', [val, val, val]); - return this; - }, - - clearer: function (ratio) { - var alpha = this.values.alpha; - this.setValues('alpha', alpha - (alpha * ratio)); - return this; - }, - - opaquer: function (ratio) { - var alpha = this.values.alpha; - this.setValues('alpha', alpha + (alpha * ratio)); - return this; - }, - - rotate: function (degrees) { - var hsl = this.values.hsl; - var hue = (hsl[0] + degrees) % 360; - hsl[0] = hue < 0 ? 360 + hue : hue; - this.setValues('hsl', hsl); - return this; - }, - - /** - * Ported from sass implementation in C - * https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 - */ - mix: function (mixinColor, weight) { - var color1 = this; - var color2 = mixinColor; - var p = weight === undefined ? 0.5 : weight; - - var w = 2 * p - 1; - var a = color1.alpha() - color2.alpha(); - - var w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0; - var w2 = 1 - w1; - - return this - .rgb( - w1 * color1.red() + w2 * color2.red(), - w1 * color1.green() + w2 * color2.green(), - w1 * color1.blue() + w2 * color2.blue() - ) - .alpha(color1.alpha() * p + color2.alpha() * (1 - p)); - }, - - toJSON: function () { - return this.rgb(); - }, - - clone: function () { - // NOTE(SB): using node-clone creates a dependency to Buffer when using browserify, - // making the final build way to big to embed in Chart.js. So let's do it manually, - // assuming that values to clone are 1 dimension arrays containing only numbers, - // except 'alpha' which is a number. - var result = new Color(); - var source = this.values; - var target = result.values; - var value, type; - - for (var prop in source) { - if (source.hasOwnProperty(prop)) { - value = source[prop]; - type = ({}).toString.call(value); - if (type === '[object Array]') { - target[prop] = value.slice(0); - } else if (type === '[object Number]') { - target[prop] = value; - } else { - console.error('unexpected color value:', value); - } - } - } - - return result; + + if (diff === 0) { + h = s = 0; + } else { + s = diff / v; + rdif = diffc(r); + gdif = diffc(g); + bdif = diffc(b); + + if (r === v) { + h = bdif - gdif; + } else if (g === v) { + h = (1 / 3) + rdif - bdif; + } else if (b === v) { + h = (2 / 3) + gdif - rdif; } - }; - - Color.prototype.spaces = { - rgb: ['red', 'green', 'blue'], - hsl: ['hue', 'saturation', 'lightness'], - hsv: ['hue', 'saturation', 'value'], - hwb: ['hue', 'whiteness', 'blackness'], - cmyk: ['cyan', 'magenta', 'yellow', 'black'] - }; - - Color.prototype.maxes = { - rgb: [255, 255, 255], - hsl: [360, 100, 100], - hsv: [360, 100, 100], - hwb: [360, 100, 100], - cmyk: [100, 100, 100, 100] - }; - - Color.prototype.getValues = function (space) { - var values = this.values; - var vals = {}; - - for (var i = 0; i < space.length; i++) { - vals[space.charAt(i)] = values[space][i]; - } - - if (values.alpha !== 1) { - vals.a = values.alpha; - } - - // {r: 255, g: 255, b: 255, a: 0.4} - return vals; - }; - - Color.prototype.setValues = function (space, vals) { - var values = this.values; - var spaces = this.spaces; - var maxes = this.maxes; - var alpha = 1; - var i; - - this.valid = true; - - if (space === 'alpha') { - alpha = vals; - } else if (vals.length) { - // [10, 10, 10] - values[space] = vals.slice(0, space.length); - alpha = vals[space.length]; - } else if (vals[space.charAt(0)] !== undefined) { - // {r: 10, g: 10, b: 10} - for (i = 0; i < space.length; i++) { - values[space][i] = vals[space.charAt(i)]; - } - - alpha = vals.a; - } else if (vals[spaces[space][0]] !== undefined) { - // {red: 10, green: 10, blue: 10} - var chans = spaces[space]; - - for (i = 0; i < space.length; i++) { - values[space][i] = vals[chans[i]]; - } - - alpha = vals.alpha; - } - - values.alpha = Math.max(0, Math.min(1, (alpha === undefined ? values.alpha : alpha))); - - if (space === 'alpha') { - return false; - } - - var capped; - - // cap values of the space prior converting all values - for (i = 0; i < space.length; i++) { - capped = Math.max(0, Math.min(maxes[space][i], values[space][i])); - values[space][i] = Math.round(capped); - } - - // convert to all the other color spaces - for (var sname in spaces) { - if (sname !== space) { - values[sname] = convert[space][sname](values[space]); - } - } - - return true; - }; - - Color.prototype.setSpace = function (space, args) { - var vals = args[0]; - - if (vals === undefined) { - // color.rgb() - return this.getValues(space); - } - - // color.rgb(10, 10, 10) - if (typeof vals === 'number') { - vals = Array.prototype.slice.call(args); - } - - this.setValues(space, vals); - return this; - }; - - Color.prototype.setChannel = function (space, index, val) { - var svalues = this.values[space]; - if (val === undefined) { - // color.red() - return svalues[index]; - } else if (val === svalues[index]) { - // color.red(color.red()) - return this; - } - - // color.red(100) - svalues[index] = val; - this.setValues(space, svalues); - - return this; - }; - - if (typeof window !== 'undefined') { - window.Color = Color; - } - - module.exports = Color; - - },{"1":1,"4":4}],3:[function(require,module,exports){ - /* MIT license */ - - module.exports = { - rgb2hsl: rgb2hsl, - rgb2hsv: rgb2hsv, - rgb2hwb: rgb2hwb, - rgb2cmyk: rgb2cmyk, - rgb2keyword: rgb2keyword, - rgb2xyz: rgb2xyz, - rgb2lab: rgb2lab, - rgb2lch: rgb2lch, - - hsl2rgb: hsl2rgb, - hsl2hsv: hsl2hsv, - hsl2hwb: hsl2hwb, - hsl2cmyk: hsl2cmyk, - hsl2keyword: hsl2keyword, - - hsv2rgb: hsv2rgb, - hsv2hsl: hsv2hsl, - hsv2hwb: hsv2hwb, - hsv2cmyk: hsv2cmyk, - hsv2keyword: hsv2keyword, - - hwb2rgb: hwb2rgb, - hwb2hsl: hwb2hsl, - hwb2hsv: hwb2hsv, - hwb2cmyk: hwb2cmyk, - hwb2keyword: hwb2keyword, - - cmyk2rgb: cmyk2rgb, - cmyk2hsl: cmyk2hsl, - cmyk2hsv: cmyk2hsv, - cmyk2hwb: cmyk2hwb, - cmyk2keyword: cmyk2keyword, - - keyword2rgb: keyword2rgb, - keyword2hsl: keyword2hsl, - keyword2hsv: keyword2hsv, - keyword2hwb: keyword2hwb, - keyword2cmyk: keyword2cmyk, - keyword2lab: keyword2lab, - keyword2xyz: keyword2xyz, - - xyz2rgb: xyz2rgb, - xyz2lab: xyz2lab, - xyz2lch: xyz2lch, - - lab2xyz: lab2xyz, - lab2rgb: lab2rgb, - lab2lch: lab2lch, - - lch2lab: lch2lab, - lch2xyz: lch2xyz, - lch2rgb: lch2rgb - } - - - function rgb2hsl(rgb) { - var r = rgb[0]/255, - g = rgb[1]/255, - b = rgb[2]/255, - min = Math.min(r, g, b), - max = Math.max(r, g, b), - delta = max - min, - h, s, l; - - if (max == min) - h = 0; - else if (r == max) - h = (g - b) / delta; - else if (g == max) - h = 2 + (b - r) / delta; - else if (b == max) - h = 4 + (r - g)/ delta; - - h = Math.min(h * 60, 360); - - if (h < 0) - h += 360; - - l = (min + max) / 2; - - if (max == min) - s = 0; - else if (l <= 0.5) - s = delta / (max + min); - else - s = delta / (2 - max - min); - - return [h, s * 100, l * 100]; - } - - function rgb2hsv(rgb) { - var r = rgb[0], - g = rgb[1], - b = rgb[2], - min = Math.min(r, g, b), - max = Math.max(r, g, b), - delta = max - min, - h, s, v; - - if (max == 0) - s = 0; - else - s = (delta/max * 1000)/10; - - if (max == min) - h = 0; - else if (r == max) - h = (g - b) / delta; - else if (g == max) - h = 2 + (b - r) / delta; - else if (b == max) - h = 4 + (r - g) / delta; - - h = Math.min(h * 60, 360); - - if (h < 0) - h += 360; - - v = ((max / 255) * 1000) / 10; - - return [h, s, v]; - } - - function rgb2hwb(rgb) { - var r = rgb[0], - g = rgb[1], - b = rgb[2], - h = rgb2hsl(rgb)[0], - w = 1/255 * Math.min(r, Math.min(g, b)), - b = 1 - 1/255 * Math.max(r, Math.max(g, b)); - - return [h, w * 100, b * 100]; - } - - function rgb2cmyk(rgb) { - var r = rgb[0] / 255, - g = rgb[1] / 255, - b = rgb[2] / 255, - c, m, y, k; - - k = Math.min(1 - r, 1 - g, 1 - b); - c = (1 - r - k) / (1 - k) || 0; - m = (1 - g - k) / (1 - k) || 0; - y = (1 - b - k) / (1 - k) || 0; - return [c * 100, m * 100, y * 100, k * 100]; - } - - function rgb2keyword(rgb) { - return reverseKeywords[JSON.stringify(rgb)]; - } - - function rgb2xyz(rgb) { - var r = rgb[0] / 255, - g = rgb[1] / 255, - b = rgb[2] / 255; - - // assume sRGB - r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92); - g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92); - b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92); - - var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); - var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); - var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); - - return [x * 100, y *100, z * 100]; - } - - function rgb2lab(rgb) { - var xyz = rgb2xyz(rgb), - x = xyz[0], - y = xyz[1], - z = xyz[2], - l, a, b; - - x /= 95.047; - y /= 100; - z /= 108.883; - - x = x > 0.008856 ? Math.pow(x, 1/3) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? Math.pow(y, 1/3) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? Math.pow(z, 1/3) : (7.787 * z) + (16 / 116); - - l = (116 * y) - 16; - a = 500 * (x - y); - b = 200 * (y - z); - - return [l, a, b]; - } - - function rgb2lch(args) { - return lab2lch(rgb2lab(args)); - } - - function hsl2rgb(hsl) { - var h = hsl[0] / 360, - s = hsl[1] / 100, - l = hsl[2] / 100, - t1, t2, t3, rgb, val; - - if (s == 0) { - val = l * 255; - return [val, val, val]; - } - - if (l < 0.5) - t2 = l * (1 + s); - else - t2 = l + s - l * s; - t1 = 2 * l - t2; - - rgb = [0, 0, 0]; - for (var i = 0; i < 3; i++) { - t3 = h + 1 / 3 * - (i - 1); - t3 < 0 && t3++; - t3 > 1 && t3--; - - if (6 * t3 < 1) - val = t1 + (t2 - t1) * 6 * t3; - else if (2 * t3 < 1) - val = t2; - else if (3 * t3 < 2) - val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; - else - val = t1; - - rgb[i] = val * 255; - } - - return rgb; - } - - function hsl2hsv(hsl) { - var h = hsl[0], - s = hsl[1] / 100, - l = hsl[2] / 100, - sv, v; - - if(l === 0) { - // no need to do calc on black - // also avoids divide by 0 error - return [0, 0, 0]; - } - - l *= 2; - s *= (l <= 1) ? l : 2 - l; - v = (l + s) / 2; - sv = (2 * s) / (l + s); - return [h, sv * 100, v * 100]; - } - - function hsl2hwb(args) { - return rgb2hwb(hsl2rgb(args)); - } - - function hsl2cmyk(args) { - return rgb2cmyk(hsl2rgb(args)); - } - - function hsl2keyword(args) { - return rgb2keyword(hsl2rgb(args)); - } - - - function hsv2rgb(hsv) { - var h = hsv[0] / 60, - s = hsv[1] / 100, - v = hsv[2] / 100, - hi = Math.floor(h) % 6; - - var f = h - Math.floor(h), - p = 255 * v * (1 - s), - q = 255 * v * (1 - (s * f)), - t = 255 * v * (1 - (s * (1 - f))), - v = 255 * v; - - switch(hi) { - case 0: - return [v, t, p]; - case 1: - return [q, v, p]; - case 2: - return [p, v, t]; - case 3: - return [p, q, v]; - case 4: - return [t, p, v]; - case 5: - return [v, p, q]; - } - } - - function hsv2hsl(hsv) { - var h = hsv[0], - s = hsv[1] / 100, - v = hsv[2] / 100, - sl, l; - - l = (2 - s) * v; - sl = s * v; - sl /= (l <= 1) ? l : 2 - l; - sl = sl || 0; - l /= 2; - return [h, sl * 100, l * 100]; - } - - function hsv2hwb(args) { - return rgb2hwb(hsv2rgb(args)) - } - - function hsv2cmyk(args) { - return rgb2cmyk(hsv2rgb(args)); - } - - function hsv2keyword(args) { - return rgb2keyword(hsv2rgb(args)); - } - -// http://dev.w3.org/csswg/css-color/#hwb-to-rgb - function hwb2rgb(hwb) { - var h = hwb[0] / 360, - wh = hwb[1] / 100, - bl = hwb[2] / 100, - ratio = wh + bl, - i, v, f, n; - - // wh + bl cant be > 1 - if (ratio > 1) { - wh /= ratio; - bl /= ratio; - } - - i = Math.floor(6 * h); - v = 1 - bl; - f = 6 * h - i; - if ((i & 0x01) != 0) { - f = 1 - f; - } - n = wh + f * (v - wh); // linear interpolation - - switch (i) { - default: - case 6: - case 0: r = v; g = n; b = wh; break; - case 1: r = n; g = v; b = wh; break; - case 2: r = wh; g = v; b = n; break; - case 3: r = wh; g = n; b = v; break; - case 4: r = n; g = wh; b = v; break; - case 5: r = v; g = wh; b = n; break; - } - - return [r * 255, g * 255, b * 255]; - } - - function hwb2hsl(args) { - return rgb2hsl(hwb2rgb(args)); - } - - function hwb2hsv(args) { - return rgb2hsv(hwb2rgb(args)); - } - - function hwb2cmyk(args) { - return rgb2cmyk(hwb2rgb(args)); - } - - function hwb2keyword(args) { - return rgb2keyword(hwb2rgb(args)); - } - - function cmyk2rgb(cmyk) { - var c = cmyk[0] / 100, - m = cmyk[1] / 100, - y = cmyk[2] / 100, - k = cmyk[3] / 100, - r, g, b; - - r = 1 - Math.min(1, c * (1 - k) + k); - g = 1 - Math.min(1, m * (1 - k) + k); - b = 1 - Math.min(1, y * (1 - k) + k); - return [r * 255, g * 255, b * 255]; - } - - function cmyk2hsl(args) { - return rgb2hsl(cmyk2rgb(args)); - } - - function cmyk2hsv(args) { - return rgb2hsv(cmyk2rgb(args)); - } - - function cmyk2hwb(args) { - return rgb2hwb(cmyk2rgb(args)); - } - - function cmyk2keyword(args) { - return rgb2keyword(cmyk2rgb(args)); - } - - - function xyz2rgb(xyz) { - var x = xyz[0] / 100, - y = xyz[1] / 100, - z = xyz[2] / 100, - r, g, b; - - r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); - g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); - b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); - - // assume sRGB - r = r > 0.0031308 ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055) - : r = (r * 12.92); - - g = g > 0.0031308 ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055) - : g = (g * 12.92); - - b = b > 0.0031308 ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055) - : b = (b * 12.92); - - r = Math.min(Math.max(0, r), 1); - g = Math.min(Math.max(0, g), 1); - b = Math.min(Math.max(0, b), 1); - - return [r * 255, g * 255, b * 255]; - } - - function xyz2lab(xyz) { - var x = xyz[0], - y = xyz[1], - z = xyz[2], - l, a, b; - - x /= 95.047; - y /= 100; - z /= 108.883; - - x = x > 0.008856 ? Math.pow(x, 1/3) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? Math.pow(y, 1/3) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? Math.pow(z, 1/3) : (7.787 * z) + (16 / 116); - - l = (116 * y) - 16; - a = 500 * (x - y); - b = 200 * (y - z); - - return [l, a, b]; - } - - function xyz2lch(args) { - return lab2lch(xyz2lab(args)); - } - - function lab2xyz(lab) { - var l = lab[0], - a = lab[1], - b = lab[2], - x, y, z, y2; - - if (l <= 8) { - y = (l * 100) / 903.3; - y2 = (7.787 * (y / 100)) + (16 / 116); - } else { - y = 100 * Math.pow((l + 16) / 116, 3); - y2 = Math.pow(y / 100, 1/3); - } - - x = x / 95.047 <= 0.008856 ? x = (95.047 * ((a / 500) + y2 - (16 / 116))) / 7.787 : 95.047 * Math.pow((a / 500) + y2, 3); - - z = z / 108.883 <= 0.008859 ? z = (108.883 * (y2 - (b / 200) - (16 / 116))) / 7.787 : 108.883 * Math.pow(y2 - (b / 200), 3); - - return [x, y, z]; - } - - function lab2lch(lab) { - var l = lab[0], - a = lab[1], - b = lab[2], - hr, h, c; - - hr = Math.atan2(b, a); - h = hr * 360 / 2 / Math.PI; if (h < 0) { - h += 360; + h += 1; + } else if (h > 1) { + h -= 1; } - c = Math.sqrt(a * a + b * b); - return [l, c, h]; } - - function lab2rgb(args) { - return xyz2rgb(lab2xyz(args)); + + return [ + h * 360, + s * 100, + v * 100 + ]; + }; + + convert.rgb.hwb = function (rgb) { + var r = rgb[0]; + var g = rgb[1]; + var b = rgb[2]; + var h = convert.rgb.hsl(rgb)[0]; + var w = 1 / 255 * Math.min(r, Math.min(g, b)); + + b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); + + return [h, w * 100, b * 100]; + }; + + convert.rgb.cmyk = function (rgb) { + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var c; + var m; + var y; + var k; + + k = Math.min(1 - r, 1 - g, 1 - b); + c = (1 - r - k) / (1 - k) || 0; + m = (1 - g - k) / (1 - k) || 0; + y = (1 - b - k) / (1 - k) || 0; + + return [c * 100, m * 100, y * 100, k * 100]; + }; + + /** + * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance + * */ + function comparativeDistance(x, y) { + return ( + Math.pow(x[0] - y[0], 2) + + Math.pow(x[1] - y[1], 2) + + Math.pow(x[2] - y[2], 2) + ); + } + + convert.rgb.keyword = function (rgb) { + var reversed = reverseKeywords[rgb]; + if (reversed) { + return reversed; } - - function lch2lab(lch) { - var l = lch[0], - c = lch[1], - h = lch[2], - a, b, hr; - - hr = h / 360 * 2 * Math.PI; - a = c * Math.cos(hr); - b = c * Math.sin(hr); - return [l, a, b]; - } - - function lch2xyz(args) { - return lab2xyz(lch2lab(args)); - } - - function lch2rgb(args) { - return lab2rgb(lch2lab(args)); - } - - function keyword2rgb(keyword) { - return cssKeywords[keyword]; - } - - function keyword2hsl(args) { - return rgb2hsl(keyword2rgb(args)); - } - - function keyword2hsv(args) { - return rgb2hsv(keyword2rgb(args)); - } - - function keyword2hwb(args) { - return rgb2hwb(keyword2rgb(args)); - } - - function keyword2cmyk(args) { - return rgb2cmyk(keyword2rgb(args)); - } - - function keyword2lab(args) { - return rgb2lab(keyword2rgb(args)); - } - - function keyword2xyz(args) { - return rgb2xyz(keyword2rgb(args)); - } - - var cssKeywords = { - aliceblue: [240,248,255], - antiquewhite: [250,235,215], - aqua: [0,255,255], - aquamarine: [127,255,212], - azure: [240,255,255], - beige: [245,245,220], - bisque: [255,228,196], - black: [0,0,0], - blanchedalmond: [255,235,205], - blue: [0,0,255], - blueviolet: [138,43,226], - brown: [165,42,42], - burlywood: [222,184,135], - cadetblue: [95,158,160], - chartreuse: [127,255,0], - chocolate: [210,105,30], - coral: [255,127,80], - cornflowerblue: [100,149,237], - cornsilk: [255,248,220], - crimson: [220,20,60], - cyan: [0,255,255], - darkblue: [0,0,139], - darkcyan: [0,139,139], - darkgoldenrod: [184,134,11], - darkgray: [169,169,169], - darkgreen: [0,100,0], - darkgrey: [169,169,169], - darkkhaki: [189,183,107], - darkmagenta: [139,0,139], - darkolivegreen: [85,107,47], - darkorange: [255,140,0], - darkorchid: [153,50,204], - darkred: [139,0,0], - darksalmon: [233,150,122], - darkseagreen: [143,188,143], - darkslateblue: [72,61,139], - darkslategray: [47,79,79], - darkslategrey: [47,79,79], - darkturquoise: [0,206,209], - darkviolet: [148,0,211], - deeppink: [255,20,147], - deepskyblue: [0,191,255], - dimgray: [105,105,105], - dimgrey: [105,105,105], - dodgerblue: [30,144,255], - firebrick: [178,34,34], - floralwhite: [255,250,240], - forestgreen: [34,139,34], - fuchsia: [255,0,255], - gainsboro: [220,220,220], - ghostwhite: [248,248,255], - gold: [255,215,0], - goldenrod: [218,165,32], - gray: [128,128,128], - green: [0,128,0], - greenyellow: [173,255,47], - grey: [128,128,128], - honeydew: [240,255,240], - hotpink: [255,105,180], - indianred: [205,92,92], - indigo: [75,0,130], - ivory: [255,255,240], - khaki: [240,230,140], - lavender: [230,230,250], - lavenderblush: [255,240,245], - lawngreen: [124,252,0], - lemonchiffon: [255,250,205], - lightblue: [173,216,230], - lightcoral: [240,128,128], - lightcyan: [224,255,255], - lightgoldenrodyellow: [250,250,210], - lightgray: [211,211,211], - lightgreen: [144,238,144], - lightgrey: [211,211,211], - lightpink: [255,182,193], - lightsalmon: [255,160,122], - lightseagreen: [32,178,170], - lightskyblue: [135,206,250], - lightslategray: [119,136,153], - lightslategrey: [119,136,153], - lightsteelblue: [176,196,222], - lightyellow: [255,255,224], - lime: [0,255,0], - limegreen: [50,205,50], - linen: [250,240,230], - magenta: [255,0,255], - maroon: [128,0,0], - mediumaquamarine: [102,205,170], - mediumblue: [0,0,205], - mediumorchid: [186,85,211], - mediumpurple: [147,112,219], - mediumseagreen: [60,179,113], - mediumslateblue: [123,104,238], - mediumspringgreen: [0,250,154], - mediumturquoise: [72,209,204], - mediumvioletred: [199,21,133], - midnightblue: [25,25,112], - mintcream: [245,255,250], - mistyrose: [255,228,225], - moccasin: [255,228,181], - navajowhite: [255,222,173], - navy: [0,0,128], - oldlace: [253,245,230], - olive: [128,128,0], - olivedrab: [107,142,35], - orange: [255,165,0], - orangered: [255,69,0], - orchid: [218,112,214], - palegoldenrod: [238,232,170], - palegreen: [152,251,152], - paleturquoise: [175,238,238], - palevioletred: [219,112,147], - papayawhip: [255,239,213], - peachpuff: [255,218,185], - peru: [205,133,63], - pink: [255,192,203], - plum: [221,160,221], - powderblue: [176,224,230], - purple: [128,0,128], - rebeccapurple: [102, 51, 153], - red: [255,0,0], - rosybrown: [188,143,143], - royalblue: [65,105,225], - saddlebrown: [139,69,19], - salmon: [250,128,114], - sandybrown: [244,164,96], - seagreen: [46,139,87], - seashell: [255,245,238], - sienna: [160,82,45], - silver: [192,192,192], - skyblue: [135,206,235], - slateblue: [106,90,205], - slategray: [112,128,144], - slategrey: [112,128,144], - snow: [255,250,250], - springgreen: [0,255,127], - steelblue: [70,130,180], - tan: [210,180,140], - teal: [0,128,128], - thistle: [216,191,216], - tomato: [255,99,71], - turquoise: [64,224,208], - violet: [238,130,238], - wheat: [245,222,179], - white: [255,255,255], - whitesmoke: [245,245,245], - yellow: [255,255,0], - yellowgreen: [154,205,50] - }; - - var reverseKeywords = {}; - for (var key in cssKeywords) { - reverseKeywords[JSON.stringify(cssKeywords[key])] = key; - } - - },{}],4:[function(require,module,exports){ - var conversions = require(3); - - var convert = function() { - return new Converter(); - } - - for (var func in conversions) { - // export Raw versions - convert[func + "Raw"] = (function(func) { - // accept array or plain args - return function(arg) { - if (typeof arg == "number") - arg = Array.prototype.slice.call(arguments); - return conversions[func](arg); + + var currentClosestDistance = Infinity; + var currentClosestKeyword; + + for (var keyword in colorName) { + if (colorName.hasOwnProperty(keyword)) { + var value = colorName[keyword]; + + // Compute comparative distance + var distance = comparativeDistance(rgb, value); + + // Check if its less, if so set as closest + if (distance < currentClosestDistance) { + currentClosestDistance = distance; + currentClosestKeyword = keyword; } - })(func); - - var pair = /(\w+)2(\w+)/.exec(func), - from = pair[1], - to = pair[2]; - - // export rgb2hsl and ["rgb"]["hsl"] - convert[from] = convert[from] || {}; - - convert[from][to] = convert[func] = (function(func) { - return function(arg) { - if (typeof arg == "number") - arg = Array.prototype.slice.call(arguments); - - var val = conversions[func](arg); - if (typeof val == "string" || val === undefined) - return val; // keyword - - for (var i = 0; i < val.length; i++) - val[i] = Math.round(val[i]); - return val; - } - })(func); + } } - - - /* Converter does lazy conversion and caching */ - var Converter = function() { - this.convs = {}; - }; - - /* Either get the values for a space or - set the values for a space, depending on args */ - Converter.prototype.routeSpace = function(space, args) { - var values = args[0]; - if (values === undefined) { - // color.rgb() - return this.getValues(space); + + return currentClosestKeyword; + }; + + convert.keyword.rgb = function (keyword) { + return colorName[keyword]; + }; + + convert.rgb.xyz = function (rgb) { + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + + // assume sRGB + r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92); + g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92); + b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92); + + var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); + var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); + var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); + + return [x * 100, y * 100, z * 100]; + }; + + convert.rgb.lab = function (rgb) { + var xyz = convert.rgb.xyz(rgb); + var x = xyz[0]; + var y = xyz[1]; + var z = xyz[2]; + var l; + var a; + var b; + + x /= 95.047; + y /= 100; + z /= 108.883; + + x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); + + l = (116 * y) - 16; + a = 500 * (x - y); + b = 200 * (y - z); + + return [l, a, b]; + }; + + convert.hsl.rgb = function (hsl) { + var h = hsl[0] / 360; + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var t1; + var t2; + var t3; + var rgb; + var val; + + if (s === 0) { + val = l * 255; + return [val, val, val]; + } + + if (l < 0.5) { + t2 = l * (1 + s); + } else { + t2 = l + s - l * s; + } + + t1 = 2 * l - t2; + + rgb = [0, 0, 0]; + for (var i = 0; i < 3; i++) { + t3 = h + 1 / 3 * -(i - 1); + if (t3 < 0) { + t3++; } - // color.rgb(10, 10, 10) - if (typeof values == "number") { - values = Array.prototype.slice.call(args); + if (t3 > 1) { + t3--; } - - return this.setValues(space, values); - }; - - /* Set the values for a space, invalidating cache */ - Converter.prototype.setValues = function(space, values) { - this.space = space; - this.convs = {}; - this.convs[space] = values; - return this; - }; - - /* Get the values for a space. If there's already - a conversion for the space, fetch it, otherwise - compute it */ - Converter.prototype.getValues = function(space) { - var vals = this.convs[space]; - if (!vals) { - var fspace = this.space, - from = this.convs[fspace]; - vals = convert[fspace][space](from); - - this.convs[space] = vals; + + if (6 * t3 < 1) { + val = t1 + (t2 - t1) * 6 * t3; + } else if (2 * t3 < 1) { + val = t2; + } else if (3 * t3 < 2) { + val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; + } else { + val = t1; } - return vals; - }; - - ["rgb", "hsl", "hsv", "cmyk", "keyword"].forEach(function(space) { - Converter.prototype[space] = function(vals) { - return this.routeSpace(space, arguments); + + rgb[i] = val * 255; + } + + return rgb; + }; + + convert.hsl.hsv = function (hsl) { + var h = hsl[0]; + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var smin = s; + var lmin = Math.max(l, 0.01); + var sv; + var v; + + l *= 2; + s *= (l <= 1) ? l : 2 - l; + smin *= lmin <= 1 ? lmin : 2 - lmin; + v = (l + s) / 2; + sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); + + return [h, sv * 100, v * 100]; + }; + + convert.hsv.rgb = function (hsv) { + var h = hsv[0] / 60; + var s = hsv[1] / 100; + var v = hsv[2] / 100; + var hi = Math.floor(h) % 6; + + var f = h - Math.floor(h); + var p = 255 * v * (1 - s); + var q = 255 * v * (1 - (s * f)); + var t = 255 * v * (1 - (s * (1 - f))); + v *= 255; + + switch (hi) { + case 0: + return [v, t, p]; + case 1: + return [q, v, p]; + case 2: + return [p, v, t]; + case 3: + return [p, q, v]; + case 4: + return [t, p, v]; + case 5: + return [v, p, q]; + } + }; + + convert.hsv.hsl = function (hsv) { + var h = hsv[0]; + var s = hsv[1] / 100; + var v = hsv[2] / 100; + var vmin = Math.max(v, 0.01); + var lmin; + var sl; + var l; + + l = (2 - s) * v; + lmin = (2 - s) * vmin; + sl = s * vmin; + sl /= (lmin <= 1) ? lmin : 2 - lmin; + sl = sl || 0; + l /= 2; + + return [h, sl * 100, l * 100]; + }; + + // http://dev.w3.org/csswg/css-color/#hwb-to-rgb + convert.hwb.rgb = function (hwb) { + var h = hwb[0] / 360; + var wh = hwb[1] / 100; + var bl = hwb[2] / 100; + var ratio = wh + bl; + var i; + var v; + var f; + var n; + + // wh + bl cant be > 1 + if (ratio > 1) { + wh /= ratio; + bl /= ratio; + } + + i = Math.floor(6 * h); + v = 1 - bl; + f = 6 * h - i; + + if ((i & 0x01) !== 0) { + f = 1 - f; + } + + n = wh + f * (v - wh); // linear interpolation + + var r; + var g; + var b; + switch (i) { + default: + case 6: + case 0: r = v; g = n; b = wh; break; + case 1: r = n; g = v; b = wh; break; + case 2: r = wh; g = v; b = n; break; + case 3: r = wh; g = n; b = v; break; + case 4: r = n; g = wh; b = v; break; + case 5: r = v; g = wh; b = n; break; + } + + return [r * 255, g * 255, b * 255]; + }; + + convert.cmyk.rgb = function (cmyk) { + var c = cmyk[0] / 100; + var m = cmyk[1] / 100; + var y = cmyk[2] / 100; + var k = cmyk[3] / 100; + var r; + var g; + var b; + + r = 1 - Math.min(1, c * (1 - k) + k); + g = 1 - Math.min(1, m * (1 - k) + k); + b = 1 - Math.min(1, y * (1 - k) + k); + + return [r * 255, g * 255, b * 255]; + }; + + convert.xyz.rgb = function (xyz) { + var x = xyz[0] / 100; + var y = xyz[1] / 100; + var z = xyz[2] / 100; + var r; + var g; + var b; + + r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); + g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); + b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); + + // assume sRGB + r = r > 0.0031308 + ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055) + : r * 12.92; + + g = g > 0.0031308 + ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055) + : g * 12.92; + + b = b > 0.0031308 + ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055) + : b * 12.92; + + r = Math.min(Math.max(0, r), 1); + g = Math.min(Math.max(0, g), 1); + b = Math.min(Math.max(0, b), 1); + + return [r * 255, g * 255, b * 255]; + }; + + convert.xyz.lab = function (xyz) { + var x = xyz[0]; + var y = xyz[1]; + var z = xyz[2]; + var l; + var a; + var b; + + x /= 95.047; + y /= 100; + z /= 108.883; + + x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); + + l = (116 * y) - 16; + a = 500 * (x - y); + b = 200 * (y - z); + + return [l, a, b]; + }; + + convert.lab.xyz = function (lab) { + var l = lab[0]; + var a = lab[1]; + var b = lab[2]; + var x; + var y; + var z; + + y = (l + 16) / 116; + x = a / 500 + y; + z = y - b / 200; + + var y2 = Math.pow(y, 3); + var x2 = Math.pow(x, 3); + var z2 = Math.pow(z, 3); + y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; + x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; + z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; + + x *= 95.047; + y *= 100; + z *= 108.883; + + return [x, y, z]; + }; + + convert.lab.lch = function (lab) { + var l = lab[0]; + var a = lab[1]; + var b = lab[2]; + var hr; + var h; + var c; + + hr = Math.atan2(b, a); + h = hr * 360 / 2 / Math.PI; + + if (h < 0) { + h += 360; + } + + c = Math.sqrt(a * a + b * b); + + return [l, c, h]; + }; + + convert.lch.lab = function (lch) { + var l = lch[0]; + var c = lch[1]; + var h = lch[2]; + var a; + var b; + var hr; + + hr = h / 360 * 2 * Math.PI; + a = c * Math.cos(hr); + b = c * Math.sin(hr); + + return [l, a, b]; + }; + + convert.rgb.ansi16 = function (args) { + var r = args[0]; + var g = args[1]; + var b = args[2]; + var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization + + value = Math.round(value / 50); + + if (value === 0) { + return 30; + } + + var ansi = 30 + + ((Math.round(b / 255) << 2) + | (Math.round(g / 255) << 1) + | Math.round(r / 255)); + + if (value === 2) { + ansi += 60; + } + + return ansi; + }; + + convert.hsv.ansi16 = function (args) { + // optimization here; we already know the value and don't need to get + // it converted for us. + return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); + }; + + convert.rgb.ansi256 = function (args) { + var r = args[0]; + var g = args[1]; + var b = args[2]; + + // we use the extended greyscale palette here, with the exception of + // black and white. normal palette only has 4 greyscale shades. + if (r === g && g === b) { + if (r < 8) { + return 16; } + + if (r > 248) { + return 231; + } + + return Math.round(((r - 8) / 247) * 24) + 232; + } + + var ansi = 16 + + (36 * Math.round(r / 255 * 5)) + + (6 * Math.round(g / 255 * 5)) + + Math.round(b / 255 * 5); + + return ansi; + }; + + convert.ansi16.rgb = function (args) { + var color = args % 10; + + // handle greyscale + if (color === 0 || color === 7) { + if (args > 50) { + color += 3.5; + } + + color = color / 10.5 * 255; + + return [color, color, color]; + } + + var mult = (~~(args > 50) + 1) * 0.5; + var r = ((color & 1) * mult) * 255; + var g = (((color >> 1) & 1) * mult) * 255; + var b = (((color >> 2) & 1) * mult) * 255; + + return [r, g, b]; + }; + + convert.ansi256.rgb = function (args) { + // handle greyscale + if (args >= 232) { + var c = (args - 232) * 10 + 8; + return [c, c, c]; + } + + args -= 16; + + var rem; + var r = Math.floor(args / 36) / 5 * 255; + var g = Math.floor((rem = args % 36) / 6) / 5 * 255; + var b = (rem % 6) / 5 * 255; + + return [r, g, b]; + }; + + convert.rgb.hex = function (args) { + var integer = ((Math.round(args[0]) & 0xFF) << 16) + + ((Math.round(args[1]) & 0xFF) << 8) + + (Math.round(args[2]) & 0xFF); + + var string = integer.toString(16).toUpperCase(); + return '000000'.substring(string.length) + string; + }; + + convert.hex.rgb = function (args) { + var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + if (!match) { + return [0, 0, 0]; + } + + var colorString = match[0]; + + if (match[0].length === 3) { + colorString = colorString.split('').map(function (char) { + return char + char; + }).join(''); + } + + var integer = parseInt(colorString, 16); + var r = (integer >> 16) & 0xFF; + var g = (integer >> 8) & 0xFF; + var b = integer & 0xFF; + + return [r, g, b]; + }; + + convert.rgb.hcg = function (rgb) { + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var max = Math.max(Math.max(r, g), b); + var min = Math.min(Math.min(r, g), b); + var chroma = (max - min); + var grayscale; + var hue; + + if (chroma < 1) { + grayscale = min / (1 - chroma); + } else { + grayscale = 0; + } + + if (chroma <= 0) { + hue = 0; + } else + if (max === r) { + hue = ((g - b) / chroma) % 6; + } else + if (max === g) { + hue = 2 + (b - r) / chroma; + } else { + hue = 4 + (r - g) / chroma + 4; + } + + hue /= 6; + hue %= 1; + + return [hue * 360, chroma * 100, grayscale * 100]; + }; + + convert.hsl.hcg = function (hsl) { + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var c = 1; + var f = 0; + + if (l < 0.5) { + c = 2.0 * s * l; + } else { + c = 2.0 * s * (1.0 - l); + } + + if (c < 1.0) { + f = (l - 0.5 * c) / (1.0 - c); + } + + return [hsl[0], c * 100, f * 100]; + }; + + convert.hsv.hcg = function (hsv) { + var s = hsv[1] / 100; + var v = hsv[2] / 100; + + var c = s * v; + var f = 0; + + if (c < 1.0) { + f = (v - c) / (1 - c); + } + + return [hsv[0], c * 100, f * 100]; + }; + + convert.hcg.rgb = function (hcg) { + var h = hcg[0] / 360; + var c = hcg[1] / 100; + var g = hcg[2] / 100; + + if (c === 0.0) { + return [g * 255, g * 255, g * 255]; + } + + var pure = [0, 0, 0]; + var hi = (h % 1) * 6; + var v = hi % 1; + var w = 1 - v; + var mg = 0; + + switch (Math.floor(hi)) { + case 0: + pure[0] = 1; pure[1] = v; pure[2] = 0; break; + case 1: + pure[0] = w; pure[1] = 1; pure[2] = 0; break; + case 2: + pure[0] = 0; pure[1] = 1; pure[2] = v; break; + case 3: + pure[0] = 0; pure[1] = w; pure[2] = 1; break; + case 4: + pure[0] = v; pure[1] = 0; pure[2] = 1; break; + default: + pure[0] = 1; pure[1] = 0; pure[2] = w; + } + + mg = (1.0 - c) * g; + + return [ + (c * pure[0] + mg) * 255, + (c * pure[1] + mg) * 255, + (c * pure[2] + mg) * 255 + ]; + }; + + convert.hcg.hsv = function (hcg) { + var c = hcg[1] / 100; + var g = hcg[2] / 100; + + var v = c + g * (1.0 - c); + var f = 0; + + if (v > 0.0) { + f = c / v; + } + + return [hcg[0], f * 100, v * 100]; + }; + + convert.hcg.hsl = function (hcg) { + var c = hcg[1] / 100; + var g = hcg[2] / 100; + + var l = g * (1.0 - c) + 0.5 * c; + var s = 0; + + if (l > 0.0 && l < 0.5) { + s = c / (2 * l); + } else + if (l >= 0.5 && l < 1.0) { + s = c / (2 * (1 - l)); + } + + return [hcg[0], s * 100, l * 100]; + }; + + convert.hcg.hwb = function (hcg) { + var c = hcg[1] / 100; + var g = hcg[2] / 100; + var v = c + g * (1.0 - c); + return [hcg[0], (v - c) * 100, (1 - v) * 100]; + }; + + convert.hwb.hcg = function (hwb) { + var w = hwb[1] / 100; + var b = hwb[2] / 100; + var v = 1 - b; + var c = v - w; + var g = 0; + + if (c < 1) { + g = (v - c) / (1 - c); + } + + return [hwb[0], c * 100, g * 100]; + }; + + convert.apple.rgb = function (apple) { + return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; + }; + + convert.rgb.apple = function (rgb) { + return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; + }; + + convert.gray.rgb = function (args) { + return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; + }; + + convert.gray.hsl = convert.gray.hsv = function (args) { + return [0, 0, args[0]]; + }; + + convert.gray.hwb = function (gray) { + return [0, 100, gray[0]]; + }; + + convert.gray.cmyk = function (gray) { + return [0, 0, 0, gray[0]]; + }; + + convert.gray.lab = function (gray) { + return [gray[0], 0, 0]; + }; + + convert.gray.hex = function (gray) { + var val = Math.round(gray[0] / 100 * 255) & 0xFF; + var integer = (val << 16) + (val << 8) + val; + + var string = integer.toString(16).toUpperCase(); + return '000000'.substring(string.length) + string; + }; + + convert.rgb.gray = function (rgb) { + var val = (rgb[0] + rgb[1] + rgb[2]) / 3; + return [val / 255 * 100]; + }; + }); + var conversions_1 = conversions.rgb; + var conversions_2 = conversions.hsl; + var conversions_3 = conversions.hsv; + var conversions_4 = conversions.hwb; + var conversions_5 = conversions.cmyk; + var conversions_6 = conversions.xyz; + var conversions_7 = conversions.lab; + var conversions_8 = conversions.lch; + var conversions_9 = conversions.hex; + var conversions_10 = conversions.keyword; + var conversions_11 = conversions.ansi16; + var conversions_12 = conversions.ansi256; + var conversions_13 = conversions.hcg; + var conversions_14 = conversions.apple; + var conversions_15 = conversions.gray; + + /* + this function routes a model to all other models. + + all functions that are routed have a property `.conversion` attached + to the returned synthetic function. This property is an array + of strings, each with the steps in between the 'from' and 'to' + color models (inclusive). + + conversions that are not possible simply are not included. + */ + + function buildGraph() { + var graph = {}; + // https://jsperf.com/object-keys-vs-for-in-with-closure/3 + var models = Object.keys(conversions); + + for (var len = models.length, i = 0; i < len; i++) { + graph[models[i]] = { + // http://jsperf.com/1-vs-infinity + // micro-opt, but this is simple. + distance: -1, + parent: null + }; + } + + return graph; + } + + // https://en.wikipedia.org/wiki/Breadth-first_search + function deriveBFS(fromModel) { + var graph = buildGraph(); + var queue = [fromModel]; // unshift -> queue -> pop + + graph[fromModel].distance = 0; + + while (queue.length) { + var current = queue.pop(); + var adjacents = Object.keys(conversions[current]); + + for (var len = adjacents.length, i = 0; i < len; i++) { + var adjacent = adjacents[i]; + var node = graph[adjacent]; + + if (node.distance === -1) { + node.distance = graph[current].distance + 1; + node.parent = current; + queue.unshift(adjacent); + } + } + } + + return graph; + } + + function link(from, to) { + return function (args) { + return to(from(args)); + }; + } + + function wrapConversion(toModel, graph) { + var path = [graph[toModel].parent, toModel]; + var fn = conversions[graph[toModel].parent][toModel]; + + var cur = graph[toModel].parent; + while (graph[cur].parent) { + path.unshift(graph[cur].parent); + fn = link(conversions[graph[cur].parent][cur], fn); + cur = graph[cur].parent; + } + + fn.conversion = path; + return fn; + } + + var route = function (fromModel) { + var graph = deriveBFS(fromModel); + var conversion = {}; + + var models = Object.keys(graph); + for (var len = models.length, i = 0; i < len; i++) { + var toModel = models[i]; + var node = graph[toModel]; + + if (node.parent === null) { + // no possible conversion, or this node is the source model. + continue; + } + + conversion[toModel] = wrapConversion(toModel, graph); + } + + return conversion; + }; + + var convert = {}; + + var models = Object.keys(conversions); + + function wrapRaw(fn) { + var wrappedFn = function (args) { + if (args === undefined || args === null) { + return args; + } + + if (arguments.length > 1) { + args = Array.prototype.slice.call(arguments); + } + + return fn(args); + }; + + // preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } + + return wrappedFn; + } + + function wrapRounded(fn) { + var wrappedFn = function (args) { + if (args === undefined || args === null) { + return args; + } + + if (arguments.length > 1) { + args = Array.prototype.slice.call(arguments); + } + + var result = fn(args); + + // we're assuming the result is an array here. + // see notice in conversions.js; don't use box types + // in conversion functions. + if (typeof result === 'object') { + for (var len = result.length, i = 0; i < len; i++) { + result[i] = Math.round(result[i]); + } + } + + return result; + }; + + // preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } + + return wrappedFn; + } + + models.forEach(function (fromModel) { + convert[fromModel] = {}; + + Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); + Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); + + var routes = route(fromModel); + var routeModels = Object.keys(routes); + + routeModels.forEach(function (toModel) { + var fn = routes[toModel]; + + convert[fromModel][toModel] = wrapRounded(fn); + convert[fromModel][toModel].raw = wrapRaw(fn); }); - - module.exports = convert; - },{"3":3}],5:[function(require,module,exports){ - 'use strict' - - module.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] + }); + + var colorConvert = convert; + + var colorName$1 = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] + }; + + /* MIT license */ + + + var colorString = { + getRgba: getRgba, + getHsla: getHsla, + getRgb: getRgb, + getHsl: getHsl, + getHwb: getHwb, + getAlpha: getAlpha, + + hexString: hexString, + rgbString: rgbString, + rgbaString: rgbaString, + percentString: percentString, + percentaString: percentaString, + hslString: hslString, + hslaString: hslaString, + hwbString: hwbString, + keyword: keyword + }; + + function getRgba(string) { + if (!string) { + return; + } + var abbr = /^#([a-fA-F0-9]{3,4})$/i, + hex = /^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i, + rgba = /^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i, + per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i, + keyword = /(\w+)/; + + var rgb = [0, 0, 0], + a = 1, + match = string.match(abbr), + hexAlpha = ""; + if (match) { + match = match[1]; + hexAlpha = match[3]; + for (var i = 0; i < rgb.length; i++) { + rgb[i] = parseInt(match[i] + match[i], 16); + } + if (hexAlpha) { + a = Math.round((parseInt(hexAlpha + hexAlpha, 16) / 255) * 100) / 100; + } + } + else if (match = string.match(hex)) { + hexAlpha = match[2]; + match = match[1]; + for (var i = 0; i < rgb.length; i++) { + rgb[i] = parseInt(match.slice(i * 2, i * 2 + 2), 16); + } + if (hexAlpha) { + a = Math.round((parseInt(hexAlpha, 16) / 255) * 100) / 100; + } + } + else if (match = string.match(rgba)) { + for (var i = 0; i < rgb.length; i++) { + rgb[i] = parseInt(match[i + 1]); + } + a = parseFloat(match[4]); + } + else if (match = string.match(per)) { + for (var i = 0; i < rgb.length; i++) { + rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55); + } + a = parseFloat(match[4]); + } + else if (match = string.match(keyword)) { + if (match[1] == "transparent") { + return [0, 0, 0, 0]; + } + rgb = colorName$1[match[1]]; + if (!rgb) { + return; + } + } + + for (var i = 0; i < rgb.length; i++) { + rgb[i] = scale(rgb[i], 0, 255); + } + if (!a && a != 0) { + a = 1; + } + else { + a = scale(a, 0, 1); + } + rgb[3] = a; + return rgb; + } + + function getHsla(string) { + if (!string) { + return; + } + var hsl = /^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/; + var match = string.match(hsl); + if (match) { + var alpha = parseFloat(match[4]); + var h = scale(parseInt(match[1]), 0, 360), + s = scale(parseFloat(match[2]), 0, 100), + l = scale(parseFloat(match[3]), 0, 100), + a = scale(isNaN(alpha) ? 1 : alpha, 0, 1); + return [h, s, l, a]; + } + } + + function getHwb(string) { + if (!string) { + return; + } + var hwb = /^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/; + var match = string.match(hwb); + if (match) { + var alpha = parseFloat(match[4]); + var h = scale(parseInt(match[1]), 0, 360), + w = scale(parseFloat(match[2]), 0, 100), + b = scale(parseFloat(match[3]), 0, 100), + a = scale(isNaN(alpha) ? 1 : alpha, 0, 1); + return [h, w, b, a]; + } + } + + function getRgb(string) { + var rgba = getRgba(string); + return rgba && rgba.slice(0, 3); + } + + function getHsl(string) { + var hsla = getHsla(string); + return hsla && hsla.slice(0, 3); + } + + function getAlpha(string) { + var vals = getRgba(string); + if (vals) { + return vals[3]; + } + else if (vals = getHsla(string)) { + return vals[3]; + } + else if (vals = getHwb(string)) { + return vals[3]; + } + } + + // generators + function hexString(rgba, a) { + var a = (a !== undefined && rgba.length === 3) ? a : rgba[3]; + return "#" + hexDouble(rgba[0]) + + hexDouble(rgba[1]) + + hexDouble(rgba[2]) + + ( + (a >= 0 && a < 1) + ? hexDouble(Math.round(a * 255)) + : "" + ); + } + + function rgbString(rgba, alpha) { + if (alpha < 1 || (rgba[3] && rgba[3] < 1)) { + return rgbaString(rgba, alpha); + } + return "rgb(" + rgba[0] + ", " + rgba[1] + ", " + rgba[2] + ")"; + } + + function rgbaString(rgba, alpha) { + if (alpha === undefined) { + alpha = (rgba[3] !== undefined ? rgba[3] : 1); + } + return "rgba(" + rgba[0] + ", " + rgba[1] + ", " + rgba[2] + + ", " + alpha + ")"; + } + + function percentString(rgba, alpha) { + if (alpha < 1 || (rgba[3] && rgba[3] < 1)) { + return percentaString(rgba, alpha); + } + var r = Math.round(rgba[0]/255 * 100), + g = Math.round(rgba[1]/255 * 100), + b = Math.round(rgba[2]/255 * 100); + + return "rgb(" + r + "%, " + g + "%, " + b + "%)"; + } + + function percentaString(rgba, alpha) { + var r = Math.round(rgba[0]/255 * 100), + g = Math.round(rgba[1]/255 * 100), + b = Math.round(rgba[2]/255 * 100); + return "rgba(" + r + "%, " + g + "%, " + b + "%, " + (alpha || rgba[3] || 1) + ")"; + } + + function hslString(hsla, alpha) { + if (alpha < 1 || (hsla[3] && hsla[3] < 1)) { + return hslaString(hsla, alpha); + } + return "hsl(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%)"; + } + + function hslaString(hsla, alpha) { + if (alpha === undefined) { + alpha = (hsla[3] !== undefined ? hsla[3] : 1); + } + return "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, " + + alpha + ")"; + } + + // hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax + // (hwb have alpha optional & 1 is default value) + function hwbString(hwb, alpha) { + if (alpha === undefined) { + alpha = (hwb[3] !== undefined ? hwb[3] : 1); + } + return "hwb(" + hwb[0] + ", " + hwb[1] + "%, " + hwb[2] + "%" + + (alpha !== undefined && alpha !== 1 ? ", " + alpha : "") + ")"; + } + + function keyword(rgb) { + return reverseNames[rgb.slice(0, 3)]; + } + + // helpers + function scale(num, min, max) { + return Math.min(Math.max(min, num), max); + } + + function hexDouble(num) { + var str = num.toString(16).toUpperCase(); + return (str.length < 2) ? "0" + str : str; + } + + + //create a list of reverse color names + var reverseNames = {}; + for (var name in colorName$1) { + reverseNames[colorName$1[name]] = name; + } + + /* MIT license */ + + + + var Color = function (obj) { + if (obj instanceof Color) { + return obj; + } + if (!(this instanceof Color)) { + return new Color(obj); + } + + this.valid = false; + this.values = { + rgb: [0, 0, 0], + hsl: [0, 0, 0], + hsv: [0, 0, 0], + hwb: [0, 0, 0], + cmyk: [0, 0, 0, 0], + alpha: 1 }; - - },{}],6:[function(require,module,exports){ -//! moment.js -//! version : 2.20.1 -//! authors : Tim Wood, Iskren Chernev, Moment.js contributors -//! license : MIT -//! momentjs.com - - ;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - global.moment = factory() - }(this, (function () { 'use strict'; - - var hookCallback; - - function hooks () { - return hookCallback.apply(null, arguments); + + // parse Color() argument + var vals; + if (typeof obj === 'string') { + vals = colorString.getRgba(obj); + if (vals) { + this.setValues('rgb', vals); + } else if (vals = colorString.getHsla(obj)) { + this.setValues('hsl', vals); + } else if (vals = colorString.getHwb(obj)) { + this.setValues('hwb', vals); } - -// This is done to register the method called with moment() -// without creating circular dependencies. - function setHookCallback (callback) { - hookCallback = callback; + } else if (typeof obj === 'object') { + vals = obj; + if (vals.r !== undefined || vals.red !== undefined) { + this.setValues('rgb', vals); + } else if (vals.l !== undefined || vals.lightness !== undefined) { + this.setValues('hsl', vals); + } else if (vals.v !== undefined || vals.value !== undefined) { + this.setValues('hsv', vals); + } else if (vals.w !== undefined || vals.whiteness !== undefined) { + this.setValues('hwb', vals); + } else if (vals.c !== undefined || vals.cyan !== undefined) { + this.setValues('cmyk', vals); } - - function isArray(input) { - return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]'; + } + }; + + Color.prototype = { + isValid: function () { + return this.valid; + }, + rgb: function () { + return this.setSpace('rgb', arguments); + }, + hsl: function () { + return this.setSpace('hsl', arguments); + }, + hsv: function () { + return this.setSpace('hsv', arguments); + }, + hwb: function () { + return this.setSpace('hwb', arguments); + }, + cmyk: function () { + return this.setSpace('cmyk', arguments); + }, + + rgbArray: function () { + return this.values.rgb; + }, + hslArray: function () { + return this.values.hsl; + }, + hsvArray: function () { + return this.values.hsv; + }, + hwbArray: function () { + var values = this.values; + if (values.alpha !== 1) { + return values.hwb.concat([values.alpha]); } - - function isObject(input) { - // IE8 will treat undefined and null as object if it wasn't for - // input != null - return input != null && Object.prototype.toString.call(input) === '[object Object]'; + return values.hwb; + }, + cmykArray: function () { + return this.values.cmyk; + }, + rgbaArray: function () { + var values = this.values; + return values.rgb.concat([values.alpha]); + }, + hslaArray: function () { + var values = this.values; + return values.hsl.concat([values.alpha]); + }, + alpha: function (val) { + if (val === undefined) { + return this.values.alpha; } - - function isObjectEmpty(obj) { - if (Object.getOwnPropertyNames) { - return (Object.getOwnPropertyNames(obj).length === 0); + this.setValues('alpha', val); + return this; + }, + + red: function (val) { + return this.setChannel('rgb', 0, val); + }, + green: function (val) { + return this.setChannel('rgb', 1, val); + }, + blue: function (val) { + return this.setChannel('rgb', 2, val); + }, + hue: function (val) { + if (val) { + val %= 360; + val = val < 0 ? 360 + val : val; + } + return this.setChannel('hsl', 0, val); + }, + saturation: function (val) { + return this.setChannel('hsl', 1, val); + }, + lightness: function (val) { + return this.setChannel('hsl', 2, val); + }, + saturationv: function (val) { + return this.setChannel('hsv', 1, val); + }, + whiteness: function (val) { + return this.setChannel('hwb', 1, val); + }, + blackness: function (val) { + return this.setChannel('hwb', 2, val); + }, + value: function (val) { + return this.setChannel('hsv', 2, val); + }, + cyan: function (val) { + return this.setChannel('cmyk', 0, val); + }, + magenta: function (val) { + return this.setChannel('cmyk', 1, val); + }, + yellow: function (val) { + return this.setChannel('cmyk', 2, val); + }, + black: function (val) { + return this.setChannel('cmyk', 3, val); + }, + + hexString: function () { + return colorString.hexString(this.values.rgb); + }, + rgbString: function () { + return colorString.rgbString(this.values.rgb, this.values.alpha); + }, + rgbaString: function () { + return colorString.rgbaString(this.values.rgb, this.values.alpha); + }, + percentString: function () { + return colorString.percentString(this.values.rgb, this.values.alpha); + }, + hslString: function () { + return colorString.hslString(this.values.hsl, this.values.alpha); + }, + hslaString: function () { + return colorString.hslaString(this.values.hsl, this.values.alpha); + }, + hwbString: function () { + return colorString.hwbString(this.values.hwb, this.values.alpha); + }, + keyword: function () { + return colorString.keyword(this.values.rgb, this.values.alpha); + }, + + rgbNumber: function () { + var rgb = this.values.rgb; + return (rgb[0] << 16) | (rgb[1] << 8) | rgb[2]; + }, + + luminosity: function () { + // http://www.w3.org/TR/WCAG20/#relativeluminancedef + var rgb = this.values.rgb; + var lum = []; + for (var i = 0; i < rgb.length; i++) { + var chan = rgb[i] / 255; + lum[i] = (chan <= 0.03928) ? chan / 12.92 : Math.pow(((chan + 0.055) / 1.055), 2.4); + } + return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2]; + }, + + contrast: function (color2) { + // http://www.w3.org/TR/WCAG20/#contrast-ratiodef + var lum1 = this.luminosity(); + var lum2 = color2.luminosity(); + if (lum1 > lum2) { + return (lum1 + 0.05) / (lum2 + 0.05); + } + return (lum2 + 0.05) / (lum1 + 0.05); + }, + + level: function (color2) { + var contrastRatio = this.contrast(color2); + if (contrastRatio >= 7.1) { + return 'AAA'; + } + + return (contrastRatio >= 4.5) ? 'AA' : ''; + }, + + dark: function () { + // YIQ equation from http://24ways.org/2010/calculating-color-contrast + var rgb = this.values.rgb; + var yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000; + return yiq < 128; + }, + + light: function () { + return !this.dark(); + }, + + negate: function () { + var rgb = []; + for (var i = 0; i < 3; i++) { + rgb[i] = 255 - this.values.rgb[i]; + } + this.setValues('rgb', rgb); + return this; + }, + + lighten: function (ratio) { + var hsl = this.values.hsl; + hsl[2] += hsl[2] * ratio; + this.setValues('hsl', hsl); + return this; + }, + + darken: function (ratio) { + var hsl = this.values.hsl; + hsl[2] -= hsl[2] * ratio; + this.setValues('hsl', hsl); + return this; + }, + + saturate: function (ratio) { + var hsl = this.values.hsl; + hsl[1] += hsl[1] * ratio; + this.setValues('hsl', hsl); + return this; + }, + + desaturate: function (ratio) { + var hsl = this.values.hsl; + hsl[1] -= hsl[1] * ratio; + this.setValues('hsl', hsl); + return this; + }, + + whiten: function (ratio) { + var hwb = this.values.hwb; + hwb[1] += hwb[1] * ratio; + this.setValues('hwb', hwb); + return this; + }, + + blacken: function (ratio) { + var hwb = this.values.hwb; + hwb[2] += hwb[2] * ratio; + this.setValues('hwb', hwb); + return this; + }, + + greyscale: function () { + var rgb = this.values.rgb; + // http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale + var val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11; + this.setValues('rgb', [val, val, val]); + return this; + }, + + clearer: function (ratio) { + var alpha = this.values.alpha; + this.setValues('alpha', alpha - (alpha * ratio)); + return this; + }, + + opaquer: function (ratio) { + var alpha = this.values.alpha; + this.setValues('alpha', alpha + (alpha * ratio)); + return this; + }, + + rotate: function (degrees) { + var hsl = this.values.hsl; + var hue = (hsl[0] + degrees) % 360; + hsl[0] = hue < 0 ? 360 + hue : hue; + this.setValues('hsl', hsl); + return this; + }, + + /** + * Ported from sass implementation in C + * https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 + */ + mix: function (mixinColor, weight) { + var color1 = this; + var color2 = mixinColor; + var p = weight === undefined ? 0.5 : weight; + + var w = 2 * p - 1; + var a = color1.alpha() - color2.alpha(); + + var w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0; + var w2 = 1 - w1; + + return this + .rgb( + w1 * color1.red() + w2 * color2.red(), + w1 * color1.green() + w2 * color2.green(), + w1 * color1.blue() + w2 * color2.blue() + ) + .alpha(color1.alpha() * p + color2.alpha() * (1 - p)); + }, + + toJSON: function () { + return this.rgb(); + }, + + clone: function () { + // NOTE(SB): using node-clone creates a dependency to Buffer when using browserify, + // making the final build way to big to embed in Chart.js. So let's do it manually, + // assuming that values to clone are 1 dimension arrays containing only numbers, + // except 'alpha' which is a number. + var result = new Color(); + var source = this.values; + var target = result.values; + var value, type; + + for (var prop in source) { + if (source.hasOwnProperty(prop)) { + value = source[prop]; + type = ({}).toString.call(value); + if (type === '[object Array]') { + target[prop] = value.slice(0); + } else if (type === '[object Number]') { + target[prop] = value; + } else { + console.error('unexpected color value:', value); + } + } + } + + return result; + } + }; + + Color.prototype.spaces = { + rgb: ['red', 'green', 'blue'], + hsl: ['hue', 'saturation', 'lightness'], + hsv: ['hue', 'saturation', 'value'], + hwb: ['hue', 'whiteness', 'blackness'], + cmyk: ['cyan', 'magenta', 'yellow', 'black'] + }; + + Color.prototype.maxes = { + rgb: [255, 255, 255], + hsl: [360, 100, 100], + hsv: [360, 100, 100], + hwb: [360, 100, 100], + cmyk: [100, 100, 100, 100] + }; + + Color.prototype.getValues = function (space) { + var values = this.values; + var vals = {}; + + for (var i = 0; i < space.length; i++) { + vals[space.charAt(i)] = values[space][i]; + } + + if (values.alpha !== 1) { + vals.a = values.alpha; + } + + // {r: 255, g: 255, b: 255, a: 0.4} + return vals; + }; + + Color.prototype.setValues = function (space, vals) { + var values = this.values; + var spaces = this.spaces; + var maxes = this.maxes; + var alpha = 1; + var i; + + this.valid = true; + + if (space === 'alpha') { + alpha = vals; + } else if (vals.length) { + // [10, 10, 10] + values[space] = vals.slice(0, space.length); + alpha = vals[space.length]; + } else if (vals[space.charAt(0)] !== undefined) { + // {r: 10, g: 10, b: 10} + for (i = 0; i < space.length; i++) { + values[space][i] = vals[space.charAt(i)]; + } + + alpha = vals.a; + } else if (vals[spaces[space][0]] !== undefined) { + // {red: 10, green: 10, blue: 10} + var chans = spaces[space]; + + for (i = 0; i < space.length; i++) { + values[space][i] = vals[chans[i]]; + } + + alpha = vals.alpha; + } + + values.alpha = Math.max(0, Math.min(1, (alpha === undefined ? values.alpha : alpha))); + + if (space === 'alpha') { + return false; + } + + var capped; + + // cap values of the space prior converting all values + for (i = 0; i < space.length; i++) { + capped = Math.max(0, Math.min(maxes[space][i], values[space][i])); + values[space][i] = Math.round(capped); + } + + // convert to all the other color spaces + for (var sname in spaces) { + if (sname !== space) { + values[sname] = colorConvert[space][sname](values[space]); + } + } + + return true; + }; + + Color.prototype.setSpace = function (space, args) { + var vals = args[0]; + + if (vals === undefined) { + // color.rgb() + return this.getValues(space); + } + + // color.rgb(10, 10, 10) + if (typeof vals === 'number') { + vals = Array.prototype.slice.call(args); + } + + this.setValues(space, vals); + return this; + }; + + Color.prototype.setChannel = function (space, index, val) { + var svalues = this.values[space]; + if (val === undefined) { + // color.red() + return svalues[index]; + } else if (val === svalues[index]) { + // color.red(color.red()) + return this; + } + + // color.red(100) + svalues[index] = val; + this.setValues(space, svalues); + + return this; + }; + + if (typeof window !== 'undefined') { + window.Color = Color; + } + + var chartjsColor = Color; + + /** + * @namespace Chart.helpers + */ + var helpers = { + /** + * An empty function that can be used, for example, for optional callback. + */ + noop: function() {}, + + /** + * Returns a unique id, sequentially generated from a global variable. + * @returns {number} + * @function + */ + uid: (function() { + var id = 0; + return function() { + return id++; + }; + }()), + + /** + * Returns true if `value` is neither null nor undefined, else returns false. + * @param {*} value - The value to test. + * @returns {boolean} + * @since 2.7.0 + */ + isNullOrUndef: function(value) { + return value === null || typeof value === 'undefined'; + }, + + /** + * Returns true if `value` is an array (including typed arrays), else returns false. + * @param {*} value - The value to test. + * @returns {boolean} + * @function + */ + isArray: function(value) { + if (Array.isArray && Array.isArray(value)) { + return true; + } + var type = Object.prototype.toString.call(value); + if (type.substr(0, 7) === '[object' && type.substr(-6) === 'Array]') { + return true; + } + return false; + }, + + /** + * Returns true if `value` is an object (excluding null), else returns false. + * @param {*} value - The value to test. + * @returns {boolean} + * @since 2.7.0 + */ + isObject: function(value) { + return value !== null && Object.prototype.toString.call(value) === '[object Object]'; + }, + + /** + * Returns true if `value` is a finite number, else returns false + * @param {*} value - The value to test. + * @returns {boolean} + */ + isFinite: function(value) { + return (typeof value === 'number' || value instanceof Number) && isFinite(value); + }, + + /** + * Returns `value` if defined, else returns `defaultValue`. + * @param {*} value - The value to return if defined. + * @param {*} defaultValue - The value to return if `value` is undefined. + * @returns {*} + */ + valueOrDefault: function(value, defaultValue) { + return typeof value === 'undefined' ? defaultValue : value; + }, + + /** + * Returns value at the given `index` in array if defined, else returns `defaultValue`. + * @param {Array} value - The array to lookup for value at `index`. + * @param {number} index - The index in `value` to lookup for value. + * @param {*} defaultValue - The value to return if `value[index]` is undefined. + * @returns {*} + */ + valueAtIndexOrDefault: function(value, index, defaultValue) { + return helpers.valueOrDefault(helpers.isArray(value) ? value[index] : value, defaultValue); + }, + + /** + * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the + * value returned by `fn`. If `fn` is not a function, this method returns undefined. + * @param {function} fn - The function to call. + * @param {Array|undefined|null} args - The arguments with which `fn` should be called. + * @param {object} [thisArg] - The value of `this` provided for the call to `fn`. + * @returns {*} + */ + callback: function(fn, args, thisArg) { + if (fn && typeof fn.call === 'function') { + return fn.apply(thisArg, args); + } + }, + + /** + * Note(SB) for performance sake, this method should only be used when loopable type + * is unknown or in none intensive code (not called often and small loopable). Else + * it's preferable to use a regular for() loop and save extra function calls. + * @param {object|Array} loopable - The object or array to be iterated. + * @param {function} fn - The function to call for each item. + * @param {object} [thisArg] - The value of `this` provided for the call to `fn`. + * @param {boolean} [reverse] - If true, iterates backward on the loopable. + */ + each: function(loopable, fn, thisArg, reverse) { + var i, len, keys; + if (helpers.isArray(loopable)) { + len = loopable.length; + if (reverse) { + for (i = len - 1; i >= 0; i--) { + fn.call(thisArg, loopable[i], i); + } } else { - var k; - for (k in obj) { - if (obj.hasOwnProperty(k)) { - return false; - } - } - return true; - } - } - - function isUndefined(input) { - return input === void 0; - } - - function isNumber(input) { - return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]'; - } - - function isDate(input) { - return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]'; - } - - function map(arr, fn) { - var res = [], i; - for (i = 0; i < arr.length; ++i) { - res.push(fn(arr[i], i)); - } - return res; - } - - function hasOwnProp(a, b) { - return Object.prototype.hasOwnProperty.call(a, b); - } - - function extend(a, b) { - for (var i in b) { - if (hasOwnProp(b, i)) { - a[i] = b[i]; + for (i = 0; i < len; i++) { + fn.call(thisArg, loopable[i], i); } } - - if (hasOwnProp(b, 'toString')) { - a.toString = b.toString; - } - - if (hasOwnProp(b, 'valueOf')) { - a.valueOf = b.valueOf; - } - - return a; - } - - function createUTC (input, format, locale, strict) { - return createLocalOrUTC(input, format, locale, strict, true).utc(); - } - - function defaultParsingFlags() { - // We need to deep clone this object. - return { - empty : false, - unusedTokens : [], - unusedInput : [], - overflow : -2, - charsLeftOver : 0, - nullInput : false, - invalidMonth : null, - invalidFormat : false, - userInvalidated : false, - iso : false, - parsedDateParts : [], - meridiem : null, - rfc2822 : false, - weekdayMismatch : false - }; - } - - function getParsingFlags(m) { - if (m._pf == null) { - m._pf = defaultParsingFlags(); - } - return m._pf; - } - - var some; - if (Array.prototype.some) { - some = Array.prototype.some; - } else { - some = function (fun) { - var t = Object(this); - var len = t.length >>> 0; - - for (var i = 0; i < len; i++) { - if (i in t && fun.call(this, t[i], i, t)) { - return true; - } - } - - return false; - }; - } - - function isValid(m) { - if (m._isValid == null) { - var flags = getParsingFlags(m); - var parsedParts = some.call(flags.parsedDateParts, function (i) { - return i != null; - }); - var isNowValid = !isNaN(m._d.getTime()) && - flags.overflow < 0 && - !flags.empty && - !flags.invalidMonth && - !flags.invalidWeekday && - !flags.weekdayMismatch && - !flags.nullInput && - !flags.invalidFormat && - !flags.userInvalidated && - (!flags.meridiem || (flags.meridiem && parsedParts)); - - if (m._strict) { - isNowValid = isNowValid && - flags.charsLeftOver === 0 && - flags.unusedTokens.length === 0 && - flags.bigHour === undefined; - } - - if (Object.isFrozen == null || !Object.isFrozen(m)) { - m._isValid = isNowValid; - } - else { - return isNowValid; - } - } - return m._isValid; - } - - function createInvalid (flags) { - var m = createUTC(NaN); - if (flags != null) { - extend(getParsingFlags(m), flags); - } - else { - getParsingFlags(m).userInvalidated = true; - } - - return m; - } - -// Plugins that add properties should also add the key here (null value), -// so we can properly clone ourselves. - var momentProperties = hooks.momentProperties = []; - - function copyConfig(to, from) { - var i, prop, val; - - if (!isUndefined(from._isAMomentObject)) { - to._isAMomentObject = from._isAMomentObject; - } - if (!isUndefined(from._i)) { - to._i = from._i; - } - if (!isUndefined(from._f)) { - to._f = from._f; - } - if (!isUndefined(from._l)) { - to._l = from._l; - } - if (!isUndefined(from._strict)) { - to._strict = from._strict; - } - if (!isUndefined(from._tzm)) { - to._tzm = from._tzm; - } - if (!isUndefined(from._isUTC)) { - to._isUTC = from._isUTC; - } - if (!isUndefined(from._offset)) { - to._offset = from._offset; - } - if (!isUndefined(from._pf)) { - to._pf = getParsingFlags(from); - } - if (!isUndefined(from._locale)) { - to._locale = from._locale; - } - - if (momentProperties.length > 0) { - for (i = 0; i < momentProperties.length; i++) { - prop = momentProperties[i]; - val = from[prop]; - if (!isUndefined(val)) { - to[prop] = val; - } - } - } - - return to; - } - - var updateInProgress = false; - -// Moment prototype object - function Moment(config) { - copyConfig(this, config); - this._d = new Date(config._d != null ? config._d.getTime() : NaN); - if (!this.isValid()) { - this._d = new Date(NaN); - } - // Prevent infinite loop in case updateOffset creates new moment - // objects. - if (updateInProgress === false) { - updateInProgress = true; - hooks.updateOffset(this); - updateInProgress = false; - } - } - - function isMoment (obj) { - return obj instanceof Moment || (obj != null && obj._isAMomentObject != null); - } - - function absFloor (number) { - if (number < 0) { - // -0 -> 0 - return Math.ceil(number) || 0; - } else { - return Math.floor(number); - } - } - - function toInt(argumentForCoercion) { - var coercedNumber = +argumentForCoercion, - value = 0; - - if (coercedNumber !== 0 && isFinite(coercedNumber)) { - value = absFloor(coercedNumber); - } - - return value; - } - -// compare two arrays, return the number of differences - function compareArrays(array1, array2, dontConvert) { - var len = Math.min(array1.length, array2.length), - lengthDiff = Math.abs(array1.length - array2.length), - diffs = 0, - i; + } else if (helpers.isObject(loopable)) { + keys = Object.keys(loopable); + len = keys.length; for (i = 0; i < len; i++) { - if ((dontConvert && array1[i] !== array2[i]) || - (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { - diffs++; - } - } - return diffs + lengthDiff; - } - - function warn(msg) { - if (hooks.suppressDeprecationWarnings === false && - (typeof console !== 'undefined') && console.warn) { - console.warn('Deprecation warning: ' + msg); - } - } - - function deprecate(msg, fn) { - var firstTime = true; - - return extend(function () { - if (hooks.deprecationHandler != null) { - hooks.deprecationHandler(null, msg); - } - if (firstTime) { - var args = []; - var arg; - for (var i = 0; i < arguments.length; i++) { - arg = ''; - if (typeof arguments[i] === 'object') { - arg += '\n[' + i + '] '; - for (var key in arguments[0]) { - arg += key + ': ' + arguments[0][key] + ', '; - } - arg = arg.slice(0, -2); // Remove trailing comma and space - } else { - arg = arguments[i]; - } - args.push(arg); - } - warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack); - firstTime = false; - } - return fn.apply(this, arguments); - }, fn); - } - - var deprecations = {}; - - function deprecateSimple(name, msg) { - if (hooks.deprecationHandler != null) { - hooks.deprecationHandler(name, msg); - } - if (!deprecations[name]) { - warn(msg); - deprecations[name] = true; - } - } - - hooks.suppressDeprecationWarnings = false; - hooks.deprecationHandler = null; - - function isFunction(input) { - return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; - } - - function set (config) { - var prop, i; - for (i in config) { - prop = config[i]; - if (isFunction(prop)) { - this[i] = prop; - } else { - this['_' + i] = prop; - } - } - this._config = config; - // Lenient ordinal parsing accepts just a number in addition to - // number + (possibly) stuff coming from _dayOfMonthOrdinalParse. - // TODO: Remove "ordinalParse" fallback in next major release. - this._dayOfMonthOrdinalParseLenient = new RegExp( - (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + - '|' + (/\d{1,2}/).source); - } - - function mergeConfigs(parentConfig, childConfig) { - var res = extend({}, parentConfig), prop; - for (prop in childConfig) { - if (hasOwnProp(childConfig, prop)) { - if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { - res[prop] = {}; - extend(res[prop], parentConfig[prop]); - extend(res[prop], childConfig[prop]); - } else if (childConfig[prop] != null) { - res[prop] = childConfig[prop]; - } else { - delete res[prop]; - } - } - } - for (prop in parentConfig) { - if (hasOwnProp(parentConfig, prop) && - !hasOwnProp(childConfig, prop) && - isObject(parentConfig[prop])) { - // make sure changes to properties don't modify parent config - res[prop] = extend({}, res[prop]); - } - } - return res; - } - - function Locale(config) { - if (config != null) { - this.set(config); - } - } - - var keys; - - if (Object.keys) { - keys = Object.keys; - } else { - keys = function (obj) { - var i, res = []; - for (i in obj) { - if (hasOwnProp(obj, i)) { - res.push(i); - } - } - return res; - }; - } - - var defaultCalendar = { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }; - - function calendar (key, mom, now) { - var output = this._calendar[key] || this._calendar['sameElse']; - return isFunction(output) ? output.call(mom, now) : output; - } - - var defaultLongDateFormat = { - LTS : 'h:mm:ss A', - LT : 'h:mm A', - L : 'MM/DD/YYYY', - LL : 'MMMM D, YYYY', - LLL : 'MMMM D, YYYY h:mm A', - LLLL : 'dddd, MMMM D, YYYY h:mm A' - }; - - function longDateFormat (key) { - var format = this._longDateFormat[key], - formatUpper = this._longDateFormat[key.toUpperCase()]; - - if (format || !formatUpper) { - return format; - } - - this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) { - return val.slice(1); - }); - - return this._longDateFormat[key]; - } - - var defaultInvalidDate = 'Invalid date'; - - function invalidDate () { - return this._invalidDate; - } - - var defaultOrdinal = '%d'; - var defaultDayOfMonthOrdinalParse = /\d{1,2}/; - - function ordinal (number) { - return this._ordinal.replace('%d', number); - } - - var defaultRelativeTime = { - future : 'in %s', - past : '%s ago', - s : 'a few seconds', - ss : '%d seconds', - m : 'a minute', - mm : '%d minutes', - h : 'an hour', - hh : '%d hours', - d : 'a day', - dd : '%d days', - M : 'a month', - MM : '%d months', - y : 'a year', - yy : '%d years' - }; - - function relativeTime (number, withoutSuffix, string, isFuture) { - var output = this._relativeTime[string]; - return (isFunction(output)) ? - output(number, withoutSuffix, string, isFuture) : - output.replace(/%d/i, number); - } - - function pastFuture (diff, output) { - var format = this._relativeTime[diff > 0 ? 'future' : 'past']; - return isFunction(format) ? format(output) : format.replace(/%s/i, output); - } - - var aliases = {}; - - function addUnitAlias (unit, shorthand) { - var lowerCase = unit.toLowerCase(); - aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit; - } - - function normalizeUnits(units) { - return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined; - } - - function normalizeObjectUnits(inputObject) { - var normalizedInput = {}, - normalizedProp, - prop; - - for (prop in inputObject) { - if (hasOwnProp(inputObject, prop)) { - normalizedProp = normalizeUnits(prop); - if (normalizedProp) { - normalizedInput[normalizedProp] = inputObject[prop]; - } - } - } - - return normalizedInput; - } - - var priorities = {}; - - function addUnitPriority(unit, priority) { - priorities[unit] = priority; - } - - function getPrioritizedUnits(unitsObj) { - var units = []; - for (var u in unitsObj) { - units.push({unit: u, priority: priorities[u]}); - } - units.sort(function (a, b) { - return a.priority - b.priority; - }); - return units; - } - - function zeroFill(number, targetLength, forceSign) { - var absNumber = '' + Math.abs(number), - zerosToFill = targetLength - absNumber.length, - sign = number >= 0; - return (sign ? (forceSign ? '+' : '') : '-') + - Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; - } - - var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; - - var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; - - var formatFunctions = {}; - - var formatTokenFunctions = {}; - -// token: 'M' -// padded: ['MM', 2] -// ordinal: 'Mo' -// callback: function () { this.month() + 1 } - function addFormatToken (token, padded, ordinal, callback) { - var func = callback; - if (typeof callback === 'string') { - func = function () { - return this[callback](); - }; - } - if (token) { - formatTokenFunctions[token] = func; - } - if (padded) { - formatTokenFunctions[padded[0]] = function () { - return zeroFill(func.apply(this, arguments), padded[1], padded[2]); - }; - } - if (ordinal) { - formatTokenFunctions[ordinal] = function () { - return this.localeData().ordinal(func.apply(this, arguments), token); - }; - } - } - - function removeFormattingTokens(input) { - if (input.match(/\[[\s\S]/)) { - return input.replace(/^\[|\]$/g, ''); - } - return input.replace(/\\/g, ''); - } - - function makeFormatFunction(format) { - var array = format.match(formattingTokens), i, length; - - for (i = 0, length = array.length; i < length; i++) { - if (formatTokenFunctions[array[i]]) { - array[i] = formatTokenFunctions[array[i]]; - } else { - array[i] = removeFormattingTokens(array[i]); - } - } - - return function (mom) { - var output = '', i; - for (i = 0; i < length; i++) { - output += isFunction(array[i]) ? array[i].call(mom, format) : array[i]; - } - return output; - }; - } - -// format date using native date object - function formatMoment(m, format) { - if (!m.isValid()) { - return m.localeData().invalidDate(); - } - - format = expandFormat(format, m.localeData()); - formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); - - return formatFunctions[format](m); - } - - function expandFormat(format, locale) { - var i = 5; - - function replaceLongDateFormatTokens(input) { - return locale.longDateFormat(input) || input; - } - - localFormattingTokens.lastIndex = 0; - while (i >= 0 && localFormattingTokens.test(format)) { - format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); - localFormattingTokens.lastIndex = 0; - i -= 1; - } - - return format; - } - - var match1 = /\d/; // 0 - 9 - var match2 = /\d\d/; // 00 - 99 - var match3 = /\d{3}/; // 000 - 999 - var match4 = /\d{4}/; // 0000 - 9999 - var match6 = /[+-]?\d{6}/; // -999999 - 999999 - var match1to2 = /\d\d?/; // 0 - 99 - var match3to4 = /\d\d\d\d?/; // 999 - 9999 - var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999 - var match1to3 = /\d{1,3}/; // 0 - 999 - var match1to4 = /\d{1,4}/; // 0 - 9999 - var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999 - - var matchUnsigned = /\d+/; // 0 - inf - var matchSigned = /[+-]?\d+/; // -inf - inf - - var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z - var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z - - var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 - -// any word (or two) characters or numbers including two/three word month in arabic. -// includes scottish gaelic two word and hyphenated months - var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i; - - - var regexes = {}; - - function addRegexToken (token, regex, strictRegex) { - regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { - return (isStrict && strictRegex) ? strictRegex : regex; - }; - } - - function getParseRegexForToken (token, config) { - if (!hasOwnProp(regexes, token)) { - return new RegExp(unescapeFormat(token)); - } - - return regexes[token](config._strict, config._locale); - } - -// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript - function unescapeFormat(s) { - return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { - return p1 || p2 || p3 || p4; - })); - } - - function regexEscape(s) { - return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); - } - - var tokens = {}; - - function addParseToken (token, callback) { - var i, func = callback; - if (typeof token === 'string') { - token = [token]; - } - if (isNumber(callback)) { - func = function (input, array) { - array[callback] = toInt(input); - }; - } - for (i = 0; i < token.length; i++) { - tokens[token[i]] = func; - } - } - - function addWeekParseToken (token, callback) { - addParseToken(token, function (input, array, config, token) { - config._w = config._w || {}; - callback(input, config._w, config, token); - }); - } - - function addTimeToArrayFromToken(token, input, config) { - if (input != null && hasOwnProp(tokens, token)) { - tokens[token](input, config._a, config, token); - } - } - - var YEAR = 0; - var MONTH = 1; - var DATE = 2; - var HOUR = 3; - var MINUTE = 4; - var SECOND = 5; - var MILLISECOND = 6; - var WEEK = 7; - var WEEKDAY = 8; - -// FORMATTING - - addFormatToken('Y', 0, 0, function () { - var y = this.year(); - return y <= 9999 ? '' + y : '+' + y; - }); - - addFormatToken(0, ['YY', 2], 0, function () { - return this.year() % 100; - }); - - addFormatToken(0, ['YYYY', 4], 0, 'year'); - addFormatToken(0, ['YYYYY', 5], 0, 'year'); - addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); - -// ALIASES - - addUnitAlias('year', 'y'); - -// PRIORITIES - - addUnitPriority('year', 1); - -// PARSING - - addRegexToken('Y', matchSigned); - addRegexToken('YY', match1to2, match2); - addRegexToken('YYYY', match1to4, match4); - addRegexToken('YYYYY', match1to6, match6); - addRegexToken('YYYYYY', match1to6, match6); - - addParseToken(['YYYYY', 'YYYYYY'], YEAR); - addParseToken('YYYY', function (input, array) { - array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input); - }); - addParseToken('YY', function (input, array) { - array[YEAR] = hooks.parseTwoDigitYear(input); - }); - addParseToken('Y', function (input, array) { - array[YEAR] = parseInt(input, 10); - }); - -// HELPERS - - function daysInYear(year) { - return isLeapYear(year) ? 366 : 365; - } - - function isLeapYear(year) { - return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; - } - -// HOOKS - - hooks.parseTwoDigitYear = function (input) { - return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); - }; - -// MOMENTS - - var getSetYear = makeGetSet('FullYear', true); - - function getIsLeapYear () { - return isLeapYear(this.year()); - } - - function makeGetSet (unit, keepTime) { - return function (value) { - if (value != null) { - set$1(this, unit, value); - hooks.updateOffset(this, keepTime); - return this; - } else { - return get(this, unit); - } - }; - } - - function get (mom, unit) { - return mom.isValid() ? - mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; - } - - function set$1 (mom, unit, value) { - if (mom.isValid() && !isNaN(value)) { - if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) { - mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month())); - } - else { - mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); - } - } - } - -// MOMENTS - - function stringGet (units) { - units = normalizeUnits(units); - if (isFunction(this[units])) { - return this[units](); - } - return this; - } - - - function stringSet (units, value) { - if (typeof units === 'object') { - units = normalizeObjectUnits(units); - var prioritized = getPrioritizedUnits(units); - for (var i = 0; i < prioritized.length; i++) { - this[prioritized[i].unit](units[prioritized[i].unit]); - } - } else { - units = normalizeUnits(units); - if (isFunction(this[units])) { - return this[units](value); - } - } - return this; - } - - function mod(n, x) { - return ((n % x) + x) % x; - } - - var indexOf; - - if (Array.prototype.indexOf) { - indexOf = Array.prototype.indexOf; - } else { - indexOf = function (o) { - // I know - var i; - for (i = 0; i < this.length; ++i) { - if (this[i] === o) { - return i; - } - } - return -1; - }; - } - - function daysInMonth(year, month) { - if (isNaN(year) || isNaN(month)) { - return NaN; - } - var modMonth = mod(month, 12); - year += (month - modMonth) / 12; - return modMonth === 1 ? (isLeapYear(year) ? 29 : 28) : (31 - modMonth % 7 % 2); - } - -// FORMATTING - - addFormatToken('M', ['MM', 2], 'Mo', function () { - return this.month() + 1; - }); - - addFormatToken('MMM', 0, 0, function (format) { - return this.localeData().monthsShort(this, format); - }); - - addFormatToken('MMMM', 0, 0, function (format) { - return this.localeData().months(this, format); - }); - -// ALIASES - - addUnitAlias('month', 'M'); - -// PRIORITY - - addUnitPriority('month', 8); - -// PARSING - - addRegexToken('M', match1to2); - addRegexToken('MM', match1to2, match2); - addRegexToken('MMM', function (isStrict, locale) { - return locale.monthsShortRegex(isStrict); - }); - addRegexToken('MMMM', function (isStrict, locale) { - return locale.monthsRegex(isStrict); - }); - - addParseToken(['M', 'MM'], function (input, array) { - array[MONTH] = toInt(input) - 1; - }); - - addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { - var month = config._locale.monthsParse(input, token, config._strict); - // if we didn't find a month name, mark the date as invalid. - if (month != null) { - array[MONTH] = month; - } else { - getParsingFlags(config).invalidMonth = input; - } - }); - -// LOCALES - - var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/; - var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); - function localeMonths (m, format) { - if (!m) { - return isArray(this._months) ? this._months : - this._months['standalone']; - } - return isArray(this._months) ? this._months[m.month()] : - this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()]; - } - - var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); - function localeMonthsShort (m, format) { - if (!m) { - return isArray(this._monthsShort) ? this._monthsShort : - this._monthsShort['standalone']; - } - return isArray(this._monthsShort) ? this._monthsShort[m.month()] : - this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; - } - - function handleStrictParse(monthName, format, strict) { - var i, ii, mom, llc = monthName.toLocaleLowerCase(); - if (!this._monthsParse) { - // this is not used - this._monthsParse = []; - this._longMonthsParse = []; - this._shortMonthsParse = []; - for (i = 0; i < 12; ++i) { - mom = createUTC([2000, i]); - this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase(); - this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase(); - } - } - - if (strict) { - if (format === 'MMM') { - ii = indexOf.call(this._shortMonthsParse, llc); - return ii !== -1 ? ii : null; - } else { - ii = indexOf.call(this._longMonthsParse, llc); - return ii !== -1 ? ii : null; - } - } else { - if (format === 'MMM') { - ii = indexOf.call(this._shortMonthsParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._longMonthsParse, llc); - return ii !== -1 ? ii : null; - } else { - ii = indexOf.call(this._longMonthsParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._shortMonthsParse, llc); - return ii !== -1 ? ii : null; - } - } - } - - function localeMonthsParse (monthName, format, strict) { - var i, mom, regex; - - if (this._monthsParseExact) { - return handleStrictParse.call(this, monthName, format, strict); - } - - if (!this._monthsParse) { - this._monthsParse = []; - this._longMonthsParse = []; - this._shortMonthsParse = []; - } - - // TODO: add sorting - // Sorting makes sure if one month (or abbr) is a prefix of another - // see sorting in computeMonthsParse - for (i = 0; i < 12; i++) { - // make the regex if we don't have it already - mom = createUTC([2000, i]); - if (strict && !this._longMonthsParse[i]) { - this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i'); - this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i'); - } - if (!strict && !this._monthsParse[i]) { - regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); - this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); - } - // test the regex - if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) { - return i; - } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) { - return i; - } else if (!strict && this._monthsParse[i].test(monthName)) { - return i; - } - } - } - -// MOMENTS - - function setMonth (mom, value) { - var dayOfMonth; - - if (!mom.isValid()) { - // No op - return mom; - } - - if (typeof value === 'string') { - if (/^\d+$/.test(value)) { - value = toInt(value); - } else { - value = mom.localeData().monthsParse(value); - // TODO: Another silent failure? - if (!isNumber(value)) { - return mom; - } - } - } - - dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); - mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); - return mom; - } - - function getSetMonth (value) { - if (value != null) { - setMonth(this, value); - hooks.updateOffset(this, true); - return this; - } else { - return get(this, 'Month'); - } - } - - function getDaysInMonth () { - return daysInMonth(this.year(), this.month()); - } - - var defaultMonthsShortRegex = matchWord; - function monthsShortRegex (isStrict) { - if (this._monthsParseExact) { - if (!hasOwnProp(this, '_monthsRegex')) { - computeMonthsParse.call(this); - } - if (isStrict) { - return this._monthsShortStrictRegex; - } else { - return this._monthsShortRegex; - } - } else { - if (!hasOwnProp(this, '_monthsShortRegex')) { - this._monthsShortRegex = defaultMonthsShortRegex; - } - return this._monthsShortStrictRegex && isStrict ? - this._monthsShortStrictRegex : this._monthsShortRegex; - } - } - - var defaultMonthsRegex = matchWord; - function monthsRegex (isStrict) { - if (this._monthsParseExact) { - if (!hasOwnProp(this, '_monthsRegex')) { - computeMonthsParse.call(this); - } - if (isStrict) { - return this._monthsStrictRegex; - } else { - return this._monthsRegex; - } - } else { - if (!hasOwnProp(this, '_monthsRegex')) { - this._monthsRegex = defaultMonthsRegex; - } - return this._monthsStrictRegex && isStrict ? - this._monthsStrictRegex : this._monthsRegex; - } - } - - function computeMonthsParse () { - function cmpLenRev(a, b) { - return b.length - a.length; - } - - var shortPieces = [], longPieces = [], mixedPieces = [], - i, mom; - for (i = 0; i < 12; i++) { - // make the regex if we don't have it already - mom = createUTC([2000, i]); - shortPieces.push(this.monthsShort(mom, '')); - longPieces.push(this.months(mom, '')); - mixedPieces.push(this.months(mom, '')); - mixedPieces.push(this.monthsShort(mom, '')); - } - // Sorting makes sure if one month (or abbr) is a prefix of another it - // will match the longer piece. - shortPieces.sort(cmpLenRev); - longPieces.sort(cmpLenRev); - mixedPieces.sort(cmpLenRev); - for (i = 0; i < 12; i++) { - shortPieces[i] = regexEscape(shortPieces[i]); - longPieces[i] = regexEscape(longPieces[i]); - } - for (i = 0; i < 24; i++) { - mixedPieces[i] = regexEscape(mixedPieces[i]); - } - - this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); - this._monthsShortRegex = this._monthsRegex; - this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); - this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); - } - - function createDate (y, m, d, h, M, s, ms) { - // can't just apply() to create a date: - // https://stackoverflow.com/q/181348 - var date = new Date(y, m, d, h, M, s, ms); - - // the date constructor remaps years 0-99 to 1900-1999 - if (y < 100 && y >= 0 && isFinite(date.getFullYear())) { - date.setFullYear(y); - } - return date; - } - - function createUTCDate (y) { - var date = new Date(Date.UTC.apply(null, arguments)); - - // the Date.UTC function remaps years 0-99 to 1900-1999 - if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) { - date.setUTCFullYear(y); - } - return date; - } - -// start-of-first-week - start-of-year - function firstWeekOffset(year, dow, doy) { - var // first-week day -- which january is always in the first week (4 for iso, 1 for other) - fwd = 7 + dow - doy, - // first-week day local weekday -- which local weekday is fwd - fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; - - return -fwdlw + fwd - 1; - } - -// https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday - function dayOfYearFromWeeks(year, week, weekday, dow, doy) { - var localWeekday = (7 + weekday - dow) % 7, - weekOffset = firstWeekOffset(year, dow, doy), - dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, - resYear, resDayOfYear; - - if (dayOfYear <= 0) { - resYear = year - 1; - resDayOfYear = daysInYear(resYear) + dayOfYear; - } else if (dayOfYear > daysInYear(year)) { - resYear = year + 1; - resDayOfYear = dayOfYear - daysInYear(year); - } else { - resYear = year; - resDayOfYear = dayOfYear; - } - - return { - year: resYear, - dayOfYear: resDayOfYear - }; - } - - function weekOfYear(mom, dow, doy) { - var weekOffset = firstWeekOffset(mom.year(), dow, doy), - week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, - resWeek, resYear; - - if (week < 1) { - resYear = mom.year() - 1; - resWeek = week + weeksInYear(resYear, dow, doy); - } else if (week > weeksInYear(mom.year(), dow, doy)) { - resWeek = week - weeksInYear(mom.year(), dow, doy); - resYear = mom.year() + 1; - } else { - resYear = mom.year(); - resWeek = week; - } - - return { - week: resWeek, - year: resYear - }; - } - - function weeksInYear(year, dow, doy) { - var weekOffset = firstWeekOffset(year, dow, doy), - weekOffsetNext = firstWeekOffset(year + 1, dow, doy); - return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; - } - -// FORMATTING - - addFormatToken('w', ['ww', 2], 'wo', 'week'); - addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); - -// ALIASES - - addUnitAlias('week', 'w'); - addUnitAlias('isoWeek', 'W'); - -// PRIORITIES - - addUnitPriority('week', 5); - addUnitPriority('isoWeek', 5); - -// PARSING - - addRegexToken('w', match1to2); - addRegexToken('ww', match1to2, match2); - addRegexToken('W', match1to2); - addRegexToken('WW', match1to2, match2); - - addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { - week[token.substr(0, 1)] = toInt(input); - }); - -// HELPERS - -// LOCALES - - function localeWeek (mom) { - return weekOfYear(mom, this._week.dow, this._week.doy).week; - } - - var defaultLocaleWeek = { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - }; - - function localeFirstDayOfWeek () { - return this._week.dow; - } - - function localeFirstDayOfYear () { - return this._week.doy; - } - -// MOMENTS - - function getSetWeek (input) { - var week = this.localeData().week(this); - return input == null ? week : this.add((input - week) * 7, 'd'); - } - - function getSetISOWeek (input) { - var week = weekOfYear(this, 1, 4).week; - return input == null ? week : this.add((input - week) * 7, 'd'); - } - -// FORMATTING - - addFormatToken('d', 0, 'do', 'day'); - - addFormatToken('dd', 0, 0, function (format) { - return this.localeData().weekdaysMin(this, format); - }); - - addFormatToken('ddd', 0, 0, function (format) { - return this.localeData().weekdaysShort(this, format); - }); - - addFormatToken('dddd', 0, 0, function (format) { - return this.localeData().weekdays(this, format); - }); - - addFormatToken('e', 0, 0, 'weekday'); - addFormatToken('E', 0, 0, 'isoWeekday'); - -// ALIASES - - addUnitAlias('day', 'd'); - addUnitAlias('weekday', 'e'); - addUnitAlias('isoWeekday', 'E'); - -// PRIORITY - addUnitPriority('day', 11); - addUnitPriority('weekday', 11); - addUnitPriority('isoWeekday', 11); - -// PARSING - - addRegexToken('d', match1to2); - addRegexToken('e', match1to2); - addRegexToken('E', match1to2); - addRegexToken('dd', function (isStrict, locale) { - return locale.weekdaysMinRegex(isStrict); - }); - addRegexToken('ddd', function (isStrict, locale) { - return locale.weekdaysShortRegex(isStrict); - }); - addRegexToken('dddd', function (isStrict, locale) { - return locale.weekdaysRegex(isStrict); - }); - - addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { - var weekday = config._locale.weekdaysParse(input, token, config._strict); - // if we didn't get a weekday name, mark the date as invalid - if (weekday != null) { - week.d = weekday; - } else { - getParsingFlags(config).invalidWeekday = input; - } - }); - - addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { - week[token] = toInt(input); - }); - -// HELPERS - - function parseWeekday(input, locale) { - if (typeof input !== 'string') { - return input; - } - - if (!isNaN(input)) { - return parseInt(input, 10); - } - - input = locale.weekdaysParse(input); - if (typeof input === 'number') { - return input; - } - - return null; - } - - function parseIsoWeekday(input, locale) { - if (typeof input === 'string') { - return locale.weekdaysParse(input) % 7 || 7; - } - return isNaN(input) ? null : input; - } - -// LOCALES - - var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); - function localeWeekdays (m, format) { - if (!m) { - return isArray(this._weekdays) ? this._weekdays : - this._weekdays['standalone']; - } - return isArray(this._weekdays) ? this._weekdays[m.day()] : - this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()]; - } - - var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); - function localeWeekdaysShort (m) { - return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort; - } - - var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'); - function localeWeekdaysMin (m) { - return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin; - } - - function handleStrictParse$1(weekdayName, format, strict) { - var i, ii, mom, llc = weekdayName.toLocaleLowerCase(); - if (!this._weekdaysParse) { - this._weekdaysParse = []; - this._shortWeekdaysParse = []; - this._minWeekdaysParse = []; - - for (i = 0; i < 7; ++i) { - mom = createUTC([2000, 1]).day(i); - this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase(); - this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase(); - this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase(); - } - } - - if (strict) { - if (format === 'dddd') { - ii = indexOf.call(this._weekdaysParse, llc); - return ii !== -1 ? ii : null; - } else if (format === 'ddd') { - ii = indexOf.call(this._shortWeekdaysParse, llc); - return ii !== -1 ? ii : null; - } else { - ii = indexOf.call(this._minWeekdaysParse, llc); - return ii !== -1 ? ii : null; - } - } else { - if (format === 'dddd') { - ii = indexOf.call(this._weekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._shortWeekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._minWeekdaysParse, llc); - return ii !== -1 ? ii : null; - } else if (format === 'ddd') { - ii = indexOf.call(this._shortWeekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._weekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._minWeekdaysParse, llc); - return ii !== -1 ? ii : null; - } else { - ii = indexOf.call(this._minWeekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._weekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._shortWeekdaysParse, llc); - return ii !== -1 ? ii : null; - } - } - } - - function localeWeekdaysParse (weekdayName, format, strict) { - var i, mom, regex; - - if (this._weekdaysParseExact) { - return handleStrictParse$1.call(this, weekdayName, format, strict); - } - - if (!this._weekdaysParse) { - this._weekdaysParse = []; - this._minWeekdaysParse = []; - this._shortWeekdaysParse = []; - this._fullWeekdaysParse = []; - } - - for (i = 0; i < 7; i++) { - // make the regex if we don't have it already - - mom = createUTC([2000, 1]).day(i); - if (strict && !this._fullWeekdaysParse[i]) { - this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i'); - this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i'); - this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i'); - } - if (!this._weekdaysParse[i]) { - regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); - this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); - } - // test the regex - if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) { - return i; - } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) { - return i; - } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) { - return i; - } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { - return i; - } - } - } - -// MOMENTS - - function getSetDayOfWeek (input) { - if (!this.isValid()) { - return input != null ? this : NaN; - } - var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); - if (input != null) { - input = parseWeekday(input, this.localeData()); - return this.add(input - day, 'd'); - } else { - return day; - } - } - - function getSetLocaleDayOfWeek (input) { - if (!this.isValid()) { - return input != null ? this : NaN; - } - var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; - return input == null ? weekday : this.add(input - weekday, 'd'); - } - - function getSetISODayOfWeek (input) { - if (!this.isValid()) { - return input != null ? this : NaN; - } - - // behaves the same as moment#day except - // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) - // as a setter, sunday should belong to the previous week. - - if (input != null) { - var weekday = parseIsoWeekday(input, this.localeData()); - return this.day(this.day() % 7 ? weekday : weekday - 7); - } else { - return this.day() || 7; - } - } - - var defaultWeekdaysRegex = matchWord; - function weekdaysRegex (isStrict) { - if (this._weekdaysParseExact) { - if (!hasOwnProp(this, '_weekdaysRegex')) { - computeWeekdaysParse.call(this); - } - if (isStrict) { - return this._weekdaysStrictRegex; - } else { - return this._weekdaysRegex; - } - } else { - if (!hasOwnProp(this, '_weekdaysRegex')) { - this._weekdaysRegex = defaultWeekdaysRegex; - } - return this._weekdaysStrictRegex && isStrict ? - this._weekdaysStrictRegex : this._weekdaysRegex; - } - } - - var defaultWeekdaysShortRegex = matchWord; - function weekdaysShortRegex (isStrict) { - if (this._weekdaysParseExact) { - if (!hasOwnProp(this, '_weekdaysRegex')) { - computeWeekdaysParse.call(this); - } - if (isStrict) { - return this._weekdaysShortStrictRegex; - } else { - return this._weekdaysShortRegex; - } - } else { - if (!hasOwnProp(this, '_weekdaysShortRegex')) { - this._weekdaysShortRegex = defaultWeekdaysShortRegex; - } - return this._weekdaysShortStrictRegex && isStrict ? - this._weekdaysShortStrictRegex : this._weekdaysShortRegex; - } - } - - var defaultWeekdaysMinRegex = matchWord; - function weekdaysMinRegex (isStrict) { - if (this._weekdaysParseExact) { - if (!hasOwnProp(this, '_weekdaysRegex')) { - computeWeekdaysParse.call(this); - } - if (isStrict) { - return this._weekdaysMinStrictRegex; - } else { - return this._weekdaysMinRegex; - } - } else { - if (!hasOwnProp(this, '_weekdaysMinRegex')) { - this._weekdaysMinRegex = defaultWeekdaysMinRegex; - } - return this._weekdaysMinStrictRegex && isStrict ? - this._weekdaysMinStrictRegex : this._weekdaysMinRegex; - } - } - - - function computeWeekdaysParse () { - function cmpLenRev(a, b) { - return b.length - a.length; - } - - var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], - i, mom, minp, shortp, longp; - for (i = 0; i < 7; i++) { - // make the regex if we don't have it already - mom = createUTC([2000, 1]).day(i); - minp = this.weekdaysMin(mom, ''); - shortp = this.weekdaysShort(mom, ''); - longp = this.weekdays(mom, ''); - minPieces.push(minp); - shortPieces.push(shortp); - longPieces.push(longp); - mixedPieces.push(minp); - mixedPieces.push(shortp); - mixedPieces.push(longp); - } - // Sorting makes sure if one weekday (or abbr) is a prefix of another it - // will match the longer piece. - minPieces.sort(cmpLenRev); - shortPieces.sort(cmpLenRev); - longPieces.sort(cmpLenRev); - mixedPieces.sort(cmpLenRev); - for (i = 0; i < 7; i++) { - shortPieces[i] = regexEscape(shortPieces[i]); - longPieces[i] = regexEscape(longPieces[i]); - mixedPieces[i] = regexEscape(mixedPieces[i]); - } - - this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); - this._weekdaysShortRegex = this._weekdaysRegex; - this._weekdaysMinRegex = this._weekdaysRegex; - - this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); - this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); - this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i'); - } - -// FORMATTING - - function hFormat() { - return this.hours() % 12 || 12; - } - - function kFormat() { - return this.hours() || 24; - } - - addFormatToken('H', ['HH', 2], 0, 'hour'); - addFormatToken('h', ['hh', 2], 0, hFormat); - addFormatToken('k', ['kk', 2], 0, kFormat); - - addFormatToken('hmm', 0, 0, function () { - return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); - }); - - addFormatToken('hmmss', 0, 0, function () { - return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + - zeroFill(this.seconds(), 2); - }); - - addFormatToken('Hmm', 0, 0, function () { - return '' + this.hours() + zeroFill(this.minutes(), 2); - }); - - addFormatToken('Hmmss', 0, 0, function () { - return '' + this.hours() + zeroFill(this.minutes(), 2) + - zeroFill(this.seconds(), 2); - }); - - function meridiem (token, lowercase) { - addFormatToken(token, 0, 0, function () { - return this.localeData().meridiem(this.hours(), this.minutes(), lowercase); - }); - } - - meridiem('a', true); - meridiem('A', false); - -// ALIASES - - addUnitAlias('hour', 'h'); - -// PRIORITY - addUnitPriority('hour', 13); - -// PARSING - - function matchMeridiem (isStrict, locale) { - return locale._meridiemParse; - } - - addRegexToken('a', matchMeridiem); - addRegexToken('A', matchMeridiem); - addRegexToken('H', match1to2); - addRegexToken('h', match1to2); - addRegexToken('k', match1to2); - addRegexToken('HH', match1to2, match2); - addRegexToken('hh', match1to2, match2); - addRegexToken('kk', match1to2, match2); - - addRegexToken('hmm', match3to4); - addRegexToken('hmmss', match5to6); - addRegexToken('Hmm', match3to4); - addRegexToken('Hmmss', match5to6); - - addParseToken(['H', 'HH'], HOUR); - addParseToken(['k', 'kk'], function (input, array, config) { - var kInput = toInt(input); - array[HOUR] = kInput === 24 ? 0 : kInput; - }); - addParseToken(['a', 'A'], function (input, array, config) { - config._isPm = config._locale.isPM(input); - config._meridiem = input; - }); - addParseToken(['h', 'hh'], function (input, array, config) { - array[HOUR] = toInt(input); - getParsingFlags(config).bigHour = true; - }); - addParseToken('hmm', function (input, array, config) { - var pos = input.length - 2; - array[HOUR] = toInt(input.substr(0, pos)); - array[MINUTE] = toInt(input.substr(pos)); - getParsingFlags(config).bigHour = true; - }); - addParseToken('hmmss', function (input, array, config) { - var pos1 = input.length - 4; - var pos2 = input.length - 2; - array[HOUR] = toInt(input.substr(0, pos1)); - array[MINUTE] = toInt(input.substr(pos1, 2)); - array[SECOND] = toInt(input.substr(pos2)); - getParsingFlags(config).bigHour = true; - }); - addParseToken('Hmm', function (input, array, config) { - var pos = input.length - 2; - array[HOUR] = toInt(input.substr(0, pos)); - array[MINUTE] = toInt(input.substr(pos)); - }); - addParseToken('Hmmss', function (input, array, config) { - var pos1 = input.length - 4; - var pos2 = input.length - 2; - array[HOUR] = toInt(input.substr(0, pos1)); - array[MINUTE] = toInt(input.substr(pos1, 2)); - array[SECOND] = toInt(input.substr(pos2)); - }); - -// LOCALES - - function localeIsPM (input) { - // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays - // Using charAt should be more compatible. - return ((input + '').toLowerCase().charAt(0) === 'p'); - } - - var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i; - function localeMeridiem (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'pm' : 'PM'; - } else { - return isLower ? 'am' : 'AM'; - } - } - - -// MOMENTS - -// Setting the hour should keep the time, because the user explicitly -// specified which hour he wants. So trying to maintain the same hour (in -// a new timezone) makes sense. Adding/subtracting hours does not follow -// this rule. - var getSetHour = makeGetSet('Hours', true); - -// months -// week -// weekdays -// meridiem - var baseConfig = { - calendar: defaultCalendar, - longDateFormat: defaultLongDateFormat, - invalidDate: defaultInvalidDate, - ordinal: defaultOrdinal, - dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse, - relativeTime: defaultRelativeTime, - - months: defaultLocaleMonths, - monthsShort: defaultLocaleMonthsShort, - - week: defaultLocaleWeek, - - weekdays: defaultLocaleWeekdays, - weekdaysMin: defaultLocaleWeekdaysMin, - weekdaysShort: defaultLocaleWeekdaysShort, - - meridiemParse: defaultLocaleMeridiemParse - }; - -// internal storage for locale config files - var locales = {}; - var localeFamilies = {}; - var globalLocale; - - function normalizeLocale(key) { - return key ? key.toLowerCase().replace('_', '-') : key; - } - -// pick the locale from the array -// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each -// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root - function chooseLocale(names) { - var i = 0, j, next, locale, split; - - while (i < names.length) { - split = normalizeLocale(names[i]).split('-'); - j = split.length; - next = normalizeLocale(names[i + 1]); - next = next ? next.split('-') : null; - while (j > 0) { - locale = loadLocale(split.slice(0, j).join('-')); - if (locale) { - return locale; - } - if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { - //the next array item is better than a shallower substring of this one - break; - } - j--; - } - i++; - } - return null; - } - - function loadLocale(name) { - var oldLocale = null; - // TODO: Find a better way to register and load all the locales in Node - if (!locales[name] && (typeof module !== 'undefined') && - module && module.exports) { - try { - oldLocale = globalLocale._abbr; - var aliasedRequire = require; - aliasedRequire('./locale/' + name); - getSetGlobalLocale(oldLocale); - } catch (e) {} - } - return locales[name]; - } - -// This function will load locale and then set the global locale. If -// no arguments are passed in, it will simply return the current global -// locale key. - function getSetGlobalLocale (key, values) { - var data; - if (key) { - if (isUndefined(values)) { - data = getLocale(key); - } - else { - data = defineLocale(key, values); - } - - if (data) { - // moment.duration._locale = moment._locale = data; - globalLocale = data; - } - } - - return globalLocale._abbr; - } - - function defineLocale (name, config) { - if (config !== null) { - var parentConfig = baseConfig; - config.abbr = name; - if (locales[name] != null) { - deprecateSimple('defineLocaleOverride', - 'use moment.updateLocale(localeName, config) to change ' + - 'an existing locale. moment.defineLocale(localeName, ' + - 'config) should only be used for creating a new locale ' + - 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'); - parentConfig = locales[name]._config; - } else if (config.parentLocale != null) { - if (locales[config.parentLocale] != null) { - parentConfig = locales[config.parentLocale]._config; - } else { - if (!localeFamilies[config.parentLocale]) { - localeFamilies[config.parentLocale] = []; - } - localeFamilies[config.parentLocale].push({ - name: name, - config: config - }); - return null; - } - } - locales[name] = new Locale(mergeConfigs(parentConfig, config)); - - if (localeFamilies[name]) { - localeFamilies[name].forEach(function (x) { - defineLocale(x.name, x.config); - }); - } - - // backwards compat for now: also set the locale - // make sure we set the locale AFTER all child locales have been - // created, so we won't end up with the child locale set. - getSetGlobalLocale(name); - - - return locales[name]; - } else { - // useful for testing - delete locales[name]; - return null; - } - } - - function updateLocale(name, config) { - if (config != null) { - var locale, tmpLocale, parentConfig = baseConfig; - // MERGE - tmpLocale = loadLocale(name); - if (tmpLocale != null) { - parentConfig = tmpLocale._config; - } - config = mergeConfigs(parentConfig, config); - locale = new Locale(config); - locale.parentLocale = locales[name]; - locales[name] = locale; - - // backwards compat for now: also set the locale - getSetGlobalLocale(name); - } else { - // pass null for config to unupdate, useful for tests - if (locales[name] != null) { - if (locales[name].parentLocale != null) { - locales[name] = locales[name].parentLocale; - } else if (locales[name] != null) { - delete locales[name]; - } - } - } - return locales[name]; - } - -// returns locale data - function getLocale (key) { - var locale; - - if (key && key._locale && key._locale._abbr) { - key = key._locale._abbr; - } - - if (!key) { - return globalLocale; - } - - if (!isArray(key)) { - //short-circuit everything else - locale = loadLocale(key); - if (locale) { - return locale; - } - key = [key]; - } - - return chooseLocale(key); - } - - function listLocales() { - return keys(locales); - } - - function checkOverflow (m) { - var overflow; - var a = m._a; - - if (a && getParsingFlags(m).overflow === -2) { - overflow = - a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : - a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : - a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR : - a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : - a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : - a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : - -1; - - if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { - overflow = DATE; - } - if (getParsingFlags(m)._overflowWeeks && overflow === -1) { - overflow = WEEK; - } - if (getParsingFlags(m)._overflowWeekday && overflow === -1) { - overflow = WEEKDAY; - } - - getParsingFlags(m).overflow = overflow; - } - - return m; - } - -// Pick the first defined of two or three arguments. - function defaults(a, b, c) { - if (a != null) { - return a; - } - if (b != null) { - return b; - } - return c; - } - - function currentDateArray(config) { - // hooks is actually the exported moment object - var nowValue = new Date(hooks.now()); - if (config._useUTC) { - return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()]; - } - return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; - } - -// convert an array to a date. -// the array should mirror the parameters below -// note: all values past the year are optional and will default to the lowest possible value. -// [year, month, day , hour, minute, second, millisecond] - function configFromArray (config) { - var i, date, input = [], currentDate, expectedWeekday, yearToUse; - - if (config._d) { - return; - } - - currentDate = currentDateArray(config); - - //compute day of the year from weeks and weekdays - if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { - dayOfYearFromWeekInfo(config); - } - - //if the day of the year is set, figure out what it is - if (config._dayOfYear != null) { - yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); - - if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) { - getParsingFlags(config)._overflowDayOfYear = true; - } - - date = createUTCDate(yearToUse, 0, config._dayOfYear); - config._a[MONTH] = date.getUTCMonth(); - config._a[DATE] = date.getUTCDate(); - } - - // Default to current date. - // * if no year, month, day of month are given, default to today - // * if day of month is given, default month and year - // * if month is given, default only year - // * if year is given, don't default anything - for (i = 0; i < 3 && config._a[i] == null; ++i) { - config._a[i] = input[i] = currentDate[i]; - } - - // Zero out whatever was not defaulted, including time - for (; i < 7; i++) { - config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; - } - - // Check for 24:00:00.000 - if (config._a[HOUR] === 24 && - config._a[MINUTE] === 0 && - config._a[SECOND] === 0 && - config._a[MILLISECOND] === 0) { - config._nextDay = true; - config._a[HOUR] = 0; - } - - config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input); - expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); - - // Apply timezone offset from input. The actual utcOffset can be changed - // with parseZone. - if (config._tzm != null) { - config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); - } - - if (config._nextDay) { - config._a[HOUR] = 24; - } - - // check for mismatching day of week - if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) { - getParsingFlags(config).weekdayMismatch = true; - } - } - - function dayOfYearFromWeekInfo(config) { - var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow; - - w = config._w; - if (w.GG != null || w.W != null || w.E != null) { - dow = 1; - doy = 4; - - // TODO: We need to take the current isoWeekYear, but that depends on - // how we interpret now (local, utc, fixed offset). So create - // a now version of current config (take local/utc/offset flags, and - // create now). - weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year); - week = defaults(w.W, 1); - weekday = defaults(w.E, 1); - if (weekday < 1 || weekday > 7) { - weekdayOverflow = true; - } - } else { - dow = config._locale._week.dow; - doy = config._locale._week.doy; - - var curWeek = weekOfYear(createLocal(), dow, doy); - - weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); - - // Default to current week. - week = defaults(w.w, curWeek.week); - - if (w.d != null) { - // weekday -- low day numbers are considered next week - weekday = w.d; - if (weekday < 0 || weekday > 6) { - weekdayOverflow = true; - } - } else if (w.e != null) { - // local weekday -- counting starts from begining of week - weekday = w.e + dow; - if (w.e < 0 || w.e > 6) { - weekdayOverflow = true; - } - } else { - // default to begining of week - weekday = dow; - } - } - if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { - getParsingFlags(config)._overflowWeeks = true; - } else if (weekdayOverflow != null) { - getParsingFlags(config)._overflowWeekday = true; - } else { - temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); - config._a[YEAR] = temp.year; - config._dayOfYear = temp.dayOfYear; - } - } - -// iso 8601 regex -// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) - var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; - var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; - - var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/; - - var isoDates = [ - ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], - ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], - ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], - ['GGGG-[W]WW', /\d{4}-W\d\d/, false], - ['YYYY-DDD', /\d{4}-\d{3}/], - ['YYYY-MM', /\d{4}-\d\d/, false], - ['YYYYYYMMDD', /[+-]\d{10}/], - ['YYYYMMDD', /\d{8}/], - // YYYYMM is NOT allowed by the standard - ['GGGG[W]WWE', /\d{4}W\d{3}/], - ['GGGG[W]WW', /\d{4}W\d{2}/, false], - ['YYYYDDD', /\d{7}/] - ]; - -// iso time formats and regexes - var isoTimes = [ - ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], - ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], - ['HH:mm:ss', /\d\d:\d\d:\d\d/], - ['HH:mm', /\d\d:\d\d/], - ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], - ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], - ['HHmmss', /\d\d\d\d\d\d/], - ['HHmm', /\d\d\d\d/], - ['HH', /\d\d/] - ]; - - var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; - -// date from iso format - function configFromISO(config) { - var i, l, - string = config._i, - match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), - allowTime, dateFormat, timeFormat, tzFormat; - - if (match) { - getParsingFlags(config).iso = true; - - for (i = 0, l = isoDates.length; i < l; i++) { - if (isoDates[i][1].exec(match[1])) { - dateFormat = isoDates[i][0]; - allowTime = isoDates[i][2] !== false; - break; - } - } - if (dateFormat == null) { - config._isValid = false; - return; - } - if (match[3]) { - for (i = 0, l = isoTimes.length; i < l; i++) { - if (isoTimes[i][1].exec(match[3])) { - // match[2] should be 'T' or space - timeFormat = (match[2] || ' ') + isoTimes[i][0]; - break; - } - } - if (timeFormat == null) { - config._isValid = false; - return; - } - } - if (!allowTime && timeFormat != null) { - config._isValid = false; - return; - } - if (match[4]) { - if (tzRegex.exec(match[4])) { - tzFormat = 'Z'; - } else { - config._isValid = false; - return; - } - } - config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); - configFromStringAndFormat(config); - } else { - config._isValid = false; - } - } - -// RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3 - var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/; - - function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { - var result = [ - untruncateYear(yearStr), - defaultLocaleMonthsShort.indexOf(monthStr), - parseInt(dayStr, 10), - parseInt(hourStr, 10), - parseInt(minuteStr, 10) - ]; - - if (secondStr) { - result.push(parseInt(secondStr, 10)); - } - - return result; - } - - function untruncateYear(yearStr) { - var year = parseInt(yearStr, 10); - if (year <= 49) { - return 2000 + year; - } else if (year <= 999) { - return 1900 + year; - } - return year; - } - - function preprocessRFC2822(s) { - // Remove comments and folding whitespace and replace multiple-spaces with a single space - return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').trim(); - } - - function checkWeekday(weekdayStr, parsedInput, config) { - if (weekdayStr) { - // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check. - var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), - weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay(); - if (weekdayProvided !== weekdayActual) { - getParsingFlags(config).weekdayMismatch = true; - config._isValid = false; - return false; - } - } - return true; - } - - var obsOffsets = { - UT: 0, - GMT: 0, - EDT: -4 * 60, - EST: -5 * 60, - CDT: -5 * 60, - CST: -6 * 60, - MDT: -6 * 60, - MST: -7 * 60, - PDT: -7 * 60, - PST: -8 * 60 - }; - - function calculateOffset(obsOffset, militaryOffset, numOffset) { - if (obsOffset) { - return obsOffsets[obsOffset]; - } else if (militaryOffset) { - // the only allowed military tz is Z - return 0; - } else { - var hm = parseInt(numOffset, 10); - var m = hm % 100, h = (hm - m) / 100; - return h * 60 + m; - } - } - -// date and time from ref 2822 format - function configFromRFC2822(config) { - var match = rfc2822.exec(preprocessRFC2822(config._i)); - if (match) { - var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]); - if (!checkWeekday(match[1], parsedArray, config)) { - return; - } - - config._a = parsedArray; - config._tzm = calculateOffset(match[8], match[9], match[10]); - - config._d = createUTCDate.apply(null, config._a); - config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); - - getParsingFlags(config).rfc2822 = true; - } else { - config._isValid = false; - } - } - -// date from iso format or fallback - function configFromString(config) { - var matched = aspNetJsonRegex.exec(config._i); - - if (matched !== null) { - config._d = new Date(+matched[1]); - return; - } - - configFromISO(config); - if (config._isValid === false) { - delete config._isValid; - } else { - return; - } - - configFromRFC2822(config); - if (config._isValid === false) { - delete config._isValid; - } else { - return; - } - - // Final attempt, use Input Fallback - hooks.createFromInputFallback(config); - } - - hooks.createFromInputFallback = deprecate( - 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + - 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + - 'discouraged and will be removed in an upcoming major release. Please refer to ' + - 'http://momentjs.com/guides/#/warnings/js-date/ for more info.', - function (config) { - config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); - } - ); - -// constant that refers to the ISO standard - hooks.ISO_8601 = function () {}; - -// constant that refers to the RFC 2822 form - hooks.RFC_2822 = function () {}; - -// date from string and format string - function configFromStringAndFormat(config) { - // TODO: Move this to another part of the creation flow to prevent circular deps - if (config._f === hooks.ISO_8601) { - configFromISO(config); - return; - } - if (config._f === hooks.RFC_2822) { - configFromRFC2822(config); - return; - } - config._a = []; - getParsingFlags(config).empty = true; - - // This array is used to make a Date, either with `new Date` or `Date.UTC` - var string = '' + config._i, - i, parsedInput, tokens, token, skipped, - stringLength = string.length, - totalParsedInputLength = 0; - - tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; - - for (i = 0; i < tokens.length; i++) { - token = tokens[i]; - parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; - // console.log('token', token, 'parsedInput', parsedInput, - // 'regex', getParseRegexForToken(token, config)); - if (parsedInput) { - skipped = string.substr(0, string.indexOf(parsedInput)); - if (skipped.length > 0) { - getParsingFlags(config).unusedInput.push(skipped); - } - string = string.slice(string.indexOf(parsedInput) + parsedInput.length); - totalParsedInputLength += parsedInput.length; - } - // don't parse if it's not a known token - if (formatTokenFunctions[token]) { - if (parsedInput) { - getParsingFlags(config).empty = false; - } - else { - getParsingFlags(config).unusedTokens.push(token); - } - addTimeToArrayFromToken(token, parsedInput, config); - } - else if (config._strict && !parsedInput) { - getParsingFlags(config).unusedTokens.push(token); - } - } - - // add remaining unparsed input length to the string - getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; - if (string.length > 0) { - getParsingFlags(config).unusedInput.push(string); - } - - // clear _12h flag if hour is <= 12 - if (config._a[HOUR] <= 12 && - getParsingFlags(config).bigHour === true && - config._a[HOUR] > 0) { - getParsingFlags(config).bigHour = undefined; - } - - getParsingFlags(config).parsedDateParts = config._a.slice(0); - getParsingFlags(config).meridiem = config._meridiem; - // handle meridiem - config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem); - - configFromArray(config); - checkOverflow(config); - } - - - function meridiemFixWrap (locale, hour, meridiem) { - var isPm; - - if (meridiem == null) { - // nothing to do - return hour; - } - if (locale.meridiemHour != null) { - return locale.meridiemHour(hour, meridiem); - } else if (locale.isPM != null) { - // Fallback - isPm = locale.isPM(meridiem); - if (isPm && hour < 12) { - hour += 12; - } - if (!isPm && hour === 12) { - hour = 0; - } - return hour; - } else { - // this is not supposed to happen - return hour; - } - } - -// date from string and array of format strings - function configFromStringAndArray(config) { - var tempConfig, - bestMoment, - - scoreToBeat, - i, - currentScore; - - if (config._f.length === 0) { - getParsingFlags(config).invalidFormat = true; - config._d = new Date(NaN); - return; - } - - for (i = 0; i < config._f.length; i++) { - currentScore = 0; - tempConfig = copyConfig({}, config); - if (config._useUTC != null) { - tempConfig._useUTC = config._useUTC; - } - tempConfig._f = config._f[i]; - configFromStringAndFormat(tempConfig); - - if (!isValid(tempConfig)) { - continue; - } - - // if there is any input that was not parsed add a penalty for that format - currentScore += getParsingFlags(tempConfig).charsLeftOver; - - //or tokens - currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; - - getParsingFlags(tempConfig).score = currentScore; - - if (scoreToBeat == null || currentScore < scoreToBeat) { - scoreToBeat = currentScore; - bestMoment = tempConfig; - } - } - - extend(config, bestMoment || tempConfig); - } - - function configFromObject(config) { - if (config._d) { - return; - } - - var i = normalizeObjectUnits(config._i); - config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) { - return obj && parseInt(obj, 10); - }); - - configFromArray(config); - } - - function createFromConfig (config) { - var res = new Moment(checkOverflow(prepareConfig(config))); - if (res._nextDay) { - // Adding is smart enough around DST - res.add(1, 'd'); - res._nextDay = undefined; - } - - return res; - } - - function prepareConfig (config) { - var input = config._i, - format = config._f; - - config._locale = config._locale || getLocale(config._l); - - if (input === null || (format === undefined && input === '')) { - return createInvalid({nullInput: true}); - } - - if (typeof input === 'string') { - config._i = input = config._locale.preparse(input); - } - - if (isMoment(input)) { - return new Moment(checkOverflow(input)); - } else if (isDate(input)) { - config._d = input; - } else if (isArray(format)) { - configFromStringAndArray(config); - } else if (format) { - configFromStringAndFormat(config); - } else { - configFromInput(config); - } - - if (!isValid(config)) { - config._d = null; - } - - return config; - } - - function configFromInput(config) { - var input = config._i; - if (isUndefined(input)) { - config._d = new Date(hooks.now()); - } else if (isDate(input)) { - config._d = new Date(input.valueOf()); - } else if (typeof input === 'string') { - configFromString(config); - } else if (isArray(input)) { - config._a = map(input.slice(0), function (obj) { - return parseInt(obj, 10); - }); - configFromArray(config); - } else if (isObject(input)) { - configFromObject(config); - } else if (isNumber(input)) { - // from milliseconds - config._d = new Date(input); - } else { - hooks.createFromInputFallback(config); - } - } - - function createLocalOrUTC (input, format, locale, strict, isUTC) { - var c = {}; - - if (locale === true || locale === false) { - strict = locale; - locale = undefined; - } - - if ((isObject(input) && isObjectEmpty(input)) || - (isArray(input) && input.length === 0)) { - input = undefined; - } - // object construction must be done this way. - // https://github.com/moment/moment/issues/1423 - c._isAMomentObject = true; - c._useUTC = c._isUTC = isUTC; - c._l = locale; - c._i = input; - c._f = format; - c._strict = strict; - - return createFromConfig(c); - } - - function createLocal (input, format, locale, strict) { - return createLocalOrUTC(input, format, locale, strict, false); - } - - var prototypeMin = deprecate( - 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', - function () { - var other = createLocal.apply(null, arguments); - if (this.isValid() && other.isValid()) { - return other < this ? this : other; - } else { - return createInvalid(); - } - } - ); - - var prototypeMax = deprecate( - 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', - function () { - var other = createLocal.apply(null, arguments); - if (this.isValid() && other.isValid()) { - return other > this ? this : other; - } else { - return createInvalid(); - } - } - ); - -// Pick a moment m from moments so that m[fn](other) is true for all -// other. This relies on the function fn to be transitive. -// -// moments should either be an array of moment objects or an array, whose -// first element is an array of moment objects. - function pickBy(fn, moments) { - var res, i; - if (moments.length === 1 && isArray(moments[0])) { - moments = moments[0]; - } - if (!moments.length) { - return createLocal(); - } - res = moments[0]; - for (i = 1; i < moments.length; ++i) { - if (!moments[i].isValid() || moments[i][fn](res)) { - res = moments[i]; - } - } - return res; - } - -// TODO: Use [].sort instead? - function min () { - var args = [].slice.call(arguments, 0); - - return pickBy('isBefore', args); - } - - function max () { - var args = [].slice.call(arguments, 0); - - return pickBy('isAfter', args); - } - - var now = function () { - return Date.now ? Date.now() : +(new Date()); - }; - - var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond']; - - function isDurationValid(m) { - for (var key in m) { - if (!(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) { - return false; - } - } - - var unitHasDecimal = false; - for (var i = 0; i < ordering.length; ++i) { - if (m[ordering[i]]) { - if (unitHasDecimal) { - return false; // only allow non-integers for smallest unit - } - if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) { - unitHasDecimal = true; - } - } - } - - return true; - } - - function isValid$1() { - return this._isValid; - } - - function createInvalid$1() { - return createDuration(NaN); - } - - function Duration (duration) { - var normalizedInput = normalizeObjectUnits(duration), - years = normalizedInput.year || 0, - quarters = normalizedInput.quarter || 0, - months = normalizedInput.month || 0, - weeks = normalizedInput.week || 0, - days = normalizedInput.day || 0, - hours = normalizedInput.hour || 0, - minutes = normalizedInput.minute || 0, - seconds = normalizedInput.second || 0, - milliseconds = normalizedInput.millisecond || 0; - - this._isValid = isDurationValid(normalizedInput); - - // representation for dateAddRemove - this._milliseconds = +milliseconds + - seconds * 1e3 + // 1000 - minutes * 6e4 + // 1000 * 60 - hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 - // Because of dateAddRemove treats 24 hours as different from a - // day when working around DST, we need to store them separately - this._days = +days + - weeks * 7; - // It is impossible to translate months into days without knowing - // which months you are are talking about, so we have to store - // it separately. - this._months = +months + - quarters * 3 + - years * 12; - - this._data = {}; - - this._locale = getLocale(); - - this._bubble(); - } - - function isDuration (obj) { - return obj instanceof Duration; - } - - function absRound (number) { - if (number < 0) { - return Math.round(-1 * number) * -1; - } else { - return Math.round(number); - } - } - -// FORMATTING - - function offset (token, separator) { - addFormatToken(token, 0, 0, function () { - var offset = this.utcOffset(); - var sign = '+'; - if (offset < 0) { - offset = -offset; - sign = '-'; - } - return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2); - }); - } - - offset('Z', ':'); - offset('ZZ', ''); - -// PARSING - - addRegexToken('Z', matchShortOffset); - addRegexToken('ZZ', matchShortOffset); - addParseToken(['Z', 'ZZ'], function (input, array, config) { - config._useUTC = true; - config._tzm = offsetFromString(matchShortOffset, input); - }); - -// HELPERS - -// timezone chunker -// '+10:00' > ['10', '00'] -// '-1530' > ['-15', '30'] - var chunkOffset = /([\+\-]|\d\d)/gi; - - function offsetFromString(matcher, string) { - var matches = (string || '').match(matcher); - - if (matches === null) { - return null; - } - - var chunk = matches[matches.length - 1] || []; - var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; - var minutes = +(parts[1] * 60) + toInt(parts[2]); - - return minutes === 0 ? - 0 : - parts[0] === '+' ? minutes : -minutes; - } - -// Return a moment from input, that is local/utc/zone equivalent to model. - function cloneWithOffset(input, model) { - var res, diff; - if (model._isUTC) { - res = model.clone(); - diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); - // Use low-level api, because this fn is low-level api. - res._d.setTime(res._d.valueOf() + diff); - hooks.updateOffset(res, false); - return res; - } else { - return createLocal(input).local(); - } - } - - function getDateOffset (m) { - // On Firefox.24 Date#getTimezoneOffset returns a floating point. - // https://github.com/moment/moment/pull/1871 - return -Math.round(m._d.getTimezoneOffset() / 15) * 15; - } - -// HOOKS - -// This function will be called whenever a moment is mutated. -// It is intended to keep the offset in sync with the timezone. - hooks.updateOffset = function () {}; - -// MOMENTS - -// keepLocalTime = true means only change the timezone, without -// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> -// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset -// +0200, so we adjust the time as needed, to be valid. -// -// Keeping the time actually adds/subtracts (one hour) -// from the actual represented time. That is why we call updateOffset -// a second time. In case it wants us to change the offset again -// _changeInProgress == true case, then we have to adjust, because -// there is no such time in the given timezone. - function getSetOffset (input, keepLocalTime, keepMinutes) { - var offset = this._offset || 0, - localAdjust; - if (!this.isValid()) { - return input != null ? this : NaN; - } - if (input != null) { - if (typeof input === 'string') { - input = offsetFromString(matchShortOffset, input); - if (input === null) { - return this; - } - } else if (Math.abs(input) < 16 && !keepMinutes) { - input = input * 60; - } - if (!this._isUTC && keepLocalTime) { - localAdjust = getDateOffset(this); - } - this._offset = input; - this._isUTC = true; - if (localAdjust != null) { - this.add(localAdjust, 'm'); - } - if (offset !== input) { - if (!keepLocalTime || this._changeInProgress) { - addSubtract(this, createDuration(input - offset, 'm'), 1, false); - } else if (!this._changeInProgress) { - this._changeInProgress = true; - hooks.updateOffset(this, true); - this._changeInProgress = null; - } - } - return this; - } else { - return this._isUTC ? offset : getDateOffset(this); - } - } - - function getSetZone (input, keepLocalTime) { - if (input != null) { - if (typeof input !== 'string') { - input = -input; - } - - this.utcOffset(input, keepLocalTime); - - return this; - } else { - return -this.utcOffset(); - } - } - - function setOffsetToUTC (keepLocalTime) { - return this.utcOffset(0, keepLocalTime); - } - - function setOffsetToLocal (keepLocalTime) { - if (this._isUTC) { - this.utcOffset(0, keepLocalTime); - this._isUTC = false; - - if (keepLocalTime) { - this.subtract(getDateOffset(this), 'm'); - } - } - return this; - } - - function setOffsetToParsedOffset () { - if (this._tzm != null) { - this.utcOffset(this._tzm, false, true); - } else if (typeof this._i === 'string') { - var tZone = offsetFromString(matchOffset, this._i); - if (tZone != null) { - this.utcOffset(tZone); - } - else { - this.utcOffset(0, true); - } - } - return this; - } - - function hasAlignedHourOffset (input) { - if (!this.isValid()) { - return false; - } - input = input ? createLocal(input).utcOffset() : 0; - - return (this.utcOffset() - input) % 60 === 0; - } - - function isDaylightSavingTime () { - return ( - this.utcOffset() > this.clone().month(0).utcOffset() || - this.utcOffset() > this.clone().month(5).utcOffset() - ); - } - - function isDaylightSavingTimeShifted () { - if (!isUndefined(this._isDSTShifted)) { - return this._isDSTShifted; - } - - var c = {}; - - copyConfig(c, this); - c = prepareConfig(c); - - if (c._a) { - var other = c._isUTC ? createUTC(c._a) : createLocal(c._a); - this._isDSTShifted = this.isValid() && - compareArrays(c._a, other.toArray()) > 0; - } else { - this._isDSTShifted = false; - } - - return this._isDSTShifted; - } - - function isLocal () { - return this.isValid() ? !this._isUTC : false; - } - - function isUtcOffset () { - return this.isValid() ? this._isUTC : false; - } - - function isUtc () { - return this.isValid() ? this._isUTC && this._offset === 0 : false; - } - -// ASP.NET json date format regex - var aspNetRegex = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/; - -// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html -// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere -// and further modified to allow for strings containing both week and day - var isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; - - function createDuration (input, key) { - var duration = input, - // matching against regexp is expensive, do it on demand - match = null, - sign, - ret, - diffRes; - - if (isDuration(input)) { - duration = { - ms : input._milliseconds, - d : input._days, - M : input._months - }; - } else if (isNumber(input)) { - duration = {}; - if (key) { - duration[key] = input; - } else { - duration.milliseconds = input; - } - } else if (!!(match = aspNetRegex.exec(input))) { - sign = (match[1] === '-') ? -1 : 1; - duration = { - y : 0, - d : toInt(match[DATE]) * sign, - h : toInt(match[HOUR]) * sign, - m : toInt(match[MINUTE]) * sign, - s : toInt(match[SECOND]) * sign, - ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match - }; - } else if (!!(match = isoRegex.exec(input))) { - sign = (match[1] === '-') ? -1 : (match[1] === '+') ? 1 : 1; - duration = { - y : parseIso(match[2], sign), - M : parseIso(match[3], sign), - w : parseIso(match[4], sign), - d : parseIso(match[5], sign), - h : parseIso(match[6], sign), - m : parseIso(match[7], sign), - s : parseIso(match[8], sign) - }; - } else if (duration == null) {// checks for null or undefined - duration = {}; - } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) { - diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to)); - - duration = {}; - duration.ms = diffRes.milliseconds; - duration.M = diffRes.months; - } - - ret = new Duration(duration); - - if (isDuration(input) && hasOwnProp(input, '_locale')) { - ret._locale = input._locale; - } - - return ret; - } - - createDuration.fn = Duration.prototype; - createDuration.invalid = createInvalid$1; - - function parseIso (inp, sign) { - // We'd normally use ~~inp for this, but unfortunately it also - // converts floats to ints. - // inp may be undefined, so careful calling replace on it. - var res = inp && parseFloat(inp.replace(',', '.')); - // apply sign while we're at it - return (isNaN(res) ? 0 : res) * sign; - } - - function positiveMomentsDifference(base, other) { - var res = {milliseconds: 0, months: 0}; - - res.months = other.month() - base.month() + - (other.year() - base.year()) * 12; - if (base.clone().add(res.months, 'M').isAfter(other)) { - --res.months; - } - - res.milliseconds = +other - +(base.clone().add(res.months, 'M')); - - return res; - } - - function momentsDifference(base, other) { - var res; - if (!(base.isValid() && other.isValid())) { - return {milliseconds: 0, months: 0}; - } - - other = cloneWithOffset(other, base); - if (base.isBefore(other)) { - res = positiveMomentsDifference(base, other); - } else { - res = positiveMomentsDifference(other, base); - res.milliseconds = -res.milliseconds; - res.months = -res.months; - } - - return res; - } - -// TODO: remove 'name' arg after deprecation is removed - function createAdder(direction, name) { - return function (val, period) { - var dur, tmp; - //invert the arguments, but complain about it - if (period !== null && !isNaN(+period)) { - deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + - 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'); - tmp = val; val = period; period = tmp; - } - - val = typeof val === 'string' ? +val : val; - dur = createDuration(val, period); - addSubtract(this, dur, direction); - return this; - }; - } - - function addSubtract (mom, duration, isAdding, updateOffset) { - var milliseconds = duration._milliseconds, - days = absRound(duration._days), - months = absRound(duration._months); - - if (!mom.isValid()) { - // No op - return; - } - - updateOffset = updateOffset == null ? true : updateOffset; - - if (months) { - setMonth(mom, get(mom, 'Month') + months * isAdding); - } - if (days) { - set$1(mom, 'Date', get(mom, 'Date') + days * isAdding); - } - if (milliseconds) { - mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); - } - if (updateOffset) { - hooks.updateOffset(mom, days || months); - } - } - - var add = createAdder(1, 'add'); - var subtract = createAdder(-1, 'subtract'); - - function getCalendarFormat(myMoment, now) { - var diff = myMoment.diff(now, 'days', true); - return diff < -6 ? 'sameElse' : - diff < -1 ? 'lastWeek' : - diff < 0 ? 'lastDay' : - diff < 1 ? 'sameDay' : - diff < 2 ? 'nextDay' : - diff < 7 ? 'nextWeek' : 'sameElse'; - } - - function calendar$1 (time, formats) { - // We want to compare the start of today, vs this. - // Getting start-of-today depends on whether we're local/utc/offset or not. - var now = time || createLocal(), - sod = cloneWithOffset(now, this).startOf('day'), - format = hooks.calendarFormat(this, sod) || 'sameElse'; - - var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]); - - return this.format(output || this.localeData().calendar(format, this, createLocal(now))); - } - - function clone () { - return new Moment(this); - } - - function isAfter (input, units) { - var localInput = isMoment(input) ? input : createLocal(input); - if (!(this.isValid() && localInput.isValid())) { - return false; - } - units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); - if (units === 'millisecond') { - return this.valueOf() > localInput.valueOf(); - } else { - return localInput.valueOf() < this.clone().startOf(units).valueOf(); - } - } - - function isBefore (input, units) { - var localInput = isMoment(input) ? input : createLocal(input); - if (!(this.isValid() && localInput.isValid())) { - return false; - } - units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); - if (units === 'millisecond') { - return this.valueOf() < localInput.valueOf(); - } else { - return this.clone().endOf(units).valueOf() < localInput.valueOf(); - } - } - - function isBetween (from, to, units, inclusivity) { - inclusivity = inclusivity || '()'; - return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) && - (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units)); - } - - function isSame (input, units) { - var localInput = isMoment(input) ? input : createLocal(input), - inputMs; - if (!(this.isValid() && localInput.isValid())) { - return false; - } - units = normalizeUnits(units || 'millisecond'); - if (units === 'millisecond') { - return this.valueOf() === localInput.valueOf(); - } else { - inputMs = localInput.valueOf(); - return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf(); - } - } - - function isSameOrAfter (input, units) { - return this.isSame(input, units) || this.isAfter(input,units); - } - - function isSameOrBefore (input, units) { - return this.isSame(input, units) || this.isBefore(input,units); - } - - function diff (input, units, asFloat) { - var that, - zoneDelta, - delta, output; - - if (!this.isValid()) { - return NaN; - } - - that = cloneWithOffset(input, this); - - if (!that.isValid()) { - return NaN; - } - - zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; - - units = normalizeUnits(units); - - switch (units) { - case 'year': output = monthDiff(this, that) / 12; break; - case 'month': output = monthDiff(this, that); break; - case 'quarter': output = monthDiff(this, that) / 3; break; - case 'second': output = (this - that) / 1e3; break; // 1000 - case 'minute': output = (this - that) / 6e4; break; // 1000 * 60 - case 'hour': output = (this - that) / 36e5; break; // 1000 * 60 * 60 - case 'day': output = (this - that - zoneDelta) / 864e5; break; // 1000 * 60 * 60 * 24, negate dst - case 'week': output = (this - that - zoneDelta) / 6048e5; break; // 1000 * 60 * 60 * 24 * 7, negate dst - default: output = this - that; - } - - return asFloat ? output : absFloor(output); - } - - function monthDiff (a, b) { - // difference in months - var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()), - // b is in (anchor - 1 month, anchor + 1 month) - anchor = a.clone().add(wholeMonthDiff, 'months'), - anchor2, adjust; - - if (b - anchor < 0) { - anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); - // linear across the month - adjust = (b - anchor) / (anchor - anchor2); - } else { - anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); - // linear across the month - adjust = (b - anchor) / (anchor2 - anchor); - } - - //check for negative zero, return zero if negative zero - return -(wholeMonthDiff + adjust) || 0; - } - - hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; - hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]'; - - function toString () { - return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); - } - - function toISOString(keepOffset) { - if (!this.isValid()) { - return null; - } - var utc = keepOffset !== true; - var m = utc ? this.clone().utc() : this; - if (m.year() < 0 || m.year() > 9999) { - return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'); - } - if (isFunction(Date.prototype.toISOString)) { - // native implementation is ~50x faster, use it when we can - if (utc) { - return this.toDate().toISOString(); - } else { - return new Date(this._d.valueOf()).toISOString().replace('Z', formatMoment(m, 'Z')); - } - } - return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'); - } - - /** - * Return a human readable representation of a moment that can - * also be evaluated to get a new moment which is the same - * - * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects - */ - function inspect () { - if (!this.isValid()) { - return 'moment.invalid(/* ' + this._i + ' */)'; - } - var func = 'moment'; - var zone = ''; - if (!this.isLocal()) { - func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; - zone = 'Z'; - } - var prefix = '[' + func + '("]'; - var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY'; - var datetime = '-MM-DD[T]HH:mm:ss.SSS'; - var suffix = zone + '[")]'; - - return this.format(prefix + year + datetime + suffix); - } - - function format (inputString) { - if (!inputString) { - inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat; - } - var output = formatMoment(this, inputString); - return this.localeData().postformat(output); - } - - function from (time, withoutSuffix) { - if (this.isValid() && - ((isMoment(time) && time.isValid()) || - createLocal(time).isValid())) { - return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); - } else { - return this.localeData().invalidDate(); - } - } - - function fromNow (withoutSuffix) { - return this.from(createLocal(), withoutSuffix); - } - - function to (time, withoutSuffix) { - if (this.isValid() && - ((isMoment(time) && time.isValid()) || - createLocal(time).isValid())) { - return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); - } else { - return this.localeData().invalidDate(); - } - } - - function toNow (withoutSuffix) { - return this.to(createLocal(), withoutSuffix); - } - -// If passed a locale key, it will set the locale for this -// instance. Otherwise, it will return the locale configuration -// variables for this instance. - function locale (key) { - var newLocaleData; - - if (key === undefined) { - return this._locale._abbr; - } else { - newLocaleData = getLocale(key); - if (newLocaleData != null) { - this._locale = newLocaleData; - } - return this; - } - } - - var lang = deprecate( - 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', - function (key) { - if (key === undefined) { - return this.localeData(); - } else { - return this.locale(key); - } - } - ); - - function localeData () { - return this._locale; - } - - function startOf (units) { - units = normalizeUnits(units); - // the following switch intentionally omits break keywords - // to utilize falling through the cases. - switch (units) { - case 'year': - this.month(0); - /* falls through */ - case 'quarter': - case 'month': - this.date(1); - /* falls through */ - case 'week': - case 'isoWeek': - case 'day': - case 'date': - this.hours(0); - /* falls through */ - case 'hour': - this.minutes(0); - /* falls through */ - case 'minute': - this.seconds(0); - /* falls through */ - case 'second': - this.milliseconds(0); - } - - // weeks are a special case - if (units === 'week') { - this.weekday(0); - } - if (units === 'isoWeek') { - this.isoWeekday(1); - } - - // quarters are also special - if (units === 'quarter') { - this.month(Math.floor(this.month() / 3) * 3); - } - - return this; - } - - function endOf (units) { - units = normalizeUnits(units); - if (units === undefined || units === 'millisecond') { - return this; - } - - // 'date' is an alias for 'day', so it should be considered as such. - if (units === 'date') { - units = 'day'; - } - - return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms'); - } - - function valueOf () { - return this._d.valueOf() - ((this._offset || 0) * 60000); - } - - function unix () { - return Math.floor(this.valueOf() / 1000); - } - - function toDate () { - return new Date(this.valueOf()); - } - - function toArray () { - var m = this; - return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()]; - } - - function toObject () { - var m = this; - return { - years: m.year(), - months: m.month(), - date: m.date(), - hours: m.hours(), - minutes: m.minutes(), - seconds: m.seconds(), - milliseconds: m.milliseconds() - }; - } - - function toJSON () { - // new Date(NaN).toJSON() === null - return this.isValid() ? this.toISOString() : null; - } - - function isValid$2 () { - return isValid(this); - } - - function parsingFlags () { - return extend({}, getParsingFlags(this)); - } - - function invalidAt () { - return getParsingFlags(this).overflow; - } - - function creationData() { - return { - input: this._i, - format: this._f, - locale: this._locale, - isUTC: this._isUTC, - strict: this._strict - }; - } - -// FORMATTING - - addFormatToken(0, ['gg', 2], 0, function () { - return this.weekYear() % 100; - }); - - addFormatToken(0, ['GG', 2], 0, function () { - return this.isoWeekYear() % 100; - }); - - function addWeekYearFormatToken (token, getter) { - addFormatToken(0, [token, token.length], 0, getter); - } - - addWeekYearFormatToken('gggg', 'weekYear'); - addWeekYearFormatToken('ggggg', 'weekYear'); - addWeekYearFormatToken('GGGG', 'isoWeekYear'); - addWeekYearFormatToken('GGGGG', 'isoWeekYear'); - -// ALIASES - - addUnitAlias('weekYear', 'gg'); - addUnitAlias('isoWeekYear', 'GG'); - -// PRIORITY - - addUnitPriority('weekYear', 1); - addUnitPriority('isoWeekYear', 1); - - -// PARSING - - addRegexToken('G', matchSigned); - addRegexToken('g', matchSigned); - addRegexToken('GG', match1to2, match2); - addRegexToken('gg', match1to2, match2); - addRegexToken('GGGG', match1to4, match4); - addRegexToken('gggg', match1to4, match4); - addRegexToken('GGGGG', match1to6, match6); - addRegexToken('ggggg', match1to6, match6); - - addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) { - week[token.substr(0, 2)] = toInt(input); - }); - - addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { - week[token] = hooks.parseTwoDigitYear(input); - }); - -// MOMENTS - - function getSetWeekYear (input) { - return getSetWeekYearHelper.call(this, - input, - this.week(), - this.weekday(), - this.localeData()._week.dow, - this.localeData()._week.doy); - } - - function getSetISOWeekYear (input) { - return getSetWeekYearHelper.call(this, - input, this.isoWeek(), this.isoWeekday(), 1, 4); - } - - function getISOWeeksInYear () { - return weeksInYear(this.year(), 1, 4); - } - - function getWeeksInYear () { - var weekInfo = this.localeData()._week; - return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); - } - - function getSetWeekYearHelper(input, week, weekday, dow, doy) { - var weeksTarget; - if (input == null) { - return weekOfYear(this, dow, doy).year; - } else { - weeksTarget = weeksInYear(input, dow, doy); - if (week > weeksTarget) { - week = weeksTarget; - } - return setWeekAll.call(this, input, week, weekday, dow, doy); - } - } - - function setWeekAll(weekYear, week, weekday, dow, doy) { - var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), - date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); - - this.year(date.getUTCFullYear()); - this.month(date.getUTCMonth()); - this.date(date.getUTCDate()); - return this; - } - -// FORMATTING - - addFormatToken('Q', 0, 'Qo', 'quarter'); - -// ALIASES - - addUnitAlias('quarter', 'Q'); - -// PRIORITY - - addUnitPriority('quarter', 7); - -// PARSING - - addRegexToken('Q', match1); - addParseToken('Q', function (input, array) { - array[MONTH] = (toInt(input) - 1) * 3; - }); - -// MOMENTS - - function getSetQuarter (input) { - return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); - } - -// FORMATTING - - addFormatToken('D', ['DD', 2], 'Do', 'date'); - -// ALIASES - - addUnitAlias('date', 'D'); - -// PRIOROITY - addUnitPriority('date', 9); - -// PARSING - - addRegexToken('D', match1to2); - addRegexToken('DD', match1to2, match2); - addRegexToken('Do', function (isStrict, locale) { - // TODO: Remove "ordinalParse" fallback in next major release. - return isStrict ? - (locale._dayOfMonthOrdinalParse || locale._ordinalParse) : - locale._dayOfMonthOrdinalParseLenient; - }); - - addParseToken(['D', 'DD'], DATE); - addParseToken('Do', function (input, array) { - array[DATE] = toInt(input.match(match1to2)[0]); - }); - -// MOMENTS - - var getSetDayOfMonth = makeGetSet('Date', true); - -// FORMATTING - - addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); - -// ALIASES - - addUnitAlias('dayOfYear', 'DDD'); - -// PRIORITY - addUnitPriority('dayOfYear', 4); - -// PARSING - - addRegexToken('DDD', match1to3); - addRegexToken('DDDD', match3); - addParseToken(['DDD', 'DDDD'], function (input, array, config) { - config._dayOfYear = toInt(input); - }); - -// HELPERS - -// MOMENTS - - function getSetDayOfYear (input) { - var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; - return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); - } - -// FORMATTING - - addFormatToken('m', ['mm', 2], 0, 'minute'); - -// ALIASES - - addUnitAlias('minute', 'm'); - -// PRIORITY - - addUnitPriority('minute', 14); - -// PARSING - - addRegexToken('m', match1to2); - addRegexToken('mm', match1to2, match2); - addParseToken(['m', 'mm'], MINUTE); - -// MOMENTS - - var getSetMinute = makeGetSet('Minutes', false); - -// FORMATTING - - addFormatToken('s', ['ss', 2], 0, 'second'); - -// ALIASES - - addUnitAlias('second', 's'); - -// PRIORITY - - addUnitPriority('second', 15); - -// PARSING - - addRegexToken('s', match1to2); - addRegexToken('ss', match1to2, match2); - addParseToken(['s', 'ss'], SECOND); - -// MOMENTS - - var getSetSecond = makeGetSet('Seconds', false); - -// FORMATTING - - addFormatToken('S', 0, 0, function () { - return ~~(this.millisecond() / 100); - }); - - addFormatToken(0, ['SS', 2], 0, function () { - return ~~(this.millisecond() / 10); - }); - - addFormatToken(0, ['SSS', 3], 0, 'millisecond'); - addFormatToken(0, ['SSSS', 4], 0, function () { - return this.millisecond() * 10; - }); - addFormatToken(0, ['SSSSS', 5], 0, function () { - return this.millisecond() * 100; - }); - addFormatToken(0, ['SSSSSS', 6], 0, function () { - return this.millisecond() * 1000; - }); - addFormatToken(0, ['SSSSSSS', 7], 0, function () { - return this.millisecond() * 10000; - }); - addFormatToken(0, ['SSSSSSSS', 8], 0, function () { - return this.millisecond() * 100000; - }); - addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { - return this.millisecond() * 1000000; - }); - - -// ALIASES - - addUnitAlias('millisecond', 'ms'); - -// PRIORITY - - addUnitPriority('millisecond', 16); - -// PARSING - - addRegexToken('S', match1to3, match1); - addRegexToken('SS', match1to3, match2); - addRegexToken('SSS', match1to3, match3); - - var token; - for (token = 'SSSS'; token.length <= 9; token += 'S') { - addRegexToken(token, matchUnsigned); - } - - function parseMs(input, array) { - array[MILLISECOND] = toInt(('0.' + input) * 1000); - } - - for (token = 'S'; token.length <= 9; token += 'S') { - addParseToken(token, parseMs); - } -// MOMENTS - - var getSetMillisecond = makeGetSet('Milliseconds', false); - -// FORMATTING - - addFormatToken('z', 0, 0, 'zoneAbbr'); - addFormatToken('zz', 0, 0, 'zoneName'); - -// MOMENTS - - function getZoneAbbr () { - return this._isUTC ? 'UTC' : ''; - } - - function getZoneName () { - return this._isUTC ? 'Coordinated Universal Time' : ''; - } - - var proto = Moment.prototype; - - proto.add = add; - proto.calendar = calendar$1; - proto.clone = clone; - proto.diff = diff; - proto.endOf = endOf; - proto.format = format; - proto.from = from; - proto.fromNow = fromNow; - proto.to = to; - proto.toNow = toNow; - proto.get = stringGet; - proto.invalidAt = invalidAt; - proto.isAfter = isAfter; - proto.isBefore = isBefore; - proto.isBetween = isBetween; - proto.isSame = isSame; - proto.isSameOrAfter = isSameOrAfter; - proto.isSameOrBefore = isSameOrBefore; - proto.isValid = isValid$2; - proto.lang = lang; - proto.locale = locale; - proto.localeData = localeData; - proto.max = prototypeMax; - proto.min = prototypeMin; - proto.parsingFlags = parsingFlags; - proto.set = stringSet; - proto.startOf = startOf; - proto.subtract = subtract; - proto.toArray = toArray; - proto.toObject = toObject; - proto.toDate = toDate; - proto.toISOString = toISOString; - proto.inspect = inspect; - proto.toJSON = toJSON; - proto.toString = toString; - proto.unix = unix; - proto.valueOf = valueOf; - proto.creationData = creationData; - -// Year - proto.year = getSetYear; - proto.isLeapYear = getIsLeapYear; - -// Week Year - proto.weekYear = getSetWeekYear; - proto.isoWeekYear = getSetISOWeekYear; - -// Quarter - proto.quarter = proto.quarters = getSetQuarter; - -// Month - proto.month = getSetMonth; - proto.daysInMonth = getDaysInMonth; - -// Week - proto.week = proto.weeks = getSetWeek; - proto.isoWeek = proto.isoWeeks = getSetISOWeek; - proto.weeksInYear = getWeeksInYear; - proto.isoWeeksInYear = getISOWeeksInYear; - -// Day - proto.date = getSetDayOfMonth; - proto.day = proto.days = getSetDayOfWeek; - proto.weekday = getSetLocaleDayOfWeek; - proto.isoWeekday = getSetISODayOfWeek; - proto.dayOfYear = getSetDayOfYear; - -// Hour - proto.hour = proto.hours = getSetHour; - -// Minute - proto.minute = proto.minutes = getSetMinute; - -// Second - proto.second = proto.seconds = getSetSecond; - -// Millisecond - proto.millisecond = proto.milliseconds = getSetMillisecond; - -// Offset - proto.utcOffset = getSetOffset; - proto.utc = setOffsetToUTC; - proto.local = setOffsetToLocal; - proto.parseZone = setOffsetToParsedOffset; - proto.hasAlignedHourOffset = hasAlignedHourOffset; - proto.isDST = isDaylightSavingTime; - proto.isLocal = isLocal; - proto.isUtcOffset = isUtcOffset; - proto.isUtc = isUtc; - proto.isUTC = isUtc; - -// Timezone - proto.zoneAbbr = getZoneAbbr; - proto.zoneName = getZoneName; - -// Deprecations - proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth); - proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth); - proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear); - proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone); - proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted); - - function createUnix (input) { - return createLocal(input * 1000); - } - - function createInZone () { - return createLocal.apply(null, arguments).parseZone(); - } - - function preParsePostFormat (string) { - return string; - } - - var proto$1 = Locale.prototype; - - proto$1.calendar = calendar; - proto$1.longDateFormat = longDateFormat; - proto$1.invalidDate = invalidDate; - proto$1.ordinal = ordinal; - proto$1.preparse = preParsePostFormat; - proto$1.postformat = preParsePostFormat; - proto$1.relativeTime = relativeTime; - proto$1.pastFuture = pastFuture; - proto$1.set = set; - -// Month - proto$1.months = localeMonths; - proto$1.monthsShort = localeMonthsShort; - proto$1.monthsParse = localeMonthsParse; - proto$1.monthsRegex = monthsRegex; - proto$1.monthsShortRegex = monthsShortRegex; - -// Week - proto$1.week = localeWeek; - proto$1.firstDayOfYear = localeFirstDayOfYear; - proto$1.firstDayOfWeek = localeFirstDayOfWeek; - -// Day of Week - proto$1.weekdays = localeWeekdays; - proto$1.weekdaysMin = localeWeekdaysMin; - proto$1.weekdaysShort = localeWeekdaysShort; - proto$1.weekdaysParse = localeWeekdaysParse; - - proto$1.weekdaysRegex = weekdaysRegex; - proto$1.weekdaysShortRegex = weekdaysShortRegex; - proto$1.weekdaysMinRegex = weekdaysMinRegex; - -// Hours - proto$1.isPM = localeIsPM; - proto$1.meridiem = localeMeridiem; - - function get$1 (format, index, field, setter) { - var locale = getLocale(); - var utc = createUTC().set(setter, index); - return locale[field](utc, format); - } - - function listMonthsImpl (format, index, field) { - if (isNumber(format)) { - index = format; - format = undefined; - } - - format = format || ''; - - if (index != null) { - return get$1(format, index, field, 'month'); - } - - var i; - var out = []; - for (i = 0; i < 12; i++) { - out[i] = get$1(format, i, field, 'month'); - } - return out; - } - -// () -// (5) -// (fmt, 5) -// (fmt) -// (true) -// (true, 5) -// (true, fmt, 5) -// (true, fmt) - function listWeekdaysImpl (localeSorted, format, index, field) { - if (typeof localeSorted === 'boolean') { - if (isNumber(format)) { - index = format; - format = undefined; - } - - format = format || ''; - } else { - format = localeSorted; - index = format; - localeSorted = false; - - if (isNumber(format)) { - index = format; - format = undefined; - } - - format = format || ''; - } - - var locale = getLocale(), - shift = localeSorted ? locale._week.dow : 0; - - if (index != null) { - return get$1(format, (index + shift) % 7, field, 'day'); - } - - var i; - var out = []; - for (i = 0; i < 7; i++) { - out[i] = get$1(format, (i + shift) % 7, field, 'day'); - } - return out; - } - - function listMonths (format, index) { - return listMonthsImpl(format, index, 'months'); - } - - function listMonthsShort (format, index) { - return listMonthsImpl(format, index, 'monthsShort'); - } - - function listWeekdays (localeSorted, format, index) { - return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); - } - - function listWeekdaysShort (localeSorted, format, index) { - return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); - } - - function listWeekdaysMin (localeSorted, format, index) { - return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); - } - - getSetGlobalLocale('en', { - dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, - ordinal : function (number) { - var b = number % 10, - output = (toInt(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - } - }); - -// Side effect imports - hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale); - hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale); - - var mathAbs = Math.abs; - - function abs () { - var data = this._data; - - this._milliseconds = mathAbs(this._milliseconds); - this._days = mathAbs(this._days); - this._months = mathAbs(this._months); - - data.milliseconds = mathAbs(data.milliseconds); - data.seconds = mathAbs(data.seconds); - data.minutes = mathAbs(data.minutes); - data.hours = mathAbs(data.hours); - data.months = mathAbs(data.months); - data.years = mathAbs(data.years); - - return this; - } - - function addSubtract$1 (duration, input, value, direction) { - var other = createDuration(input, value); - - duration._milliseconds += direction * other._milliseconds; - duration._days += direction * other._days; - duration._months += direction * other._months; - - return duration._bubble(); - } - -// supports only 2.0-style add(1, 's') or add(duration) - function add$1 (input, value) { - return addSubtract$1(this, input, value, 1); - } - -// supports only 2.0-style subtract(1, 's') or subtract(duration) - function subtract$1 (input, value) { - return addSubtract$1(this, input, value, -1); - } - - function absCeil (number) { - if (number < 0) { - return Math.floor(number); - } else { - return Math.ceil(number); - } - } - - function bubble () { - var milliseconds = this._milliseconds; - var days = this._days; - var months = this._months; - var data = this._data; - var seconds, minutes, hours, years, monthsFromDays; - - // if we have a mix of positive and negative values, bubble down first - // check: https://github.com/moment/moment/issues/2166 - if (!((milliseconds >= 0 && days >= 0 && months >= 0) || - (milliseconds <= 0 && days <= 0 && months <= 0))) { - milliseconds += absCeil(monthsToDays(months) + days) * 864e5; - days = 0; - months = 0; - } - - // The following code bubbles up values, see the tests for - // examples of what that means. - data.milliseconds = milliseconds % 1000; - - seconds = absFloor(milliseconds / 1000); - data.seconds = seconds % 60; - - minutes = absFloor(seconds / 60); - data.minutes = minutes % 60; - - hours = absFloor(minutes / 60); - data.hours = hours % 24; - - days += absFloor(hours / 24); - - // convert days to months - monthsFromDays = absFloor(daysToMonths(days)); - months += monthsFromDays; - days -= absCeil(monthsToDays(monthsFromDays)); - - // 12 months -> 1 year - years = absFloor(months / 12); - months %= 12; - - data.days = days; - data.months = months; - data.years = years; - - return this; - } - - function daysToMonths (days) { - // 400 years have 146097 days (taking into account leap year rules) - // 400 years have 12 months === 4800 - return days * 4800 / 146097; - } - - function monthsToDays (months) { - // the reverse of daysToMonths - return months * 146097 / 4800; - } - - function as (units) { - if (!this.isValid()) { - return NaN; - } - var days; - var months; - var milliseconds = this._milliseconds; - - units = normalizeUnits(units); - - if (units === 'month' || units === 'year') { - days = this._days + milliseconds / 864e5; - months = this._months + daysToMonths(days); - return units === 'month' ? months : months / 12; - } else { - // handle milliseconds separately because of floating point math errors (issue #1867) - days = this._days + Math.round(monthsToDays(this._months)); - switch (units) { - case 'week' : return days / 7 + milliseconds / 6048e5; - case 'day' : return days + milliseconds / 864e5; - case 'hour' : return days * 24 + milliseconds / 36e5; - case 'minute' : return days * 1440 + milliseconds / 6e4; - case 'second' : return days * 86400 + milliseconds / 1000; - // Math.floor prevents floating point math errors here - case 'millisecond': return Math.floor(days * 864e5) + milliseconds; - default: throw new Error('Unknown unit ' + units); - } - } - } - -// TODO: Use this.as('ms')? - function valueOf$1 () { - if (!this.isValid()) { - return NaN; - } - return ( - this._milliseconds + - this._days * 864e5 + - (this._months % 12) * 2592e6 + - toInt(this._months / 12) * 31536e6 - ); - } - - function makeAs (alias) { - return function () { - return this.as(alias); - }; - } - - var asMilliseconds = makeAs('ms'); - var asSeconds = makeAs('s'); - var asMinutes = makeAs('m'); - var asHours = makeAs('h'); - var asDays = makeAs('d'); - var asWeeks = makeAs('w'); - var asMonths = makeAs('M'); - var asYears = makeAs('y'); - - function clone$1 () { - return createDuration(this); - } - - function get$2 (units) { - units = normalizeUnits(units); - return this.isValid() ? this[units + 's']() : NaN; - } - - function makeGetter(name) { - return function () { - return this.isValid() ? this._data[name] : NaN; - }; - } - - var milliseconds = makeGetter('milliseconds'); - var seconds = makeGetter('seconds'); - var minutes = makeGetter('minutes'); - var hours = makeGetter('hours'); - var days = makeGetter('days'); - var months = makeGetter('months'); - var years = makeGetter('years'); - - function weeks () { - return absFloor(this.days() / 7); - } - - var round = Math.round; - var thresholds = { - ss: 44, // a few seconds to seconds - s : 45, // seconds to minute - m : 45, // minutes to hour - h : 22, // hours to day - d : 26, // days to month - M : 11 // months to year - }; - -// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize - function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { - return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); - } - - function relativeTime$1 (posNegDuration, withoutSuffix, locale) { - var duration = createDuration(posNegDuration).abs(); - var seconds = round(duration.as('s')); - var minutes = round(duration.as('m')); - var hours = round(duration.as('h')); - var days = round(duration.as('d')); - var months = round(duration.as('M')); - var years = round(duration.as('y')); - - var a = seconds <= thresholds.ss && ['s', seconds] || - seconds < thresholds.s && ['ss', seconds] || - minutes <= 1 && ['m'] || - minutes < thresholds.m && ['mm', minutes] || - hours <= 1 && ['h'] || - hours < thresholds.h && ['hh', hours] || - days <= 1 && ['d'] || - days < thresholds.d && ['dd', days] || - months <= 1 && ['M'] || - months < thresholds.M && ['MM', months] || - years <= 1 && ['y'] || ['yy', years]; - - a[2] = withoutSuffix; - a[3] = +posNegDuration > 0; - a[4] = locale; - return substituteTimeAgo.apply(null, a); - } - -// This function allows you to set the rounding function for relative time strings - function getSetRelativeTimeRounding (roundingFunction) { - if (roundingFunction === undefined) { - return round; - } - if (typeof(roundingFunction) === 'function') { - round = roundingFunction; - return true; - } + fn.call(thisArg, loopable[keys[i]], keys[i]); + } + } + }, + + /** + * Returns true if the `a0` and `a1` arrays have the same content, else returns false. + * @see https://stackoverflow.com/a/14853974 + * @param {Array} a0 - The array to compare + * @param {Array} a1 - The array to compare + * @returns {boolean} + */ + arrayEquals: function(a0, a1) { + var i, ilen, v0, v1; + + if (!a0 || !a1 || a0.length !== a1.length) { return false; } - -// This function allows you to set a threshold for relative time strings - function getSetRelativeTimeThreshold (threshold, limit) { - if (thresholds[threshold] === undefined) { + + for (i = 0, ilen = a0.length; i < ilen; ++i) { + v0 = a0[i]; + v1 = a1[i]; + + if (v0 instanceof Array && v1 instanceof Array) { + if (!helpers.arrayEquals(v0, v1)) { + return false; + } + } else if (v0 !== v1) { + // NOTE: two different object instances will never be equal: {x:20} != {x:20} return false; } - if (limit === undefined) { - return thresholds[threshold]; + } + + return true; + }, + + /** + * Returns a deep copy of `source` without keeping references on objects and arrays. + * @param {*} source - The value to clone. + * @returns {*} + */ + clone: function(source) { + if (helpers.isArray(source)) { + return source.map(helpers.clone); + } + + if (helpers.isObject(source)) { + var target = {}; + var keys = Object.keys(source); + var klen = keys.length; + var k = 0; + + for (; k < klen; ++k) { + target[keys[k]] = helpers.clone(source[keys[k]]); } - thresholds[threshold] = limit; - if (threshold === 's') { - thresholds.ss = limit - 1; - } - return true; + + return target; } - - function humanize (withSuffix) { - if (!this.isValid()) { - return this.localeData().invalidDate(); - } - - var locale = this.localeData(); - var output = relativeTime$1(this, !withSuffix, locale); - - if (withSuffix) { - output = locale.pastFuture(+this, output); - } - - return locale.postformat(output); - } - - var abs$1 = Math.abs; - - function sign(x) { - return ((x > 0) - (x < 0)) || +x; - } - - function toISOString$1() { - // for ISO strings we do not use the normal bubbling rules: - // * milliseconds bubble up until they become hours - // * days do not bubble at all - // * months bubble up until they become years - // This is because there is no context-free conversion between hours and days - // (think of clock changes) - // and also not between days and months (28-31 days per month) - if (!this.isValid()) { - return this.localeData().invalidDate(); - } - - var seconds = abs$1(this._milliseconds) / 1000; - var days = abs$1(this._days); - var months = abs$1(this._months); - var minutes, hours, years; - - // 3600 seconds -> 60 minutes -> 1 hour - minutes = absFloor(seconds / 60); - hours = absFloor(minutes / 60); - seconds %= 60; - minutes %= 60; - - // 12 months -> 1 year - years = absFloor(months / 12); - months %= 12; - - - // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js - var Y = years; - var M = months; - var D = days; - var h = hours; - var m = minutes; - var s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : ''; - var total = this.asSeconds(); - - if (!total) { - // this is the same as C#'s (Noda) and python (isodate)... - // but not other JS (goog.date) - return 'P0D'; - } - - var totalSign = total < 0 ? '-' : ''; - var ymSign = sign(this._months) !== sign(total) ? '-' : ''; - var daysSign = sign(this._days) !== sign(total) ? '-' : ''; - var hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : ''; - - return totalSign + 'P' + - (Y ? ymSign + Y + 'Y' : '') + - (M ? ymSign + M + 'M' : '') + - (D ? daysSign + D + 'D' : '') + - ((h || m || s) ? 'T' : '') + - (h ? hmsSign + h + 'H' : '') + - (m ? hmsSign + m + 'M' : '') + - (s ? hmsSign + s + 'S' : ''); - } - - var proto$2 = Duration.prototype; - - proto$2.isValid = isValid$1; - proto$2.abs = abs; - proto$2.add = add$1; - proto$2.subtract = subtract$1; - proto$2.as = as; - proto$2.asMilliseconds = asMilliseconds; - proto$2.asSeconds = asSeconds; - proto$2.asMinutes = asMinutes; - proto$2.asHours = asHours; - proto$2.asDays = asDays; - proto$2.asWeeks = asWeeks; - proto$2.asMonths = asMonths; - proto$2.asYears = asYears; - proto$2.valueOf = valueOf$1; - proto$2._bubble = bubble; - proto$2.clone = clone$1; - proto$2.get = get$2; - proto$2.milliseconds = milliseconds; - proto$2.seconds = seconds; - proto$2.minutes = minutes; - proto$2.hours = hours; - proto$2.days = days; - proto$2.weeks = weeks; - proto$2.months = months; - proto$2.years = years; - proto$2.humanize = humanize; - proto$2.toISOString = toISOString$1; - proto$2.toString = toISOString$1; - proto$2.toJSON = toISOString$1; - proto$2.locale = locale; - proto$2.localeData = localeData; - -// Deprecations - proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1); - proto$2.lang = lang; - -// Side effect imports - -// FORMATTING - - addFormatToken('X', 0, 0, 'unix'); - addFormatToken('x', 0, 0, 'valueOf'); - -// PARSING - - addRegexToken('x', matchSigned); - addRegexToken('X', matchTimestamp); - addParseToken('X', function (input, array, config) { - config._d = new Date(parseFloat(input, 10) * 1000); - }); - addParseToken('x', function (input, array, config) { - config._d = new Date(toInt(input)); - }); - -// Side effect imports - - - hooks.version = '2.20.1'; - - setHookCallback(createLocal); - - hooks.fn = proto; - hooks.min = min; - hooks.max = max; - hooks.now = now; - hooks.utc = createUTC; - hooks.unix = createUnix; - hooks.months = listMonths; - hooks.isDate = isDate; - hooks.locale = getSetGlobalLocale; - hooks.invalid = createInvalid; - hooks.duration = createDuration; - hooks.isMoment = isMoment; - hooks.weekdays = listWeekdays; - hooks.parseZone = createInZone; - hooks.localeData = getLocale; - hooks.isDuration = isDuration; - hooks.monthsShort = listMonthsShort; - hooks.weekdaysMin = listWeekdaysMin; - hooks.defineLocale = defineLocale; - hooks.updateLocale = updateLocale; - hooks.locales = listLocales; - hooks.weekdaysShort = listWeekdaysShort; - hooks.normalizeUnits = normalizeUnits; - hooks.relativeTimeRounding = getSetRelativeTimeRounding; - hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; - hooks.calendarFormat = getCalendarFormat; - hooks.prototype = proto; - -// currently HTML5 input type only supports 24-hour formats - hooks.HTML5_FMT = { - DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // - DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // - DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // - DATE: 'YYYY-MM-DD', // - TIME: 'HH:mm', // - TIME_SECONDS: 'HH:mm:ss', // - TIME_MS: 'HH:mm:ss.SSS', // - WEEK: 'YYYY-[W]WW', // - MONTH: 'YYYY-MM' // - }; - - return hooks; - - }))); - - },{}],7:[function(require,module,exports){ + + return source; + }, + /** - * @namespace Chart - */ - var Chart = require(29)(); - - Chart.helpers = require(45); - -// @todo dispatch these helpers into appropriated helpers/helpers.* file and write unit tests! - require(27)(Chart); - - Chart.defaults = require(25); - Chart.Element = require(26); - Chart.elements = require(40); - Chart.Interaction = require(28); - Chart.layouts = require(30); - Chart.platform = require(48); - Chart.plugins = require(31); - Chart.Ticks = require(34); - - require(22)(Chart); - require(23)(Chart); - require(24)(Chart); - require(33)(Chart); - require(32)(Chart); - require(35)(Chart); - - require(55)(Chart); - require(53)(Chart); - require(54)(Chart); - require(56)(Chart); - require(57)(Chart); - require(58)(Chart); - -// Controllers must be loaded after elements -// See Chart.core.datasetController.dataElementType - require(15)(Chart); - require(16)(Chart); - require(17)(Chart); - require(18)(Chart); - require(19)(Chart); - require(20)(Chart); - require(21)(Chart); - - require(8)(Chart); - require(9)(Chart); - require(10)(Chart); - require(11)(Chart); - require(12)(Chart); - require(13)(Chart); - require(14)(Chart); - -// Loading built-it plugins - var plugins = require(49); - for (var k in plugins) { - if (plugins.hasOwnProperty(k)) { - Chart.plugins.register(plugins[k]); - } - } - - Chart.platform.initialize(); - - module.exports = Chart; - if (typeof window !== 'undefined') { - window.Chart = Chart; - } - -// DEPRECATIONS - - /** - * Provided for backward compatibility, not available anymore - * @namespace Chart.Legend - * @deprecated since version 2.1.5 - * @todo remove at version 3 + * The default merger when Chart.helpers.merge is called without merger option. + * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback. * @private */ - Chart.Legend = plugins.legend._element; - - /** - * Provided for backward compatibility, not available anymore - * @namespace Chart.Title - * @deprecated since version 2.1.5 - * @todo remove at version 3 - * @private - */ - Chart.Title = plugins.title._element; - - /** - * Provided for backward compatibility, use Chart.plugins instead - * @namespace Chart.pluginService - * @deprecated since version 2.1.5 - * @todo remove at version 3 - * @private - */ - Chart.pluginService = Chart.plugins; - - /** - * Provided for backward compatibility, inheriting from Chart.PlugingBase has no - * effect, instead simply create/register plugins via plain JavaScript objects. - * @interface Chart.PluginBase - * @deprecated since version 2.5.0 - * @todo remove at version 3 - * @private - */ - Chart.PluginBase = Chart.Element.extend({}); - - /** - * Provided for backward compatibility, use Chart.helpers.canvas instead. - * @namespace Chart.canvasHelpers - * @deprecated since version 2.6.0 - * @todo remove at version 3 - * @private - */ - Chart.canvasHelpers = Chart.helpers.canvas; - - /** - * Provided for backward compatibility, use Chart.layouts instead. - * @namespace Chart.layoutService - * @deprecated since version 2.8.0 - * @todo remove at version 3 - * @private - */ - Chart.layoutService = Chart.layouts; - - },{"10":10,"11":11,"12":12,"13":13,"14":14,"15":15,"16":16,"17":17,"18":18,"19":19,"20":20,"21":21,"22":22,"23":23,"24":24,"25":25,"26":26,"27":27,"28":28,"29":29,"30":30,"31":31,"32":32,"33":33,"34":34,"35":35,"40":40,"45":45,"48":48,"49":49,"53":53,"54":54,"55":55,"56":56,"57":57,"58":58,"8":8,"9":9}],8:[function(require,module,exports){ - 'use strict'; - - module.exports = function(Chart) { - - Chart.Bar = function(context, config) { - config.type = 'bar'; - - return new Chart(context, config); - }; - - }; - - },{}],9:[function(require,module,exports){ - 'use strict'; - - module.exports = function(Chart) { - - Chart.Bubble = function(context, config) { - config.type = 'bubble'; - return new Chart(context, config); - }; - - }; - - },{}],10:[function(require,module,exports){ - 'use strict'; - - module.exports = function(Chart) { - - Chart.Doughnut = function(context, config) { - config.type = 'doughnut'; - - return new Chart(context, config); - }; - - }; - - },{}],11:[function(require,module,exports){ - 'use strict'; - - module.exports = function(Chart) { - - Chart.Line = function(context, config) { - config.type = 'line'; - - return new Chart(context, config); - }; - - }; - - },{}],12:[function(require,module,exports){ - 'use strict'; - - module.exports = function(Chart) { - - Chart.PolarArea = function(context, config) { - config.type = 'polarArea'; - - return new Chart(context, config); - }; - - }; - - },{}],13:[function(require,module,exports){ - 'use strict'; - - module.exports = function(Chart) { - - Chart.Radar = function(context, config) { - config.type = 'radar'; - - return new Chart(context, config); - }; - - }; - - },{}],14:[function(require,module,exports){ - 'use strict'; - - module.exports = function(Chart) { - Chart.Scatter = function(context, config) { - config.type = 'scatter'; - return new Chart(context, config); - }; - }; - - },{}],15:[function(require,module,exports){ - 'use strict'; - - var defaults = require(25); - var elements = require(40); - var helpers = require(45); - - defaults._set('bar', { - hover: { - mode: 'label' - }, - - scales: { - xAxes: [{ - type: 'category', - - // Specific to Bar Controller - categoryPercentage: 0.8, - barPercentage: 0.9, - - // offset settings - offset: true, - - // grid line settings - gridLines: { - offsetGridLines: true - } - }], - - yAxes: [{ - type: 'linear' - }] - } - }); - - defaults._set('horizontalBar', { - hover: { - mode: 'index', - axis: 'y' - }, - - scales: { - xAxes: [{ - type: 'linear', - position: 'bottom' - }], - - yAxes: [{ - position: 'left', - type: 'category', - - // Specific to Horizontal Bar Controller - categoryPercentage: 0.8, - barPercentage: 0.9, - - // offset settings - offset: true, - - // grid line settings - gridLines: { - offsetGridLines: true - } - }] - }, - - elements: { - rectangle: { - borderSkipped: 'left' - } - }, - - tooltips: { - callbacks: { - title: function(item, data) { - // Pick first xLabel for now - var title = ''; - - if (item.length > 0) { - if (item[0].yLabel) { - title = item[0].yLabel; - } else if (data.labels.length > 0 && item[0].index < data.labels.length) { - title = data.labels[item[0].index]; - } - } - - return title; - }, - - label: function(item, data) { - var datasetLabel = data.datasets[item.datasetIndex].label || ''; - return datasetLabel + ': ' + item.xLabel; - } - }, - mode: 'index', - axis: 'y' - } - }); - - /** - * Computes the "optimal" sample size to maintain bars equally sized while preventing overlap. - * @private - */ - function computeMinSampleSize(scale, pixels) { - var min = scale.isHorizontal() ? scale.width : scale.height; - var ticks = scale.getTicks(); - var prev, curr, i, ilen; - - for (i = 1, ilen = pixels.length; i < ilen; ++i) { - min = Math.min(min, pixels[i] - pixels[i - 1]); - } - - for (i = 0, ilen = ticks.length; i < ilen; ++i) { - curr = scale.getPixelForTick(i); - min = i > 0 ? Math.min(min, curr - prev) : min; - prev = curr; - } - - return min; - } - - /** - * Computes an "ideal" category based on the absolute bar thickness or, if undefined or null, - * uses the smallest interval (see computeMinSampleSize) that prevents bar overlapping. This - * mode currently always generates bars equally sized (until we introduce scriptable options?). - * @private - */ - function computeFitCategoryTraits(index, ruler, options) { - var thickness = options.barThickness; - var count = ruler.stackCount; - var curr = ruler.pixels[index]; - var size, ratio; - - if (helpers.isNullOrUndef(thickness)) { - size = ruler.min * options.categoryPercentage; - ratio = options.barPercentage; + _merger: function(key, target, source, options) { + var tval = target[key]; + var sval = source[key]; + + if (helpers.isObject(tval) && helpers.isObject(sval)) { + helpers.merge(tval, sval, options); } else { - // When bar thickness is enforced, category and bar percentages are ignored. - // Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%') - // and deprecate barPercentage since this value is ignored when thickness is absolute. - size = thickness * count; - ratio = 1; + target[key] = helpers.clone(sval); } - - return { - chunk: size / count, - ratio: ratio, - start: curr - (size / 2) - }; - } - + }, + /** - * Computes an "optimal" category that globally arranges bars side by side (no gap when - * percentage options are 1), based on the previous and following categories. This mode - * generates bars with different widths when data are not evenly spaced. + * Merges source[key] in target[key] only if target[key] is undefined. * @private */ - function computeFlexCategoryTraits(index, ruler, options) { - var pixels = ruler.pixels; - var curr = pixels[index]; - var prev = index > 0 ? pixels[index - 1] : null; - var next = index < pixels.length - 1 ? pixels[index + 1] : null; - var percent = options.categoryPercentage; - var start, size; - - if (prev === null) { - // first data: its size is double based on the next point or, - // if it's also the last data, we use the scale end extremity. - prev = curr - (next === null ? ruler.end - curr : next - curr); + _mergerIf: function(key, target, source) { + var tval = target[key]; + var sval = source[key]; + + if (helpers.isObject(tval) && helpers.isObject(sval)) { + helpers.mergeIf(tval, sval); + } else if (!target.hasOwnProperty(key)) { + target[key] = helpers.clone(sval); } - - if (next === null) { - // last data: its size is also double based on the previous point. - next = curr + curr - prev; + }, + + /** + * Recursively deep copies `source` properties into `target` with the given `options`. + * IMPORTANT: `target` is not cloned and will be updated with `source` properties. + * @param {object} target - The target object in which all sources are merged into. + * @param {object|object[]} source - Object(s) to merge into `target`. + * @param {object} [options] - Merging options: + * @param {function} [options.merger] - The merge method (key, target, source, options) + * @returns {object} The `target` object. + */ + merge: function(target, source, options) { + var sources = helpers.isArray(source) ? source : [source]; + var ilen = sources.length; + var merge, i, keys, klen, k; + + if (!helpers.isObject(target)) { + return target; } - - start = curr - ((curr - prev) / 2) * percent; - size = ((next - prev) / 2) * percent; - + + options = options || {}; + merge = options.merger || helpers._merger; + + for (i = 0; i < ilen; ++i) { + source = sources[i]; + if (!helpers.isObject(source)) { + continue; + } + + keys = Object.keys(source); + for (k = 0, klen = keys.length; k < klen; ++k) { + merge(keys[k], target, source, options); + } + } + + return target; + }, + + /** + * Recursively deep copies `source` properties into `target` *only* if not defined in target. + * IMPORTANT: `target` is not cloned and will be updated with `source` properties. + * @param {object} target - The target object in which all sources are merged into. + * @param {object|object[]} source - Object(s) to merge into `target`. + * @returns {object} The `target` object. + */ + mergeIf: function(target, source) { + return helpers.merge(target, source, {merger: helpers._mergerIf}); + }, + + /** + * Applies the contents of two or more objects together into the first object. + * @param {object} target - The target object in which all objects are merged into. + * @param {object} arg1 - Object containing additional properties to merge in target. + * @param {object} argN - Additional objects containing properties to merge in target. + * @returns {object} The `target` object. + */ + extend: Object.assign || function(target) { + return helpers.merge(target, [].slice.call(arguments, 1), { + merger: function(key, dst, src) { + dst[key] = src[key]; + } + }); + }, + + /** + * Basic javascript inheritance based on the model created in Backbone.js + */ + inherits: function(extensions) { + var me = this; + var ChartElement = (extensions && extensions.hasOwnProperty('constructor')) ? extensions.constructor : function() { + return me.apply(this, arguments); + }; + + var Surrogate = function() { + this.constructor = ChartElement; + }; + + Surrogate.prototype = me.prototype; + ChartElement.prototype = new Surrogate(); + ChartElement.extend = helpers.inherits; + + if (extensions) { + helpers.extend(ChartElement.prototype, extensions); + } + + ChartElement.__super__ = me.prototype; + return ChartElement; + }, + + _deprecated: function(scope, value, previous, current) { + if (value !== undefined) { + console.warn(scope + ': "' + previous + + '" is deprecated. Please use "' + current + '" instead'); + } + } + }; + + var helpers_core = helpers; + + // DEPRECATIONS + + /** + * Provided for backward compatibility, use Chart.helpers.callback instead. + * @function Chart.helpers.callCallback + * @deprecated since version 2.6.0 + * @todo remove at version 3 + * @private + */ + helpers.callCallback = helpers.callback; + + /** + * Provided for backward compatibility, use Array.prototype.indexOf instead. + * Array.prototype.indexOf compatibility: Chrome, Opera, Safari, FF1.5+, IE9+ + * @function Chart.helpers.indexOf + * @deprecated since version 2.7.0 + * @todo remove at version 3 + * @private + */ + helpers.indexOf = function(array, item, fromIndex) { + return Array.prototype.indexOf.call(array, item, fromIndex); + }; + + /** + * Provided for backward compatibility, use Chart.helpers.valueOrDefault instead. + * @function Chart.helpers.getValueOrDefault + * @deprecated since version 2.7.0 + * @todo remove at version 3 + * @private + */ + helpers.getValueOrDefault = helpers.valueOrDefault; + + /** + * Provided for backward compatibility, use Chart.helpers.valueAtIndexOrDefault instead. + * @function Chart.helpers.getValueAtIndexOrDefault + * @deprecated since version 2.7.0 + * @todo remove at version 3 + * @private + */ + helpers.getValueAtIndexOrDefault = helpers.valueAtIndexOrDefault; + + /** + * Easing functions adapted from Robert Penner's easing equations. + * @namespace Chart.helpers.easingEffects + * @see http://www.robertpenner.com/easing/ + */ + var effects = { + linear: function(t) { + return t; + }, + + easeInQuad: function(t) { + return t * t; + }, + + easeOutQuad: function(t) { + return -t * (t - 2); + }, + + easeInOutQuad: function(t) { + if ((t /= 0.5) < 1) { + return 0.5 * t * t; + } + return -0.5 * ((--t) * (t - 2) - 1); + }, + + easeInCubic: function(t) { + return t * t * t; + }, + + easeOutCubic: function(t) { + return (t = t - 1) * t * t + 1; + }, + + easeInOutCubic: function(t) { + if ((t /= 0.5) < 1) { + return 0.5 * t * t * t; + } + return 0.5 * ((t -= 2) * t * t + 2); + }, + + easeInQuart: function(t) { + return t * t * t * t; + }, + + easeOutQuart: function(t) { + return -((t = t - 1) * t * t * t - 1); + }, + + easeInOutQuart: function(t) { + if ((t /= 0.5) < 1) { + return 0.5 * t * t * t * t; + } + return -0.5 * ((t -= 2) * t * t * t - 2); + }, + + easeInQuint: function(t) { + return t * t * t * t * t; + }, + + easeOutQuint: function(t) { + return (t = t - 1) * t * t * t * t + 1; + }, + + easeInOutQuint: function(t) { + if ((t /= 0.5) < 1) { + return 0.5 * t * t * t * t * t; + } + return 0.5 * ((t -= 2) * t * t * t * t + 2); + }, + + easeInSine: function(t) { + return -Math.cos(t * (Math.PI / 2)) + 1; + }, + + easeOutSine: function(t) { + return Math.sin(t * (Math.PI / 2)); + }, + + easeInOutSine: function(t) { + return -0.5 * (Math.cos(Math.PI * t) - 1); + }, + + easeInExpo: function(t) { + return (t === 0) ? 0 : Math.pow(2, 10 * (t - 1)); + }, + + easeOutExpo: function(t) { + return (t === 1) ? 1 : -Math.pow(2, -10 * t) + 1; + }, + + easeInOutExpo: function(t) { + if (t === 0) { + return 0; + } + if (t === 1) { + return 1; + } + if ((t /= 0.5) < 1) { + return 0.5 * Math.pow(2, 10 * (t - 1)); + } + return 0.5 * (-Math.pow(2, -10 * --t) + 2); + }, + + easeInCirc: function(t) { + if (t >= 1) { + return t; + } + return -(Math.sqrt(1 - t * t) - 1); + }, + + easeOutCirc: function(t) { + return Math.sqrt(1 - (t = t - 1) * t); + }, + + easeInOutCirc: function(t) { + if ((t /= 0.5) < 1) { + return -0.5 * (Math.sqrt(1 - t * t) - 1); + } + return 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1); + }, + + easeInElastic: function(t) { + var s = 1.70158; + var p = 0; + var a = 1; + if (t === 0) { + return 0; + } + if (t === 1) { + return 1; + } + if (!p) { + p = 0.3; + } + if (a < 1) { + a = 1; + s = p / 4; + } else { + s = p / (2 * Math.PI) * Math.asin(1 / a); + } + return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p)); + }, + + easeOutElastic: function(t) { + var s = 1.70158; + var p = 0; + var a = 1; + if (t === 0) { + return 0; + } + if (t === 1) { + return 1; + } + if (!p) { + p = 0.3; + } + if (a < 1) { + a = 1; + s = p / 4; + } else { + s = p / (2 * Math.PI) * Math.asin(1 / a); + } + return a * Math.pow(2, -10 * t) * Math.sin((t - s) * (2 * Math.PI) / p) + 1; + }, + + easeInOutElastic: function(t) { + var s = 1.70158; + var p = 0; + var a = 1; + if (t === 0) { + return 0; + } + if ((t /= 0.5) === 2) { + return 1; + } + if (!p) { + p = 0.45; + } + if (a < 1) { + a = 1; + s = p / 4; + } else { + s = p / (2 * Math.PI) * Math.asin(1 / a); + } + if (t < 1) { + return -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p)); + } + return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p) * 0.5 + 1; + }, + easeInBack: function(t) { + var s = 1.70158; + return t * t * ((s + 1) * t - s); + }, + + easeOutBack: function(t) { + var s = 1.70158; + return (t = t - 1) * t * ((s + 1) * t + s) + 1; + }, + + easeInOutBack: function(t) { + var s = 1.70158; + if ((t /= 0.5) < 1) { + return 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s)); + } + return 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2); + }, + + easeInBounce: function(t) { + return 1 - effects.easeOutBounce(1 - t); + }, + + easeOutBounce: function(t) { + if (t < (1 / 2.75)) { + return 7.5625 * t * t; + } + if (t < (2 / 2.75)) { + return 7.5625 * (t -= (1.5 / 2.75)) * t + 0.75; + } + if (t < (2.5 / 2.75)) { + return 7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375; + } + return 7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375; + }, + + easeInOutBounce: function(t) { + if (t < 0.5) { + return effects.easeInBounce(t * 2) * 0.5; + } + return effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5; + } + }; + + var helpers_easing = { + effects: effects + }; + + // DEPRECATIONS + + /** + * Provided for backward compatibility, use Chart.helpers.easing.effects instead. + * @function Chart.helpers.easingEffects + * @deprecated since version 2.7.0 + * @todo remove at version 3 + * @private + */ + helpers_core.easingEffects = effects; + + var PI = Math.PI; + var RAD_PER_DEG = PI / 180; + var DOUBLE_PI = PI * 2; + var HALF_PI = PI / 2; + var QUARTER_PI = PI / 4; + var TWO_THIRDS_PI = PI * 2 / 3; + + /** + * @namespace Chart.helpers.canvas + */ + var exports$1 = { + /** + * Clears the entire canvas associated to the given `chart`. + * @param {Chart} chart - The chart for which to clear the canvas. + */ + clear: function(chart) { + chart.ctx.clearRect(0, 0, chart.width, chart.height); + }, + + /** + * Creates a "path" for a rectangle with rounded corners at position (x, y) with a + * given size (width, height) and the same `radius` for all corners. + * @param {CanvasRenderingContext2D} ctx - The canvas 2D Context. + * @param {number} x - The x axis of the coordinate for the rectangle starting point. + * @param {number} y - The y axis of the coordinate for the rectangle starting point. + * @param {number} width - The rectangle's width. + * @param {number} height - The rectangle's height. + * @param {number} radius - The rounded amount (in pixels) for the four corners. + * @todo handle `radius` as top-left, top-right, bottom-right, bottom-left array/object? + */ + roundedRect: function(ctx, x, y, width, height, radius) { + if (radius) { + var r = Math.min(radius, height / 2, width / 2); + var left = x + r; + var top = y + r; + var right = x + width - r; + var bottom = y + height - r; + + ctx.moveTo(x, top); + if (left < right && top < bottom) { + ctx.arc(left, top, r, -PI, -HALF_PI); + ctx.arc(right, top, r, -HALF_PI, 0); + ctx.arc(right, bottom, r, 0, HALF_PI); + ctx.arc(left, bottom, r, HALF_PI, PI); + } else if (left < right) { + ctx.moveTo(left, y); + ctx.arc(right, top, r, -HALF_PI, HALF_PI); + ctx.arc(left, top, r, HALF_PI, PI + HALF_PI); + } else if (top < bottom) { + ctx.arc(left, top, r, -PI, 0); + ctx.arc(left, bottom, r, 0, PI); + } else { + ctx.arc(left, top, r, -PI, PI); + } + ctx.closePath(); + ctx.moveTo(x, y); + } else { + ctx.rect(x, y, width, height); + } + }, + + drawPoint: function(ctx, style, radius, x, y, rotation) { + var type, xOffset, yOffset, size, cornerRadius; + var rad = (rotation || 0) * RAD_PER_DEG; + + if (style && typeof style === 'object') { + type = style.toString(); + if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') { + ctx.save(); + ctx.translate(x, y); + ctx.rotate(rad); + ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height); + ctx.restore(); + return; + } + } + + if (isNaN(radius) || radius <= 0) { + return; + } + + ctx.beginPath(); + + switch (style) { + // Default includes circle + default: + ctx.arc(x, y, radius, 0, DOUBLE_PI); + ctx.closePath(); + break; + case 'triangle': + ctx.moveTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius); + rad += TWO_THIRDS_PI; + ctx.lineTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius); + rad += TWO_THIRDS_PI; + ctx.lineTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius); + ctx.closePath(); + break; + case 'rectRounded': + // NOTE: the rounded rect implementation changed to use `arc` instead of + // `quadraticCurveTo` since it generates better results when rect is + // almost a circle. 0.516 (instead of 0.5) produces results with visually + // closer proportion to the previous impl and it is inscribed in the + // circle with `radius`. For more details, see the following PRs: + // https://github.com/chartjs/Chart.js/issues/5597 + // https://github.com/chartjs/Chart.js/issues/5858 + cornerRadius = radius * 0.516; + size = radius - cornerRadius; + xOffset = Math.cos(rad + QUARTER_PI) * size; + yOffset = Math.sin(rad + QUARTER_PI) * size; + ctx.arc(x - xOffset, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI); + ctx.arc(x + yOffset, y - xOffset, cornerRadius, rad - HALF_PI, rad); + ctx.arc(x + xOffset, y + yOffset, cornerRadius, rad, rad + HALF_PI); + ctx.arc(x - yOffset, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI); + ctx.closePath(); + break; + case 'rect': + if (!rotation) { + size = Math.SQRT1_2 * radius; + ctx.rect(x - size, y - size, 2 * size, 2 * size); + break; + } + rad += QUARTER_PI; + /* falls through */ + case 'rectRot': + xOffset = Math.cos(rad) * radius; + yOffset = Math.sin(rad) * radius; + ctx.moveTo(x - xOffset, y - yOffset); + ctx.lineTo(x + yOffset, y - xOffset); + ctx.lineTo(x + xOffset, y + yOffset); + ctx.lineTo(x - yOffset, y + xOffset); + ctx.closePath(); + break; + case 'crossRot': + rad += QUARTER_PI; + /* falls through */ + case 'cross': + xOffset = Math.cos(rad) * radius; + yOffset = Math.sin(rad) * radius; + ctx.moveTo(x - xOffset, y - yOffset); + ctx.lineTo(x + xOffset, y + yOffset); + ctx.moveTo(x + yOffset, y - xOffset); + ctx.lineTo(x - yOffset, y + xOffset); + break; + case 'star': + xOffset = Math.cos(rad) * radius; + yOffset = Math.sin(rad) * radius; + ctx.moveTo(x - xOffset, y - yOffset); + ctx.lineTo(x + xOffset, y + yOffset); + ctx.moveTo(x + yOffset, y - xOffset); + ctx.lineTo(x - yOffset, y + xOffset); + rad += QUARTER_PI; + xOffset = Math.cos(rad) * radius; + yOffset = Math.sin(rad) * radius; + ctx.moveTo(x - xOffset, y - yOffset); + ctx.lineTo(x + xOffset, y + yOffset); + ctx.moveTo(x + yOffset, y - xOffset); + ctx.lineTo(x - yOffset, y + xOffset); + break; + case 'line': + xOffset = Math.cos(rad) * radius; + yOffset = Math.sin(rad) * radius; + ctx.moveTo(x - xOffset, y - yOffset); + ctx.lineTo(x + xOffset, y + yOffset); + break; + case 'dash': + ctx.moveTo(x, y); + ctx.lineTo(x + Math.cos(rad) * radius, y + Math.sin(rad) * radius); + break; + } + + ctx.fill(); + ctx.stroke(); + }, + + /** + * Returns true if the point is inside the rectangle + * @param {object} point - The point to test + * @param {object} area - The rectangle + * @returns {boolean} + * @private + */ + _isPointInArea: function(point, area) { + var epsilon = 1e-6; // 1e-6 is margin in pixels for accumulated error. + + return point.x > area.left - epsilon && point.x < area.right + epsilon && + point.y > area.top - epsilon && point.y < area.bottom + epsilon; + }, + + clipArea: function(ctx, area) { + ctx.save(); + ctx.beginPath(); + ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top); + ctx.clip(); + }, + + unclipArea: function(ctx) { + ctx.restore(); + }, + + lineTo: function(ctx, previous, target, flip) { + var stepped = target.steppedLine; + if (stepped) { + if (stepped === 'middle') { + var midpoint = (previous.x + target.x) / 2.0; + ctx.lineTo(midpoint, flip ? target.y : previous.y); + ctx.lineTo(midpoint, flip ? previous.y : target.y); + } else if ((stepped === 'after' && !flip) || (stepped !== 'after' && flip)) { + ctx.lineTo(previous.x, target.y); + } else { + ctx.lineTo(target.x, previous.y); + } + ctx.lineTo(target.x, target.y); + return; + } + + if (!target.tension) { + ctx.lineTo(target.x, target.y); + return; + } + + ctx.bezierCurveTo( + flip ? previous.controlPointPreviousX : previous.controlPointNextX, + flip ? previous.controlPointPreviousY : previous.controlPointNextY, + flip ? target.controlPointNextX : target.controlPointPreviousX, + flip ? target.controlPointNextY : target.controlPointPreviousY, + target.x, + target.y); + } + }; + + var helpers_canvas = exports$1; + + // DEPRECATIONS + + /** + * Provided for backward compatibility, use Chart.helpers.canvas.clear instead. + * @namespace Chart.helpers.clear + * @deprecated since version 2.7.0 + * @todo remove at version 3 + * @private + */ + helpers_core.clear = exports$1.clear; + + /** + * Provided for backward compatibility, use Chart.helpers.canvas.roundedRect instead. + * @namespace Chart.helpers.drawRoundedRectangle + * @deprecated since version 2.7.0 + * @todo remove at version 3 + * @private + */ + helpers_core.drawRoundedRectangle = function(ctx) { + ctx.beginPath(); + exports$1.roundedRect.apply(exports$1, arguments); + }; + + var defaults = { + /** + * @private + */ + _set: function(scope, values) { + return helpers_core.merge(this[scope] || (this[scope] = {}), values); + } + }; + + // TODO(v3): remove 'global' from namespace. all default are global and + // there's inconsistency around which options are under 'global' + defaults._set('global', { + defaultColor: 'rgba(0,0,0,0.1)', + defaultFontColor: '#666', + defaultFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", + defaultFontSize: 12, + defaultFontStyle: 'normal', + defaultLineHeight: 1.2, + showLines: true + }); + + var core_defaults = defaults; + + var valueOrDefault = helpers_core.valueOrDefault; + + /** + * Converts the given font object into a CSS font string. + * @param {object} font - A font object. + * @return {string} The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font + * @private + */ + function toFontString(font) { + if (!font || helpers_core.isNullOrUndef(font.size) || helpers_core.isNullOrUndef(font.family)) { + return null; + } + + return (font.style ? font.style + ' ' : '') + + (font.weight ? font.weight + ' ' : '') + + font.size + 'px ' + + font.family; + } + + /** + * @alias Chart.helpers.options + * @namespace + */ + var helpers_options = { + /** + * Converts the given line height `value` in pixels for a specific font `size`. + * @param {number|string} value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em'). + * @param {number} size - The font size (in pixels) used to resolve relative `value`. + * @returns {number} The effective line height in pixels (size * 1.2 if value is invalid). + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height + * @since 2.7.0 + */ + toLineHeight: function(value, size) { + var matches = ('' + value).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/); + if (!matches || matches[1] === 'normal') { + return size * 1.2; + } + + value = +matches[2]; + + switch (matches[3]) { + case 'px': + return value; + case '%': + value /= 100; + break; + } + + return size * value; + }, + + /** + * Converts the given value into a padding object with pre-computed width/height. + * @param {number|object} value - If a number, set the value to all TRBL component, + * else, if and object, use defined properties and sets undefined ones to 0. + * @returns {object} The padding values (top, right, bottom, left, width, height) + * @since 2.7.0 + */ + toPadding: function(value) { + var t, r, b, l; + + if (helpers_core.isObject(value)) { + t = +value.top || 0; + r = +value.right || 0; + b = +value.bottom || 0; + l = +value.left || 0; + } else { + t = r = b = l = +value || 0; + } + return { - chunk: size / ruler.stackCount, - ratio: options.barPercentage, - start: start + top: t, + right: r, + bottom: b, + left: l, + height: t + b, + width: l + r + }; + }, + + /** + * Parses font options and returns the font object. + * @param {object} options - A object that contains font options to be parsed. + * @return {object} The font object. + * @todo Support font.* options and renamed to toFont(). + * @private + */ + _parseFont: function(options) { + var globalDefaults = core_defaults.global; + var size = valueOrDefault(options.fontSize, globalDefaults.defaultFontSize); + var font = { + family: valueOrDefault(options.fontFamily, globalDefaults.defaultFontFamily), + lineHeight: helpers_core.options.toLineHeight(valueOrDefault(options.lineHeight, globalDefaults.defaultLineHeight), size), + size: size, + style: valueOrDefault(options.fontStyle, globalDefaults.defaultFontStyle), + weight: null, + string: '' + }; + + font.string = toFontString(font); + return font; + }, + + /** + * Evaluates the given `inputs` sequentially and returns the first defined value. + * @param {Array} inputs - An array of values, falling back to the last value. + * @param {object} [context] - If defined and the current value is a function, the value + * is called with `context` as first argument and the result becomes the new input. + * @param {number} [index] - If defined and the current value is an array, the value + * at `index` become the new input. + * @param {object} [info] - object to return information about resolution in + * @param {boolean} [info.cacheable] - Will be set to `false` if option is not cacheable. + * @since 2.7.0 + */ + resolve: function(inputs, context, index, info) { + var cacheable = true; + var i, ilen, value; + + for (i = 0, ilen = inputs.length; i < ilen; ++i) { + value = inputs[i]; + if (value === undefined) { + continue; + } + if (context !== undefined && typeof value === 'function') { + value = value(context); + cacheable = false; + } + if (index !== undefined && helpers_core.isArray(value)) { + value = value[index]; + cacheable = false; + } + if (value !== undefined) { + if (info && !cacheable) { + info.cacheable = false; + } + return value; + } + } + } + }; + + /** + * @alias Chart.helpers.math + * @namespace + */ + var exports$2 = { + /** + * Returns an array of factors sorted from 1 to sqrt(value) + * @private + */ + _factorize: function(value) { + var result = []; + var sqrt = Math.sqrt(value); + var i; + + for (i = 1; i < sqrt; i++) { + if (value % i === 0) { + result.push(i); + result.push(value / i); + } + } + if (sqrt === (sqrt | 0)) { // if value is a square number + result.push(sqrt); + } + + result.sort(function(a, b) { + return a - b; + }).pop(); + return result; + }, + + log10: Math.log10 || function(x) { + var exponent = Math.log(x) * Math.LOG10E; // Math.LOG10E = 1 / Math.LN10. + // Check for whole powers of 10, + // which due to floating point rounding error should be corrected. + var powerOf10 = Math.round(exponent); + var isPowerOf10 = x === Math.pow(10, powerOf10); + + return isPowerOf10 ? powerOf10 : exponent; + } + }; + + var helpers_math = exports$2; + + // DEPRECATIONS + + /** + * Provided for backward compatibility, use Chart.helpers.math.log10 instead. + * @namespace Chart.helpers.log10 + * @deprecated since version 2.9.0 + * @todo remove at version 3 + * @private + */ + helpers_core.log10 = exports$2.log10; + + var getRtlAdapter = function(rectX, width) { + return { + x: function(x) { + return rectX + rectX + width - x; + }, + setWidth: function(w) { + width = w; + }, + textAlign: function(align) { + if (align === 'center') { + return align; + } + return align === 'right' ? 'left' : 'right'; + }, + xPlus: function(x, value) { + return x - value; + }, + leftForLtr: function(x, itemWidth) { + return x - itemWidth; + }, + }; + }; + + var getLtrAdapter = function() { + return { + x: function(x) { + return x; + }, + setWidth: function(w) { // eslint-disable-line no-unused-vars + }, + textAlign: function(align) { + return align; + }, + xPlus: function(x, value) { + return x + value; + }, + leftForLtr: function(x, _itemWidth) { // eslint-disable-line no-unused-vars + return x; + }, + }; + }; + + var getAdapter = function(rtl, rectX, width) { + return rtl ? getRtlAdapter(rectX, width) : getLtrAdapter(); + }; + + var overrideTextDirection = function(ctx, direction) { + var style, original; + if (direction === 'ltr' || direction === 'rtl') { + style = ctx.canvas.style; + original = [ + style.getPropertyValue('direction'), + style.getPropertyPriority('direction'), + ]; + + style.setProperty('direction', direction, 'important'); + ctx.prevTextDirection = original; + } + }; + + var restoreTextDirection = function(ctx) { + var original = ctx.prevTextDirection; + if (original !== undefined) { + delete ctx.prevTextDirection; + ctx.canvas.style.setProperty('direction', original[0], original[1]); + } + }; + + var helpers_rtl = { + getRtlAdapter: getAdapter, + overrideTextDirection: overrideTextDirection, + restoreTextDirection: restoreTextDirection, + }; + + var helpers$1 = helpers_core; + var easing = helpers_easing; + var canvas = helpers_canvas; + var options = helpers_options; + var math = helpers_math; + var rtl = helpers_rtl; + helpers$1.easing = easing; + helpers$1.canvas = canvas; + helpers$1.options = options; + helpers$1.math = math; + helpers$1.rtl = rtl; + + function interpolate(start, view, model, ease) { + var keys = Object.keys(model); + var i, ilen, key, actual, origin, target, type, c0, c1; + + for (i = 0, ilen = keys.length; i < ilen; ++i) { + key = keys[i]; + + target = model[key]; + + // if a value is added to the model after pivot() has been called, the view + // doesn't contain it, so let's initialize the view to the target value. + if (!view.hasOwnProperty(key)) { + view[key] = target; + } + + actual = view[key]; + + if (actual === target || key[0] === '_') { + continue; + } + + if (!start.hasOwnProperty(key)) { + start[key] = actual; + } + + origin = start[key]; + + type = typeof target; + + if (type === typeof origin) { + if (type === 'string') { + c0 = chartjsColor(origin); + if (c0.valid) { + c1 = chartjsColor(target); + if (c1.valid) { + view[key] = c1.mix(c0, ease).rgbString(); + continue; + } + } + } else if (helpers$1.isFinite(origin) && helpers$1.isFinite(target)) { + view[key] = origin + (target - origin) * ease; + continue; + } + } + + view[key] = target; + } + } + + var Element = function(configuration) { + helpers$1.extend(this, configuration); + this.initialize.apply(this, arguments); + }; + + helpers$1.extend(Element.prototype, { + _type: undefined, + + initialize: function() { + this.hidden = false; + }, + + pivot: function() { + var me = this; + if (!me._view) { + me._view = helpers$1.extend({}, me._model); + } + me._start = {}; + return me; + }, + + transition: function(ease) { + var me = this; + var model = me._model; + var start = me._start; + var view = me._view; + + // No animation -> No Transition + if (!model || ease === 1) { + me._view = helpers$1.extend({}, model); + me._start = null; + return me; + } + + if (!view) { + view = me._view = {}; + } + + if (!start) { + start = me._start = {}; + } + + interpolate(start, view, model, ease); + + return me; + }, + + tooltipPosition: function() { + return { + x: this._model.x, + y: this._model.y + }; + }, + + hasValue: function() { + return helpers$1.isNumber(this._model.x) && helpers$1.isNumber(this._model.y); + } + }); + + Element.extend = helpers$1.inherits; + + var core_element = Element; + + var exports$3 = core_element.extend({ + chart: null, // the animation associated chart instance + currentStep: 0, // the current animation step + numSteps: 60, // default number of steps + easing: '', // the easing to use for this animation + render: null, // render function used by the animation service + + onAnimationProgress: null, // user specified callback to fire on each step of the animation + onAnimationComplete: null, // user specified callback to fire when the animation finishes + }); + + var core_animation = exports$3; + + // DEPRECATIONS + + /** + * Provided for backward compatibility, use Chart.Animation instead + * @prop Chart.Animation#animationObject + * @deprecated since version 2.6.0 + * @todo remove at version 3 + */ + Object.defineProperty(exports$3.prototype, 'animationObject', { + get: function() { + return this; + } + }); + + /** + * Provided for backward compatibility, use Chart.Animation#chart instead + * @prop Chart.Animation#chartInstance + * @deprecated since version 2.6.0 + * @todo remove at version 3 + */ + Object.defineProperty(exports$3.prototype, 'chartInstance', { + get: function() { + return this.chart; + }, + set: function(value) { + this.chart = value; + } + }); + + core_defaults._set('global', { + animation: { + duration: 1000, + easing: 'easeOutQuart', + onProgress: helpers$1.noop, + onComplete: helpers$1.noop + } + }); + + var core_animations = { + animations: [], + request: null, + + /** + * @param {Chart} chart - The chart to animate. + * @param {Chart.Animation} animation - The animation that we will animate. + * @param {number} duration - The animation duration in ms. + * @param {boolean} lazy - if true, the chart is not marked as animating to enable more responsive interactions + */ + addAnimation: function(chart, animation, duration, lazy) { + var animations = this.animations; + var i, ilen; + + animation.chart = chart; + animation.startTime = Date.now(); + animation.duration = duration; + + if (!lazy) { + chart.animating = true; + } + + for (i = 0, ilen = animations.length; i < ilen; ++i) { + if (animations[i].chart === chart) { + animations[i] = animation; + return; + } + } + + animations.push(animation); + + // If there are no animations queued, manually kickstart a digest, for lack of a better word + if (animations.length === 1) { + this.requestAnimationFrame(); + } + }, + + cancelAnimation: function(chart) { + var index = helpers$1.findIndex(this.animations, function(animation) { + return animation.chart === chart; + }); + + if (index !== -1) { + this.animations.splice(index, 1); + chart.animating = false; + } + }, + + requestAnimationFrame: function() { + var me = this; + if (me.request === null) { + // Skip animation frame requests until the active one is executed. + // This can happen when processing mouse events, e.g. 'mousemove' + // and 'mouseout' events will trigger multiple renders. + me.request = helpers$1.requestAnimFrame.call(window, function() { + me.request = null; + me.startDigest(); + }); + } + }, + + /** + * @private + */ + startDigest: function() { + var me = this; + + me.advance(); + + // Do we have more stuff to animate? + if (me.animations.length > 0) { + me.requestAnimationFrame(); + } + }, + + /** + * @private + */ + advance: function() { + var animations = this.animations; + var animation, chart, numSteps, nextStep; + var i = 0; + + // 1 animation per chart, so we are looping charts here + while (i < animations.length) { + animation = animations[i]; + chart = animation.chart; + numSteps = animation.numSteps; + + // Make sure that currentStep starts at 1 + // https://github.com/chartjs/Chart.js/issues/6104 + nextStep = Math.floor((Date.now() - animation.startTime) / animation.duration * numSteps) + 1; + animation.currentStep = Math.min(nextStep, numSteps); + + helpers$1.callback(animation.render, [chart, animation], chart); + helpers$1.callback(animation.onAnimationProgress, [animation], chart); + + if (animation.currentStep >= numSteps) { + helpers$1.callback(animation.onAnimationComplete, [animation], chart); + chart.animating = false; + animations.splice(i, 1); + } else { + ++i; + } + } + } + }; + + var resolve = helpers$1.options.resolve; + + var arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift']; + + /** + * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice', + * 'unshift') and notify the listener AFTER the array has been altered. Listeners are + * called on the 'onData*' callbacks (e.g. onDataPush, etc.) with same arguments. + */ + function listenArrayEvents(array, listener) { + if (array._chartjs) { + array._chartjs.listeners.push(listener); + return; + } + + Object.defineProperty(array, '_chartjs', { + configurable: true, + enumerable: false, + value: { + listeners: [listener] + } + }); + + arrayEvents.forEach(function(key) { + var method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1); + var base = array[key]; + + Object.defineProperty(array, key, { + configurable: true, + enumerable: false, + value: function() { + var args = Array.prototype.slice.call(arguments); + var res = base.apply(this, args); + + helpers$1.each(array._chartjs.listeners, function(object) { + if (typeof object[method] === 'function') { + object[method].apply(object, args); + } + }); + + return res; + } + }); + }); + } + + /** + * Removes the given array event listener and cleanup extra attached properties (such as + * the _chartjs stub and overridden methods) if array doesn't have any more listeners. + */ + function unlistenArrayEvents(array, listener) { + var stub = array._chartjs; + if (!stub) { + return; + } + + var listeners = stub.listeners; + var index = listeners.indexOf(listener); + if (index !== -1) { + listeners.splice(index, 1); + } + + if (listeners.length > 0) { + return; + } + + arrayEvents.forEach(function(key) { + delete array[key]; + }); + + delete array._chartjs; + } + + // Base class for all dataset controllers (line, bar, etc) + var DatasetController = function(chart, datasetIndex) { + this.initialize(chart, datasetIndex); + }; + + helpers$1.extend(DatasetController.prototype, { + + /** + * Element type used to generate a meta dataset (e.g. Chart.element.Line). + * @type {Chart.core.element} + */ + datasetElementType: null, + + /** + * Element type used to generate a meta data (e.g. Chart.element.Point). + * @type {Chart.core.element} + */ + dataElementType: null, + + /** + * Dataset element option keys to be resolved in _resolveDatasetElementOptions. + * A derived controller may override this to resolve controller-specific options. + * The keys defined here are for backward compatibility for legend styles. + * @private + */ + _datasetElementOptions: [ + 'backgroundColor', + 'borderCapStyle', + 'borderColor', + 'borderDash', + 'borderDashOffset', + 'borderJoinStyle', + 'borderWidth' + ], + + /** + * Data element option keys to be resolved in _resolveDataElementOptions. + * A derived controller may override this to resolve controller-specific options. + * The keys defined here are for backward compatibility for legend styles. + * @private + */ + _dataElementOptions: [ + 'backgroundColor', + 'borderColor', + 'borderWidth', + 'pointStyle' + ], + + initialize: function(chart, datasetIndex) { + var me = this; + me.chart = chart; + me.index = datasetIndex; + me.linkScales(); + me.addElements(); + me._type = me.getMeta().type; + }, + + updateIndex: function(datasetIndex) { + this.index = datasetIndex; + }, + + linkScales: function() { + var me = this; + var meta = me.getMeta(); + var chart = me.chart; + var scales = chart.scales; + var dataset = me.getDataset(); + var scalesOpts = chart.options.scales; + + if (meta.xAxisID === null || !(meta.xAxisID in scales) || dataset.xAxisID) { + meta.xAxisID = dataset.xAxisID || scalesOpts.xAxes[0].id; + } + if (meta.yAxisID === null || !(meta.yAxisID in scales) || dataset.yAxisID) { + meta.yAxisID = dataset.yAxisID || scalesOpts.yAxes[0].id; + } + }, + + getDataset: function() { + return this.chart.data.datasets[this.index]; + }, + + getMeta: function() { + return this.chart.getDatasetMeta(this.index); + }, + + getScaleForId: function(scaleID) { + return this.chart.scales[scaleID]; + }, + + /** + * @private + */ + _getValueScaleId: function() { + return this.getMeta().yAxisID; + }, + + /** + * @private + */ + _getIndexScaleId: function() { + return this.getMeta().xAxisID; + }, + + /** + * @private + */ + _getValueScale: function() { + return this.getScaleForId(this._getValueScaleId()); + }, + + /** + * @private + */ + _getIndexScale: function() { + return this.getScaleForId(this._getIndexScaleId()); + }, + + reset: function() { + this._update(true); + }, + + /** + * @private + */ + destroy: function() { + if (this._data) { + unlistenArrayEvents(this._data, this); + } + }, + + createMetaDataset: function() { + var me = this; + var type = me.datasetElementType; + return type && new type({ + _chart: me.chart, + _datasetIndex: me.index + }); + }, + + createMetaData: function(index) { + var me = this; + var type = me.dataElementType; + return type && new type({ + _chart: me.chart, + _datasetIndex: me.index, + _index: index + }); + }, + + addElements: function() { + var me = this; + var meta = me.getMeta(); + var data = me.getDataset().data || []; + var metaData = meta.data; + var i, ilen; + + for (i = 0, ilen = data.length; i < ilen; ++i) { + metaData[i] = metaData[i] || me.createMetaData(i); + } + + meta.dataset = meta.dataset || me.createMetaDataset(); + }, + + addElementAndReset: function(index) { + var element = this.createMetaData(index); + this.getMeta().data.splice(index, 0, element); + this.updateElement(element, index, true); + }, + + buildOrUpdateElements: function() { + var me = this; + var dataset = me.getDataset(); + var data = dataset.data || (dataset.data = []); + + // In order to correctly handle data addition/deletion animation (an thus simulate + // real-time charts), we need to monitor these data modifications and synchronize + // the internal meta data accordingly. + if (me._data !== data) { + if (me._data) { + // This case happens when the user replaced the data array instance. + unlistenArrayEvents(me._data, me); + } + + if (data && Object.isExtensible(data)) { + listenArrayEvents(data, me); + } + me._data = data; + } + + // Re-sync meta data in case the user replaced the data array or if we missed + // any updates and so make sure that we handle number of datapoints changing. + me.resyncElements(); + }, + + /** + * Returns the merged user-supplied and default dataset-level options + * @private + */ + _configure: function() { + var me = this; + me._config = helpers$1.merge({}, [ + me.chart.options.datasets[me._type], + me.getDataset(), + ], { + merger: function(key, target, source) { + if (key !== '_meta' && key !== 'data') { + helpers$1._merger(key, target, source); + } + } + }); + }, + + _update: function(reset) { + var me = this; + me._configure(); + me._cachedDataOpts = null; + me.update(reset); + }, + + update: helpers$1.noop, + + transition: function(easingValue) { + var meta = this.getMeta(); + var elements = meta.data || []; + var ilen = elements.length; + var i = 0; + + for (; i < ilen; ++i) { + elements[i].transition(easingValue); + } + + if (meta.dataset) { + meta.dataset.transition(easingValue); + } + }, + + draw: function() { + var meta = this.getMeta(); + var elements = meta.data || []; + var ilen = elements.length; + var i = 0; + + if (meta.dataset) { + meta.dataset.draw(); + } + + for (; i < ilen; ++i) { + elements[i].draw(); + } + }, + + /** + * Returns a set of predefined style properties that should be used to represent the dataset + * or the data if the index is specified + * @param {number} index - data index + * @return {IStyleInterface} style object + */ + getStyle: function(index) { + var me = this; + var meta = me.getMeta(); + var dataset = meta.dataset; + var style; + + me._configure(); + if (dataset && index === undefined) { + style = me._resolveDatasetElementOptions(dataset || {}); + } else { + index = index || 0; + style = me._resolveDataElementOptions(meta.data[index] || {}, index); + } + + if (style.fill === false || style.fill === null) { + style.backgroundColor = style.borderColor; + } + + return style; + }, + + /** + * @private + */ + _resolveDatasetElementOptions: function(element, hover) { + var me = this; + var chart = me.chart; + var datasetOpts = me._config; + var custom = element.custom || {}; + var options = chart.options.elements[me.datasetElementType.prototype._type] || {}; + var elementOptions = me._datasetElementOptions; + var values = {}; + var i, ilen, key, readKey; + + // Scriptable options + var context = { + chart: chart, + dataset: me.getDataset(), + datasetIndex: me.index, + hover: hover + }; + + for (i = 0, ilen = elementOptions.length; i < ilen; ++i) { + key = elementOptions[i]; + readKey = hover ? 'hover' + key.charAt(0).toUpperCase() + key.slice(1) : key; + values[key] = resolve([ + custom[readKey], + datasetOpts[readKey], + options[readKey] + ], context); + } + + return values; + }, + + /** + * @private + */ + _resolveDataElementOptions: function(element, index) { + var me = this; + var custom = element && element.custom; + var cached = me._cachedDataOpts; + if (cached && !custom) { + return cached; + } + var chart = me.chart; + var datasetOpts = me._config; + var options = chart.options.elements[me.dataElementType.prototype._type] || {}; + var elementOptions = me._dataElementOptions; + var values = {}; + + // Scriptable options + var context = { + chart: chart, + dataIndex: index, + dataset: me.getDataset(), + datasetIndex: me.index + }; + + // `resolve` sets cacheable to `false` if any option is indexed or scripted + var info = {cacheable: !custom}; + + var keys, i, ilen, key; + + custom = custom || {}; + + if (helpers$1.isArray(elementOptions)) { + for (i = 0, ilen = elementOptions.length; i < ilen; ++i) { + key = elementOptions[i]; + values[key] = resolve([ + custom[key], + datasetOpts[key], + options[key] + ], context, index, info); + } + } else { + keys = Object.keys(elementOptions); + for (i = 0, ilen = keys.length; i < ilen; ++i) { + key = keys[i]; + values[key] = resolve([ + custom[key], + datasetOpts[elementOptions[key]], + datasetOpts[key], + options[key] + ], context, index, info); + } + } + + if (info.cacheable) { + me._cachedDataOpts = Object.freeze(values); + } + + return values; + }, + + removeHoverStyle: function(element) { + helpers$1.merge(element._model, element.$previousStyle || {}); + delete element.$previousStyle; + }, + + setHoverStyle: function(element) { + var dataset = this.chart.data.datasets[element._datasetIndex]; + var index = element._index; + var custom = element.custom || {}; + var model = element._model; + var getHoverColor = helpers$1.getHoverColor; + + element.$previousStyle = { + backgroundColor: model.backgroundColor, + borderColor: model.borderColor, + borderWidth: model.borderWidth + }; + + model.backgroundColor = resolve([custom.hoverBackgroundColor, dataset.hoverBackgroundColor, getHoverColor(model.backgroundColor)], undefined, index); + model.borderColor = resolve([custom.hoverBorderColor, dataset.hoverBorderColor, getHoverColor(model.borderColor)], undefined, index); + model.borderWidth = resolve([custom.hoverBorderWidth, dataset.hoverBorderWidth, model.borderWidth], undefined, index); + }, + + /** + * @private + */ + _removeDatasetHoverStyle: function() { + var element = this.getMeta().dataset; + + if (element) { + this.removeHoverStyle(element); + } + }, + + /** + * @private + */ + _setDatasetHoverStyle: function() { + var element = this.getMeta().dataset; + var prev = {}; + var i, ilen, key, keys, hoverOptions, model; + + if (!element) { + return; + } + + model = element._model; + hoverOptions = this._resolveDatasetElementOptions(element, true); + + keys = Object.keys(hoverOptions); + for (i = 0, ilen = keys.length; i < ilen; ++i) { + key = keys[i]; + prev[key] = model[key]; + model[key] = hoverOptions[key]; + } + + element.$previousStyle = prev; + }, + + /** + * @private + */ + resyncElements: function() { + var me = this; + var meta = me.getMeta(); + var data = me.getDataset().data; + var numMeta = meta.data.length; + var numData = data.length; + + if (numData < numMeta) { + meta.data.splice(numData, numMeta - numData); + } else if (numData > numMeta) { + me.insertElements(numMeta, numData - numMeta); + } + }, + + /** + * @private + */ + insertElements: function(start, count) { + for (var i = 0; i < count; ++i) { + this.addElementAndReset(start + i); + } + }, + + /** + * @private + */ + onDataPush: function() { + var count = arguments.length; + this.insertElements(this.getDataset().data.length - count, count); + }, + + /** + * @private + */ + onDataPop: function() { + this.getMeta().data.pop(); + }, + + /** + * @private + */ + onDataShift: function() { + this.getMeta().data.shift(); + }, + + /** + * @private + */ + onDataSplice: function(start, count) { + this.getMeta().data.splice(start, count); + this.insertElements(start, arguments.length - 2); + }, + + /** + * @private + */ + onDataUnshift: function() { + this.insertElements(0, arguments.length); + } + }); + + DatasetController.extend = helpers$1.inherits; + + var core_datasetController = DatasetController; + + var TAU = Math.PI * 2; + + core_defaults._set('global', { + elements: { + arc: { + backgroundColor: core_defaults.global.defaultColor, + borderColor: '#fff', + borderWidth: 2, + borderAlign: 'center' + } + } + }); + + function clipArc(ctx, arc) { + var startAngle = arc.startAngle; + var endAngle = arc.endAngle; + var pixelMargin = arc.pixelMargin; + var angleMargin = pixelMargin / arc.outerRadius; + var x = arc.x; + var y = arc.y; + + // Draw an inner border by cliping the arc and drawing a double-width border + // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders + ctx.beginPath(); + ctx.arc(x, y, arc.outerRadius, startAngle - angleMargin, endAngle + angleMargin); + if (arc.innerRadius > pixelMargin) { + angleMargin = pixelMargin / arc.innerRadius; + ctx.arc(x, y, arc.innerRadius - pixelMargin, endAngle + angleMargin, startAngle - angleMargin, true); + } else { + ctx.arc(x, y, pixelMargin, endAngle + Math.PI / 2, startAngle - Math.PI / 2); + } + ctx.closePath(); + ctx.clip(); + } + + function drawFullCircleBorders(ctx, vm, arc, inner) { + var endAngle = arc.endAngle; + var i; + + if (inner) { + arc.endAngle = arc.startAngle + TAU; + clipArc(ctx, arc); + arc.endAngle = endAngle; + if (arc.endAngle === arc.startAngle && arc.fullCircles) { + arc.endAngle += TAU; + arc.fullCircles--; + } + } + + ctx.beginPath(); + ctx.arc(arc.x, arc.y, arc.innerRadius, arc.startAngle + TAU, arc.startAngle, true); + for (i = 0; i < arc.fullCircles; ++i) { + ctx.stroke(); + } + + ctx.beginPath(); + ctx.arc(arc.x, arc.y, vm.outerRadius, arc.startAngle, arc.startAngle + TAU); + for (i = 0; i < arc.fullCircles; ++i) { + ctx.stroke(); + } + } + + function drawBorder(ctx, vm, arc) { + var inner = vm.borderAlign === 'inner'; + + if (inner) { + ctx.lineWidth = vm.borderWidth * 2; + ctx.lineJoin = 'round'; + } else { + ctx.lineWidth = vm.borderWidth; + ctx.lineJoin = 'bevel'; + } + + if (arc.fullCircles) { + drawFullCircleBorders(ctx, vm, arc, inner); + } + + if (inner) { + clipArc(ctx, arc); + } + + ctx.beginPath(); + ctx.arc(arc.x, arc.y, vm.outerRadius, arc.startAngle, arc.endAngle); + ctx.arc(arc.x, arc.y, arc.innerRadius, arc.endAngle, arc.startAngle, true); + ctx.closePath(); + ctx.stroke(); + } + + var element_arc = core_element.extend({ + _type: 'arc', + + inLabelRange: function(mouseX) { + var vm = this._view; + + if (vm) { + return (Math.pow(mouseX - vm.x, 2) < Math.pow(vm.radius + vm.hoverRadius, 2)); + } + return false; + }, + + inRange: function(chartX, chartY) { + var vm = this._view; + + if (vm) { + var pointRelativePosition = helpers$1.getAngleFromPoint(vm, {x: chartX, y: chartY}); + var angle = pointRelativePosition.angle; + var distance = pointRelativePosition.distance; + + // Sanitise angle range + var startAngle = vm.startAngle; + var endAngle = vm.endAngle; + while (endAngle < startAngle) { + endAngle += TAU; + } + while (angle > endAngle) { + angle -= TAU; + } + while (angle < startAngle) { + angle += TAU; + } + + // Check if within the range of the open/close angle + var betweenAngles = (angle >= startAngle && angle <= endAngle); + var withinRadius = (distance >= vm.innerRadius && distance <= vm.outerRadius); + + return (betweenAngles && withinRadius); + } + return false; + }, + + getCenterPoint: function() { + var vm = this._view; + var halfAngle = (vm.startAngle + vm.endAngle) / 2; + var halfRadius = (vm.innerRadius + vm.outerRadius) / 2; + return { + x: vm.x + Math.cos(halfAngle) * halfRadius, + y: vm.y + Math.sin(halfAngle) * halfRadius + }; + }, + + getArea: function() { + var vm = this._view; + return Math.PI * ((vm.endAngle - vm.startAngle) / (2 * Math.PI)) * (Math.pow(vm.outerRadius, 2) - Math.pow(vm.innerRadius, 2)); + }, + + tooltipPosition: function() { + var vm = this._view; + var centreAngle = vm.startAngle + ((vm.endAngle - vm.startAngle) / 2); + var rangeFromCentre = (vm.outerRadius - vm.innerRadius) / 2 + vm.innerRadius; + + return { + x: vm.x + (Math.cos(centreAngle) * rangeFromCentre), + y: vm.y + (Math.sin(centreAngle) * rangeFromCentre) + }; + }, + + draw: function() { + var ctx = this._chart.ctx; + var vm = this._view; + var pixelMargin = (vm.borderAlign === 'inner') ? 0.33 : 0; + var arc = { + x: vm.x, + y: vm.y, + innerRadius: vm.innerRadius, + outerRadius: Math.max(vm.outerRadius - pixelMargin, 0), + pixelMargin: pixelMargin, + startAngle: vm.startAngle, + endAngle: vm.endAngle, + fullCircles: Math.floor(vm.circumference / TAU) + }; + var i; + + ctx.save(); + + ctx.fillStyle = vm.backgroundColor; + ctx.strokeStyle = vm.borderColor; + + if (arc.fullCircles) { + arc.endAngle = arc.startAngle + TAU; + ctx.beginPath(); + ctx.arc(arc.x, arc.y, arc.outerRadius, arc.startAngle, arc.endAngle); + ctx.arc(arc.x, arc.y, arc.innerRadius, arc.endAngle, arc.startAngle, true); + ctx.closePath(); + for (i = 0; i < arc.fullCircles; ++i) { + ctx.fill(); + } + arc.endAngle = arc.startAngle + vm.circumference % TAU; + } + + ctx.beginPath(); + ctx.arc(arc.x, arc.y, arc.outerRadius, arc.startAngle, arc.endAngle); + ctx.arc(arc.x, arc.y, arc.innerRadius, arc.endAngle, arc.startAngle, true); + ctx.closePath(); + ctx.fill(); + + if (vm.borderWidth) { + drawBorder(ctx, vm, arc); + } + + ctx.restore(); + } + }); + + var valueOrDefault$1 = helpers$1.valueOrDefault; + + var defaultColor = core_defaults.global.defaultColor; + + core_defaults._set('global', { + elements: { + line: { + tension: 0.4, + backgroundColor: defaultColor, + borderWidth: 3, + borderColor: defaultColor, + borderCapStyle: 'butt', + borderDash: [], + borderDashOffset: 0.0, + borderJoinStyle: 'miter', + capBezierPoints: true, + fill: true, // do we fill in the area between the line and its base axis + } + } + }); + + var element_line = core_element.extend({ + _type: 'line', + + draw: function() { + var me = this; + var vm = me._view; + var ctx = me._chart.ctx; + var spanGaps = vm.spanGaps; + var points = me._children.slice(); // clone array + var globalDefaults = core_defaults.global; + var globalOptionLineElements = globalDefaults.elements.line; + var lastDrawnIndex = -1; + var closePath = me._loop; + var index, previous, currentVM; + + if (!points.length) { + return; + } + + if (me._loop) { + for (index = 0; index < points.length; ++index) { + previous = helpers$1.previousItem(points, index); + // If the line has an open path, shift the point array + if (!points[index]._view.skip && previous._view.skip) { + points = points.slice(index).concat(points.slice(0, index)); + closePath = spanGaps; + break; + } + } + // If the line has a close path, add the first point again + if (closePath) { + points.push(points[0]); + } + } + + ctx.save(); + + // Stroke Line Options + ctx.lineCap = vm.borderCapStyle || globalOptionLineElements.borderCapStyle; + + // IE 9 and 10 do not support line dash + if (ctx.setLineDash) { + ctx.setLineDash(vm.borderDash || globalOptionLineElements.borderDash); + } + + ctx.lineDashOffset = valueOrDefault$1(vm.borderDashOffset, globalOptionLineElements.borderDashOffset); + ctx.lineJoin = vm.borderJoinStyle || globalOptionLineElements.borderJoinStyle; + ctx.lineWidth = valueOrDefault$1(vm.borderWidth, globalOptionLineElements.borderWidth); + ctx.strokeStyle = vm.borderColor || globalDefaults.defaultColor; + + // Stroke Line + ctx.beginPath(); + + // First point moves to it's starting position no matter what + currentVM = points[0]._view; + if (!currentVM.skip) { + ctx.moveTo(currentVM.x, currentVM.y); + lastDrawnIndex = 0; + } + + for (index = 1; index < points.length; ++index) { + currentVM = points[index]._view; + previous = lastDrawnIndex === -1 ? helpers$1.previousItem(points, index) : points[lastDrawnIndex]; + + if (!currentVM.skip) { + if ((lastDrawnIndex !== (index - 1) && !spanGaps) || lastDrawnIndex === -1) { + // There was a gap and this is the first point after the gap + ctx.moveTo(currentVM.x, currentVM.y); + } else { + // Line to next point + helpers$1.canvas.lineTo(ctx, previous._view, currentVM); + } + lastDrawnIndex = index; + } + } + + if (closePath) { + ctx.closePath(); + } + + ctx.stroke(); + ctx.restore(); + } + }); + + var valueOrDefault$2 = helpers$1.valueOrDefault; + + var defaultColor$1 = core_defaults.global.defaultColor; + + core_defaults._set('global', { + elements: { + point: { + radius: 3, + pointStyle: 'circle', + backgroundColor: defaultColor$1, + borderColor: defaultColor$1, + borderWidth: 1, + // Hover + hitRadius: 1, + hoverRadius: 4, + hoverBorderWidth: 1 + } + } + }); + + function xRange(mouseX) { + var vm = this._view; + return vm ? (Math.abs(mouseX - vm.x) < vm.radius + vm.hitRadius) : false; + } + + function yRange(mouseY) { + var vm = this._view; + return vm ? (Math.abs(mouseY - vm.y) < vm.radius + vm.hitRadius) : false; + } + + var element_point = core_element.extend({ + _type: 'point', + + inRange: function(mouseX, mouseY) { + var vm = this._view; + return vm ? ((Math.pow(mouseX - vm.x, 2) + Math.pow(mouseY - vm.y, 2)) < Math.pow(vm.hitRadius + vm.radius, 2)) : false; + }, + + inLabelRange: xRange, + inXRange: xRange, + inYRange: yRange, + + getCenterPoint: function() { + var vm = this._view; + return { + x: vm.x, + y: vm.y + }; + }, + + getArea: function() { + return Math.PI * Math.pow(this._view.radius, 2); + }, + + tooltipPosition: function() { + var vm = this._view; + return { + x: vm.x, + y: vm.y, + padding: vm.radius + vm.borderWidth + }; + }, + + draw: function(chartArea) { + var vm = this._view; + var ctx = this._chart.ctx; + var pointStyle = vm.pointStyle; + var rotation = vm.rotation; + var radius = vm.radius; + var x = vm.x; + var y = vm.y; + var globalDefaults = core_defaults.global; + var defaultColor = globalDefaults.defaultColor; // eslint-disable-line no-shadow + + if (vm.skip) { + return; + } + + // Clipping for Points. + if (chartArea === undefined || helpers$1.canvas._isPointInArea(vm, chartArea)) { + ctx.strokeStyle = vm.borderColor || defaultColor; + ctx.lineWidth = valueOrDefault$2(vm.borderWidth, globalDefaults.elements.point.borderWidth); + ctx.fillStyle = vm.backgroundColor || defaultColor; + helpers$1.canvas.drawPoint(ctx, pointStyle, radius, x, y, rotation); + } + } + }); + + var defaultColor$2 = core_defaults.global.defaultColor; + + core_defaults._set('global', { + elements: { + rectangle: { + backgroundColor: defaultColor$2, + borderColor: defaultColor$2, + borderSkipped: 'bottom', + borderWidth: 0 + } + } + }); + + function isVertical(vm) { + return vm && vm.width !== undefined; + } + + /** + * Helper function to get the bounds of the bar regardless of the orientation + * @param bar {Chart.Element.Rectangle} the bar + * @return {Bounds} bounds of the bar + * @private + */ + function getBarBounds(vm) { + var x1, x2, y1, y2, half; + + if (isVertical(vm)) { + half = vm.width / 2; + x1 = vm.x - half; + x2 = vm.x + half; + y1 = Math.min(vm.y, vm.base); + y2 = Math.max(vm.y, vm.base); + } else { + half = vm.height / 2; + x1 = Math.min(vm.x, vm.base); + x2 = Math.max(vm.x, vm.base); + y1 = vm.y - half; + y2 = vm.y + half; + } + + return { + left: x1, + top: y1, + right: x2, + bottom: y2 + }; + } + + function swap(orig, v1, v2) { + return orig === v1 ? v2 : orig === v2 ? v1 : orig; + } + + function parseBorderSkipped(vm) { + var edge = vm.borderSkipped; + var res = {}; + + if (!edge) { + return res; + } + + if (vm.horizontal) { + if (vm.base > vm.x) { + edge = swap(edge, 'left', 'right'); + } + } else if (vm.base < vm.y) { + edge = swap(edge, 'bottom', 'top'); + } + + res[edge] = true; + return res; + } + + function parseBorderWidth(vm, maxW, maxH) { + var value = vm.borderWidth; + var skip = parseBorderSkipped(vm); + var t, r, b, l; + + if (helpers$1.isObject(value)) { + t = +value.top || 0; + r = +value.right || 0; + b = +value.bottom || 0; + l = +value.left || 0; + } else { + t = r = b = l = +value || 0; + } + + return { + t: skip.top || (t < 0) ? 0 : t > maxH ? maxH : t, + r: skip.right || (r < 0) ? 0 : r > maxW ? maxW : r, + b: skip.bottom || (b < 0) ? 0 : b > maxH ? maxH : b, + l: skip.left || (l < 0) ? 0 : l > maxW ? maxW : l + }; + } + + function boundingRects(vm) { + var bounds = getBarBounds(vm); + var width = bounds.right - bounds.left; + var height = bounds.bottom - bounds.top; + var border = parseBorderWidth(vm, width / 2, height / 2); + + return { + outer: { + x: bounds.left, + y: bounds.top, + w: width, + h: height + }, + inner: { + x: bounds.left + border.l, + y: bounds.top + border.t, + w: width - border.l - border.r, + h: height - border.t - border.b + } + }; + } + + function inRange(vm, x, y) { + var skipX = x === null; + var skipY = y === null; + var bounds = !vm || (skipX && skipY) ? false : getBarBounds(vm); + + return bounds + && (skipX || x >= bounds.left && x <= bounds.right) + && (skipY || y >= bounds.top && y <= bounds.bottom); + } + + var element_rectangle = core_element.extend({ + _type: 'rectangle', + + draw: function() { + var ctx = this._chart.ctx; + var vm = this._view; + var rects = boundingRects(vm); + var outer = rects.outer; + var inner = rects.inner; + + ctx.fillStyle = vm.backgroundColor; + ctx.fillRect(outer.x, outer.y, outer.w, outer.h); + + if (outer.w === inner.w && outer.h === inner.h) { + return; + } + + ctx.save(); + ctx.beginPath(); + ctx.rect(outer.x, outer.y, outer.w, outer.h); + ctx.clip(); + ctx.fillStyle = vm.borderColor; + ctx.rect(inner.x, inner.y, inner.w, inner.h); + ctx.fill('evenodd'); + ctx.restore(); + }, + + height: function() { + var vm = this._view; + return vm.base - vm.y; + }, + + inRange: function(mouseX, mouseY) { + return inRange(this._view, mouseX, mouseY); + }, + + inLabelRange: function(mouseX, mouseY) { + var vm = this._view; + return isVertical(vm) + ? inRange(vm, mouseX, null) + : inRange(vm, null, mouseY); + }, + + inXRange: function(mouseX) { + return inRange(this._view, mouseX, null); + }, + + inYRange: function(mouseY) { + return inRange(this._view, null, mouseY); + }, + + getCenterPoint: function() { + var vm = this._view; + var x, y; + if (isVertical(vm)) { + x = vm.x; + y = (vm.y + vm.base) / 2; + } else { + x = (vm.x + vm.base) / 2; + y = vm.y; + } + + return {x: x, y: y}; + }, + + getArea: function() { + var vm = this._view; + + return isVertical(vm) + ? vm.width * Math.abs(vm.y - vm.base) + : vm.height * Math.abs(vm.x - vm.base); + }, + + tooltipPosition: function() { + var vm = this._view; + return { + x: vm.x, + y: vm.y }; } - - module.exports = function(Chart) { - - Chart.controllers.bar = Chart.DatasetController.extend({ - - dataElementType: elements.Rectangle, - - initialize: function() { - var me = this; - var meta; - - Chart.DatasetController.prototype.initialize.apply(me, arguments); - - meta = me.getMeta(); - meta.stack = me.getDataset().stack; - meta.bar = true; - }, - - update: function(reset) { - var me = this; - var rects = me.getMeta().data; - var i, ilen; - - me._ruler = me.getRuler(); - - for (i = 0, ilen = rects.length; i < ilen; ++i) { - me.updateElement(rects[i], i, reset); - } - }, - - updateElement: function(rectangle, index, reset) { - var me = this; - var chart = me.chart; - var meta = me.getMeta(); - var dataset = me.getDataset(); - var custom = rectangle.custom || {}; - var rectangleOptions = chart.options.elements.rectangle; - - rectangle._xScale = me.getScaleForId(meta.xAxisID); - rectangle._yScale = me.getScaleForId(meta.yAxisID); - rectangle._datasetIndex = me.index; - rectangle._index = index; - - rectangle._model = { - datasetLabel: dataset.label, - label: chart.data.labels[index], - borderSkipped: custom.borderSkipped ? custom.borderSkipped : rectangleOptions.borderSkipped, - backgroundColor: custom.backgroundColor ? custom.backgroundColor : helpers.valueAtIndexOrDefault(dataset.backgroundColor, index, rectangleOptions.backgroundColor), - borderColor: custom.borderColor ? custom.borderColor : helpers.valueAtIndexOrDefault(dataset.borderColor, index, rectangleOptions.borderColor), - borderWidth: custom.borderWidth ? custom.borderWidth : helpers.valueAtIndexOrDefault(dataset.borderWidth, index, rectangleOptions.borderWidth) - }; - - me.updateElementGeometry(rectangle, index, reset); - - rectangle.pivot(); - }, - - /** - * @private - */ - updateElementGeometry: function(rectangle, index, reset) { - var me = this; - var model = rectangle._model; - var vscale = me.getValueScale(); - var base = vscale.getBasePixel(); - var horizontal = vscale.isHorizontal(); - var ruler = me._ruler || me.getRuler(); - var vpixels = me.calculateBarValuePixels(me.index, index); - var ipixels = me.calculateBarIndexPixels(me.index, index, ruler); - - model.horizontal = horizontal; - model.base = reset ? base : vpixels.base; - model.x = horizontal ? reset ? base : vpixels.head : ipixels.center; - model.y = horizontal ? ipixels.center : reset ? base : vpixels.head; - model.height = horizontal ? ipixels.size : undefined; - model.width = horizontal ? undefined : ipixels.size; - }, - - /** - * @private - */ - getValueScaleId: function() { - return this.getMeta().yAxisID; - }, - - /** - * @private - */ - getIndexScaleId: function() { - return this.getMeta().xAxisID; - }, - - /** - * @private - */ - getValueScale: function() { - return this.getScaleForId(this.getValueScaleId()); - }, - - /** - * @private - */ - getIndexScale: function() { - return this.getScaleForId(this.getIndexScaleId()); - }, - - /** - * Returns the stacks based on groups and bar visibility. - * @param {Number} [last] - The dataset index - * @returns {Array} The stack list - * @private - */ - _getStacks: function(last) { - var me = this; - var chart = me.chart; - var scale = me.getIndexScale(); - var stacked = scale.options.stacked; - var ilen = last === undefined ? chart.data.datasets.length : last + 1; - var stacks = []; - var i, meta; - - for (i = 0; i < ilen; ++i) { - meta = chart.getDatasetMeta(i); - if (meta.bar && chart.isDatasetVisible(i) && - (stacked === false || - (stacked === true && stacks.indexOf(meta.stack) === -1) || - (stacked === undefined && (meta.stack === undefined || stacks.indexOf(meta.stack) === -1)))) { - stacks.push(meta.stack); - } - } - - return stacks; - }, - - /** - * Returns the effective number of stacks based on groups and bar visibility. - * @private - */ - getStackCount: function() { - return this._getStacks().length; - }, - - /** - * Returns the stack index for the given dataset based on groups and bar visibility. - * @param {Number} [datasetIndex] - The dataset index - * @param {String} [name] - The stack name to find - * @returns {Number} The stack index - * @private - */ - getStackIndex: function(datasetIndex, name) { - var stacks = this._getStacks(datasetIndex); - var index = (name !== undefined) - ? stacks.indexOf(name) - : -1; // indexOf returns -1 if element is not present - - return (index === -1) - ? stacks.length - 1 - : index; - }, - - /** - * @private - */ - getRuler: function() { - var me = this; - var scale = me.getIndexScale(); - var stackCount = me.getStackCount(); - var datasetIndex = me.index; - var isHorizontal = scale.isHorizontal(); - var start = isHorizontal ? scale.left : scale.top; - var end = start + (isHorizontal ? scale.width : scale.height); - var pixels = []; - var i, ilen, min; - - for (i = 0, ilen = me.getMeta().data.length; i < ilen; ++i) { - pixels.push(scale.getPixelForValue(null, i, datasetIndex)); - } - - min = helpers.isNullOrUndef(scale.options.barThickness) - ? computeMinSampleSize(scale, pixels) - : -1; - - return { - min: min, - pixels: pixels, - start: start, - end: end, - stackCount: stackCount, - scale: scale - }; - }, - - /** - * Note: pixel values are not clamped to the scale area. - * @private - */ - calculateBarValuePixels: function(datasetIndex, index) { - var me = this; - var chart = me.chart; - var meta = me.getMeta(); - var scale = me.getValueScale(); - var datasets = chart.data.datasets; - var value = scale.getRightValue(datasets[datasetIndex].data[index]); - var stacked = scale.options.stacked; - var stack = meta.stack; - var start = 0; - var i, imeta, ivalue, base, head, size; - - if (stacked || (stacked === undefined && stack !== undefined)) { - for (i = 0; i < datasetIndex; ++i) { - imeta = chart.getDatasetMeta(i); - - if (imeta.bar && - imeta.stack === stack && - imeta.controller.getValueScaleId() === scale.id && - chart.isDatasetVisible(i)) { - - ivalue = scale.getRightValue(datasets[i].data[index]); - if ((value < 0 && ivalue < 0) || (value >= 0 && ivalue > 0)) { - start += ivalue; - } - } - } - } - - base = scale.getPixelForValue(start); - head = scale.getPixelForValue(start + value); - size = (head - base) / 2; - - return { - size: size, - base: base, - head: head, - center: head + size / 2 - }; - }, - - /** - * @private - */ - calculateBarIndexPixels: function(datasetIndex, index, ruler) { - var me = this; - var options = ruler.scale.options; - var range = options.barThickness === 'flex' - ? computeFlexCategoryTraits(index, ruler, options) - : computeFitCategoryTraits(index, ruler, options); - - var stackIndex = me.getStackIndex(datasetIndex, me.getMeta().stack); - var center = range.start + (range.chunk * stackIndex) + (range.chunk / 2); - var size = Math.min( - helpers.valueOrDefault(options.maxBarThickness, Infinity), - range.chunk * range.ratio); - - return { - base: center - size / 2, - head: center + size / 2, - center: center, - size: size - }; - }, - - draw: function() { - var me = this; - var chart = me.chart; - var scale = me.getValueScale(); - var rects = me.getMeta().data; - var dataset = me.getDataset(); - var ilen = rects.length; - var i = 0; - - helpers.canvas.clipArea(chart.ctx, chart.chartArea); - - for (; i < ilen; ++i) { - if (!isNaN(scale.getRightValue(dataset.data[i]))) { - rects[i].draw(); - } - } - - helpers.canvas.unclipArea(chart.ctx); - }, - - setHoverStyle: function(rectangle) { - var dataset = this.chart.data.datasets[rectangle._datasetIndex]; - var index = rectangle._index; - var custom = rectangle.custom || {}; - var model = rectangle._model; - - model.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : helpers.valueAtIndexOrDefault(dataset.hoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor)); - model.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : helpers.valueAtIndexOrDefault(dataset.hoverBorderColor, index, helpers.getHoverColor(model.borderColor)); - model.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : helpers.valueAtIndexOrDefault(dataset.hoverBorderWidth, index, model.borderWidth); - }, - - removeHoverStyle: function(rectangle) { - var dataset = this.chart.data.datasets[rectangle._datasetIndex]; - var index = rectangle._index; - var custom = rectangle.custom || {}; - var model = rectangle._model; - var rectangleElementOptions = this.chart.options.elements.rectangle; - - model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : helpers.valueAtIndexOrDefault(dataset.backgroundColor, index, rectangleElementOptions.backgroundColor); - model.borderColor = custom.borderColor ? custom.borderColor : helpers.valueAtIndexOrDefault(dataset.borderColor, index, rectangleElementOptions.borderColor); - model.borderWidth = custom.borderWidth ? custom.borderWidth : helpers.valueAtIndexOrDefault(dataset.borderWidth, index, rectangleElementOptions.borderWidth); + }); + + var elements = {}; + var Arc = element_arc; + var Line = element_line; + var Point = element_point; + var Rectangle = element_rectangle; + elements.Arc = Arc; + elements.Line = Line; + elements.Point = Point; + elements.Rectangle = Rectangle; + + var deprecated = helpers$1._deprecated; + var valueOrDefault$3 = helpers$1.valueOrDefault; + + core_defaults._set('bar', { + hover: { + mode: 'label' + }, + + scales: { + xAxes: [{ + type: 'category', + offset: true, + gridLines: { + offsetGridLines: true } - }); - - Chart.controllers.horizontalBar = Chart.controllers.bar.extend({ - /** - * @private - */ - getValueScaleId: function() { - return this.getMeta().xAxisID; - }, - - /** - * @private - */ - getIndexScaleId: function() { - return this.getMeta().yAxisID; - } - }); + }], + + yAxes: [{ + type: 'linear' + }] + } + }); + + core_defaults._set('global', { + datasets: { + bar: { + categoryPercentage: 0.8, + barPercentage: 0.9 + } + } + }); + + /** + * Computes the "optimal" sample size to maintain bars equally sized while preventing overlap. + * @private + */ + function computeMinSampleSize(scale, pixels) { + var min = scale._length; + var prev, curr, i, ilen; + + for (i = 1, ilen = pixels.length; i < ilen; ++i) { + min = Math.min(min, Math.abs(pixels[i] - pixels[i - 1])); + } + + for (i = 0, ilen = scale.getTicks().length; i < ilen; ++i) { + curr = scale.getPixelForTick(i); + min = i > 0 ? Math.min(min, Math.abs(curr - prev)) : min; + prev = curr; + } + + return min; + } + + /** + * Computes an "ideal" category based on the absolute bar thickness or, if undefined or null, + * uses the smallest interval (see computeMinSampleSize) that prevents bar overlapping. This + * mode currently always generates bars equally sized (until we introduce scriptable options?). + * @private + */ + function computeFitCategoryTraits(index, ruler, options) { + var thickness = options.barThickness; + var count = ruler.stackCount; + var curr = ruler.pixels[index]; + var min = helpers$1.isNullOrUndef(thickness) + ? computeMinSampleSize(ruler.scale, ruler.pixels) + : -1; + var size, ratio; + + if (helpers$1.isNullOrUndef(thickness)) { + size = min * options.categoryPercentage; + ratio = options.barPercentage; + } else { + // When bar thickness is enforced, category and bar percentages are ignored. + // Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%') + // and deprecate barPercentage since this value is ignored when thickness is absolute. + size = thickness * count; + ratio = 1; + } + + return { + chunk: size / count, + ratio: ratio, + start: curr - (size / 2) }; - - },{"25":25,"40":40,"45":45}],16:[function(require,module,exports){ - 'use strict'; - - var defaults = require(25); - var elements = require(40); - var helpers = require(45); - - defaults._set('bubble', { - hover: { - mode: 'single' - }, - - scales: { - xAxes: [{ - type: 'linear', // bubble should probably use a linear scale by default - position: 'bottom', - id: 'x-axis-0' // need an ID so datasets can reference the scale - }], - yAxes: [{ - type: 'linear', - position: 'left', - id: 'y-axis-0' - }] - }, - - tooltips: { - callbacks: { - title: function() { - // Title doesn't make sense for scatter since we format the data as a point - return ''; - }, - label: function(item, data) { - var datasetLabel = data.datasets[item.datasetIndex].label || ''; - var dataPoint = data.datasets[item.datasetIndex].data[item.index]; - return datasetLabel + ': (' + item.xLabel + ', ' + item.yLabel + ', ' + dataPoint.r + ')'; - } - } - } - }); - - - module.exports = function(Chart) { - - Chart.controllers.bubble = Chart.DatasetController.extend({ - /** - * @protected - */ - dataElementType: elements.Point, - - /** - * @protected - */ - update: function(reset) { - var me = this; - var meta = me.getMeta(); - var points = meta.data; - - // Update Points - helpers.each(points, function(point, index) { - me.updateElement(point, index, reset); - }); - }, - - /** - * @protected - */ - updateElement: function(point, index, reset) { - var me = this; - var meta = me.getMeta(); - var custom = point.custom || {}; - var xScale = me.getScaleForId(meta.xAxisID); - var yScale = me.getScaleForId(meta.yAxisID); - var options = me._resolveElementOptions(point, index); - var data = me.getDataset().data[index]; - var dsIndex = me.index; - - var x = reset ? xScale.getPixelForDecimal(0.5) : xScale.getPixelForValue(typeof data === 'object' ? data : NaN, index, dsIndex); - var y = reset ? yScale.getBasePixel() : yScale.getPixelForValue(data, index, dsIndex); - - point._xScale = xScale; - point._yScale = yScale; - point._options = options; - point._datasetIndex = dsIndex; - point._index = index; - point._model = { - backgroundColor: options.backgroundColor, - borderColor: options.borderColor, - borderWidth: options.borderWidth, - hitRadius: options.hitRadius, - pointStyle: options.pointStyle, - radius: reset ? 0 : options.radius, - skip: custom.skip || isNaN(x) || isNaN(y), - x: x, - y: y, - }; - - point.pivot(); - }, - - /** - * @protected - */ - setHoverStyle: function(point) { - var model = point._model; - var options = point._options; - - model.backgroundColor = helpers.valueOrDefault(options.hoverBackgroundColor, helpers.getHoverColor(options.backgroundColor)); - model.borderColor = helpers.valueOrDefault(options.hoverBorderColor, helpers.getHoverColor(options.borderColor)); - model.borderWidth = helpers.valueOrDefault(options.hoverBorderWidth, options.borderWidth); - model.radius = options.radius + options.hoverRadius; - }, - - /** - * @protected - */ - removeHoverStyle: function(point) { - var model = point._model; - var options = point._options; - - model.backgroundColor = options.backgroundColor; - model.borderColor = options.borderColor; - model.borderWidth = options.borderWidth; - model.radius = options.radius; - }, - - /** - * @private - */ - _resolveElementOptions: function(point, index) { - var me = this; - var chart = me.chart; - var datasets = chart.data.datasets; - var dataset = datasets[me.index]; - var custom = point.custom || {}; - var options = chart.options.elements.point; - var resolve = helpers.options.resolve; - var data = dataset.data[index]; - var values = {}; - var i, ilen, key; - - // Scriptable options - var context = { - chart: chart, - dataIndex: index, - dataset: dataset, - datasetIndex: me.index - }; - - var keys = [ - 'backgroundColor', - 'borderColor', - 'borderWidth', - 'hoverBackgroundColor', - 'hoverBorderColor', - 'hoverBorderWidth', - 'hoverRadius', - 'hitRadius', - 'pointStyle' - ]; - - for (i = 0, ilen = keys.length; i < ilen; ++i) { - key = keys[i]; - values[key] = resolve([ - custom[key], - dataset[key], - options[key] - ], context, index); - } - - // Custom radius resolution - values.radius = resolve([ - custom.radius, - data ? data.r : undefined, - dataset.radius, - options.radius - ], context, index); - - return values; - } - }); + } + + /** + * Computes an "optimal" category that globally arranges bars side by side (no gap when + * percentage options are 1), based on the previous and following categories. This mode + * generates bars with different widths when data are not evenly spaced. + * @private + */ + function computeFlexCategoryTraits(index, ruler, options) { + var pixels = ruler.pixels; + var curr = pixels[index]; + var prev = index > 0 ? pixels[index - 1] : null; + var next = index < pixels.length - 1 ? pixels[index + 1] : null; + var percent = options.categoryPercentage; + var start, size; + + if (prev === null) { + // first data: its size is double based on the next point or, + // if it's also the last data, we use the scale size. + prev = curr - (next === null ? ruler.end - ruler.start : next - curr); + } + + if (next === null) { + // last data: its size is also double based on the previous point. + next = curr + curr - prev; + } + + start = curr - (curr - Math.min(prev, next)) / 2 * percent; + size = Math.abs(next - prev) / 2 * percent; + + return { + chunk: size / ruler.stackCount, + ratio: options.barPercentage, + start: start }; - - },{"25":25,"40":40,"45":45}],17:[function(require,module,exports){ - 'use strict'; - - var defaults = require(25); - var elements = require(40); - var helpers = require(45); - - defaults._set('doughnut', { - animation: { - // Boolean - Whether we animate the rotation of the Doughnut - animateRotate: true, - // Boolean - Whether we animate scaling the Doughnut from the centre - animateScale: false - }, - hover: { - mode: 'single' - }, - legendCallback: function(chart) { - var text = []; - text.push('
      '); - - var data = chart.data; - var datasets = data.datasets; - var labels = data.labels; - - if (datasets.length) { - for (var i = 0; i < datasets[0].data.length; ++i) { - text.push('
    • '); - if (labels[i]) { - text.push(labels[i]); - } - text.push('
    • '); - } + } + + var controller_bar = core_datasetController.extend({ + + dataElementType: elements.Rectangle, + + /** + * @private + */ + _dataElementOptions: [ + 'backgroundColor', + 'borderColor', + 'borderSkipped', + 'borderWidth', + 'barPercentage', + 'barThickness', + 'categoryPercentage', + 'maxBarThickness', + 'minBarLength' + ], + + initialize: function() { + var me = this; + var meta, scaleOpts; + + core_datasetController.prototype.initialize.apply(me, arguments); + + meta = me.getMeta(); + meta.stack = me.getDataset().stack; + meta.bar = true; + + scaleOpts = me._getIndexScale().options; + deprecated('bar chart', scaleOpts.barPercentage, 'scales.[x/y]Axes.barPercentage', 'dataset.barPercentage'); + deprecated('bar chart', scaleOpts.barThickness, 'scales.[x/y]Axes.barThickness', 'dataset.barThickness'); + deprecated('bar chart', scaleOpts.categoryPercentage, 'scales.[x/y]Axes.categoryPercentage', 'dataset.categoryPercentage'); + deprecated('bar chart', me._getValueScale().options.minBarLength, 'scales.[x/y]Axes.minBarLength', 'dataset.minBarLength'); + deprecated('bar chart', scaleOpts.maxBarThickness, 'scales.[x/y]Axes.maxBarThickness', 'dataset.maxBarThickness'); + }, + + update: function(reset) { + var me = this; + var rects = me.getMeta().data; + var i, ilen; + + me._ruler = me.getRuler(); + + for (i = 0, ilen = rects.length; i < ilen; ++i) { + me.updateElement(rects[i], i, reset); + } + }, + + updateElement: function(rectangle, index, reset) { + var me = this; + var meta = me.getMeta(); + var dataset = me.getDataset(); + var options = me._resolveDataElementOptions(rectangle, index); + + rectangle._xScale = me.getScaleForId(meta.xAxisID); + rectangle._yScale = me.getScaleForId(meta.yAxisID); + rectangle._datasetIndex = me.index; + rectangle._index = index; + rectangle._model = { + backgroundColor: options.backgroundColor, + borderColor: options.borderColor, + borderSkipped: options.borderSkipped, + borderWidth: options.borderWidth, + datasetLabel: dataset.label, + label: me.chart.data.labels[index] + }; + + if (helpers$1.isArray(dataset.data[index])) { + rectangle._model.borderSkipped = null; + } + + me._updateElementGeometry(rectangle, index, reset, options); + + rectangle.pivot(); + }, + + /** + * @private + */ + _updateElementGeometry: function(rectangle, index, reset, options) { + var me = this; + var model = rectangle._model; + var vscale = me._getValueScale(); + var base = vscale.getBasePixel(); + var horizontal = vscale.isHorizontal(); + var ruler = me._ruler || me.getRuler(); + var vpixels = me.calculateBarValuePixels(me.index, index, options); + var ipixels = me.calculateBarIndexPixels(me.index, index, ruler, options); + + model.horizontal = horizontal; + model.base = reset ? base : vpixels.base; + model.x = horizontal ? reset ? base : vpixels.head : ipixels.center; + model.y = horizontal ? ipixels.center : reset ? base : vpixels.head; + model.height = horizontal ? ipixels.size : undefined; + model.width = horizontal ? undefined : ipixels.size; + }, + + /** + * Returns the stacks based on groups and bar visibility. + * @param {number} [last] - The dataset index + * @returns {string[]} The list of stack IDs + * @private + */ + _getStacks: function(last) { + var me = this; + var scale = me._getIndexScale(); + var metasets = scale._getMatchingVisibleMetas(me._type); + var stacked = scale.options.stacked; + var ilen = metasets.length; + var stacks = []; + var i, meta; + + for (i = 0; i < ilen; ++i) { + meta = metasets[i]; + // stacked | meta.stack + // | found | not found | undefined + // false | x | x | x + // true | | x | + // undefined | | x | x + if (stacked === false || stacks.indexOf(meta.stack) === -1 || + (stacked === undefined && meta.stack === undefined)) { + stacks.push(meta.stack); } - - text.push('
    '); - return text.join(''); - }, - legend: { - labels: { - generateLabels: function(chart) { - var data = chart.data; - if (data.labels.length && data.datasets.length) { - return data.labels.map(function(label, i) { - var meta = chart.getDatasetMeta(0); - var ds = data.datasets[0]; - var arc = meta.data[i]; - var custom = arc && arc.custom || {}; - var valueAtIndexOrDefault = helpers.valueAtIndexOrDefault; - var arcOpts = chart.options.elements.arc; - var fill = custom.backgroundColor ? custom.backgroundColor : valueAtIndexOrDefault(ds.backgroundColor, i, arcOpts.backgroundColor); - var stroke = custom.borderColor ? custom.borderColor : valueAtIndexOrDefault(ds.borderColor, i, arcOpts.borderColor); - var bw = custom.borderWidth ? custom.borderWidth : valueAtIndexOrDefault(ds.borderWidth, i, arcOpts.borderWidth); - - return { - text: label, - fillStyle: fill, - strokeStyle: stroke, - lineWidth: bw, - hidden: isNaN(ds.data[i]) || meta.data[i].hidden, - - // Extra data used for toggling the correct item - index: i - }; - }); - } - return []; - } - }, - - onClick: function(e, legendItem) { - var index = legendItem.index; - var chart = this.chart; - var i, ilen, meta; - - for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) { - meta = chart.getDatasetMeta(i); - // toggle visibility of index if exists - if (meta.data[index]) { - meta.data[index].hidden = !meta.data[index].hidden; - } - } - - chart.update(); + if (meta.index === last) { + break; } - }, - - // The percentage of the chart that we cut out of the middle. - cutoutPercentage: 50, - - // The rotation of the chart, where the first data arc begins. - rotation: Math.PI * -0.5, - - // The total circumference of the chart. - circumference: Math.PI * 2.0, - - // Need to override these to give a nice default - tooltips: { - callbacks: { - title: function() { - return ''; - }, - label: function(tooltipItem, data) { - var dataLabel = data.labels[tooltipItem.index]; - var value = ': ' + data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index]; - - if (helpers.isArray(dataLabel)) { - // show value on first line of multiline label - // need to clone because we are changing the value - dataLabel = dataLabel.slice(); - dataLabel[0] += value; - } else { - dataLabel += value; + } + + return stacks; + }, + + /** + * Returns the effective number of stacks based on groups and bar visibility. + * @private + */ + getStackCount: function() { + return this._getStacks().length; + }, + + /** + * Returns the stack index for the given dataset based on groups and bar visibility. + * @param {number} [datasetIndex] - The dataset index + * @param {string} [name] - The stack name to find + * @returns {number} The stack index + * @private + */ + getStackIndex: function(datasetIndex, name) { + var stacks = this._getStacks(datasetIndex); + var index = (name !== undefined) + ? stacks.indexOf(name) + : -1; // indexOf returns -1 if element is not present + + return (index === -1) + ? stacks.length - 1 + : index; + }, + + /** + * @private + */ + getRuler: function() { + var me = this; + var scale = me._getIndexScale(); + var pixels = []; + var i, ilen; + + for (i = 0, ilen = me.getMeta().data.length; i < ilen; ++i) { + pixels.push(scale.getPixelForValue(null, i, me.index)); + } + + return { + pixels: pixels, + start: scale._startPixel, + end: scale._endPixel, + stackCount: me.getStackCount(), + scale: scale + }; + }, + + /** + * Note: pixel values are not clamped to the scale area. + * @private + */ + calculateBarValuePixels: function(datasetIndex, index, options) { + var me = this; + var chart = me.chart; + var scale = me._getValueScale(); + var isHorizontal = scale.isHorizontal(); + var datasets = chart.data.datasets; + var metasets = scale._getMatchingVisibleMetas(me._type); + var value = scale._parseValue(datasets[datasetIndex].data[index]); + var minBarLength = options.minBarLength; + var stacked = scale.options.stacked; + var stack = me.getMeta().stack; + var start = value.start === undefined ? 0 : value.max >= 0 && value.min >= 0 ? value.min : value.max; + var length = value.start === undefined ? value.end : value.max >= 0 && value.min >= 0 ? value.max - value.min : value.min - value.max; + var ilen = metasets.length; + var i, imeta, ivalue, base, head, size, stackLength; + + if (stacked || (stacked === undefined && stack !== undefined)) { + for (i = 0; i < ilen; ++i) { + imeta = metasets[i]; + + if (imeta.index === datasetIndex) { + break; + } + + if (imeta.stack === stack) { + stackLength = scale._parseValue(datasets[imeta.index].data[index]); + ivalue = stackLength.start === undefined ? stackLength.end : stackLength.min >= 0 && stackLength.max >= 0 ? stackLength.max : stackLength.min; + + if ((value.min < 0 && ivalue < 0) || (value.max >= 0 && ivalue > 0)) { + start += ivalue; } - - return dataLabel; } } } - }); - - defaults._set('pie', helpers.clone(defaults.doughnut)); - defaults._set('pie', { - cutoutPercentage: 0 - }); - - module.exports = function(Chart) { - - Chart.controllers.doughnut = Chart.controllers.pie = Chart.DatasetController.extend({ - - dataElementType: elements.Arc, - - linkScales: helpers.noop, - - // Get index of the dataset in relation to the visible datasets. This allows determining the inner and outer radius correctly - getRingIndex: function(datasetIndex) { - var ringIndex = 0; - - for (var j = 0; j < datasetIndex; ++j) { - if (this.chart.isDatasetVisible(j)) { - ++ringIndex; - } - } - - return ringIndex; - }, - - update: function(reset) { - var me = this; - var chart = me.chart; - var chartArea = chart.chartArea; - var opts = chart.options; - var arcOpts = opts.elements.arc; - var availableWidth = chartArea.right - chartArea.left - arcOpts.borderWidth; - var availableHeight = chartArea.bottom - chartArea.top - arcOpts.borderWidth; - var minSize = Math.min(availableWidth, availableHeight); - var offset = {x: 0, y: 0}; - var meta = me.getMeta(); - var cutoutPercentage = opts.cutoutPercentage; - var circumference = opts.circumference; - - // If the chart's circumference isn't a full circle, calculate minSize as a ratio of the width/height of the arc - if (circumference < Math.PI * 2.0) { - var startAngle = opts.rotation % (Math.PI * 2.0); - startAngle += Math.PI * 2.0 * (startAngle >= Math.PI ? -1 : startAngle < -Math.PI ? 1 : 0); - var endAngle = startAngle + circumference; - var start = {x: Math.cos(startAngle), y: Math.sin(startAngle)}; - var end = {x: Math.cos(endAngle), y: Math.sin(endAngle)}; - var contains0 = (startAngle <= 0 && endAngle >= 0) || (startAngle <= Math.PI * 2.0 && Math.PI * 2.0 <= endAngle); - var contains90 = (startAngle <= Math.PI * 0.5 && Math.PI * 0.5 <= endAngle) || (startAngle <= Math.PI * 2.5 && Math.PI * 2.5 <= endAngle); - var contains180 = (startAngle <= -Math.PI && -Math.PI <= endAngle) || (startAngle <= Math.PI && Math.PI <= endAngle); - var contains270 = (startAngle <= -Math.PI * 0.5 && -Math.PI * 0.5 <= endAngle) || (startAngle <= Math.PI * 1.5 && Math.PI * 1.5 <= endAngle); - var cutout = cutoutPercentage / 100.0; - var min = {x: contains180 ? -1 : Math.min(start.x * (start.x < 0 ? 1 : cutout), end.x * (end.x < 0 ? 1 : cutout)), y: contains270 ? -1 : Math.min(start.y * (start.y < 0 ? 1 : cutout), end.y * (end.y < 0 ? 1 : cutout))}; - var max = {x: contains0 ? 1 : Math.max(start.x * (start.x > 0 ? 1 : cutout), end.x * (end.x > 0 ? 1 : cutout)), y: contains90 ? 1 : Math.max(start.y * (start.y > 0 ? 1 : cutout), end.y * (end.y > 0 ? 1 : cutout))}; - var size = {width: (max.x - min.x) * 0.5, height: (max.y - min.y) * 0.5}; - minSize = Math.min(availableWidth / size.width, availableHeight / size.height); - offset = {x: (max.x + min.x) * -0.5, y: (max.y + min.y) * -0.5}; - } - - chart.borderWidth = me.getMaxBorderWidth(meta.data); - chart.outerRadius = Math.max((minSize - chart.borderWidth) / 2, 0); - chart.innerRadius = Math.max(cutoutPercentage ? (chart.outerRadius / 100) * (cutoutPercentage) : 0, 0); - chart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount(); - chart.offsetX = offset.x * chart.outerRadius; - chart.offsetY = offset.y * chart.outerRadius; - - meta.total = me.calculateTotal(); - - me.outerRadius = chart.outerRadius - (chart.radiusLength * me.getRingIndex(me.index)); - me.innerRadius = Math.max(me.outerRadius - chart.radiusLength, 0); - - helpers.each(meta.data, function(arc, index) { - me.updateElement(arc, index, reset); - }); - }, - - updateElement: function(arc, index, reset) { - var me = this; - var chart = me.chart; - var chartArea = chart.chartArea; - var opts = chart.options; - var animationOpts = opts.animation; - var centerX = (chartArea.left + chartArea.right) / 2; - var centerY = (chartArea.top + chartArea.bottom) / 2; - var startAngle = opts.rotation; // non reset case handled later - var endAngle = opts.rotation; // non reset case handled later - var dataset = me.getDataset(); - var circumference = reset && animationOpts.animateRotate ? 0 : arc.hidden ? 0 : me.calculateCircumference(dataset.data[index]) * (opts.circumference / (2.0 * Math.PI)); - var innerRadius = reset && animationOpts.animateScale ? 0 : me.innerRadius; - var outerRadius = reset && animationOpts.animateScale ? 0 : me.outerRadius; - var valueAtIndexOrDefault = helpers.valueAtIndexOrDefault; - - helpers.extend(arc, { - // Utility - _datasetIndex: me.index, - _index: index, - - // Desired view properties - _model: { - x: centerX + chart.offsetX, - y: centerY + chart.offsetY, - startAngle: startAngle, - endAngle: endAngle, - circumference: circumference, - outerRadius: outerRadius, - innerRadius: innerRadius, - label: valueAtIndexOrDefault(dataset.label, index, chart.data.labels[index]) - } - }); - - var model = arc._model; - // Resets the visual styles - this.removeHoverStyle(arc); - - // Set correct angles if not resetting - if (!reset || !animationOpts.animateRotate) { - if (index === 0) { - model.startAngle = opts.rotation; - } else { - model.startAngle = me.getMeta().data[index - 1]._model.endAngle; - } - - model.endAngle = model.startAngle + model.circumference; - } - - arc.pivot(); - }, - - removeHoverStyle: function(arc) { - Chart.DatasetController.prototype.removeHoverStyle.call(this, arc, this.chart.options.elements.arc); - }, - - calculateTotal: function() { - var dataset = this.getDataset(); - var meta = this.getMeta(); - var total = 0; - var value; - - helpers.each(meta.data, function(element, index) { - value = dataset.data[index]; - if (!isNaN(value) && !element.hidden) { - total += Math.abs(value); - } - }); - - /* if (total === 0) { - total = NaN; - }*/ - - return total; - }, - - calculateCircumference: function(value) { - var total = this.getMeta().total; - if (total > 0 && !isNaN(value)) { - return (Math.PI * 2.0) * (Math.abs(value) / total); - } - return 0; - }, - - // gets the max border or hover width to properly scale pie charts - getMaxBorderWidth: function(arcs) { - var max = 0; - var index = this.index; - var length = arcs.length; - var borderWidth; - var hoverWidth; - - for (var i = 0; i < length; i++) { - borderWidth = arcs[i]._model ? arcs[i]._model.borderWidth : 0; - hoverWidth = arcs[i]._chart ? arcs[i]._chart.config.data.datasets[index].hoverBorderWidth : 0; - - max = borderWidth > max ? borderWidth : max; - max = hoverWidth > max ? hoverWidth : max; - } - return max; + + base = scale.getPixelForValue(start); + head = scale.getPixelForValue(start + length); + size = head - base; + + if (minBarLength !== undefined && Math.abs(size) < minBarLength) { + size = minBarLength; + if (length >= 0 && !isHorizontal || length < 0 && isHorizontal) { + head = base - minBarLength; + } else { + head = base + minBarLength; } + } + + return { + size: size, + base: base, + head: head, + center: head + size / 2 + }; + }, + + /** + * @private + */ + calculateBarIndexPixels: function(datasetIndex, index, ruler, options) { + var me = this; + var range = options.barThickness === 'flex' + ? computeFlexCategoryTraits(index, ruler, options) + : computeFitCategoryTraits(index, ruler, options); + + var stackIndex = me.getStackIndex(datasetIndex, me.getMeta().stack); + var center = range.start + (range.chunk * stackIndex) + (range.chunk / 2); + var size = Math.min( + valueOrDefault$3(options.maxBarThickness, Infinity), + range.chunk * range.ratio); + + return { + base: center - size / 2, + head: center + size / 2, + center: center, + size: size + }; + }, + + draw: function() { + var me = this; + var chart = me.chart; + var scale = me._getValueScale(); + var rects = me.getMeta().data; + var dataset = me.getDataset(); + var ilen = rects.length; + var i = 0; + + helpers$1.canvas.clipArea(chart.ctx, chart.chartArea); + + for (; i < ilen; ++i) { + var val = scale._parseValue(dataset.data[i]); + if (!isNaN(val.min) && !isNaN(val.max)) { + rects[i].draw(); + } + } + + helpers$1.canvas.unclipArea(chart.ctx); + }, + + /** + * @private + */ + _resolveDataElementOptions: function() { + var me = this; + var values = helpers$1.extend({}, core_datasetController.prototype._resolveDataElementOptions.apply(me, arguments)); + var indexOpts = me._getIndexScale().options; + var valueOpts = me._getValueScale().options; + + values.barPercentage = valueOrDefault$3(indexOpts.barPercentage, values.barPercentage); + values.barThickness = valueOrDefault$3(indexOpts.barThickness, values.barThickness); + values.categoryPercentage = valueOrDefault$3(indexOpts.categoryPercentage, values.categoryPercentage); + values.maxBarThickness = valueOrDefault$3(indexOpts.maxBarThickness, values.maxBarThickness); + values.minBarLength = valueOrDefault$3(valueOpts.minBarLength, values.minBarLength); + + return values; + } + + }); + + var valueOrDefault$4 = helpers$1.valueOrDefault; + var resolve$1 = helpers$1.options.resolve; + + core_defaults._set('bubble', { + hover: { + mode: 'single' + }, + + scales: { + xAxes: [{ + type: 'linear', // bubble should probably use a linear scale by default + position: 'bottom', + id: 'x-axis-0' // need an ID so datasets can reference the scale + }], + yAxes: [{ + type: 'linear', + position: 'left', + id: 'y-axis-0' + }] + }, + + tooltips: { + callbacks: { + title: function() { + // Title doesn't make sense for scatter since we format the data as a point + return ''; + }, + label: function(item, data) { + var datasetLabel = data.datasets[item.datasetIndex].label || ''; + var dataPoint = data.datasets[item.datasetIndex].data[item.index]; + return datasetLabel + ': (' + item.xLabel + ', ' + item.yLabel + ', ' + dataPoint.r + ')'; + } + } + } + }); + + var controller_bubble = core_datasetController.extend({ + /** + * @protected + */ + dataElementType: elements.Point, + + /** + * @private + */ + _dataElementOptions: [ + 'backgroundColor', + 'borderColor', + 'borderWidth', + 'hoverBackgroundColor', + 'hoverBorderColor', + 'hoverBorderWidth', + 'hoverRadius', + 'hitRadius', + 'pointStyle', + 'rotation' + ], + + /** + * @protected + */ + update: function(reset) { + var me = this; + var meta = me.getMeta(); + var points = meta.data; + + // Update Points + helpers$1.each(points, function(point, index) { + me.updateElement(point, index, reset); }); - }; - - },{"25":25,"40":40,"45":45}],18:[function(require,module,exports){ - 'use strict'; - - var defaults = require(25); - var elements = require(40); - var helpers = require(45); - - defaults._set('line', { - showLines: true, - spanGaps: false, - - hover: { - mode: 'label' - }, - - scales: { - xAxes: [{ - type: 'category', - id: 'x-axis-0' - }], - yAxes: [{ - type: 'linear', - id: 'y-axis-0' - }] + }, + + /** + * @protected + */ + updateElement: function(point, index, reset) { + var me = this; + var meta = me.getMeta(); + var custom = point.custom || {}; + var xScale = me.getScaleForId(meta.xAxisID); + var yScale = me.getScaleForId(meta.yAxisID); + var options = me._resolveDataElementOptions(point, index); + var data = me.getDataset().data[index]; + var dsIndex = me.index; + + var x = reset ? xScale.getPixelForDecimal(0.5) : xScale.getPixelForValue(typeof data === 'object' ? data : NaN, index, dsIndex); + var y = reset ? yScale.getBasePixel() : yScale.getPixelForValue(data, index, dsIndex); + + point._xScale = xScale; + point._yScale = yScale; + point._options = options; + point._datasetIndex = dsIndex; + point._index = index; + point._model = { + backgroundColor: options.backgroundColor, + borderColor: options.borderColor, + borderWidth: options.borderWidth, + hitRadius: options.hitRadius, + pointStyle: options.pointStyle, + rotation: options.rotation, + radius: reset ? 0 : options.radius, + skip: custom.skip || isNaN(x) || isNaN(y), + x: x, + y: y, + }; + + point.pivot(); + }, + + /** + * @protected + */ + setHoverStyle: function(point) { + var model = point._model; + var options = point._options; + var getHoverColor = helpers$1.getHoverColor; + + point.$previousStyle = { + backgroundColor: model.backgroundColor, + borderColor: model.borderColor, + borderWidth: model.borderWidth, + radius: model.radius + }; + + model.backgroundColor = valueOrDefault$4(options.hoverBackgroundColor, getHoverColor(options.backgroundColor)); + model.borderColor = valueOrDefault$4(options.hoverBorderColor, getHoverColor(options.borderColor)); + model.borderWidth = valueOrDefault$4(options.hoverBorderWidth, options.borderWidth); + model.radius = options.radius + options.hoverRadius; + }, + + /** + * @private + */ + _resolveDataElementOptions: function(point, index) { + var me = this; + var chart = me.chart; + var dataset = me.getDataset(); + var custom = point.custom || {}; + var data = dataset.data[index] || {}; + var values = core_datasetController.prototype._resolveDataElementOptions.apply(me, arguments); + + // Scriptable options + var context = { + chart: chart, + dataIndex: index, + dataset: dataset, + datasetIndex: me.index + }; + + // In case values were cached (and thus frozen), we need to clone the values + if (me._cachedDataOpts === values) { + values = helpers$1.extend({}, values); } - }); - - module.exports = function(Chart) { - - function lineEnabled(dataset, options) { - return helpers.valueOrDefault(dataset.showLine, options.showLines); + + // Custom radius resolution + values.radius = resolve$1([ + custom.radius, + data.r, + me._config.radius, + chart.options.elements.point.radius + ], context, index); + + return values; + } + }); + + var valueOrDefault$5 = helpers$1.valueOrDefault; + + var PI$1 = Math.PI; + var DOUBLE_PI$1 = PI$1 * 2; + var HALF_PI$1 = PI$1 / 2; + + core_defaults._set('doughnut', { + animation: { + // Boolean - Whether we animate the rotation of the Doughnut + animateRotate: true, + // Boolean - Whether we animate scaling the Doughnut from the centre + animateScale: false + }, + hover: { + mode: 'single' + }, + legendCallback: function(chart) { + var list = document.createElement('ul'); + var data = chart.data; + var datasets = data.datasets; + var labels = data.labels; + var i, ilen, listItem, listItemSpan; + + list.setAttribute('class', chart.id + '-legend'); + if (datasets.length) { + for (i = 0, ilen = datasets[0].data.length; i < ilen; ++i) { + listItem = list.appendChild(document.createElement('li')); + listItemSpan = listItem.appendChild(document.createElement('span')); + listItemSpan.style.backgroundColor = datasets[0].backgroundColor[i]; + if (labels[i]) { + listItem.appendChild(document.createTextNode(labels[i])); + } + } } - - Chart.controllers.line = Chart.DatasetController.extend({ - - datasetElementType: elements.Line, - - dataElementType: elements.Point, - - update: function(reset) { - var me = this; - var meta = me.getMeta(); - var line = meta.dataset; - var points = meta.data || []; - var options = me.chart.options; - var lineElementOptions = options.elements.line; - var scale = me.getScaleForId(meta.yAxisID); - var i, ilen, custom; - var dataset = me.getDataset(); - var showLine = lineEnabled(dataset, options); - - // Update Line - if (showLine) { - custom = line.custom || {}; - - // Compatibility: If the properties are defined with only the old name, use those values - if ((dataset.tension !== undefined) && (dataset.lineTension === undefined)) { - dataset.lineTension = dataset.tension; - } - - // Utility - line._scale = scale; - line._datasetIndex = me.index; - // Data - line._children = points; - // Model - line._model = { - // Appearance - // The default behavior of lines is to break at null values, according - // to https://github.com/chartjs/Chart.js/issues/2435#issuecomment-216718158 - // This option gives lines the ability to span gaps - spanGaps: dataset.spanGaps ? dataset.spanGaps : options.spanGaps, - tension: custom.tension ? custom.tension : helpers.valueOrDefault(dataset.lineTension, lineElementOptions.tension), - backgroundColor: custom.backgroundColor ? custom.backgroundColor : (dataset.backgroundColor || lineElementOptions.backgroundColor), - borderWidth: custom.borderWidth ? custom.borderWidth : (dataset.borderWidth || lineElementOptions.borderWidth), - borderColor: custom.borderColor ? custom.borderColor : (dataset.borderColor || lineElementOptions.borderColor), - borderCapStyle: custom.borderCapStyle ? custom.borderCapStyle : (dataset.borderCapStyle || lineElementOptions.borderCapStyle), - borderDash: custom.borderDash ? custom.borderDash : (dataset.borderDash || lineElementOptions.borderDash), - borderDashOffset: custom.borderDashOffset ? custom.borderDashOffset : (dataset.borderDashOffset || lineElementOptions.borderDashOffset), - borderJoinStyle: custom.borderJoinStyle ? custom.borderJoinStyle : (dataset.borderJoinStyle || lineElementOptions.borderJoinStyle), - fill: custom.fill ? custom.fill : (dataset.fill !== undefined ? dataset.fill : lineElementOptions.fill), - steppedLine: custom.steppedLine ? custom.steppedLine : helpers.valueOrDefault(dataset.steppedLine, lineElementOptions.stepped), - cubicInterpolationMode: custom.cubicInterpolationMode ? custom.cubicInterpolationMode : helpers.valueOrDefault(dataset.cubicInterpolationMode, lineElementOptions.cubicInterpolationMode), - }; - - line.pivot(); - } - - // Update Points - for (i = 0, ilen = points.length; i < ilen; ++i) { - me.updateElement(points[i], i, reset); - } - - if (showLine && line._model.tension !== 0) { - me.updateBezierControlPoints(); - } - - // Now pivot the point for animation - for (i = 0, ilen = points.length; i < ilen; ++i) { - points[i].pivot(); - } - }, - - getPointBackgroundColor: function(point, index) { - var backgroundColor = this.chart.options.elements.point.backgroundColor; - var dataset = this.getDataset(); - var custom = point.custom || {}; - - if (custom.backgroundColor) { - backgroundColor = custom.backgroundColor; - } else if (dataset.pointBackgroundColor) { - backgroundColor = helpers.valueAtIndexOrDefault(dataset.pointBackgroundColor, index, backgroundColor); - } else if (dataset.backgroundColor) { - backgroundColor = dataset.backgroundColor; - } - - return backgroundColor; - }, - - getPointBorderColor: function(point, index) { - var borderColor = this.chart.options.elements.point.borderColor; - var dataset = this.getDataset(); - var custom = point.custom || {}; - - if (custom.borderColor) { - borderColor = custom.borderColor; - } else if (dataset.pointBorderColor) { - borderColor = helpers.valueAtIndexOrDefault(dataset.pointBorderColor, index, borderColor); - } else if (dataset.borderColor) { - borderColor = dataset.borderColor; - } - - return borderColor; - }, - - getPointBorderWidth: function(point, index) { - var borderWidth = this.chart.options.elements.point.borderWidth; - var dataset = this.getDataset(); - var custom = point.custom || {}; - - if (!isNaN(custom.borderWidth)) { - borderWidth = custom.borderWidth; - } else if (!isNaN(dataset.pointBorderWidth) || helpers.isArray(dataset.pointBorderWidth)) { - borderWidth = helpers.valueAtIndexOrDefault(dataset.pointBorderWidth, index, borderWidth); - } else if (!isNaN(dataset.borderWidth)) { - borderWidth = dataset.borderWidth; - } - - return borderWidth; - }, - - updateElement: function(point, index, reset) { - var me = this; - var meta = me.getMeta(); - var custom = point.custom || {}; - var dataset = me.getDataset(); - var datasetIndex = me.index; - var value = dataset.data[index]; - var yScale = me.getScaleForId(meta.yAxisID); - var xScale = me.getScaleForId(meta.xAxisID); - var pointOptions = me.chart.options.elements.point; - var x, y; - - // Compatibility: If the properties are defined with only the old name, use those values - if ((dataset.radius !== undefined) && (dataset.pointRadius === undefined)) { - dataset.pointRadius = dataset.radius; - } - if ((dataset.hitRadius !== undefined) && (dataset.pointHitRadius === undefined)) { - dataset.pointHitRadius = dataset.hitRadius; - } - - x = xScale.getPixelForValue(typeof value === 'object' ? value : NaN, index, datasetIndex); - y = reset ? yScale.getBasePixel() : me.calculatePointY(value, index, datasetIndex); - - // Utility - point._xScale = xScale; - point._yScale = yScale; - point._datasetIndex = datasetIndex; - point._index = index; - - // Desired view properties - point._model = { - x: x, - y: y, - skip: custom.skip || isNaN(x) || isNaN(y), - // Appearance - radius: custom.radius || helpers.valueAtIndexOrDefault(dataset.pointRadius, index, pointOptions.radius), - pointStyle: custom.pointStyle || helpers.valueAtIndexOrDefault(dataset.pointStyle, index, pointOptions.pointStyle), - backgroundColor: me.getPointBackgroundColor(point, index), - borderColor: me.getPointBorderColor(point, index), - borderWidth: me.getPointBorderWidth(point, index), - tension: meta.dataset._model ? meta.dataset._model.tension : 0, - steppedLine: meta.dataset._model ? meta.dataset._model.steppedLine : false, - // Tooltip - hitRadius: custom.hitRadius || helpers.valueAtIndexOrDefault(dataset.pointHitRadius, index, pointOptions.hitRadius) - }; - }, - - calculatePointY: function(value, index, datasetIndex) { - var me = this; - var chart = me.chart; - var meta = me.getMeta(); - var yScale = me.getScaleForId(meta.yAxisID); - var sumPos = 0; - var sumNeg = 0; - var i, ds, dsMeta; - - if (yScale.options.stacked) { - for (i = 0; i < datasetIndex; i++) { - ds = chart.data.datasets[i]; - dsMeta = chart.getDatasetMeta(i); - if (dsMeta.type === 'line' && dsMeta.yAxisID === yScale.id && chart.isDatasetVisible(i)) { - var stackedRightValue = Number(yScale.getRightValue(ds.data[index])); - if (stackedRightValue < 0) { - sumNeg += stackedRightValue || 0; - } else { - sumPos += stackedRightValue || 0; - } - } - } - - var rightValue = Number(yScale.getRightValue(value)); - if (rightValue < 0) { - return yScale.getPixelForValue(sumNeg + rightValue); - } - return yScale.getPixelForValue(sumPos + rightValue); - } - - return yScale.getPixelForValue(value); - }, - - updateBezierControlPoints: function() { - var me = this; - var meta = me.getMeta(); - var area = me.chart.chartArea; - var points = (meta.data || []); - var i, ilen, point, model, controlPoints; - - // Only consider points that are drawn in case the spanGaps option is used - if (meta.dataset._model.spanGaps) { - points = points.filter(function(pt) { - return !pt._model.skip; + + return list.outerHTML; + }, + legend: { + labels: { + generateLabels: function(chart) { + var data = chart.data; + if (data.labels.length && data.datasets.length) { + return data.labels.map(function(label, i) { + var meta = chart.getDatasetMeta(0); + var style = meta.controller.getStyle(i); + + return { + text: label, + fillStyle: style.backgroundColor, + strokeStyle: style.borderColor, + lineWidth: style.borderWidth, + hidden: isNaN(data.datasets[0].data[i]) || meta.data[i].hidden, + + // Extra data used for toggling the correct item + index: i + }; }); } - - function capControlPoint(pt, min, max) { - return Math.max(Math.min(pt, max), min); + return []; + } + }, + + onClick: function(e, legendItem) { + var index = legendItem.index; + var chart = this.chart; + var i, ilen, meta; + + for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) { + meta = chart.getDatasetMeta(i); + // toggle visibility of index if exists + if (meta.data[index]) { + meta.data[index].hidden = !meta.data[index].hidden; } - - if (meta.dataset._model.cubicInterpolationMode === 'monotone') { - helpers.splineCurveMonotone(points); + } + + chart.update(); + } + }, + + // The percentage of the chart that we cut out of the middle. + cutoutPercentage: 50, + + // The rotation of the chart, where the first data arc begins. + rotation: -HALF_PI$1, + + // The total circumference of the chart. + circumference: DOUBLE_PI$1, + + // Need to override these to give a nice default + tooltips: { + callbacks: { + title: function() { + return ''; + }, + label: function(tooltipItem, data) { + var dataLabel = data.labels[tooltipItem.index]; + var value = ': ' + data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index]; + + if (helpers$1.isArray(dataLabel)) { + // show value on first line of multiline label + // need to clone because we are changing the value + dataLabel = dataLabel.slice(); + dataLabel[0] += value; } else { - for (i = 0, ilen = points.length; i < ilen; ++i) { - point = points[i]; - model = point._model; - controlPoints = helpers.splineCurve( - helpers.previousItem(points, i)._model, - model, - helpers.nextItem(points, i)._model, - meta.dataset._model.tension - ); - model.controlPointPreviousX = controlPoints.previous.x; - model.controlPointPreviousY = controlPoints.previous.y; - model.controlPointNextX = controlPoints.next.x; - model.controlPointNextY = controlPoints.next.y; + dataLabel += value; + } + + return dataLabel; + } + } + } + }); + + var controller_doughnut = core_datasetController.extend({ + + dataElementType: elements.Arc, + + linkScales: helpers$1.noop, + + /** + * @private + */ + _dataElementOptions: [ + 'backgroundColor', + 'borderColor', + 'borderWidth', + 'borderAlign', + 'hoverBackgroundColor', + 'hoverBorderColor', + 'hoverBorderWidth', + ], + + // Get index of the dataset in relation to the visible datasets. This allows determining the inner and outer radius correctly + getRingIndex: function(datasetIndex) { + var ringIndex = 0; + + for (var j = 0; j < datasetIndex; ++j) { + if (this.chart.isDatasetVisible(j)) { + ++ringIndex; + } + } + + return ringIndex; + }, + + update: function(reset) { + var me = this; + var chart = me.chart; + var chartArea = chart.chartArea; + var opts = chart.options; + var ratioX = 1; + var ratioY = 1; + var offsetX = 0; + var offsetY = 0; + var meta = me.getMeta(); + var arcs = meta.data; + var cutout = opts.cutoutPercentage / 100 || 0; + var circumference = opts.circumference; + var chartWeight = me._getRingWeight(me.index); + var maxWidth, maxHeight, i, ilen; + + // If the chart's circumference isn't a full circle, calculate size as a ratio of the width/height of the arc + if (circumference < DOUBLE_PI$1) { + var startAngle = opts.rotation % DOUBLE_PI$1; + startAngle += startAngle >= PI$1 ? -DOUBLE_PI$1 : startAngle < -PI$1 ? DOUBLE_PI$1 : 0; + var endAngle = startAngle + circumference; + var startX = Math.cos(startAngle); + var startY = Math.sin(startAngle); + var endX = Math.cos(endAngle); + var endY = Math.sin(endAngle); + var contains0 = (startAngle <= 0 && endAngle >= 0) || endAngle >= DOUBLE_PI$1; + var contains90 = (startAngle <= HALF_PI$1 && endAngle >= HALF_PI$1) || endAngle >= DOUBLE_PI$1 + HALF_PI$1; + var contains180 = startAngle === -PI$1 || endAngle >= PI$1; + var contains270 = (startAngle <= -HALF_PI$1 && endAngle >= -HALF_PI$1) || endAngle >= PI$1 + HALF_PI$1; + var minX = contains180 ? -1 : Math.min(startX, startX * cutout, endX, endX * cutout); + var minY = contains270 ? -1 : Math.min(startY, startY * cutout, endY, endY * cutout); + var maxX = contains0 ? 1 : Math.max(startX, startX * cutout, endX, endX * cutout); + var maxY = contains90 ? 1 : Math.max(startY, startY * cutout, endY, endY * cutout); + ratioX = (maxX - minX) / 2; + ratioY = (maxY - minY) / 2; + offsetX = -(maxX + minX) / 2; + offsetY = -(maxY + minY) / 2; + } + + for (i = 0, ilen = arcs.length; i < ilen; ++i) { + arcs[i]._options = me._resolveDataElementOptions(arcs[i], i); + } + + chart.borderWidth = me.getMaxBorderWidth(); + maxWidth = (chartArea.right - chartArea.left - chart.borderWidth) / ratioX; + maxHeight = (chartArea.bottom - chartArea.top - chart.borderWidth) / ratioY; + chart.outerRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0); + chart.innerRadius = Math.max(chart.outerRadius * cutout, 0); + chart.radiusLength = (chart.outerRadius - chart.innerRadius) / (me._getVisibleDatasetWeightTotal() || 1); + chart.offsetX = offsetX * chart.outerRadius; + chart.offsetY = offsetY * chart.outerRadius; + + meta.total = me.calculateTotal(); + + me.outerRadius = chart.outerRadius - chart.radiusLength * me._getRingWeightOffset(me.index); + me.innerRadius = Math.max(me.outerRadius - chart.radiusLength * chartWeight, 0); + + for (i = 0, ilen = arcs.length; i < ilen; ++i) { + me.updateElement(arcs[i], i, reset); + } + }, + + updateElement: function(arc, index, reset) { + var me = this; + var chart = me.chart; + var chartArea = chart.chartArea; + var opts = chart.options; + var animationOpts = opts.animation; + var centerX = (chartArea.left + chartArea.right) / 2; + var centerY = (chartArea.top + chartArea.bottom) / 2; + var startAngle = opts.rotation; // non reset case handled later + var endAngle = opts.rotation; // non reset case handled later + var dataset = me.getDataset(); + var circumference = reset && animationOpts.animateRotate ? 0 : arc.hidden ? 0 : me.calculateCircumference(dataset.data[index]) * (opts.circumference / DOUBLE_PI$1); + var innerRadius = reset && animationOpts.animateScale ? 0 : me.innerRadius; + var outerRadius = reset && animationOpts.animateScale ? 0 : me.outerRadius; + var options = arc._options || {}; + + helpers$1.extend(arc, { + // Utility + _datasetIndex: me.index, + _index: index, + + // Desired view properties + _model: { + backgroundColor: options.backgroundColor, + borderColor: options.borderColor, + borderWidth: options.borderWidth, + borderAlign: options.borderAlign, + x: centerX + chart.offsetX, + y: centerY + chart.offsetY, + startAngle: startAngle, + endAngle: endAngle, + circumference: circumference, + outerRadius: outerRadius, + innerRadius: innerRadius, + label: helpers$1.valueAtIndexOrDefault(dataset.label, index, chart.data.labels[index]) + } + }); + + var model = arc._model; + + // Set correct angles if not resetting + if (!reset || !animationOpts.animateRotate) { + if (index === 0) { + model.startAngle = opts.rotation; + } else { + model.startAngle = me.getMeta().data[index - 1]._model.endAngle; + } + + model.endAngle = model.startAngle + model.circumference; + } + + arc.pivot(); + }, + + calculateTotal: function() { + var dataset = this.getDataset(); + var meta = this.getMeta(); + var total = 0; + var value; + + helpers$1.each(meta.data, function(element, index) { + value = dataset.data[index]; + if (!isNaN(value) && !element.hidden) { + total += Math.abs(value); + } + }); + + /* if (total === 0) { + total = NaN; + }*/ + + return total; + }, + + calculateCircumference: function(value) { + var total = this.getMeta().total; + if (total > 0 && !isNaN(value)) { + return DOUBLE_PI$1 * (Math.abs(value) / total); + } + return 0; + }, + + // gets the max border or hover width to properly scale pie charts + getMaxBorderWidth: function(arcs) { + var me = this; + var max = 0; + var chart = me.chart; + var i, ilen, meta, arc, controller, options, borderWidth, hoverWidth; + + if (!arcs) { + // Find the outmost visible dataset + for (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) { + if (chart.isDatasetVisible(i)) { + meta = chart.getDatasetMeta(i); + arcs = meta.data; + if (i !== me.index) { + controller = meta.controller; + } + break; + } + } + } + + if (!arcs) { + return 0; + } + + for (i = 0, ilen = arcs.length; i < ilen; ++i) { + arc = arcs[i]; + if (controller) { + controller._configure(); + options = controller._resolveDataElementOptions(arc, i); + } else { + options = arc._options; + } + if (options.borderAlign !== 'inner') { + borderWidth = options.borderWidth; + hoverWidth = options.hoverBorderWidth; + + max = borderWidth > max ? borderWidth : max; + max = hoverWidth > max ? hoverWidth : max; + } + } + return max; + }, + + /** + * @protected + */ + setHoverStyle: function(arc) { + var model = arc._model; + var options = arc._options; + var getHoverColor = helpers$1.getHoverColor; + + arc.$previousStyle = { + backgroundColor: model.backgroundColor, + borderColor: model.borderColor, + borderWidth: model.borderWidth, + }; + + model.backgroundColor = valueOrDefault$5(options.hoverBackgroundColor, getHoverColor(options.backgroundColor)); + model.borderColor = valueOrDefault$5(options.hoverBorderColor, getHoverColor(options.borderColor)); + model.borderWidth = valueOrDefault$5(options.hoverBorderWidth, options.borderWidth); + }, + + /** + * Get radius length offset of the dataset in relation to the visible datasets weights. This allows determining the inner and outer radius correctly + * @private + */ + _getRingWeightOffset: function(datasetIndex) { + var ringWeightOffset = 0; + + for (var i = 0; i < datasetIndex; ++i) { + if (this.chart.isDatasetVisible(i)) { + ringWeightOffset += this._getRingWeight(i); + } + } + + return ringWeightOffset; + }, + + /** + * @private + */ + _getRingWeight: function(dataSetIndex) { + return Math.max(valueOrDefault$5(this.chart.data.datasets[dataSetIndex].weight, 1), 0); + }, + + /** + * Returns the sum of all visibile data set weights. This value can be 0. + * @private + */ + _getVisibleDatasetWeightTotal: function() { + return this._getRingWeightOffset(this.chart.data.datasets.length); + } + }); + + core_defaults._set('horizontalBar', { + hover: { + mode: 'index', + axis: 'y' + }, + + scales: { + xAxes: [{ + type: 'linear', + position: 'bottom' + }], + + yAxes: [{ + type: 'category', + position: 'left', + offset: true, + gridLines: { + offsetGridLines: true + } + }] + }, + + elements: { + rectangle: { + borderSkipped: 'left' + } + }, + + tooltips: { + mode: 'index', + axis: 'y' + } + }); + + core_defaults._set('global', { + datasets: { + horizontalBar: { + categoryPercentage: 0.8, + barPercentage: 0.9 + } + } + }); + + var controller_horizontalBar = controller_bar.extend({ + /** + * @private + */ + _getValueScaleId: function() { + return this.getMeta().xAxisID; + }, + + /** + * @private + */ + _getIndexScaleId: function() { + return this.getMeta().yAxisID; + } + }); + + var valueOrDefault$6 = helpers$1.valueOrDefault; + var resolve$2 = helpers$1.options.resolve; + var isPointInArea = helpers$1.canvas._isPointInArea; + + core_defaults._set('line', { + showLines: true, + spanGaps: false, + + hover: { + mode: 'label' + }, + + scales: { + xAxes: [{ + type: 'category', + id: 'x-axis-0' + }], + yAxes: [{ + type: 'linear', + id: 'y-axis-0' + }] + } + }); + + function scaleClip(scale, halfBorderWidth) { + var tickOpts = scale && scale.options.ticks || {}; + var reverse = tickOpts.reverse; + var min = tickOpts.min === undefined ? halfBorderWidth : 0; + var max = tickOpts.max === undefined ? halfBorderWidth : 0; + return { + start: reverse ? max : min, + end: reverse ? min : max + }; + } + + function defaultClip(xScale, yScale, borderWidth) { + var halfBorderWidth = borderWidth / 2; + var x = scaleClip(xScale, halfBorderWidth); + var y = scaleClip(yScale, halfBorderWidth); + + return { + top: y.end, + right: x.end, + bottom: y.start, + left: x.start + }; + } + + function toClip(value) { + var t, r, b, l; + + if (helpers$1.isObject(value)) { + t = value.top; + r = value.right; + b = value.bottom; + l = value.left; + } else { + t = r = b = l = value; + } + + return { + top: t, + right: r, + bottom: b, + left: l + }; + } + + + var controller_line = core_datasetController.extend({ + + datasetElementType: elements.Line, + + dataElementType: elements.Point, + + /** + * @private + */ + _datasetElementOptions: [ + 'backgroundColor', + 'borderCapStyle', + 'borderColor', + 'borderDash', + 'borderDashOffset', + 'borderJoinStyle', + 'borderWidth', + 'cubicInterpolationMode', + 'fill' + ], + + /** + * @private + */ + _dataElementOptions: { + backgroundColor: 'pointBackgroundColor', + borderColor: 'pointBorderColor', + borderWidth: 'pointBorderWidth', + hitRadius: 'pointHitRadius', + hoverBackgroundColor: 'pointHoverBackgroundColor', + hoverBorderColor: 'pointHoverBorderColor', + hoverBorderWidth: 'pointHoverBorderWidth', + hoverRadius: 'pointHoverRadius', + pointStyle: 'pointStyle', + radius: 'pointRadius', + rotation: 'pointRotation' + }, + + update: function(reset) { + var me = this; + var meta = me.getMeta(); + var line = meta.dataset; + var points = meta.data || []; + var options = me.chart.options; + var config = me._config; + var showLine = me._showLine = valueOrDefault$6(config.showLine, options.showLines); + var i, ilen; + + me._xScale = me.getScaleForId(meta.xAxisID); + me._yScale = me.getScaleForId(meta.yAxisID); + + // Update Line + if (showLine) { + // Compatibility: If the properties are defined with only the old name, use those values + if (config.tension !== undefined && config.lineTension === undefined) { + config.lineTension = config.tension; + } + + // Utility + line._scale = me._yScale; + line._datasetIndex = me.index; + // Data + line._children = points; + // Model + line._model = me._resolveDatasetElementOptions(line); + + line.pivot(); + } + + // Update Points + for (i = 0, ilen = points.length; i < ilen; ++i) { + me.updateElement(points[i], i, reset); + } + + if (showLine && line._model.tension !== 0) { + me.updateBezierControlPoints(); + } + + // Now pivot the point for animation + for (i = 0, ilen = points.length; i < ilen; ++i) { + points[i].pivot(); + } + }, + + updateElement: function(point, index, reset) { + var me = this; + var meta = me.getMeta(); + var custom = point.custom || {}; + var dataset = me.getDataset(); + var datasetIndex = me.index; + var value = dataset.data[index]; + var xScale = me._xScale; + var yScale = me._yScale; + var lineModel = meta.dataset._model; + var x, y; + + var options = me._resolveDataElementOptions(point, index); + + x = xScale.getPixelForValue(typeof value === 'object' ? value : NaN, index, datasetIndex); + y = reset ? yScale.getBasePixel() : me.calculatePointY(value, index, datasetIndex); + + // Utility + point._xScale = xScale; + point._yScale = yScale; + point._options = options; + point._datasetIndex = datasetIndex; + point._index = index; + + // Desired view properties + point._model = { + x: x, + y: y, + skip: custom.skip || isNaN(x) || isNaN(y), + // Appearance + radius: options.radius, + pointStyle: options.pointStyle, + rotation: options.rotation, + backgroundColor: options.backgroundColor, + borderColor: options.borderColor, + borderWidth: options.borderWidth, + tension: valueOrDefault$6(custom.tension, lineModel ? lineModel.tension : 0), + steppedLine: lineModel ? lineModel.steppedLine : false, + // Tooltip + hitRadius: options.hitRadius + }; + }, + + /** + * @private + */ + _resolveDatasetElementOptions: function(element) { + var me = this; + var config = me._config; + var custom = element.custom || {}; + var options = me.chart.options; + var lineOptions = options.elements.line; + var values = core_datasetController.prototype._resolveDatasetElementOptions.apply(me, arguments); + + // The default behavior of lines is to break at null values, according + // to https://github.com/chartjs/Chart.js/issues/2435#issuecomment-216718158 + // This option gives lines the ability to span gaps + values.spanGaps = valueOrDefault$6(config.spanGaps, options.spanGaps); + values.tension = valueOrDefault$6(config.lineTension, lineOptions.tension); + values.steppedLine = resolve$2([custom.steppedLine, config.steppedLine, lineOptions.stepped]); + values.clip = toClip(valueOrDefault$6(config.clip, defaultClip(me._xScale, me._yScale, values.borderWidth))); + + return values; + }, + + calculatePointY: function(value, index, datasetIndex) { + var me = this; + var chart = me.chart; + var yScale = me._yScale; + var sumPos = 0; + var sumNeg = 0; + var i, ds, dsMeta, stackedRightValue, rightValue, metasets, ilen; + + if (yScale.options.stacked) { + rightValue = +yScale.getRightValue(value); + metasets = chart._getSortedVisibleDatasetMetas(); + ilen = metasets.length; + + for (i = 0; i < ilen; ++i) { + dsMeta = metasets[i]; + if (dsMeta.index === datasetIndex) { + break; + } + + ds = chart.data.datasets[dsMeta.index]; + if (dsMeta.type === 'line' && dsMeta.yAxisID === yScale.id) { + stackedRightValue = +yScale.getRightValue(ds.data[index]); + if (stackedRightValue < 0) { + sumNeg += stackedRightValue || 0; + } else { + sumPos += stackedRightValue || 0; } } - - if (me.chart.options.elements.line.capBezierPoints) { - for (i = 0, ilen = points.length; i < ilen; ++i) { - model = points[i]._model; + } + + if (rightValue < 0) { + return yScale.getPixelForValue(sumNeg + rightValue); + } + return yScale.getPixelForValue(sumPos + rightValue); + } + return yScale.getPixelForValue(value); + }, + + updateBezierControlPoints: function() { + var me = this; + var chart = me.chart; + var meta = me.getMeta(); + var lineModel = meta.dataset._model; + var area = chart.chartArea; + var points = meta.data || []; + var i, ilen, model, controlPoints; + + // Only consider points that are drawn in case the spanGaps option is used + if (lineModel.spanGaps) { + points = points.filter(function(pt) { + return !pt._model.skip; + }); + } + + function capControlPoint(pt, min, max) { + return Math.max(Math.min(pt, max), min); + } + + if (lineModel.cubicInterpolationMode === 'monotone') { + helpers$1.splineCurveMonotone(points); + } else { + for (i = 0, ilen = points.length; i < ilen; ++i) { + model = points[i]._model; + controlPoints = helpers$1.splineCurve( + helpers$1.previousItem(points, i)._model, + model, + helpers$1.nextItem(points, i)._model, + lineModel.tension + ); + model.controlPointPreviousX = controlPoints.previous.x; + model.controlPointPreviousY = controlPoints.previous.y; + model.controlPointNextX = controlPoints.next.x; + model.controlPointNextY = controlPoints.next.y; + } + } + + if (chart.options.elements.line.capBezierPoints) { + for (i = 0, ilen = points.length; i < ilen; ++i) { + model = points[i]._model; + if (isPointInArea(model, area)) { + if (i > 0 && isPointInArea(points[i - 1]._model, area)) { model.controlPointPreviousX = capControlPoint(model.controlPointPreviousX, area.left, area.right); model.controlPointPreviousY = capControlPoint(model.controlPointPreviousY, area.top, area.bottom); + } + if (i < points.length - 1 && isPointInArea(points[i + 1]._model, area)) { model.controlPointNextX = capControlPoint(model.controlPointNextX, area.left, area.right); model.controlPointNextY = capControlPoint(model.controlPointNextY, area.top, area.bottom); } } - }, - - draw: function() { - var me = this; - var chart = me.chart; - var meta = me.getMeta(); - var points = meta.data || []; - var area = chart.chartArea; - var ilen = points.length; - var i = 0; - - helpers.canvas.clipArea(chart.ctx, area); - - if (lineEnabled(me.getDataset(), chart.options)) { - meta.dataset.draw(); - } - - helpers.canvas.unclipArea(chart.ctx); - - // Draw the points - for (; i < ilen; ++i) { - points[i].draw(area); - } - }, - - setHoverStyle: function(point) { - // Point - var dataset = this.chart.data.datasets[point._datasetIndex]; - var index = point._index; - var custom = point.custom || {}; - var model = point._model; - - model.radius = custom.hoverRadius || helpers.valueAtIndexOrDefault(dataset.pointHoverRadius, index, this.chart.options.elements.point.hoverRadius); - model.backgroundColor = custom.hoverBackgroundColor || helpers.valueAtIndexOrDefault(dataset.pointHoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor)); - model.borderColor = custom.hoverBorderColor || helpers.valueAtIndexOrDefault(dataset.pointHoverBorderColor, index, helpers.getHoverColor(model.borderColor)); - model.borderWidth = custom.hoverBorderWidth || helpers.valueAtIndexOrDefault(dataset.pointHoverBorderWidth, index, model.borderWidth); - }, - - removeHoverStyle: function(point) { - var me = this; - var dataset = me.chart.data.datasets[point._datasetIndex]; - var index = point._index; - var custom = point.custom || {}; - var model = point._model; - - // Compatibility: If the properties are defined with only the old name, use those values - if ((dataset.radius !== undefined) && (dataset.pointRadius === undefined)) { - dataset.pointRadius = dataset.radius; - } - - model.radius = custom.radius || helpers.valueAtIndexOrDefault(dataset.pointRadius, index, me.chart.options.elements.point.radius); - model.backgroundColor = me.getPointBackgroundColor(point, index); - model.borderColor = me.getPointBorderColor(point, index); - model.borderWidth = me.getPointBorderWidth(point, index); - } - }); - }; - - },{"25":25,"40":40,"45":45}],19:[function(require,module,exports){ - 'use strict'; - - var defaults = require(25); - var elements = require(40); - var helpers = require(45); - - defaults._set('polarArea', { - scale: { - type: 'radialLinear', - angleLines: { - display: false - }, - gridLines: { - circular: true - }, - pointLabels: { - display: false - }, - ticks: { - beginAtZero: true - } - }, - - // Boolean - Whether to animate the rotation of the chart - animation: { - animateRotate: true, - animateScale: true - }, - - startAngle: -0.5 * Math.PI, - legendCallback: function(chart) { - var text = []; - text.push('
      '); - - var data = chart.data; - var datasets = data.datasets; - var labels = data.labels; - - if (datasets.length) { - for (var i = 0; i < datasets[0].data.length; ++i) { - text.push('
    • '); - if (labels[i]) { - text.push(labels[i]); - } - text.push('
    • '); - } - } - - text.push('
    '); - return text.join(''); - }, - legend: { - labels: { - generateLabels: function(chart) { - var data = chart.data; - if (data.labels.length && data.datasets.length) { - return data.labels.map(function(label, i) { - var meta = chart.getDatasetMeta(0); - var ds = data.datasets[0]; - var arc = meta.data[i]; - var custom = arc.custom || {}; - var valueAtIndexOrDefault = helpers.valueAtIndexOrDefault; - var arcOpts = chart.options.elements.arc; - var fill = custom.backgroundColor ? custom.backgroundColor : valueAtIndexOrDefault(ds.backgroundColor, i, arcOpts.backgroundColor); - var stroke = custom.borderColor ? custom.borderColor : valueAtIndexOrDefault(ds.borderColor, i, arcOpts.borderColor); - var bw = custom.borderWidth ? custom.borderWidth : valueAtIndexOrDefault(ds.borderWidth, i, arcOpts.borderWidth); - - return { - text: label, - fillStyle: fill, - strokeStyle: stroke, - lineWidth: bw, - hidden: isNaN(ds.data[i]) || meta.data[i].hidden, - - // Extra data used for toggling the correct item - index: i - }; - }); - } - return []; - } - }, - - onClick: function(e, legendItem) { - var index = legendItem.index; - var chart = this.chart; - var i, ilen, meta; - - for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) { - meta = chart.getDatasetMeta(i); - meta.data[index].hidden = !meta.data[index].hidden; - } - - chart.update(); - } - }, - - // Need to override these to give a nice default - tooltips: { - callbacks: { - title: function() { - return ''; - }, - label: function(item, data) { - return data.labels[item.index] + ': ' + item.yLabel; - } } } - }); - - module.exports = function(Chart) { - - Chart.controllers.polarArea = Chart.DatasetController.extend({ - - dataElementType: elements.Arc, - - linkScales: helpers.noop, - - update: function(reset) { - var me = this; - var chart = me.chart; - var chartArea = chart.chartArea; - var meta = me.getMeta(); - var opts = chart.options; - var arcOpts = opts.elements.arc; - var minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top); - chart.outerRadius = Math.max((minSize - arcOpts.borderWidth / 2) / 2, 0); - chart.innerRadius = Math.max(opts.cutoutPercentage ? (chart.outerRadius / 100) * (opts.cutoutPercentage) : 1, 0); - chart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount(); - - me.outerRadius = chart.outerRadius - (chart.radiusLength * me.index); - me.innerRadius = me.outerRadius - chart.radiusLength; - - meta.count = me.countVisibleElements(); - - helpers.each(meta.data, function(arc, index) { - me.updateElement(arc, index, reset); - }); - }, - - updateElement: function(arc, index, reset) { - var me = this; - var chart = me.chart; - var dataset = me.getDataset(); - var opts = chart.options; - var animationOpts = opts.animation; - var scale = chart.scale; - var labels = chart.data.labels; - - var circumference = me.calculateCircumference(dataset.data[index]); - var centerX = scale.xCenter; - var centerY = scale.yCenter; - - // If there is NaN data before us, we need to calculate the starting angle correctly. - // We could be way more efficient here, but its unlikely that the polar area chart will have a lot of data - var visibleCount = 0; - var meta = me.getMeta(); - for (var i = 0; i < index; ++i) { - if (!isNaN(dataset.data[i]) && !meta.data[i].hidden) { - ++visibleCount; - } - } - - // var negHalfPI = -0.5 * Math.PI; - var datasetStartAngle = opts.startAngle; - var distance = arc.hidden ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]); - var startAngle = datasetStartAngle + (circumference * visibleCount); - var endAngle = startAngle + (arc.hidden ? 0 : circumference); - - var resetRadius = animationOpts.animateScale ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]); - - helpers.extend(arc, { - // Utility - _datasetIndex: me.index, - _index: index, - _scale: scale, - - // Desired view properties - _model: { - x: centerX, - y: centerY, - innerRadius: 0, - outerRadius: reset ? resetRadius : distance, - startAngle: reset && animationOpts.animateRotate ? datasetStartAngle : startAngle, - endAngle: reset && animationOpts.animateRotate ? datasetStartAngle : endAngle, - label: helpers.valueAtIndexOrDefault(labels, index, labels[index]) - } - }); - - // Apply border and fill style - me.removeHoverStyle(arc); - - arc.pivot(); - }, - - removeHoverStyle: function(arc) { - Chart.DatasetController.prototype.removeHoverStyle.call(this, arc, this.chart.options.elements.arc); - }, - - countVisibleElements: function() { - var dataset = this.getDataset(); - var meta = this.getMeta(); - var count = 0; - - helpers.each(meta.data, function(element, index) { - if (!isNaN(dataset.data[index]) && !element.hidden) { - count++; - } - }); - - return count; - }, - - calculateCircumference: function(value) { - var count = this.getMeta().count; - if (count > 0 && !isNaN(value)) { - return (2 * Math.PI) / count; - } - return 0; - } - }); - }; - - },{"25":25,"40":40,"45":45}],20:[function(require,module,exports){ - 'use strict'; - - var defaults = require(25); - var elements = require(40); - var helpers = require(45); - - defaults._set('radar', { - scale: { - type: 'radialLinear' - }, - elements: { - line: { - tension: 0 // no bezier in radar - } - } - }); - - module.exports = function(Chart) { - - Chart.controllers.radar = Chart.DatasetController.extend({ - - datasetElementType: elements.Line, - - dataElementType: elements.Point, - - linkScales: helpers.noop, - - update: function(reset) { - var me = this; - var meta = me.getMeta(); - var line = meta.dataset; - var points = meta.data; - var custom = line.custom || {}; - var dataset = me.getDataset(); - var lineElementOptions = me.chart.options.elements.line; - var scale = me.chart.scale; - - // Compatibility: If the properties are defined with only the old name, use those values - if ((dataset.tension !== undefined) && (dataset.lineTension === undefined)) { - dataset.lineTension = dataset.tension; - } - - helpers.extend(meta.dataset, { - // Utility - _datasetIndex: me.index, - _scale: scale, - // Data - _children: points, - _loop: true, - // Model - _model: { - // Appearance - tension: custom.tension ? custom.tension : helpers.valueOrDefault(dataset.lineTension, lineElementOptions.tension), - backgroundColor: custom.backgroundColor ? custom.backgroundColor : (dataset.backgroundColor || lineElementOptions.backgroundColor), - borderWidth: custom.borderWidth ? custom.borderWidth : (dataset.borderWidth || lineElementOptions.borderWidth), - borderColor: custom.borderColor ? custom.borderColor : (dataset.borderColor || lineElementOptions.borderColor), - fill: custom.fill ? custom.fill : (dataset.fill !== undefined ? dataset.fill : lineElementOptions.fill), - borderCapStyle: custom.borderCapStyle ? custom.borderCapStyle : (dataset.borderCapStyle || lineElementOptions.borderCapStyle), - borderDash: custom.borderDash ? custom.borderDash : (dataset.borderDash || lineElementOptions.borderDash), - borderDashOffset: custom.borderDashOffset ? custom.borderDashOffset : (dataset.borderDashOffset || lineElementOptions.borderDashOffset), - borderJoinStyle: custom.borderJoinStyle ? custom.borderJoinStyle : (dataset.borderJoinStyle || lineElementOptions.borderJoinStyle), - } - }); - - meta.dataset.pivot(); - - // Update Points - helpers.each(points, function(point, index) { - me.updateElement(point, index, reset); - }, me); - - // Update bezier control points - me.updateBezierControlPoints(); - }, - updateElement: function(point, index, reset) { - var me = this; - var custom = point.custom || {}; - var dataset = me.getDataset(); - var scale = me.chart.scale; - var pointElementOptions = me.chart.options.elements.point; - var pointPosition = scale.getPointPositionForValue(index, dataset.data[index]); - - // Compatibility: If the properties are defined with only the old name, use those values - if ((dataset.radius !== undefined) && (dataset.pointRadius === undefined)) { - dataset.pointRadius = dataset.radius; - } - if ((dataset.hitRadius !== undefined) && (dataset.pointHitRadius === undefined)) { - dataset.pointHitRadius = dataset.hitRadius; - } - - helpers.extend(point, { - // Utility - _datasetIndex: me.index, - _index: index, - _scale: scale, - - // Desired view properties - _model: { - x: reset ? scale.xCenter : pointPosition.x, // value not used in dataset scale, but we want a consistent API between scales - y: reset ? scale.yCenter : pointPosition.y, - - // Appearance - tension: custom.tension ? custom.tension : helpers.valueOrDefault(dataset.lineTension, me.chart.options.elements.line.tension), - radius: custom.radius ? custom.radius : helpers.valueAtIndexOrDefault(dataset.pointRadius, index, pointElementOptions.radius), - backgroundColor: custom.backgroundColor ? custom.backgroundColor : helpers.valueAtIndexOrDefault(dataset.pointBackgroundColor, index, pointElementOptions.backgroundColor), - borderColor: custom.borderColor ? custom.borderColor : helpers.valueAtIndexOrDefault(dataset.pointBorderColor, index, pointElementOptions.borderColor), - borderWidth: custom.borderWidth ? custom.borderWidth : helpers.valueAtIndexOrDefault(dataset.pointBorderWidth, index, pointElementOptions.borderWidth), - pointStyle: custom.pointStyle ? custom.pointStyle : helpers.valueAtIndexOrDefault(dataset.pointStyle, index, pointElementOptions.pointStyle), - - // Tooltip - hitRadius: custom.hitRadius ? custom.hitRadius : helpers.valueAtIndexOrDefault(dataset.pointHitRadius, index, pointElementOptions.hitRadius) - } - }); - - point._model.skip = custom.skip ? custom.skip : (isNaN(point._model.x) || isNaN(point._model.y)); - }, - updateBezierControlPoints: function() { - var chartArea = this.chart.chartArea; - var meta = this.getMeta(); - - helpers.each(meta.data, function(point, index) { - var model = point._model; - var controlPoints = helpers.splineCurve( - helpers.previousItem(meta.data, index, true)._model, - model, - helpers.nextItem(meta.data, index, true)._model, - model.tension - ); - - // Prevent the bezier going outside of the bounds of the graph - model.controlPointPreviousX = Math.max(Math.min(controlPoints.previous.x, chartArea.right), chartArea.left); - model.controlPointPreviousY = Math.max(Math.min(controlPoints.previous.y, chartArea.bottom), chartArea.top); - - model.controlPointNextX = Math.max(Math.min(controlPoints.next.x, chartArea.right), chartArea.left); - model.controlPointNextY = Math.max(Math.min(controlPoints.next.y, chartArea.bottom), chartArea.top); - - // Now pivot the point for animation - point.pivot(); - }); - }, - - setHoverStyle: function(point) { - // Point - var dataset = this.chart.data.datasets[point._datasetIndex]; - var custom = point.custom || {}; - var index = point._index; - var model = point._model; - - model.radius = custom.hoverRadius ? custom.hoverRadius : helpers.valueAtIndexOrDefault(dataset.pointHoverRadius, index, this.chart.options.elements.point.hoverRadius); - model.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : helpers.valueAtIndexOrDefault(dataset.pointHoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor)); - model.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : helpers.valueAtIndexOrDefault(dataset.pointHoverBorderColor, index, helpers.getHoverColor(model.borderColor)); - model.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : helpers.valueAtIndexOrDefault(dataset.pointHoverBorderWidth, index, model.borderWidth); - }, - - removeHoverStyle: function(point) { - var dataset = this.chart.data.datasets[point._datasetIndex]; - var custom = point.custom || {}; - var index = point._index; - var model = point._model; - var pointElementOptions = this.chart.options.elements.point; - - model.radius = custom.radius ? custom.radius : helpers.valueAtIndexOrDefault(dataset.pointRadius, index, pointElementOptions.radius); - model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : helpers.valueAtIndexOrDefault(dataset.pointBackgroundColor, index, pointElementOptions.backgroundColor); - model.borderColor = custom.borderColor ? custom.borderColor : helpers.valueAtIndexOrDefault(dataset.pointBorderColor, index, pointElementOptions.borderColor); - model.borderWidth = custom.borderWidth ? custom.borderWidth : helpers.valueAtIndexOrDefault(dataset.pointBorderWidth, index, pointElementOptions.borderWidth); - } - }); - }; - - },{"25":25,"40":40,"45":45}],21:[function(require,module,exports){ - 'use strict'; - - var defaults = require(25); - - defaults._set('scatter', { - hover: { - mode: 'single' - }, - - scales: { - xAxes: [{ - id: 'x-axis-1', // need an ID so datasets can reference the scale - type: 'linear', // scatter should not use a category axis - position: 'bottom' - }], - yAxes: [{ - id: 'y-axis-1', - type: 'linear', - position: 'left' - }] - }, - - showLines: false, - - tooltips: { - callbacks: { - title: function() { - return ''; // doesn't make sense for scatter since data are formatted as a point - }, - label: function(item) { - return '(' + item.xLabel + ', ' + item.yLabel + ')'; - } - } - } - }); - - module.exports = function(Chart) { - - // Scatter charts use line controllers - Chart.controllers.scatter = Chart.controllers.line; - - }; - - },{"25":25}],22:[function(require,module,exports){ - /* global window: false */ - 'use strict'; - - var defaults = require(25); - var Element = require(26); - var helpers = require(45); - - defaults._set('global', { - animation: { - duration: 1000, - easing: 'easeOutQuart', - onProgress: helpers.noop, - onComplete: helpers.noop - } - }); - - module.exports = function(Chart) { - - Chart.Animation = Element.extend({ - chart: null, // the animation associated chart instance - currentStep: 0, // the current animation step - numSteps: 60, // default number of steps - easing: '', // the easing to use for this animation - render: null, // render function used by the animation service - - onAnimationProgress: null, // user specified callback to fire on each step of the animation - onAnimationComplete: null, // user specified callback to fire when the animation finishes - }); - - Chart.animationService = { - frameDuration: 17, - animations: [], - dropFrames: 0, - request: null, - - /** - * @param {Chart} chart - The chart to animate. - * @param {Chart.Animation} animation - The animation that we will animate. - * @param {Number} duration - The animation duration in ms. - * @param {Boolean} lazy - if true, the chart is not marked as animating to enable more responsive interactions - */ - addAnimation: function(chart, animation, duration, lazy) { - var animations = this.animations; - var i, ilen; - - animation.chart = chart; - - if (!lazy) { - chart.animating = true; - } - - for (i = 0, ilen = animations.length; i < ilen; ++i) { - if (animations[i].chart === chart) { - animations[i] = animation; - return; - } - } - - animations.push(animation); - - // If there are no animations queued, manually kickstart a digest, for lack of a better word - if (animations.length === 1) { - this.requestAnimationFrame(); - } - }, - - cancelAnimation: function(chart) { - var index = helpers.findIndex(this.animations, function(animation) { - return animation.chart === chart; - }); - - if (index !== -1) { - this.animations.splice(index, 1); - chart.animating = false; - } - }, - - requestAnimationFrame: function() { - var me = this; - if (me.request === null) { - // Skip animation frame requests until the active one is executed. - // This can happen when processing mouse events, e.g. 'mousemove' - // and 'mouseout' events will trigger multiple renders. - me.request = helpers.requestAnimFrame.call(window, function() { - me.request = null; - me.startDigest(); - }); - } - }, - - /** - * @private - */ - startDigest: function() { - var me = this; - var startTime = Date.now(); - var framesToDrop = 0; - - if (me.dropFrames > 1) { - framesToDrop = Math.floor(me.dropFrames); - me.dropFrames = me.dropFrames % 1; - } - - me.advance(1 + framesToDrop); - - var endTime = Date.now(); - - me.dropFrames += (endTime - startTime) / me.frameDuration; - - // Do we have more stuff to animate? - if (me.animations.length > 0) { - me.requestAnimationFrame(); - } - }, - - /** - * @private - */ - advance: function(count) { - var animations = this.animations; - var animation, chart; - var i = 0; - - while (i < animations.length) { - animation = animations[i]; - chart = animation.chart; - - animation.currentStep = (animation.currentStep || 0) + count; - animation.currentStep = Math.min(animation.currentStep, animation.numSteps); - - helpers.callback(animation.render, [chart, animation], chart); - helpers.callback(animation.onAnimationProgress, [animation], chart); - - if (animation.currentStep >= animation.numSteps) { - helpers.callback(animation.onAnimationComplete, [animation], chart); - chart.animating = false; - animations.splice(i, 1); - } else { - ++i; - } - } - } - }; - - /** - * Provided for backward compatibility, use Chart.Animation instead - * @prop Chart.Animation#animationObject - * @deprecated since version 2.6.0 - * @todo remove at version 3 - */ - Object.defineProperty(Chart.Animation.prototype, 'animationObject', { - get: function() { - return this; - } - }); - - /** - * Provided for backward compatibility, use Chart.Animation#chart instead - * @prop Chart.Animation#chartInstance - * @deprecated since version 2.6.0 - * @todo remove at version 3 - */ - Object.defineProperty(Chart.Animation.prototype, 'chartInstance', { - get: function() { - return this.chart; - }, - set: function(value) { - this.chart = value; - } - }); - - }; - - },{"25":25,"26":26,"45":45}],23:[function(require,module,exports){ - 'use strict'; - - var defaults = require(25); - var helpers = require(45); - var Interaction = require(28); - var layouts = require(30); - var platform = require(48); - var plugins = require(31); - - module.exports = function(Chart) { - - // Create a dictionary of chart types, to allow for extension of existing types - Chart.types = {}; - - // Store a reference to each instance - allowing us to globally resize chart instances on window resize. - // Destroy method on the chart will remove the instance of the chart from this reference. - Chart.instances = {}; - - // Controllers available for dataset visualization eg. bar, line, slice, etc. - Chart.controllers = {}; - - /** - * Initializes the given config with global and chart default values. - */ - function initConfig(config) { - config = config || {}; - - // Do NOT use configMerge() for the data object because this method merges arrays - // and so would change references to labels and datasets, preventing data updates. - var data = config.data = config.data || {}; - data.datasets = data.datasets || []; - data.labels = data.labels || []; - - config.options = helpers.configMerge( - defaults.global, - defaults[config.type], - config.options || {}); - - return config; - } - - /** - * Updates the config of the chart - * @param chart {Chart} chart to update the options for - */ - function updateConfig(chart) { - var newOptions = chart.options; - - helpers.each(chart.scales, function(scale) { - layouts.removeBox(chart, scale); + }, + + draw: function() { + var me = this; + var chart = me.chart; + var meta = me.getMeta(); + var points = meta.data || []; + var area = chart.chartArea; + var canvas = chart.canvas; + var i = 0; + var ilen = points.length; + var clip; + + if (me._showLine) { + clip = meta.dataset._model.clip; + + helpers$1.canvas.clipArea(chart.ctx, { + left: clip.left === false ? 0 : area.left - clip.left, + right: clip.right === false ? canvas.width : area.right + clip.right, + top: clip.top === false ? 0 : area.top - clip.top, + bottom: clip.bottom === false ? canvas.height : area.bottom + clip.bottom }); - - newOptions = helpers.configMerge( - Chart.defaults.global, - Chart.defaults[chart.config.type], - newOptions); - - chart.options = chart.config.options = newOptions; - chart.ensureScalesHaveIDs(); - chart.buildOrUpdateScales(); - // Tooltip - chart.tooltip._options = newOptions.tooltips; - chart.tooltip.initialize(); + + meta.dataset.draw(); + + helpers$1.canvas.unclipArea(chart.ctx); } - - function positionIsHorizontal(position) { - return position === 'top' || position === 'bottom'; + + // Draw the points + for (; i < ilen; ++i) { + points[i].draw(area); } - - helpers.extend(Chart.prototype, /** @lends Chart */ { - /** - * @private - */ - construct: function(item, config) { - var me = this; - - config = initConfig(config); - - var context = platform.acquireContext(item, config); - var canvas = context && context.canvas; - var height = canvas && canvas.height; - var width = canvas && canvas.width; - - me.id = helpers.uid(); - me.ctx = context; - me.canvas = canvas; - me.config = config; - me.width = width; - me.height = height; - me.aspectRatio = height ? width / height : null; - me.options = config.options; - me._bufferedRender = false; - - /** - * Provided for backward compatibility, Chart and Chart.Controller have been merged, - * the "instance" still need to be defined since it might be called from plugins. - * @prop Chart#chart - * @deprecated since version 2.6.0 - * @todo remove at version 3 - * @private - */ - me.chart = me; - me.controller = me; // chart.chart.controller #inception - - // Add the chart instance to the global namespace - Chart.instances[me.id] = me; - - // Define alias to the config data: `chart.data === chart.config.data` - Object.defineProperty(me, 'data', { - get: function() { - return me.config.data; - }, - set: function(value) { - me.config.data = value; - } - }); - - if (!context || !canvas) { - // The given item is not a compatible context2d element, let's return before finalizing - // the chart initialization but after setting basic chart / controller properties that - // can help to figure out that the chart is not valid (e.g chart.canvas !== null); - // https://github.com/chartjs/Chart.js/issues/2807 - console.error("Failed to create chart: can't acquire context from the given item"); - return; + }, + + /** + * @protected + */ + setHoverStyle: function(point) { + var model = point._model; + var options = point._options; + var getHoverColor = helpers$1.getHoverColor; + + point.$previousStyle = { + backgroundColor: model.backgroundColor, + borderColor: model.borderColor, + borderWidth: model.borderWidth, + radius: model.radius + }; + + model.backgroundColor = valueOrDefault$6(options.hoverBackgroundColor, getHoverColor(options.backgroundColor)); + model.borderColor = valueOrDefault$6(options.hoverBorderColor, getHoverColor(options.borderColor)); + model.borderWidth = valueOrDefault$6(options.hoverBorderWidth, options.borderWidth); + model.radius = valueOrDefault$6(options.hoverRadius, options.radius); + }, + }); + + var resolve$3 = helpers$1.options.resolve; + + core_defaults._set('polarArea', { + scale: { + type: 'radialLinear', + angleLines: { + display: false + }, + gridLines: { + circular: true + }, + pointLabels: { + display: false + }, + ticks: { + beginAtZero: true + } + }, + + // Boolean - Whether to animate the rotation of the chart + animation: { + animateRotate: true, + animateScale: true + }, + + startAngle: -0.5 * Math.PI, + legendCallback: function(chart) { + var list = document.createElement('ul'); + var data = chart.data; + var datasets = data.datasets; + var labels = data.labels; + var i, ilen, listItem, listItemSpan; + + list.setAttribute('class', chart.id + '-legend'); + if (datasets.length) { + for (i = 0, ilen = datasets[0].data.length; i < ilen; ++i) { + listItem = list.appendChild(document.createElement('li')); + listItemSpan = listItem.appendChild(document.createElement('span')); + listItemSpan.style.backgroundColor = datasets[0].backgroundColor[i]; + if (labels[i]) { + listItem.appendChild(document.createTextNode(labels[i])); } - - me.initialize(); - me.update(); - }, - - /** - * @private - */ - initialize: function() { - var me = this; - - // Before init plugin notification - plugins.notify(me, 'beforeInit'); - - helpers.retinaScale(me, me.options.devicePixelRatio); - - me.bindEvents(); - - if (me.options.responsive) { - // Initial resize before chart draws (must be silent to preserve initial animations). - me.resize(true); - } - - // Make sure scales have IDs and are built before we build any controllers. - me.ensureScalesHaveIDs(); - me.buildOrUpdateScales(); - me.initToolTip(); - - // After init plugin notification - plugins.notify(me, 'afterInit'); - - return me; - }, - - clear: function() { - helpers.canvas.clear(this); - return this; - }, - - stop: function() { - // Stops any current animation loop occurring - Chart.animationService.cancelAnimation(this); - return this; - }, - - resize: function(silent) { - var me = this; - var options = me.options; - var canvas = me.canvas; - var aspectRatio = (options.maintainAspectRatio && me.aspectRatio) || null; - - // the canvas render width and height will be casted to integers so make sure that - // the canvas display style uses the same integer values to avoid blurring effect. - - // Set to 0 instead of canvas.size because the size defaults to 300x150 if the element is collased - var newWidth = Math.max(0, Math.floor(helpers.getMaximumWidth(canvas))); - var newHeight = Math.max(0, Math.floor(aspectRatio ? newWidth / aspectRatio : helpers.getMaximumHeight(canvas))); - - if (me.width === newWidth && me.height === newHeight) { - return; - } - - canvas.width = me.width = newWidth; - canvas.height = me.height = newHeight; - canvas.style.width = newWidth + 'px'; - canvas.style.height = newHeight + 'px'; - - helpers.retinaScale(me, options.devicePixelRatio); - - if (!silent) { - // Notify any plugins about the resize - var newSize = {width: newWidth, height: newHeight}; - plugins.notify(me, 'resize', [newSize]); - - // Notify of resize - if (me.options.onResize) { - me.options.onResize(me, newSize); - } - - me.stop(); - me.update(me.options.responsiveAnimationDuration); - } - }, - - ensureScalesHaveIDs: function() { - var options = this.options; - var scalesOptions = options.scales || {}; - var scaleOptions = options.scale; - - helpers.each(scalesOptions.xAxes, function(xAxisOptions, index) { - xAxisOptions.id = xAxisOptions.id || ('x-axis-' + index); - }); - - helpers.each(scalesOptions.yAxes, function(yAxisOptions, index) { - yAxisOptions.id = yAxisOptions.id || ('y-axis-' + index); - }); - - if (scaleOptions) { - scaleOptions.id = scaleOptions.id || 'scale'; - } - }, - - /** - * Builds a map of scale ID to scale object for future lookup. - */ - buildOrUpdateScales: function() { - var me = this; - var options = me.options; - var scales = me.scales || {}; - var items = []; - var updated = Object.keys(scales).reduce(function(obj, id) { - obj[id] = false; - return obj; - }, {}); - - if (options.scales) { - items = items.concat( - (options.scales.xAxes || []).map(function(xAxisOptions) { - return {options: xAxisOptions, dtype: 'category', dposition: 'bottom'}; - }), - (options.scales.yAxes || []).map(function(yAxisOptions) { - return {options: yAxisOptions, dtype: 'linear', dposition: 'left'}; - }) - ); - } - - if (options.scale) { - items.push({ - options: options.scale, - dtype: 'radialLinear', - isDefault: true, - dposition: 'chartArea' + } + } + + return list.outerHTML; + }, + legend: { + labels: { + generateLabels: function(chart) { + var data = chart.data; + if (data.labels.length && data.datasets.length) { + return data.labels.map(function(label, i) { + var meta = chart.getDatasetMeta(0); + var style = meta.controller.getStyle(i); + + return { + text: label, + fillStyle: style.backgroundColor, + strokeStyle: style.borderColor, + lineWidth: style.borderWidth, + hidden: isNaN(data.datasets[0].data[i]) || meta.data[i].hidden, + + // Extra data used for toggling the correct item + index: i + }; }); } - - helpers.each(items, function(item) { - var scaleOptions = item.options; - var id = scaleOptions.id; - var scaleType = helpers.valueOrDefault(scaleOptions.type, item.dtype); - - if (positionIsHorizontal(scaleOptions.position) !== positionIsHorizontal(item.dposition)) { - scaleOptions.position = item.dposition; - } - - updated[id] = true; - var scale = null; - if (id in scales && scales[id].type === scaleType) { - scale = scales[id]; - scale.options = scaleOptions; - scale.ctx = me.ctx; - scale.chart = me; - } else { - var scaleClass = Chart.scaleService.getScaleConstructor(scaleType); - if (!scaleClass) { - return; - } - scale = new scaleClass({ - id: id, - type: scaleType, - options: scaleOptions, - ctx: me.ctx, - chart: me - }); - scales[scale.id] = scale; - } - - scale.mergeTicksOptions(); - - // TODO(SB): I think we should be able to remove this custom case (options.scale) - // and consider it as a regular scale part of the "scales"" map only! This would - // make the logic easier and remove some useless? custom code. - if (item.isDefault) { - me.scale = scale; - } - }); - // clear up discarded scales - helpers.each(updated, function(hasUpdated, id) { - if (!hasUpdated) { - delete scales[id]; - } - }); - - me.scales = scales; - - Chart.scaleService.addScalesToLayout(this); - }, - - buildOrUpdateControllers: function() { - var me = this; - var types = []; - var newControllers = []; - - helpers.each(me.data.datasets, function(dataset, datasetIndex) { - var meta = me.getDatasetMeta(datasetIndex); - var type = dataset.type || me.config.type; - - if (meta.type && meta.type !== type) { - me.destroyDatasetMeta(datasetIndex); - meta = me.getDatasetMeta(datasetIndex); - } - meta.type = type; - - types.push(meta.type); - - if (meta.controller) { - meta.controller.updateIndex(datasetIndex); - meta.controller.linkScales(); - } else { - var ControllerClass = Chart.controllers[meta.type]; - if (ControllerClass === undefined) { - throw new Error('"' + meta.type + '" is not a chart type.'); - } - - meta.controller = new ControllerClass(me, datasetIndex); - newControllers.push(meta.controller); - } - }, me); - - return newControllers; - }, - - /** - * Reset the elements of all datasets - * @private - */ - resetElements: function() { - var me = this; - helpers.each(me.data.datasets, function(dataset, datasetIndex) { - me.getDatasetMeta(datasetIndex).controller.reset(); - }, me); - }, - - /** - * Resets the chart back to it's state before the initial animation - */ - reset: function() { - this.resetElements(); - this.tooltip.initialize(); - }, - - update: function(config) { - var me = this; - - if (!config || typeof config !== 'object') { - // backwards compatibility - config = { - duration: config, - lazy: arguments[1] - }; - } - - updateConfig(me); - - // plugins options references might have change, let's invalidate the cache - // https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167 - plugins._invalidate(me); - - if (plugins.notify(me, 'beforeUpdate') === false) { - return; - } - - // In case the entire data object changed - me.tooltip._data = me.data; - - // Make sure dataset controllers are updated and new controllers are reset - var newControllers = me.buildOrUpdateControllers(); - - // Make sure all dataset controllers have correct meta data counts - helpers.each(me.data.datasets, function(dataset, datasetIndex) { - me.getDatasetMeta(datasetIndex).controller.buildOrUpdateElements(); - }, me); - - me.updateLayout(); - - // Can only reset the new controllers after the scales have been updated - if (me.options.animation && me.options.animation.duration) { - helpers.each(newControllers, function(controller) { - controller.reset(); - }); - } - - me.updateDatasets(); - - // Need to reset tooltip in case it is displayed with elements that are removed - // after update. - me.tooltip.initialize(); - - // Last active contains items that were previously in the tooltip. - // When we reset the tooltip, we need to clear it - me.lastActive = []; - - // Do this before render so that any plugins that need final scale updates can use it - plugins.notify(me, 'afterUpdate'); - - if (me._bufferedRender) { - me._bufferedRequest = { - duration: config.duration, - easing: config.easing, - lazy: config.lazy - }; - } else { - me.render(config); - } - }, - - /** - * Updates the chart layout unless a plugin returns `false` to the `beforeLayout` - * hook, in which case, plugins will not be called on `afterLayout`. - * @private - */ - updateLayout: function() { - var me = this; - - if (plugins.notify(me, 'beforeLayout') === false) { - return; - } - - layouts.update(this, this.width, this.height); - - /** - * Provided for backward compatibility, use `afterLayout` instead. - * @method IPlugin#afterScaleUpdate - * @deprecated since version 2.5.0 - * @todo remove at version 3 - * @private - */ - plugins.notify(me, 'afterScaleUpdate'); - plugins.notify(me, 'afterLayout'); - }, - - /** - * Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate` - * hook, in which case, plugins will not be called on `afterDatasetsUpdate`. - * @private - */ - updateDatasets: function() { - var me = this; - - if (plugins.notify(me, 'beforeDatasetsUpdate') === false) { - return; - } - - for (var i = 0, ilen = me.data.datasets.length; i < ilen; ++i) { - me.updateDataset(i); - } - - plugins.notify(me, 'afterDatasetsUpdate'); - }, - - /** - * Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate` - * hook, in which case, plugins will not be called on `afterDatasetUpdate`. - * @private - */ - updateDataset: function(index) { - var me = this; - var meta = me.getDatasetMeta(index); - var args = { - meta: meta, - index: index - }; - - if (plugins.notify(me, 'beforeDatasetUpdate', [args]) === false) { - return; - } - - meta.controller.update(); - - plugins.notify(me, 'afterDatasetUpdate', [args]); - }, - - render: function(config) { - var me = this; - - if (!config || typeof config !== 'object') { - // backwards compatibility - config = { - duration: config, - lazy: arguments[1] - }; - } - - var duration = config.duration; - var lazy = config.lazy; - - if (plugins.notify(me, 'beforeRender') === false) { - return; - } - - var animationOptions = me.options.animation; - var onComplete = function(animation) { - plugins.notify(me, 'afterRender'); - helpers.callback(animationOptions && animationOptions.onComplete, [animation], me); - }; - - if (animationOptions && ((typeof duration !== 'undefined' && duration !== 0) || (typeof duration === 'undefined' && animationOptions.duration !== 0))) { - var animation = new Chart.Animation({ - numSteps: (duration || animationOptions.duration) / 16.66, // 60 fps - easing: config.easing || animationOptions.easing, - - render: function(chart, animationObject) { - var easingFunction = helpers.easing.effects[animationObject.easing]; - var currentStep = animationObject.currentStep; - var stepDecimal = currentStep / animationObject.numSteps; - - chart.draw(easingFunction(stepDecimal), stepDecimal, currentStep); - }, - - onAnimationProgress: animationOptions.onProgress, - onAnimationComplete: onComplete - }); - - Chart.animationService.addAnimation(me, animation, duration, lazy); - } else { - me.draw(); - - // See https://github.com/chartjs/Chart.js/issues/3781 - onComplete(new Chart.Animation({numSteps: 0, chart: me})); - } - - return me; - }, - - draw: function(easingValue) { - var me = this; - - me.clear(); - - if (helpers.isNullOrUndef(easingValue)) { - easingValue = 1; - } - - me.transition(easingValue); - - if (plugins.notify(me, 'beforeDraw', [easingValue]) === false) { - return; - } - - // Draw all the scales - helpers.each(me.boxes, function(box) { - box.draw(me.chartArea); - }, me); - - if (me.scale) { - me.scale.draw(); - } - - me.drawDatasets(easingValue); - me._drawTooltip(easingValue); - - plugins.notify(me, 'afterDraw', [easingValue]); - }, - - /** - * @private - */ - transition: function(easingValue) { - var me = this; - - for (var i = 0, ilen = (me.data.datasets || []).length; i < ilen; ++i) { - if (me.isDatasetVisible(i)) { - me.getDatasetMeta(i).controller.transition(easingValue); - } - } - - me.tooltip.transition(easingValue); - }, - - /** - * Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw` - * hook, in which case, plugins will not be called on `afterDatasetsDraw`. - * @private - */ - drawDatasets: function(easingValue) { - var me = this; - - if (plugins.notify(me, 'beforeDatasetsDraw', [easingValue]) === false) { - return; - } - - // Draw datasets reversed to support proper line stacking - for (var i = (me.data.datasets || []).length - 1; i >= 0; --i) { - if (me.isDatasetVisible(i)) { - me.drawDataset(i, easingValue); - } - } - - plugins.notify(me, 'afterDatasetsDraw', [easingValue]); - }, - - /** - * Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw` - * hook, in which case, plugins will not be called on `afterDatasetDraw`. - * @private - */ - drawDataset: function(index, easingValue) { - var me = this; - var meta = me.getDatasetMeta(index); - var args = { - meta: meta, - index: index, - easingValue: easingValue - }; - - if (plugins.notify(me, 'beforeDatasetDraw', [args]) === false) { - return; - } - - meta.controller.draw(easingValue); - - plugins.notify(me, 'afterDatasetDraw', [args]); - }, - - /** - * Draws tooltip unless a plugin returns `false` to the `beforeTooltipDraw` - * hook, in which case, plugins will not be called on `afterTooltipDraw`. - * @private - */ - _drawTooltip: function(easingValue) { - var me = this; - var tooltip = me.tooltip; - var args = { - tooltip: tooltip, - easingValue: easingValue - }; - - if (plugins.notify(me, 'beforeTooltipDraw', [args]) === false) { - return; - } - - tooltip.draw(); - - plugins.notify(me, 'afterTooltipDraw', [args]); - }, - - // Get the single element that was clicked on - // @return : An object containing the dataset index and element index of the matching element. Also contains the rectangle that was draw - getElementAtEvent: function(e) { - return Interaction.modes.single(this, e); - }, - - getElementsAtEvent: function(e) { - return Interaction.modes.label(this, e, {intersect: true}); - }, - - getElementsAtXAxis: function(e) { - return Interaction.modes['x-axis'](this, e, {intersect: true}); - }, - - getElementsAtEventForMode: function(e, mode, options) { - var method = Interaction.modes[mode]; - if (typeof method === 'function') { - return method(this, e, options); - } - return []; - }, - - getDatasetAtEvent: function(e) { - return Interaction.modes.dataset(this, e, {intersect: true}); - }, - - getDatasetMeta: function(datasetIndex) { - var me = this; - var dataset = me.data.datasets[datasetIndex]; - if (!dataset._meta) { - dataset._meta = {}; - } - - var meta = dataset._meta[me.id]; - if (!meta) { - meta = dataset._meta[me.id] = { - type: null, - data: [], - dataset: null, - controller: null, - hidden: null, // See isDatasetVisible() comment - xAxisID: null, - yAxisID: null - }; - } - - return meta; - }, - - getVisibleDatasetCount: function() { - var count = 0; - for (var i = 0, ilen = this.data.datasets.length; i < ilen; ++i) { - if (this.isDatasetVisible(i)) { - count++; - } - } - return count; - }, - - isDatasetVisible: function(datasetIndex) { - var meta = this.getDatasetMeta(datasetIndex); - - // meta.hidden is a per chart dataset hidden flag override with 3 states: if true or false, - // the dataset.hidden value is ignored, else if null, the dataset hidden state is returned. - return typeof meta.hidden === 'boolean' ? !meta.hidden : !this.data.datasets[datasetIndex].hidden; - }, - - generateLegend: function() { - return this.options.legendCallback(this); - }, - - /** - * @private - */ - destroyDatasetMeta: function(datasetIndex) { - var id = this.id; - var dataset = this.data.datasets[datasetIndex]; - var meta = dataset._meta && dataset._meta[id]; - - if (meta) { - meta.controller.destroy(); - delete dataset._meta[id]; - } - }, - - destroy: function() { - var me = this; - var canvas = me.canvas; - var i, ilen; - - me.stop(); - - // dataset controllers need to cleanup associated data - for (i = 0, ilen = me.data.datasets.length; i < ilen; ++i) { - me.destroyDatasetMeta(i); - } - - if (canvas) { - me.unbindEvents(); - helpers.canvas.clear(me); - platform.releaseContext(me.ctx); - me.canvas = null; - me.ctx = null; - } - - plugins.notify(me, 'destroy'); - - delete Chart.instances[me.id]; - }, - - toBase64Image: function() { - return this.canvas.toDataURL.apply(this.canvas, arguments); - }, - - initToolTip: function() { - var me = this; - me.tooltip = new Chart.Tooltip({ - _chart: me, - _chartInstance: me, // deprecated, backward compatibility - _data: me.data, - _options: me.options.tooltips - }, me); - }, - - /** - * @private - */ - bindEvents: function() { - var me = this; - var listeners = me._listeners = {}; - var listener = function() { - me.eventHandler.apply(me, arguments); - }; - - helpers.each(me.options.events, function(type) { - platform.addEventListener(me, type, listener); - listeners[type] = listener; - }); - - // Elements used to detect size change should not be injected for non responsive charts. - // See https://github.com/chartjs/Chart.js/issues/2210 - if (me.options.responsive) { - listener = function() { - me.resize(); - }; - - platform.addEventListener(me, 'resize', listener); - listeners.resize = listener; - } - }, - - /** - * @private - */ - unbindEvents: function() { - var me = this; - var listeners = me._listeners; - if (!listeners) { - return; - } - - delete me._listeners; - helpers.each(listeners, function(listener, type) { - platform.removeEventListener(me, type, listener); - }); - }, - - updateHoverStyle: function(elements, mode, enabled) { - var method = enabled ? 'setHoverStyle' : 'removeHoverStyle'; - var element, i, ilen; - - for (i = 0, ilen = elements.length; i < ilen; ++i) { - element = elements[i]; - if (element) { - this.getDatasetMeta(element._datasetIndex).controller[method](element); - } - } - }, - - /** - * @private - */ - eventHandler: function(e) { - var me = this; - var tooltip = me.tooltip; - - if (plugins.notify(me, 'beforeEvent', [e]) === false) { - return; - } - - // Buffer any update calls so that renders do not occur - me._bufferedRender = true; - me._bufferedRequest = null; - - var changed = me.handleEvent(e); - // for smooth tooltip animations issue #4989 - // the tooltip should be the source of change - // Animation check workaround: - // tooltip._start will be null when tooltip isn't animating - if (tooltip) { - changed = tooltip._start - ? tooltip.handleEvent(e) - : changed | tooltip.handleEvent(e); - } - - plugins.notify(me, 'afterEvent', [e]); - - var bufferedRequest = me._bufferedRequest; - if (bufferedRequest) { - // If we have an update that was triggered, we need to do a normal render - me.render(bufferedRequest); - } else if (changed && !me.animating) { - // If entering, leaving, or changing elements, animate the change via pivot - me.stop(); - - // We only need to render at this point. Updating will cause scales to be - // recomputed generating flicker & using more memory than necessary. - me.render(me.options.hover.animationDuration, true); - } - - me._bufferedRender = false; - me._bufferedRequest = null; - - return me; - }, - - /** - * Handle an event - * @private - * @param {IEvent} event the event to handle - * @return {Boolean} true if the chart needs to re-render - */ - handleEvent: function(e) { - var me = this; - var options = me.options || {}; - var hoverOptions = options.hover; - var changed = false; - - me.lastActive = me.lastActive || []; - - // Find Active Elements for hover and tooltips - if (e.type === 'mouseout') { - me.active = []; - } else { - me.active = me.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions); - } - - // Invoke onHover hook - // Need to call with native event here to not break backwards compatibility - helpers.callback(options.onHover || options.hover.onHover, [e.native, me.active], me); - - if (e.type === 'mouseup' || e.type === 'click') { - if (options.onClick) { - // Use e.native here for backwards compatibility - options.onClick.call(me, e.native, me.active); - } - } - - // Remove styling for last active (even if it may still be active) - if (me.lastActive.length) { - me.updateHoverStyle(me.lastActive, hoverOptions.mode, false); - } - - // Built in hover styling - if (me.active.length && hoverOptions.mode) { - me.updateHoverStyle(me.active, hoverOptions.mode, true); - } - - changed = !helpers.arrayEquals(me.active, me.lastActive); - - // Remember Last Actives - me.lastActive = me.active; - - return changed; } - }); - - /** - * Provided for backward compatibility, use Chart instead. - * @class Chart.Controller - * @deprecated since version 2.6.0 - * @todo remove at version 3 - * @private - */ - Chart.Controller = Chart; - }; - - },{"25":25,"28":28,"30":30,"31":31,"45":45,"48":48}],24:[function(require,module,exports){ - 'use strict'; - - var helpers = require(45); - - module.exports = function(Chart) { - - var arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift']; - - /** - * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice', - * 'unshift') and notify the listener AFTER the array has been altered. Listeners are - * called on the 'onData*' callbacks (e.g. onDataPush, etc.) with same arguments. - */ - function listenArrayEvents(array, listener) { - if (array._chartjs) { - array._chartjs.listeners.push(listener); - return; + }, + + onClick: function(e, legendItem) { + var index = legendItem.index; + var chart = this.chart; + var i, ilen, meta; + + for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) { + meta = chart.getDatasetMeta(i); + meta.data[index].hidden = !meta.data[index].hidden; } - - Object.defineProperty(array, '_chartjs', { - configurable: true, - enumerable: false, - value: { - listeners: [listener] - } - }); - - arrayEvents.forEach(function(key) { - var method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1); - var base = array[key]; - - Object.defineProperty(array, key, { - configurable: true, - enumerable: false, - value: function() { - var args = Array.prototype.slice.call(arguments); - var res = base.apply(this, args); - - helpers.each(array._chartjs.listeners, function(object) { - if (typeof object[method] === 'function') { - object[method].apply(object, args); - } - }); - - return res; - } - }); - }); + + chart.update(); } - - /** - * Removes the given array event listener and cleanup extra attached properties (such as - * the _chartjs stub and overridden methods) if array doesn't have any more listeners. - */ - function unlistenArrayEvents(array, listener) { - var stub = array._chartjs; - if (!stub) { - return; + }, + + // Need to override these to give a nice default + tooltips: { + callbacks: { + title: function() { + return ''; + }, + label: function(item, data) { + return data.labels[item.index] + ': ' + item.yLabel; } - - var listeners = stub.listeners; - var index = listeners.indexOf(listener); - if (index !== -1) { - listeners.splice(index, 1); - } - - if (listeners.length > 0) { - return; - } - - arrayEvents.forEach(function(key) { - delete array[key]; - }); - - delete array._chartjs; - } - - // Base class for all dataset controllers (line, bar, etc) - Chart.DatasetController = function(chart, datasetIndex) { - this.initialize(chart, datasetIndex); - }; - - helpers.extend(Chart.DatasetController.prototype, { - - /** - * Element type used to generate a meta dataset (e.g. Chart.element.Line). - * @type {Chart.core.element} - */ - datasetElementType: null, - - /** - * Element type used to generate a meta data (e.g. Chart.element.Point). - * @type {Chart.core.element} - */ - dataElementType: null, - - initialize: function(chart, datasetIndex) { - var me = this; - me.chart = chart; - me.index = datasetIndex; - me.linkScales(); - me.addElements(); - }, - - updateIndex: function(datasetIndex) { - this.index = datasetIndex; - }, - - linkScales: function() { - var me = this; - var meta = me.getMeta(); - var dataset = me.getDataset(); - - if (meta.xAxisID === null || !(meta.xAxisID in me.chart.scales)) { - meta.xAxisID = dataset.xAxisID || me.chart.options.scales.xAxes[0].id; - } - if (meta.yAxisID === null || !(meta.yAxisID in me.chart.scales)) { - meta.yAxisID = dataset.yAxisID || me.chart.options.scales.yAxes[0].id; - } - }, - - getDataset: function() { - return this.chart.data.datasets[this.index]; - }, - - getMeta: function() { - return this.chart.getDatasetMeta(this.index); - }, - - getScaleForId: function(scaleID) { - return this.chart.scales[scaleID]; - }, - - reset: function() { - this.update(true); - }, - - /** - * @private - */ - destroy: function() { - if (this._data) { - unlistenArrayEvents(this._data, this); - } - }, - - createMetaDataset: function() { - var me = this; - var type = me.datasetElementType; - return type && new type({ - _chart: me.chart, - _datasetIndex: me.index - }); - }, - - createMetaData: function(index) { - var me = this; - var type = me.dataElementType; - return type && new type({ - _chart: me.chart, - _datasetIndex: me.index, - _index: index - }); - }, - - addElements: function() { - var me = this; - var meta = me.getMeta(); - var data = me.getDataset().data || []; - var metaData = meta.data; - var i, ilen; - - for (i = 0, ilen = data.length; i < ilen; ++i) { - metaData[i] = metaData[i] || me.createMetaData(i); - } - - meta.dataset = meta.dataset || me.createMetaDataset(); - }, - - addElementAndReset: function(index) { - var element = this.createMetaData(index); - this.getMeta().data.splice(index, 0, element); - this.updateElement(element, index, true); - }, - - buildOrUpdateElements: function() { - var me = this; - var dataset = me.getDataset(); - var data = dataset.data || (dataset.data = []); - - // In order to correctly handle data addition/deletion animation (an thus simulate - // real-time charts), we need to monitor these data modifications and synchronize - // the internal meta data accordingly. - if (me._data !== data) { - if (me._data) { - // This case happens when the user replaced the data array instance. - unlistenArrayEvents(me._data, me); - } - - listenArrayEvents(data, me); - me._data = data; - } - - // Re-sync meta data in case the user replaced the data array or if we missed - // any updates and so make sure that we handle number of datapoints changing. - me.resyncElements(); - }, - - update: helpers.noop, - - transition: function(easingValue) { - var meta = this.getMeta(); - var elements = meta.data || []; - var ilen = elements.length; - var i = 0; - - for (; i < ilen; ++i) { - elements[i].transition(easingValue); - } - - if (meta.dataset) { - meta.dataset.transition(easingValue); - } - }, - - draw: function() { - var meta = this.getMeta(); - var elements = meta.data || []; - var ilen = elements.length; - var i = 0; - - if (meta.dataset) { - meta.dataset.draw(); - } - - for (; i < ilen; ++i) { - elements[i].draw(); - } - }, - - removeHoverStyle: function(element, elementOpts) { - var dataset = this.chart.data.datasets[element._datasetIndex]; - var index = element._index; - var custom = element.custom || {}; - var valueOrDefault = helpers.valueAtIndexOrDefault; - var model = element._model; - - model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : valueOrDefault(dataset.backgroundColor, index, elementOpts.backgroundColor); - model.borderColor = custom.borderColor ? custom.borderColor : valueOrDefault(dataset.borderColor, index, elementOpts.borderColor); - model.borderWidth = custom.borderWidth ? custom.borderWidth : valueOrDefault(dataset.borderWidth, index, elementOpts.borderWidth); - }, - - setHoverStyle: function(element) { - var dataset = this.chart.data.datasets[element._datasetIndex]; - var index = element._index; - var custom = element.custom || {}; - var valueOrDefault = helpers.valueAtIndexOrDefault; - var getHoverColor = helpers.getHoverColor; - var model = element._model; - - model.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : valueOrDefault(dataset.hoverBackgroundColor, index, getHoverColor(model.backgroundColor)); - model.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : valueOrDefault(dataset.hoverBorderColor, index, getHoverColor(model.borderColor)); - model.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : valueOrDefault(dataset.hoverBorderWidth, index, model.borderWidth); - }, - - /** - * @private - */ - resyncElements: function() { - var me = this; - var meta = me.getMeta(); - var data = me.getDataset().data; - var numMeta = meta.data.length; - var numData = data.length; - - if (numData < numMeta) { - meta.data.splice(numData, numMeta - numData); - } else if (numData > numMeta) { - me.insertElements(numMeta, numData - numMeta); - } - }, - - /** - * @private - */ - insertElements: function(start, count) { - for (var i = 0; i < count; ++i) { - this.addElementAndReset(start + i); - } - }, - - /** - * @private - */ - onDataPush: function() { - this.insertElements(this.getDataset().data.length - 1, arguments.length); - }, - - /** - * @private - */ - onDataPop: function() { - this.getMeta().data.pop(); - }, - - /** - * @private - */ - onDataShift: function() { - this.getMeta().data.shift(); - }, - - /** - * @private - */ - onDataSplice: function(start, count) { - this.getMeta().data.splice(start, count); - this.insertElements(start, arguments.length - 2); - }, - - /** - * @private - */ - onDataUnshift: function() { - this.insertElements(0, arguments.length); - } - }); - - Chart.DatasetController.extend = helpers.inherits; - }; - - },{"45":45}],25:[function(require,module,exports){ - 'use strict'; - - var helpers = require(45); - - module.exports = { - /** - * @private - */ - _set: function(scope, values) { - return helpers.merge(this[scope] || (this[scope] = {}), values); - } - }; - - },{"45":45}],26:[function(require,module,exports){ - 'use strict'; - - var color = require(2); - var helpers = require(45); - - function interpolate(start, view, model, ease) { - var keys = Object.keys(model); - var i, ilen, key, actual, origin, target, type, c0, c1; - - for (i = 0, ilen = keys.length; i < ilen; ++i) { - key = keys[i]; - - target = model[key]; - - // if a value is added to the model after pivot() has been called, the view - // doesn't contain it, so let's initialize the view to the target value. - if (!view.hasOwnProperty(key)) { - view[key] = target; - } - - actual = view[key]; - - if (actual === target || key[0] === '_') { - continue; - } - - if (!start.hasOwnProperty(key)) { - start[key] = actual; - } - - origin = start[key]; - - type = typeof target; - - if (type === typeof origin) { - if (type === 'string') { - c0 = color(origin); - if (c0.valid) { - c1 = color(target); - if (c1.valid) { - view[key] = c1.mix(c0, ease).rgbString(); - continue; - } - } - } else if (type === 'number' && isFinite(origin) && isFinite(target)) { - view[key] = origin + (target - origin) * ease; - continue; - } - } - - view[key] = target; } } - - var Element = function(configuration) { - helpers.extend(this, configuration); - this.initialize.apply(this, arguments); - }; - - helpers.extend(Element.prototype, { - - initialize: function() { - this.hidden = false; - }, - - pivot: function() { - var me = this; - if (!me._view) { - me._view = helpers.clone(me._model); + }); + + var controller_polarArea = core_datasetController.extend({ + + dataElementType: elements.Arc, + + linkScales: helpers$1.noop, + + /** + * @private + */ + _dataElementOptions: [ + 'backgroundColor', + 'borderColor', + 'borderWidth', + 'borderAlign', + 'hoverBackgroundColor', + 'hoverBorderColor', + 'hoverBorderWidth', + ], + + /** + * @private + */ + _getIndexScaleId: function() { + return this.chart.scale.id; + }, + + /** + * @private + */ + _getValueScaleId: function() { + return this.chart.scale.id; + }, + + update: function(reset) { + var me = this; + var dataset = me.getDataset(); + var meta = me.getMeta(); + var start = me.chart.options.startAngle || 0; + var starts = me._starts = []; + var angles = me._angles = []; + var arcs = meta.data; + var i, ilen, angle; + + me._updateRadius(); + + meta.count = me.countVisibleElements(); + + for (i = 0, ilen = dataset.data.length; i < ilen; i++) { + starts[i] = start; + angle = me._computeAngle(i); + angles[i] = angle; + start += angle; + } + + for (i = 0, ilen = arcs.length; i < ilen; ++i) { + arcs[i]._options = me._resolveDataElementOptions(arcs[i], i); + me.updateElement(arcs[i], i, reset); + } + }, + + /** + * @private + */ + _updateRadius: function() { + var me = this; + var chart = me.chart; + var chartArea = chart.chartArea; + var opts = chart.options; + var minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top); + + chart.outerRadius = Math.max(minSize / 2, 0); + chart.innerRadius = Math.max(opts.cutoutPercentage ? (chart.outerRadius / 100) * (opts.cutoutPercentage) : 1, 0); + chart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount(); + + me.outerRadius = chart.outerRadius - (chart.radiusLength * me.index); + me.innerRadius = me.outerRadius - chart.radiusLength; + }, + + updateElement: function(arc, index, reset) { + var me = this; + var chart = me.chart; + var dataset = me.getDataset(); + var opts = chart.options; + var animationOpts = opts.animation; + var scale = chart.scale; + var labels = chart.data.labels; + + var centerX = scale.xCenter; + var centerY = scale.yCenter; + + // var negHalfPI = -0.5 * Math.PI; + var datasetStartAngle = opts.startAngle; + var distance = arc.hidden ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]); + var startAngle = me._starts[index]; + var endAngle = startAngle + (arc.hidden ? 0 : me._angles[index]); + + var resetRadius = animationOpts.animateScale ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]); + var options = arc._options || {}; + + helpers$1.extend(arc, { + // Utility + _datasetIndex: me.index, + _index: index, + _scale: scale, + + // Desired view properties + _model: { + backgroundColor: options.backgroundColor, + borderColor: options.borderColor, + borderWidth: options.borderWidth, + borderAlign: options.borderAlign, + x: centerX, + y: centerY, + innerRadius: 0, + outerRadius: reset ? resetRadius : distance, + startAngle: reset && animationOpts.animateRotate ? datasetStartAngle : startAngle, + endAngle: reset && animationOpts.animateRotate ? datasetStartAngle : endAngle, + label: helpers$1.valueAtIndexOrDefault(labels, index, labels[index]) } - me._start = {}; - return me; - }, - - transition: function(ease) { - var me = this; - var model = me._model; - var start = me._start; - var view = me._view; - - // No animation -> No Transition - if (!model || ease === 1) { - me._view = model; - me._start = null; - return me; + }); + + arc.pivot(); + }, + + countVisibleElements: function() { + var dataset = this.getDataset(); + var meta = this.getMeta(); + var count = 0; + + helpers$1.each(meta.data, function(element, index) { + if (!isNaN(dataset.data[index]) && !element.hidden) { + count++; } - - if (!view) { - view = me._view = {}; + }); + + return count; + }, + + /** + * @protected + */ + setHoverStyle: function(arc) { + var model = arc._model; + var options = arc._options; + var getHoverColor = helpers$1.getHoverColor; + var valueOrDefault = helpers$1.valueOrDefault; + + arc.$previousStyle = { + backgroundColor: model.backgroundColor, + borderColor: model.borderColor, + borderWidth: model.borderWidth, + }; + + model.backgroundColor = valueOrDefault(options.hoverBackgroundColor, getHoverColor(options.backgroundColor)); + model.borderColor = valueOrDefault(options.hoverBorderColor, getHoverColor(options.borderColor)); + model.borderWidth = valueOrDefault(options.hoverBorderWidth, options.borderWidth); + }, + + /** + * @private + */ + _computeAngle: function(index) { + var me = this; + var count = this.getMeta().count; + var dataset = me.getDataset(); + var meta = me.getMeta(); + + if (isNaN(dataset.data[index]) || meta.data[index].hidden) { + return 0; + } + + // Scriptable options + var context = { + chart: me.chart, + dataIndex: index, + dataset: dataset, + datasetIndex: me.index + }; + + return resolve$3([ + me.chart.options.elements.arc.angle, + (2 * Math.PI) / count + ], context, index); + } + }); + + core_defaults._set('pie', helpers$1.clone(core_defaults.doughnut)); + core_defaults._set('pie', { + cutoutPercentage: 0 + }); + + // Pie charts are Doughnut chart with different defaults + var controller_pie = controller_doughnut; + + var valueOrDefault$7 = helpers$1.valueOrDefault; + + core_defaults._set('radar', { + spanGaps: false, + scale: { + type: 'radialLinear' + }, + elements: { + line: { + fill: 'start', + tension: 0 // no bezier in radar + } + } + }); + + var controller_radar = core_datasetController.extend({ + datasetElementType: elements.Line, + + dataElementType: elements.Point, + + linkScales: helpers$1.noop, + + /** + * @private + */ + _datasetElementOptions: [ + 'backgroundColor', + 'borderWidth', + 'borderColor', + 'borderCapStyle', + 'borderDash', + 'borderDashOffset', + 'borderJoinStyle', + 'fill' + ], + + /** + * @private + */ + _dataElementOptions: { + backgroundColor: 'pointBackgroundColor', + borderColor: 'pointBorderColor', + borderWidth: 'pointBorderWidth', + hitRadius: 'pointHitRadius', + hoverBackgroundColor: 'pointHoverBackgroundColor', + hoverBorderColor: 'pointHoverBorderColor', + hoverBorderWidth: 'pointHoverBorderWidth', + hoverRadius: 'pointHoverRadius', + pointStyle: 'pointStyle', + radius: 'pointRadius', + rotation: 'pointRotation' + }, + + /** + * @private + */ + _getIndexScaleId: function() { + return this.chart.scale.id; + }, + + /** + * @private + */ + _getValueScaleId: function() { + return this.chart.scale.id; + }, + + update: function(reset) { + var me = this; + var meta = me.getMeta(); + var line = meta.dataset; + var points = meta.data || []; + var scale = me.chart.scale; + var config = me._config; + var i, ilen; + + // Compatibility: If the properties are defined with only the old name, use those values + if (config.tension !== undefined && config.lineTension === undefined) { + config.lineTension = config.tension; + } + + // Utility + line._scale = scale; + line._datasetIndex = me.index; + // Data + line._children = points; + line._loop = true; + // Model + line._model = me._resolveDatasetElementOptions(line); + + line.pivot(); + + // Update Points + for (i = 0, ilen = points.length; i < ilen; ++i) { + me.updateElement(points[i], i, reset); + } + + // Update bezier control points + me.updateBezierControlPoints(); + + // Now pivot the point for animation + for (i = 0, ilen = points.length; i < ilen; ++i) { + points[i].pivot(); + } + }, + + updateElement: function(point, index, reset) { + var me = this; + var custom = point.custom || {}; + var dataset = me.getDataset(); + var scale = me.chart.scale; + var pointPosition = scale.getPointPositionForValue(index, dataset.data[index]); + var options = me._resolveDataElementOptions(point, index); + var lineModel = me.getMeta().dataset._model; + var x = reset ? scale.xCenter : pointPosition.x; + var y = reset ? scale.yCenter : pointPosition.y; + + // Utility + point._scale = scale; + point._options = options; + point._datasetIndex = me.index; + point._index = index; + + // Desired view properties + point._model = { + x: x, // value not used in dataset scale, but we want a consistent API between scales + y: y, + skip: custom.skip || isNaN(x) || isNaN(y), + // Appearance + radius: options.radius, + pointStyle: options.pointStyle, + rotation: options.rotation, + backgroundColor: options.backgroundColor, + borderColor: options.borderColor, + borderWidth: options.borderWidth, + tension: valueOrDefault$7(custom.tension, lineModel ? lineModel.tension : 0), + + // Tooltip + hitRadius: options.hitRadius + }; + }, + + /** + * @private + */ + _resolveDatasetElementOptions: function() { + var me = this; + var config = me._config; + var options = me.chart.options; + var values = core_datasetController.prototype._resolveDatasetElementOptions.apply(me, arguments); + + values.spanGaps = valueOrDefault$7(config.spanGaps, options.spanGaps); + values.tension = valueOrDefault$7(config.lineTension, options.elements.line.tension); + + return values; + }, + + updateBezierControlPoints: function() { + var me = this; + var meta = me.getMeta(); + var area = me.chart.chartArea; + var points = meta.data || []; + var i, ilen, model, controlPoints; + + // Only consider points that are drawn in case the spanGaps option is used + if (meta.dataset._model.spanGaps) { + points = points.filter(function(pt) { + return !pt._model.skip; + }); + } + + function capControlPoint(pt, min, max) { + return Math.max(Math.min(pt, max), min); + } + + for (i = 0, ilen = points.length; i < ilen; ++i) { + model = points[i]._model; + controlPoints = helpers$1.splineCurve( + helpers$1.previousItem(points, i, true)._model, + model, + helpers$1.nextItem(points, i, true)._model, + model.tension + ); + + // Prevent the bezier going outside of the bounds of the graph + model.controlPointPreviousX = capControlPoint(controlPoints.previous.x, area.left, area.right); + model.controlPointPreviousY = capControlPoint(controlPoints.previous.y, area.top, area.bottom); + model.controlPointNextX = capControlPoint(controlPoints.next.x, area.left, area.right); + model.controlPointNextY = capControlPoint(controlPoints.next.y, area.top, area.bottom); + } + }, + + setHoverStyle: function(point) { + var model = point._model; + var options = point._options; + var getHoverColor = helpers$1.getHoverColor; + + point.$previousStyle = { + backgroundColor: model.backgroundColor, + borderColor: model.borderColor, + borderWidth: model.borderWidth, + radius: model.radius + }; + + model.backgroundColor = valueOrDefault$7(options.hoverBackgroundColor, getHoverColor(options.backgroundColor)); + model.borderColor = valueOrDefault$7(options.hoverBorderColor, getHoverColor(options.borderColor)); + model.borderWidth = valueOrDefault$7(options.hoverBorderWidth, options.borderWidth); + model.radius = valueOrDefault$7(options.hoverRadius, options.radius); + } + }); + + core_defaults._set('scatter', { + hover: { + mode: 'single' + }, + + scales: { + xAxes: [{ + id: 'x-axis-1', // need an ID so datasets can reference the scale + type: 'linear', // scatter should not use a category axis + position: 'bottom' + }], + yAxes: [{ + id: 'y-axis-1', + type: 'linear', + position: 'left' + }] + }, + + tooltips: { + callbacks: { + title: function() { + return ''; // doesn't make sense for scatter since data are formatted as a point + }, + label: function(item) { + return '(' + item.xLabel + ', ' + item.yLabel + ')'; } - - if (!start) { - start = me._start = {}; + } + } + }); + + core_defaults._set('global', { + datasets: { + scatter: { + showLine: false + } + } + }); + + // Scatter charts use line controllers + var controller_scatter = controller_line; + + // NOTE export a map in which the key represents the controller type, not + // the class, and so must be CamelCase in order to be correctly retrieved + // by the controller in core.controller.js (`controllers[meta.type]`). + + var controllers = { + bar: controller_bar, + bubble: controller_bubble, + doughnut: controller_doughnut, + horizontalBar: controller_horizontalBar, + line: controller_line, + polarArea: controller_polarArea, + pie: controller_pie, + radar: controller_radar, + scatter: controller_scatter + }; + + /** + * Helper function to get relative position for an event + * @param {Event|IEvent} event - The event to get the position for + * @param {Chart} chart - The chart + * @returns {object} the event position + */ + function getRelativePosition(e, chart) { + if (e.native) { + return { + x: e.x, + y: e.y + }; + } + + return helpers$1.getRelativePosition(e, chart); + } + + /** + * Helper function to traverse all of the visible elements in the chart + * @param {Chart} chart - the chart + * @param {function} handler - the callback to execute for each visible item + */ + function parseVisibleItems(chart, handler) { + var metasets = chart._getSortedVisibleDatasetMetas(); + var metadata, i, j, ilen, jlen, element; + + for (i = 0, ilen = metasets.length; i < ilen; ++i) { + metadata = metasets[i].data; + for (j = 0, jlen = metadata.length; j < jlen; ++j) { + element = metadata[j]; + if (!element._view.skip) { + handler(element); } - - interpolate(start, view, model, ease); - - return me; - }, - - tooltipPosition: function() { - return { - x: this._model.x, - y: this._model.y - }; - }, - - hasValue: function() { - return helpers.isNumber(this._model.x) && helpers.isNumber(this._model.y); + } + } + } + + /** + * Helper function to get the items that intersect the event position + * @param {ChartElement[]} items - elements to filter + * @param {object} position - the point to be nearest to + * @return {ChartElement[]} the nearest items + */ + function getIntersectItems(chart, position) { + var elements = []; + + parseVisibleItems(chart, function(element) { + if (element.inRange(position.x, position.y)) { + elements.push(element); } }); - - Element.extend = helpers.inherits; - - module.exports = Element; - - },{"2":2,"45":45}],27:[function(require,module,exports){ - /* global window: false */ - /* global document: false */ - 'use strict'; - - var color = require(2); - var defaults = require(25); - var helpers = require(45); - - module.exports = function(Chart) { - - // -- Basic js utility methods - - helpers.configMerge = function(/* objects ... */) { - return helpers.merge(helpers.clone(arguments[0]), [].slice.call(arguments, 1), { - merger: function(key, target, source, options) { - var tval = target[key] || {}; - var sval = source[key]; - - if (key === 'scales') { - // scale config merging is complex. Add our own function here for that - target[key] = helpers.scaleMerge(tval, sval); - } else if (key === 'scale') { - // used in polar area & radar charts since there is only one scale - target[key] = helpers.merge(tval, [Chart.scaleService.getScaleDefaults(sval.type), sval]); - } else { - helpers._merger(key, target, source, options); - } + + return elements; + } + + /** + * Helper function to get the items nearest to the event position considering all visible items in teh chart + * @param {Chart} chart - the chart to look at elements from + * @param {object} position - the point to be nearest to + * @param {boolean} intersect - if true, only consider items that intersect the position + * @param {function} distanceMetric - function to provide the distance between points + * @return {ChartElement[]} the nearest items + */ + function getNearestItems(chart, position, intersect, distanceMetric) { + var minDistance = Number.POSITIVE_INFINITY; + var nearestItems = []; + + parseVisibleItems(chart, function(element) { + if (intersect && !element.inRange(position.x, position.y)) { + return; + } + + var center = element.getCenterPoint(); + var distance = distanceMetric(position, center); + if (distance < minDistance) { + nearestItems = [element]; + minDistance = distance; + } else if (distance === minDistance) { + // Can have multiple items at the same distance in which case we sort by size + nearestItems.push(element); + } + }); + + return nearestItems; + } + + /** + * Get a distance metric function for two points based on the + * axis mode setting + * @param {string} axis - the axis mode. x|y|xy + */ + function getDistanceMetricForAxis(axis) { + var useX = axis.indexOf('x') !== -1; + var useY = axis.indexOf('y') !== -1; + + return function(pt1, pt2) { + var deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0; + var deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0; + return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2)); + }; + } + + function indexMode(chart, e, options) { + var position = getRelativePosition(e, chart); + // Default axis for index mode is 'x' to match old behaviour + options.axis = options.axis || 'x'; + var distanceMetric = getDistanceMetricForAxis(options.axis); + var items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric); + var elements = []; + + if (!items.length) { + return []; + } + + chart._getSortedVisibleDatasetMetas().forEach(function(meta) { + var element = meta.data[items[0]._index]; + + // don't count items that are skipped (null data) + if (element && !element._view.skip) { + elements.push(element); + } + }); + + return elements; + } + + /** + * @interface IInteractionOptions + */ + /** + * If true, only consider items that intersect the point + * @name IInterfaceOptions#boolean + * @type Boolean + */ + + /** + * Contains interaction related functions + * @namespace Chart.Interaction + */ + var core_interaction = { + // Helper function for different modes + modes: { + single: function(chart, e) { + var position = getRelativePosition(e, chart); + var elements = []; + + parseVisibleItems(chart, function(element) { + if (element.inRange(position.x, position.y)) { + elements.push(element); + return elements; } }); - }; - - helpers.scaleMerge = function(/* objects ... */) { - return helpers.merge(helpers.clone(arguments[0]), [].slice.call(arguments, 1), { - merger: function(key, target, source, options) { - if (key === 'xAxes' || key === 'yAxes') { - var slen = source[key].length; - var i, type, scale; - - if (!target[key]) { - target[key] = []; - } - - for (i = 0; i < slen; ++i) { - scale = source[key][i]; - type = helpers.valueOrDefault(scale.type, key === 'xAxes' ? 'category' : 'linear'); - - if (i >= target[key].length) { - target[key].push({}); - } - - if (!target[key][i].type || (scale.type && scale.type !== target[key][i].type)) { - // new/untyped scale or type changed: let's apply the new defaults - // then merge source scale to correctly overwrite the defaults. - helpers.merge(target[key][i], [Chart.scaleService.getScaleDefaults(type), scale]); - } else { - // scales type are the same - helpers.merge(target[key][i], scale); - } - } - } else { - helpers._merger(key, target, source, options); - } + + return elements.slice(0, 1); + }, + + /** + * @function Chart.Interaction.modes.label + * @deprecated since version 2.4.0 + * @todo remove at version 3 + * @private + */ + label: indexMode, + + /** + * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something + * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item + * @function Chart.Interaction.modes.index + * @since v2.4.0 + * @param {Chart} chart - the chart we are returning items from + * @param {Event} e - the event we are find things at + * @param {IInteractionOptions} options - options to use during interaction + * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned + */ + index: indexMode, + + /** + * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something + * If the options.intersect is false, we find the nearest item and return the items in that dataset + * @function Chart.Interaction.modes.dataset + * @param {Chart} chart - the chart we are returning items from + * @param {Event} e - the event we are find things at + * @param {IInteractionOptions} options - options to use during interaction + * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned + */ + dataset: function(chart, e, options) { + var position = getRelativePosition(e, chart); + options.axis = options.axis || 'xy'; + var distanceMetric = getDistanceMetricForAxis(options.axis); + var items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric); + + if (items.length > 0) { + items = chart.getDatasetMeta(items[0]._datasetIndex).data; + } + + return items; + }, + + /** + * @function Chart.Interaction.modes.x-axis + * @deprecated since version 2.4.0. Use index mode and intersect == true + * @todo remove at version 3 + * @private + */ + 'x-axis': function(chart, e) { + return indexMode(chart, e, {intersect: false}); + }, + + /** + * Point mode returns all elements that hit test based on the event position + * of the event + * @function Chart.Interaction.modes.intersect + * @param {Chart} chart - the chart we are returning items from + * @param {Event} e - the event we are find things at + * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned + */ + point: function(chart, e) { + var position = getRelativePosition(e, chart); + return getIntersectItems(chart, position); + }, + + /** + * nearest mode returns the element closest to the point + * @function Chart.Interaction.modes.intersect + * @param {Chart} chart - the chart we are returning items from + * @param {Event} e - the event we are find things at + * @param {IInteractionOptions} options - options to use + * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned + */ + nearest: function(chart, e, options) { + var position = getRelativePosition(e, chart); + options.axis = options.axis || 'xy'; + var distanceMetric = getDistanceMetricForAxis(options.axis); + return getNearestItems(chart, position, options.intersect, distanceMetric); + }, + + /** + * x mode returns the elements that hit-test at the current x coordinate + * @function Chart.Interaction.modes.x + * @param {Chart} chart - the chart we are returning items from + * @param {Event} e - the event we are find things at + * @param {IInteractionOptions} options - options to use + * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned + */ + x: function(chart, e, options) { + var position = getRelativePosition(e, chart); + var items = []; + var intersectsItem = false; + + parseVisibleItems(chart, function(element) { + if (element.inXRange(position.x)) { + items.push(element); + } + + if (element.inRange(position.x, position.y)) { + intersectsItem = true; } }); - }; - - helpers.where = function(collection, filterCallback) { - if (helpers.isArray(collection) && Array.prototype.filter) { - return collection.filter(filterCallback); + + // If we want to trigger on an intersect and we don't have any items + // that intersect the position, return nothing + if (options.intersect && !intersectsItem) { + items = []; } - var filtered = []; - - helpers.each(collection, function(item) { - if (filterCallback(item)) { - filtered.push(item); + return items; + }, + + /** + * y mode returns the elements that hit-test at the current y coordinate + * @function Chart.Interaction.modes.y + * @param {Chart} chart - the chart we are returning items from + * @param {Event} e - the event we are find things at + * @param {IInteractionOptions} options - options to use + * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned + */ + y: function(chart, e, options) { + var position = getRelativePosition(e, chart); + var items = []; + var intersectsItem = false; + + parseVisibleItems(chart, function(element) { + if (element.inYRange(position.y)) { + items.push(element); + } + + if (element.inRange(position.x, position.y)) { + intersectsItem = true; } }); - - return filtered; + + // If we want to trigger on an intersect and we don't have any items + // that intersect the position, return nothing + if (options.intersect && !intersectsItem) { + items = []; + } + return items; + } + } + }; + + var extend = helpers$1.extend; + + function filterByPosition(array, position) { + return helpers$1.where(array, function(v) { + return v.pos === position; + }); + } + + function sortByWeight(array, reverse) { + return array.sort(function(a, b) { + var v0 = reverse ? b : a; + var v1 = reverse ? a : b; + return v0.weight === v1.weight ? + v0.index - v1.index : + v0.weight - v1.weight; + }); + } + + function wrapBoxes(boxes) { + var layoutBoxes = []; + var i, ilen, box; + + for (i = 0, ilen = (boxes || []).length; i < ilen; ++i) { + box = boxes[i]; + layoutBoxes.push({ + index: i, + box: box, + pos: box.position, + horizontal: box.isHorizontal(), + weight: box.weight + }); + } + return layoutBoxes; + } + + function setLayoutDims(layouts, params) { + var i, ilen, layout; + for (i = 0, ilen = layouts.length; i < ilen; ++i) { + layout = layouts[i]; + // store width used instead of chartArea.w in fitBoxes + layout.width = layout.horizontal + ? layout.box.fullWidth && params.availableWidth + : params.vBoxMaxWidth; + // store height used instead of chartArea.h in fitBoxes + layout.height = layout.horizontal && params.hBoxMaxHeight; + } + } + + function buildLayoutBoxes(boxes) { + var layoutBoxes = wrapBoxes(boxes); + var left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true); + var right = sortByWeight(filterByPosition(layoutBoxes, 'right')); + var top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true); + var bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom')); + + return { + leftAndTop: left.concat(top), + rightAndBottom: right.concat(bottom), + chartArea: filterByPosition(layoutBoxes, 'chartArea'), + vertical: left.concat(right), + horizontal: top.concat(bottom) + }; + } + + function getCombinedMax(maxPadding, chartArea, a, b) { + return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]); + } + + function updateDims(chartArea, params, layout) { + var box = layout.box; + var maxPadding = chartArea.maxPadding; + var newWidth, newHeight; + + if (layout.size) { + // this layout was already counted for, lets first reduce old size + chartArea[layout.pos] -= layout.size; + } + layout.size = layout.horizontal ? box.height : box.width; + chartArea[layout.pos] += layout.size; + + if (box.getPadding) { + var boxPadding = box.getPadding(); + maxPadding.top = Math.max(maxPadding.top, boxPadding.top); + maxPadding.left = Math.max(maxPadding.left, boxPadding.left); + maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom); + maxPadding.right = Math.max(maxPadding.right, boxPadding.right); + } + + newWidth = params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right'); + newHeight = params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom'); + + if (newWidth !== chartArea.w || newHeight !== chartArea.h) { + chartArea.w = newWidth; + chartArea.h = newHeight; + + // return true if chart area changed in layout's direction + return layout.horizontal ? newWidth !== chartArea.w : newHeight !== chartArea.h; + } + } + + function handleMaxPadding(chartArea) { + var maxPadding = chartArea.maxPadding; + + function updatePos(pos) { + var change = Math.max(maxPadding[pos] - chartArea[pos], 0); + chartArea[pos] += change; + return change; + } + chartArea.y += updatePos('top'); + chartArea.x += updatePos('left'); + updatePos('right'); + updatePos('bottom'); + } + + function getMargins(horizontal, chartArea) { + var maxPadding = chartArea.maxPadding; + + function marginForPositions(positions) { + var margin = {left: 0, top: 0, right: 0, bottom: 0}; + positions.forEach(function(pos) { + margin[pos] = Math.max(chartArea[pos], maxPadding[pos]); + }); + return margin; + } + + return horizontal + ? marginForPositions(['left', 'right']) + : marginForPositions(['top', 'bottom']); + } + + function fitBoxes(boxes, chartArea, params) { + var refitBoxes = []; + var i, ilen, layout, box, refit, changed; + + for (i = 0, ilen = boxes.length; i < ilen; ++i) { + layout = boxes[i]; + box = layout.box; + + box.update( + layout.width || chartArea.w, + layout.height || chartArea.h, + getMargins(layout.horizontal, chartArea) + ); + if (updateDims(chartArea, params, layout)) { + changed = true; + if (refitBoxes.length) { + // Dimensions changed and there were non full width boxes before this + // -> we have to refit those + refit = true; + } + } + if (!box.fullWidth) { // fullWidth boxes don't need to be re-fitted in any case + refitBoxes.push(layout); + } + } + + return refit ? fitBoxes(refitBoxes, chartArea, params) || changed : changed; + } + + function placeBoxes(boxes, chartArea, params) { + var userPadding = params.padding; + var x = chartArea.x; + var y = chartArea.y; + var i, ilen, layout, box; + + for (i = 0, ilen = boxes.length; i < ilen; ++i) { + layout = boxes[i]; + box = layout.box; + if (layout.horizontal) { + box.left = box.fullWidth ? userPadding.left : chartArea.left; + box.right = box.fullWidth ? params.outerWidth - userPadding.right : chartArea.left + chartArea.w; + box.top = y; + box.bottom = y + box.height; + box.width = box.right - box.left; + y = box.bottom; + } else { + box.left = x; + box.right = x + box.width; + box.top = chartArea.top; + box.bottom = chartArea.top + chartArea.h; + box.height = box.bottom - box.top; + x = box.right; + } + } + + chartArea.x = x; + chartArea.y = y; + } + + core_defaults._set('global', { + layout: { + padding: { + top: 0, + right: 0, + bottom: 0, + left: 0 + } + } + }); + + /** + * @interface ILayoutItem + * @prop {string} position - The position of the item in the chart layout. Possible values are + * 'left', 'top', 'right', 'bottom', and 'chartArea' + * @prop {number} weight - The weight used to sort the item. Higher weights are further away from the chart area + * @prop {boolean} fullWidth - if true, and the item is horizontal, then push vertical boxes down + * @prop {function} isHorizontal - returns true if the layout item is horizontal (ie. top or bottom) + * @prop {function} update - Takes two parameters: width and height. Returns size of item + * @prop {function} getPadding - Returns an object with padding on the edges + * @prop {number} width - Width of item. Must be valid after update() + * @prop {number} height - Height of item. Must be valid after update() + * @prop {number} left - Left edge of the item. Set by layout system and cannot be used in update + * @prop {number} top - Top edge of the item. Set by layout system and cannot be used in update + * @prop {number} right - Right edge of the item. Set by layout system and cannot be used in update + * @prop {number} bottom - Bottom edge of the item. Set by layout system and cannot be used in update + */ + + // The layout service is very self explanatory. It's responsible for the layout within a chart. + // Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need + // It is this service's responsibility of carrying out that layout. + var core_layouts = { + defaults: {}, + + /** + * Register a box to a chart. + * A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title. + * @param {Chart} chart - the chart to use + * @param {ILayoutItem} item - the item to add to be layed out + */ + addBox: function(chart, item) { + if (!chart.boxes) { + chart.boxes = []; + } + + // initialize item with default values + item.fullWidth = item.fullWidth || false; + item.position = item.position || 'top'; + item.weight = item.weight || 0; + item._layers = item._layers || function() { + return [{ + z: 0, + draw: function() { + item.draw.apply(item, arguments); + } + }]; }; - helpers.findIndex = Array.prototype.findIndex ? - function(array, callback, scope) { - return array.findIndex(callback, scope); - } : - function(array, callback, scope) { - scope = scope === undefined ? array : scope; - for (var i = 0, ilen = array.length; i < ilen; ++i) { - if (callback.call(scope, array[i], i, array)) { - return i; + + chart.boxes.push(item); + }, + + /** + * Remove a layoutItem from a chart + * @param {Chart} chart - the chart to remove the box from + * @param {ILayoutItem} layoutItem - the item to remove from the layout + */ + removeBox: function(chart, layoutItem) { + var index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1; + if (index !== -1) { + chart.boxes.splice(index, 1); + } + }, + + /** + * Sets (or updates) options on the given `item`. + * @param {Chart} chart - the chart in which the item lives (or will be added to) + * @param {ILayoutItem} item - the item to configure with the given options + * @param {object} options - the new item options. + */ + configure: function(chart, item, options) { + var props = ['fullWidth', 'position', 'weight']; + var ilen = props.length; + var i = 0; + var prop; + + for (; i < ilen; ++i) { + prop = props[i]; + if (options.hasOwnProperty(prop)) { + item[prop] = options[prop]; + } + } + }, + + /** + * Fits boxes of the given chart into the given size by having each box measure itself + * then running a fitting algorithm + * @param {Chart} chart - the chart + * @param {number} width - the width to fit into + * @param {number} height - the height to fit into + */ + update: function(chart, width, height) { + if (!chart) { + return; + } + + var layoutOptions = chart.options.layout || {}; + var padding = helpers$1.options.toPadding(layoutOptions.padding); + + var availableWidth = width - padding.width; + var availableHeight = height - padding.height; + var boxes = buildLayoutBoxes(chart.boxes); + var verticalBoxes = boxes.vertical; + var horizontalBoxes = boxes.horizontal; + + // Essentially we now have any number of boxes on each of the 4 sides. + // Our canvas looks like the following. + // The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and + // B1 is the bottom axis + // There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays + // These locations are single-box locations only, when trying to register a chartArea location that is already taken, + // an error will be thrown. + // + // |----------------------------------------------------| + // | T1 (Full Width) | + // |----------------------------------------------------| + // | | | T2 | | + // | |----|-------------------------------------|----| + // | | | C1 | | C2 | | + // | | |----| |----| | + // | | | | | + // | L1 | L2 | ChartArea (C0) | R1 | + // | | | | | + // | | |----| |----| | + // | | | C3 | | C4 | | + // | |----|-------------------------------------|----| + // | | | B1 | | + // |----------------------------------------------------| + // | B2 (Full Width) | + // |----------------------------------------------------| + // + + var params = Object.freeze({ + outerWidth: width, + outerHeight: height, + padding: padding, + availableWidth: availableWidth, + vBoxMaxWidth: availableWidth / 2 / verticalBoxes.length, + hBoxMaxHeight: availableHeight / 2 + }); + var chartArea = extend({ + maxPadding: extend({}, padding), + w: availableWidth, + h: availableHeight, + x: padding.left, + y: padding.top + }, padding); + + setLayoutDims(verticalBoxes.concat(horizontalBoxes), params); + + // First fit vertical boxes + fitBoxes(verticalBoxes, chartArea, params); + + // Then fit horizontal boxes + if (fitBoxes(horizontalBoxes, chartArea, params)) { + // if the area changed, re-fit vertical boxes + fitBoxes(verticalBoxes, chartArea, params); + } + + handleMaxPadding(chartArea); + + // Finally place the boxes to correct coordinates + placeBoxes(boxes.leftAndTop, chartArea, params); + + // Move to opposite side of chart + chartArea.x += chartArea.w; + chartArea.y += chartArea.h; + + placeBoxes(boxes.rightAndBottom, chartArea, params); + + chart.chartArea = { + left: chartArea.left, + top: chartArea.top, + right: chartArea.left + chartArea.w, + bottom: chartArea.top + chartArea.h + }; + + // Finally update boxes in chartArea (radial scale for example) + helpers$1.each(boxes.chartArea, function(layout) { + var box = layout.box; + extend(box, chart.chartArea); + box.update(chartArea.w, chartArea.h); + }); + } + }; + + /** + * Platform fallback implementation (minimal). + * @see https://github.com/chartjs/Chart.js/pull/4591#issuecomment-319575939 + */ + + var platform_basic = { + acquireContext: function(item) { + if (item && item.canvas) { + // Support for any object associated to a canvas (including a context2d) + item = item.canvas; + } + + return item && item.getContext('2d') || null; + } + }; + + var platform_dom = "/*\n * DOM element rendering detection\n * https://davidwalsh.name/detect-node-insertion\n */\n@keyframes chartjs-render-animation {\n\tfrom { opacity: 0.99; }\n\tto { opacity: 1; }\n}\n\n.chartjs-render-monitor {\n\tanimation: chartjs-render-animation 0.001s;\n}\n\n/*\n * DOM element resizing detection\n * https://github.com/marcj/css-element-queries\n */\n.chartjs-size-monitor,\n.chartjs-size-monitor-expand,\n.chartjs-size-monitor-shrink {\n\tposition: absolute;\n\tdirection: ltr;\n\tleft: 0;\n\ttop: 0;\n\tright: 0;\n\tbottom: 0;\n\toverflow: hidden;\n\tpointer-events: none;\n\tvisibility: hidden;\n\tz-index: -1;\n}\n\n.chartjs-size-monitor-expand > div {\n\tposition: absolute;\n\twidth: 1000000px;\n\theight: 1000000px;\n\tleft: 0;\n\ttop: 0;\n}\n\n.chartjs-size-monitor-shrink > div {\n\tposition: absolute;\n\twidth: 200%;\n\theight: 200%;\n\tleft: 0;\n\ttop: 0;\n}\n"; + + var platform_dom$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': platform_dom + }); + + var stylesheet = getCjsExportFromNamespace(platform_dom$1); + + var EXPANDO_KEY = '$chartjs'; + var CSS_PREFIX = 'chartjs-'; + var CSS_SIZE_MONITOR = CSS_PREFIX + 'size-monitor'; + var CSS_RENDER_MONITOR = CSS_PREFIX + 'render-monitor'; + var CSS_RENDER_ANIMATION = CSS_PREFIX + 'render-animation'; + var ANIMATION_START_EVENTS = ['animationstart', 'webkitAnimationStart']; + + /** + * DOM event types -> Chart.js event types. + * Note: only events with different types are mapped. + * @see https://developer.mozilla.org/en-US/docs/Web/Events + */ + var EVENT_TYPES = { + touchstart: 'mousedown', + touchmove: 'mousemove', + touchend: 'mouseup', + pointerenter: 'mouseenter', + pointerdown: 'mousedown', + pointermove: 'mousemove', + pointerup: 'mouseup', + pointerleave: 'mouseout', + pointerout: 'mouseout' + }; + + /** + * The "used" size is the final value of a dimension property after all calculations have + * been performed. This method uses the computed style of `element` but returns undefined + * if the computed style is not expressed in pixels. That can happen in some cases where + * `element` has a size relative to its parent and this last one is not yet displayed, + * for example because of `display: none` on a parent node. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value + * @returns {number} Size in pixels or undefined if unknown. + */ + function readUsedSize(element, property) { + var value = helpers$1.getStyle(element, property); + var matches = value && value.match(/^(\d+)(\.\d+)?px$/); + return matches ? Number(matches[1]) : undefined; + } + + /** + * Initializes the canvas style and render size without modifying the canvas display size, + * since responsiveness is handled by the controller.resize() method. The config is used + * to determine the aspect ratio to apply in case no explicit height has been specified. + */ + function initCanvas(canvas, config) { + var style = canvas.style; + + // NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it + // returns null or '' if no explicit value has been set to the canvas attribute. + var renderHeight = canvas.getAttribute('height'); + var renderWidth = canvas.getAttribute('width'); + + // Chart.js modifies some canvas values that we want to restore on destroy + canvas[EXPANDO_KEY] = { + initial: { + height: renderHeight, + width: renderWidth, + style: { + display: style.display, + height: style.height, + width: style.width + } + } + }; + + // Force canvas to display as block to avoid extra space caused by inline + // elements, which would interfere with the responsive resize process. + // https://github.com/chartjs/Chart.js/issues/2538 + style.display = style.display || 'block'; + + if (renderWidth === null || renderWidth === '') { + var displayWidth = readUsedSize(canvas, 'width'); + if (displayWidth !== undefined) { + canvas.width = displayWidth; + } + } + + if (renderHeight === null || renderHeight === '') { + if (canvas.style.height === '') { + // If no explicit render height and style height, let's apply the aspect ratio, + // which one can be specified by the user but also by charts as default option + // (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2. + canvas.height = canvas.width / (config.options.aspectRatio || 2); + } else { + var displayHeight = readUsedSize(canvas, 'height'); + if (displayWidth !== undefined) { + canvas.height = displayHeight; + } + } + } + + return canvas; + } + + /** + * Detects support for options object argument in addEventListener. + * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support + * @private + */ + var supportsEventListenerOptions = (function() { + var supports = false; + try { + var options = Object.defineProperty({}, 'passive', { + // eslint-disable-next-line getter-return + get: function() { + supports = true; + } + }); + window.addEventListener('e', null, options); + } catch (e) { + // continue regardless of error + } + return supports; + }()); + + // Default passive to true as expected by Chrome for 'touchstart' and 'touchend' events. + // https://github.com/chartjs/Chart.js/issues/4287 + var eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false; + + function addListener(node, type, listener) { + node.addEventListener(type, listener, eventListenerOptions); + } + + function removeListener(node, type, listener) { + node.removeEventListener(type, listener, eventListenerOptions); + } + + function createEvent(type, chart, x, y, nativeEvent) { + return { + type: type, + chart: chart, + native: nativeEvent || null, + x: x !== undefined ? x : null, + y: y !== undefined ? y : null, + }; + } + + function fromNativeEvent(event, chart) { + var type = EVENT_TYPES[event.type] || event.type; + var pos = helpers$1.getRelativePosition(event, chart); + return createEvent(type, chart, pos.x, pos.y, event); + } + + function throttled(fn, thisArg) { + var ticking = false; + var args = []; + + return function() { + args = Array.prototype.slice.call(arguments); + thisArg = thisArg || this; + + if (!ticking) { + ticking = true; + helpers$1.requestAnimFrame.call(window, function() { + ticking = false; + fn.apply(thisArg, args); + }); + } + }; + } + + function createDiv(cls) { + var el = document.createElement('div'); + el.className = cls || ''; + return el; + } + + // Implementation based on https://github.com/marcj/css-element-queries + function createResizer(handler) { + var maxSize = 1000000; + + // NOTE(SB) Don't use innerHTML because it could be considered unsafe. + // https://github.com/chartjs/Chart.js/issues/5902 + var resizer = createDiv(CSS_SIZE_MONITOR); + var expand = createDiv(CSS_SIZE_MONITOR + '-expand'); + var shrink = createDiv(CSS_SIZE_MONITOR + '-shrink'); + + expand.appendChild(createDiv()); + shrink.appendChild(createDiv()); + + resizer.appendChild(expand); + resizer.appendChild(shrink); + resizer._reset = function() { + expand.scrollLeft = maxSize; + expand.scrollTop = maxSize; + shrink.scrollLeft = maxSize; + shrink.scrollTop = maxSize; + }; + + var onScroll = function() { + resizer._reset(); + handler(); + }; + + addListener(expand, 'scroll', onScroll.bind(expand, 'expand')); + addListener(shrink, 'scroll', onScroll.bind(shrink, 'shrink')); + + return resizer; + } + + // https://davidwalsh.name/detect-node-insertion + function watchForRender(node, handler) { + var expando = node[EXPANDO_KEY] || (node[EXPANDO_KEY] = {}); + var proxy = expando.renderProxy = function(e) { + if (e.animationName === CSS_RENDER_ANIMATION) { + handler(); + } + }; + + helpers$1.each(ANIMATION_START_EVENTS, function(type) { + addListener(node, type, proxy); + }); + + // #4737: Chrome might skip the CSS animation when the CSS_RENDER_MONITOR class + // is removed then added back immediately (same animation frame?). Accessing the + // `offsetParent` property will force a reflow and re-evaluate the CSS animation. + // https://gist.github.com/paulirish/5d52fb081b3570c81e3a#box-metrics + // https://github.com/chartjs/Chart.js/issues/4737 + expando.reflow = !!node.offsetParent; + + node.classList.add(CSS_RENDER_MONITOR); + } + + function unwatchForRender(node) { + var expando = node[EXPANDO_KEY] || {}; + var proxy = expando.renderProxy; + + if (proxy) { + helpers$1.each(ANIMATION_START_EVENTS, function(type) { + removeListener(node, type, proxy); + }); + + delete expando.renderProxy; + } + + node.classList.remove(CSS_RENDER_MONITOR); + } + + function addResizeListener(node, listener, chart) { + var expando = node[EXPANDO_KEY] || (node[EXPANDO_KEY] = {}); + + // Let's keep track of this added resizer and thus avoid DOM query when removing it. + var resizer = expando.resizer = createResizer(throttled(function() { + if (expando.resizer) { + var container = chart.options.maintainAspectRatio && node.parentNode; + var w = container ? container.clientWidth : 0; + listener(createEvent('resize', chart)); + if (container && container.clientWidth < w && chart.canvas) { + // If the container size shrank during chart resize, let's assume + // scrollbar appeared. So we resize again with the scrollbar visible - + // effectively making chart smaller and the scrollbar hidden again. + // Because we are inside `throttled`, and currently `ticking`, scroll + // events are ignored during this whole 2 resize process. + // If we assumed wrong and something else happened, we are resizing + // twice in a frame (potential performance issue) + listener(createEvent('resize', chart)); + } + } + })); + + // The resizer needs to be attached to the node parent, so we first need to be + // sure that `node` is attached to the DOM before injecting the resizer element. + watchForRender(node, function() { + if (expando.resizer) { + var container = node.parentNode; + if (container && container !== resizer.parentNode) { + container.insertBefore(resizer, container.firstChild); + } + + // The container size might have changed, let's reset the resizer state. + resizer._reset(); + } + }); + } + + function removeResizeListener(node) { + var expando = node[EXPANDO_KEY] || {}; + var resizer = expando.resizer; + + delete expando.resizer; + unwatchForRender(node); + + if (resizer && resizer.parentNode) { + resizer.parentNode.removeChild(resizer); + } + } + + /** + * Injects CSS styles inline if the styles are not already present. + * @param {HTMLDocument|ShadowRoot} rootNode - the node to contain the