Merge branch 'master' into database-key-fix
This commit is contained in:
commit
6e0b32325a
|
@ -6,12 +6,18 @@
|
|||
- Added option to force HTTPS connection to the Appwrite server (_APP_OPTIONS_FORCE_HTTPS)
|
||||
- Added Google Fonts to Appwrite for offline availability
|
||||
- Added a new route in the Avatars API to get user initials avatar
|
||||
- Added option to delete team from the console
|
||||
- Added option to view team members from the console
|
||||
- Added option to join a user to any team from the console
|
||||
- Added support for Brotli compression
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
- Fixed output of /v1/health/queue/certificates returning wrong data
|
||||
- Fixed bug where team members count was wrong in some cases
|
||||
- Fixed network calculation for uploaded files
|
||||
- Fixed a UI bug preventing float values in numeric fields
|
||||
- Fixed scroll positioning when moving rules order up & down
|
||||
- Fixed missing validation for database documents key length (32 chars)
|
||||
|
||||
## Security
|
||||
|
|
45
Dockerfile
45
Dockerfile
|
@ -11,7 +11,7 @@ ENV TZ=Asia/Tel_Aviv \
|
|||
|
||||
RUN \
|
||||
apt-get update && \
|
||||
apt-get install -y --no-install-recommends --no-install-suggests ca-certificates software-properties-common wget curl git openssl && \
|
||||
apt-get install -y --no-install-recommends --no-install-suggests ca-certificates software-properties-common wget git openssl && \
|
||||
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php && \
|
||||
apt-get update && \
|
||||
apt-get install -y --no-install-recommends --no-install-suggests make php$PHP_VERSION php$PHP_VERSION-dev zip unzip php$PHP_VERSION-zip && \
|
||||
|
@ -23,7 +23,13 @@ RUN \
|
|||
./configure && \
|
||||
make && \
|
||||
# Composer
|
||||
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
|
||||
wget https://getcomposer.org/composer.phar && \
|
||||
chmod +x ./composer.phar && \
|
||||
mv ./composer.phar /usr/bin/composer && \
|
||||
#Brotli
|
||||
cd / && \
|
||||
git clone https://github.com/eustas/ngx_brotli.git && \
|
||||
cd ngx_brotli && git submodule update --init && cd ..
|
||||
|
||||
WORKDIR /usr/local/src/
|
||||
|
||||
|
@ -75,31 +81,50 @@ ENV TZ=Asia/Tel_Aviv \
|
|||
#ENV _APP_SMTP_PASSWORD ''
|
||||
|
||||
COPY --from=builder /phpredis-5.2.1/modules/redis.so /usr/lib/php/20190902/
|
||||
COPY --from=builder /phpredis-5.2.1/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 curl ca-certificates software-properties-common openssl gnupg && \
|
||||
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 htop supervisor php$PHP_VERSION php$PHP_VERSION-fpm \
|
||||
apt-get install -y --no-install-recommends --no-install-suggests php$PHP_VERSION php$PHP_VERSION-fpm \
|
||||
php$PHP_VERSION-mysqlnd php$PHP_VERSION-curl php$PHP_VERSION-imagick php$PHP_VERSION-mbstring php$PHP_VERSION-dom webp certbot && \
|
||||
# Nginx
|
||||
echo "deb http://nginx.org/packages/mainline/ubuntu/ bionic nginx" >> /etc/apt/sources.list.d/nginx.list && \
|
||||
wget -q http://nginx.org/keys/nginx_signing.key && \
|
||||
apt-key add nginx_signing.key && \
|
||||
apt-get update && \
|
||||
apt-get install -y --no-install-recommends --no-install-suggests nginx && \
|
||||
wget http://nginx.org/download/nginx-1.19.0.tar.gz && \
|
||||
tar -xzvf nginx-1.19.0.tar.gz && rm nginx-1.19.0.tar.gz && \
|
||||
cd nginx-1.19.0 && \
|
||||
./configure --prefix=/usr/share/nginx \
|
||||
--sbin-path=/usr/sbin/nginx \
|
||||
--modules-path=/usr/lib/nginx/modules \
|
||||
--conf-path=/etc/nginx/nginx.conf \
|
||||
--error-log-path=/var/log/nginx/error.log \
|
||||
--http-log-path=/var/log/nginx/access.log \
|
||||
--pid-path=/run/nginx.pid \
|
||||
--lock-path=/var/lock/nginx.lock \
|
||||
--user=www-data \
|
||||
--group=www-data \
|
||||
--build=Ubuntu \
|
||||
--with-http_gzip_static_module \
|
||||
--with-http_ssl_module \
|
||||
--with-http_v2_module \
|
||||
--add-module=/ngx_brotli && \
|
||||
make && \
|
||||
make install && \
|
||||
rm -rf ../nginx-1.19.0 && \
|
||||
# Redis Extension
|
||||
echo extension=redis.so >> /etc/php/$PHP_VERSION/fpm/conf.d/redis.ini && \
|
||||
echo extension=redis.so >> /etc/php/$PHP_VERSION/cli/conf.d/redis.ini && \
|
||||
# Cleanup
|
||||
cd ../ && \
|
||||
apt-get purge -y --auto-remove software-properties-common gnupg curl && \
|
||||
apt-get purge -y --auto-remove wget software-properties-common build-essential libpcre3-dev zlib1g-dev libssl-dev gnupg && \
|
||||
apt-get clean && \
|
||||
rm -rf /ngx_brotli && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Set Upload Limit (default to 100MB)
|
||||
|
|
|
@ -16,7 +16,7 @@ use Appwrite\Database\Database;
|
|||
use Appwrite\Database\Document;
|
||||
use Appwrite\Database\Validator\Authorization;
|
||||
use Appwrite\Event\Event;
|
||||
use Appwrite\Network\Validators\Origin;
|
||||
use Appwrite\Network\Validator\Origin;
|
||||
|
||||
/*
|
||||
* Configuration files
|
||||
|
|
936
app/config/languages.php
Normal file
936
app/config/languages.php
Normal file
|
@ -0,0 +1,936 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* List of languages classified in ISO 639-1.
|
||||
*
|
||||
* Source:
|
||||
* https://gist.github.com/joshuabaker/d2775b5ada7d1601bcd7b31cb4081981
|
||||
*/
|
||||
|
||||
return [
|
||||
[
|
||||
"code" => "aa",
|
||||
"name" => "Afar",
|
||||
"nativeName" => "Afar"
|
||||
],
|
||||
[
|
||||
"code" => "ab",
|
||||
"name" => "Abkhazian",
|
||||
"nativeName" => "Аҧсуа"
|
||||
],
|
||||
[
|
||||
"code" => "af",
|
||||
"name" => "Afrikaans",
|
||||
"nativeName" => "Afrikaans"
|
||||
],
|
||||
[
|
||||
"code" => "ak",
|
||||
"name" => "Akan",
|
||||
"nativeName" => "Akana"
|
||||
],
|
||||
[
|
||||
"code" => "am",
|
||||
"name" => "Amharic",
|
||||
"nativeName" => "አማርኛ"
|
||||
],
|
||||
[
|
||||
"code" => "an",
|
||||
"name" => "Aragonese",
|
||||
"nativeName" => "Aragonés"
|
||||
],
|
||||
[
|
||||
"code" => "ar",
|
||||
"name" => "Arabic",
|
||||
"nativeName" => "العربية"
|
||||
],
|
||||
[
|
||||
"code" => "as",
|
||||
"name" => "Assamese",
|
||||
"nativeName" => "অসমীয়া"
|
||||
],
|
||||
[
|
||||
"code" => "av",
|
||||
"name" => "Avar",
|
||||
"nativeName" => "Авар"
|
||||
],
|
||||
[
|
||||
"code" => "ay",
|
||||
"name" => "Aymara",
|
||||
"nativeName" => "Aymar"
|
||||
],
|
||||
[
|
||||
"code" => "az",
|
||||
"name" => "Azerbaijani",
|
||||
"nativeName" => "Azərbaycanca / آذربايجان"
|
||||
],
|
||||
[
|
||||
"code" => "ba",
|
||||
"name" => "Bashkir",
|
||||
"nativeName" => "Башҡорт"
|
||||
],
|
||||
[
|
||||
"code" => "be",
|
||||
"name" => "Belarusian",
|
||||
"nativeName" => "Беларуская"
|
||||
],
|
||||
[
|
||||
"code" => "bg",
|
||||
"name" => "Bulgarian",
|
||||
"nativeName" => "Български"
|
||||
],
|
||||
[
|
||||
"code" => "bh",
|
||||
"name" => "Bihari",
|
||||
"nativeName" => "भोजपुरी"
|
||||
],
|
||||
[
|
||||
"code" => "bi",
|
||||
"name" => "Bislama",
|
||||
"nativeName" => "Bislama"
|
||||
],
|
||||
[
|
||||
"code" => "bm",
|
||||
"name" => "Bambara",
|
||||
"nativeName" => "Bamanankan"
|
||||
],
|
||||
[
|
||||
"code" => "bn",
|
||||
"name" => "Bengali",
|
||||
"nativeName" => "বাংলা"
|
||||
],
|
||||
[
|
||||
"code" => "bo",
|
||||
"name" => "Tibetan",
|
||||
"nativeName" => "བོད་ཡིག / Bod skad"
|
||||
],
|
||||
[
|
||||
"code" => "br",
|
||||
"name" => "Breton",
|
||||
"nativeName" => "Brezhoneg"
|
||||
],
|
||||
[
|
||||
"code" => "bs",
|
||||
"name" => "Bosnian",
|
||||
"nativeName" => "Bosanski"
|
||||
],
|
||||
[
|
||||
"code" => "ca",
|
||||
"name" => "Catalan",
|
||||
"nativeName" => "Català"
|
||||
],
|
||||
[
|
||||
"code" => "ce",
|
||||
"name" => "Chechen",
|
||||
"nativeName" => "Нохчийн"
|
||||
],
|
||||
[
|
||||
"code" => "ch",
|
||||
"name" => "Chamorro",
|
||||
"nativeName" => "Chamoru"
|
||||
],
|
||||
[
|
||||
"code" => "co",
|
||||
"name" => "Corsican",
|
||||
"nativeName" => "Corsu"
|
||||
],
|
||||
[
|
||||
"code" => "cr",
|
||||
"name" => "Cree",
|
||||
"nativeName" => "Nehiyaw"
|
||||
],
|
||||
[
|
||||
"code" => "cs",
|
||||
"name" => "Czech",
|
||||
"nativeName" => "Česky"
|
||||
],
|
||||
[
|
||||
"code" => "cu",
|
||||
"name" => "Old Church Slavonic / Old Bulgarian",
|
||||
"nativeName" => "словѣньскъ / slověnĭskŭ"
|
||||
],
|
||||
[
|
||||
"code" => "cv",
|
||||
"name" => "Chuvash",
|
||||
"nativeName" => "Чăваш"
|
||||
],
|
||||
[
|
||||
"code" => "cy",
|
||||
"name" => "Welsh",
|
||||
"nativeName" => "Cymraeg"
|
||||
],
|
||||
[
|
||||
"code" => "da",
|
||||
"name" => "Danish",
|
||||
"nativeName" => "Dansk"
|
||||
],
|
||||
[
|
||||
"code" => "de",
|
||||
"name" => "German",
|
||||
"nativeName" => "Deutsch"
|
||||
],
|
||||
[
|
||||
"code" => "dv",
|
||||
"name" => "Divehi",
|
||||
"nativeName" => "ދިވެހިބަސް"
|
||||
],
|
||||
[
|
||||
"code" => "dz",
|
||||
"name" => "Dzongkha",
|
||||
"nativeName" => "ཇོང་ཁ"
|
||||
],
|
||||
[
|
||||
"code" => "ee",
|
||||
"name" => "Ewe",
|
||||
"nativeName" => "Ɛʋɛ"
|
||||
],
|
||||
[
|
||||
"code" => "el",
|
||||
"name" => "Greek",
|
||||
"nativeName" => "Ελληνικά"
|
||||
],
|
||||
[
|
||||
"code" => "en",
|
||||
"name" => "English",
|
||||
"nativeName" => "English"
|
||||
],
|
||||
[
|
||||
"code" => "eo",
|
||||
"name" => "Esperanto",
|
||||
"nativeName" => "Esperanto"
|
||||
],
|
||||
[
|
||||
"code" => "es",
|
||||
"name" => "Spanish",
|
||||
"nativeName" => "Español"
|
||||
],
|
||||
[
|
||||
"code" => "et",
|
||||
"name" => "Estonian",
|
||||
"nativeName" => "Eesti"
|
||||
],
|
||||
[
|
||||
"code" => "eu",
|
||||
"name" => "Basque",
|
||||
"nativeName" => "Euskara"
|
||||
],
|
||||
[
|
||||
"code" => "fa",
|
||||
"name" => "Persian",
|
||||
"nativeName" => "فارسی"
|
||||
],
|
||||
[
|
||||
"code" => "ff",
|
||||
"name" => "Peul",
|
||||
"nativeName" => "Fulfulde"
|
||||
],
|
||||
[
|
||||
"code" => "fi",
|
||||
"name" => "Finnish",
|
||||
"nativeName" => "Suomi"
|
||||
],
|
||||
[
|
||||
"code" => "fj",
|
||||
"name" => "Fijian",
|
||||
"nativeName" => "Na Vosa Vakaviti"
|
||||
],
|
||||
[
|
||||
"code" => "fo",
|
||||
"name" => "Faroese",
|
||||
"nativeName" => "Føroyskt"
|
||||
],
|
||||
[
|
||||
"code" => "fr",
|
||||
"name" => "French",
|
||||
"nativeName" => "Français"
|
||||
],
|
||||
[
|
||||
"code" => "fy",
|
||||
"name" => "West Frisian",
|
||||
"nativeName" => "Frysk"
|
||||
],
|
||||
[
|
||||
"code" => "ga",
|
||||
"name" => "Irish",
|
||||
"nativeName" => "Gaeilge"
|
||||
],
|
||||
[
|
||||
"code" => "gd",
|
||||
"name" => "Scottish Gaelic",
|
||||
"nativeName" => "Gàidhlig"
|
||||
],
|
||||
[
|
||||
"code" => "gl",
|
||||
"name" => "Galician",
|
||||
"nativeName" => "Galego"
|
||||
],
|
||||
[
|
||||
"code" => "gn",
|
||||
"name" => "Guarani",
|
||||
"nativeName" => "Avañe'ẽ"
|
||||
],
|
||||
[
|
||||
"code" => "gu",
|
||||
"name" => "Gujarati",
|
||||
"nativeName" => "ગુજરાતી"
|
||||
],
|
||||
[
|
||||
"code" => "gv",
|
||||
"name" => "Manx",
|
||||
"nativeName" => "Gaelg"
|
||||
],
|
||||
[
|
||||
"code" => "ha",
|
||||
"name" => "Hausa",
|
||||
"nativeName" => "هَوُسَ"
|
||||
],
|
||||
[
|
||||
"code" => "he",
|
||||
"name" => "Hebrew",
|
||||
"nativeName" => "עברית"
|
||||
],
|
||||
[
|
||||
"code" => "hi",
|
||||
"name" => "Hindi",
|
||||
"nativeName" => "हिन्दी"
|
||||
],
|
||||
[
|
||||
"code" => "ho",
|
||||
"name" => "Hiri Motu",
|
||||
"nativeName" => "Hiri Motu"
|
||||
],
|
||||
[
|
||||
"code" => "hr",
|
||||
"name" => "Croatian",
|
||||
"nativeName" => "Hrvatski"
|
||||
],
|
||||
[
|
||||
"code" => "ht",
|
||||
"name" => "Haitian",
|
||||
"nativeName" => "Krèyol ayisyen"
|
||||
],
|
||||
[
|
||||
"code" => "hu",
|
||||
"name" => "Hungarian",
|
||||
"nativeName" => "Magyar"
|
||||
],
|
||||
[
|
||||
"code" => "hy",
|
||||
"name" => "Armenian",
|
||||
"nativeName" => "Հայերեն"
|
||||
],
|
||||
[
|
||||
"code" => "hz",
|
||||
"name" => "Herero",
|
||||
"nativeName" => "Otsiherero"
|
||||
],
|
||||
[
|
||||
"code" => "ia",
|
||||
"name" => "Interlingua",
|
||||
"nativeName" => "Interlingua"
|
||||
],
|
||||
[
|
||||
"code" => "id",
|
||||
"name" => "Indonesian",
|
||||
"nativeName" => "Bahasa Indonesia"
|
||||
],
|
||||
[
|
||||
"code" => "ie",
|
||||
"name" => "Interlingue",
|
||||
"nativeName" => "Interlingue"
|
||||
],
|
||||
[
|
||||
"code" => "ig",
|
||||
"name" => "Igbo",
|
||||
"nativeName" => "Igbo"
|
||||
],
|
||||
[
|
||||
"code" => "ii",
|
||||
"name" => "Sichuan Yi",
|
||||
"nativeName" => "ꆇꉙ / 四川彝语"
|
||||
],
|
||||
[
|
||||
"code" => "ik",
|
||||
"name" => "Inupiak",
|
||||
"nativeName" => "Iñupiak"
|
||||
],
|
||||
[
|
||||
"code" => "io",
|
||||
"name" => "Ido",
|
||||
"nativeName" => "Ido"
|
||||
],
|
||||
[
|
||||
"code" => "is",
|
||||
"name" => "Icelandic",
|
||||
"nativeName" => "Íslenska"
|
||||
],
|
||||
[
|
||||
"code" => "it",
|
||||
"name" => "Italian",
|
||||
"nativeName" => "Italiano"
|
||||
],
|
||||
[
|
||||
"code" => "iu",
|
||||
"name" => "Inuktitut",
|
||||
"nativeName" => "ᐃᓄᒃᑎᑐᑦ"
|
||||
],
|
||||
[
|
||||
"code" => "ja",
|
||||
"name" => "Japanese",
|
||||
"nativeName" => "日本語"
|
||||
],
|
||||
[
|
||||
"code" => "jv",
|
||||
"name" => "Javanese",
|
||||
"nativeName" => "Basa Jawa"
|
||||
],
|
||||
[
|
||||
"code" => "ka",
|
||||
"name" => "Georgian",
|
||||
"nativeName" => "ქართული"
|
||||
],
|
||||
[
|
||||
"code" => "kg",
|
||||
"name" => "Kongo",
|
||||
"nativeName" => "KiKongo"
|
||||
],
|
||||
[
|
||||
"code" => "ki",
|
||||
"name" => "Kikuyu",
|
||||
"nativeName" => "Gĩkũyũ"
|
||||
],
|
||||
[
|
||||
"code" => "kj",
|
||||
"name" => "Kuanyama",
|
||||
"nativeName" => "Kuanyama"
|
||||
],
|
||||
[
|
||||
"code" => "kk",
|
||||
"name" => "Kazakh",
|
||||
"nativeName" => "Қазақша"
|
||||
],
|
||||
[
|
||||
"code" => "kl",
|
||||
"name" => "Greenlandic",
|
||||
"nativeName" => "Kalaallisut"
|
||||
],
|
||||
[
|
||||
"code" => "km",
|
||||
"name" => "Cambodian",
|
||||
"nativeName" => "ភាសាខ្មែរ"
|
||||
],
|
||||
[
|
||||
"code" => "kn",
|
||||
"name" => "Kannada",
|
||||
"nativeName" => "ಕನ್ನಡ"
|
||||
],
|
||||
[
|
||||
"code" => "ko",
|
||||
"name" => "Korean",
|
||||
"nativeName" => "한국어"
|
||||
],
|
||||
[
|
||||
"code" => "kr",
|
||||
"name" => "Kanuri",
|
||||
"nativeName" => "Kanuri"
|
||||
],
|
||||
[
|
||||
"code" => "ks",
|
||||
"name" => "Kashmiri",
|
||||
"nativeName" => "कश्मीरी / كشميري"
|
||||
],
|
||||
[
|
||||
"code" => "ku",
|
||||
"name" => "Kurdish",
|
||||
"nativeName" => "Kurdî / كوردی"
|
||||
],
|
||||
[
|
||||
"code" => "kv",
|
||||
"name" => "Komi",
|
||||
"nativeName" => "Коми"
|
||||
],
|
||||
[
|
||||
"code" => "kw",
|
||||
"name" => "Cornish",
|
||||
"nativeName" => "Kernewek"
|
||||
],
|
||||
[
|
||||
"code" => "ky",
|
||||
"name" => "Kirghiz",
|
||||
"nativeName" => "Kırgızca / Кыргызча"
|
||||
],
|
||||
[
|
||||
"code" => "la",
|
||||
"name" => "Latin",
|
||||
"nativeName" => "Latina"
|
||||
],
|
||||
[
|
||||
"code" => "lb",
|
||||
"name" => "Luxembourgish",
|
||||
"nativeName" => "Lëtzebuergesch"
|
||||
],
|
||||
[
|
||||
"code" => "lg",
|
||||
"name" => "Ganda",
|
||||
"nativeName" => "Luganda"
|
||||
],
|
||||
[
|
||||
"code" => "li",
|
||||
"name" => "Limburgian",
|
||||
"nativeName" => "Limburgs"
|
||||
],
|
||||
[
|
||||
"code" => "ln",
|
||||
"name" => "Lingala",
|
||||
"nativeName" => "Lingála"
|
||||
],
|
||||
[
|
||||
"code" => "lo",
|
||||
"name" => "Laotian",
|
||||
"nativeName" => "ລາວ / Pha xa lao"
|
||||
],
|
||||
[
|
||||
"code" => "lt",
|
||||
"name" => "Lithuanian",
|
||||
"nativeName" => "Lietuvių"
|
||||
],
|
||||
[
|
||||
"code" => "lu",
|
||||
"name" => "Luba-Katanga",
|
||||
"nativeName" => "Tshiluba"
|
||||
],
|
||||
[
|
||||
"code" => "lv",
|
||||
"name" => "Latvian",
|
||||
"nativeName" => "Latviešu"
|
||||
],
|
||||
[
|
||||
"code" => "mg",
|
||||
"name" => "Malagasy",
|
||||
"nativeName" => "Malagasy"
|
||||
],
|
||||
[
|
||||
"code" => "mh",
|
||||
"name" => "Marshallese",
|
||||
"nativeName" => "Kajin Majel / Ebon"
|
||||
],
|
||||
[
|
||||
"code" => "mi",
|
||||
"name" => "Maori",
|
||||
"nativeName" => "Māori"
|
||||
],
|
||||
[
|
||||
"code" => "mk",
|
||||
"name" => "Macedonian",
|
||||
"nativeName" => "Македонски"
|
||||
],
|
||||
[
|
||||
"code" => "ml",
|
||||
"name" => "Malayalam",
|
||||
"nativeName" => "മലയാളം"
|
||||
],
|
||||
[
|
||||
"code" => "mn",
|
||||
"name" => "Mongolian",
|
||||
"nativeName" => "Монгол"
|
||||
],
|
||||
[
|
||||
"code" => "mo",
|
||||
"name" => "Moldovan",
|
||||
"nativeName" => "Moldovenească"
|
||||
],
|
||||
[
|
||||
"code" => "mr",
|
||||
"name" => "Marathi",
|
||||
"nativeName" => "मराठी"
|
||||
],
|
||||
[
|
||||
"code" => "ms",
|
||||
"name" => "Malay",
|
||||
"nativeName" => "Bahasa Melayu"
|
||||
],
|
||||
[
|
||||
"code" => "mt",
|
||||
"name" => "Maltese",
|
||||
"nativeName" => "bil-Malti"
|
||||
],
|
||||
[
|
||||
"code" => "my",
|
||||
"name" => "Burmese",
|
||||
"nativeName" => "မြန်မာစာ"
|
||||
],
|
||||
[
|
||||
"code" => "na",
|
||||
"name" => "Nauruan",
|
||||
"nativeName" => "Dorerin Naoero"
|
||||
],
|
||||
[
|
||||
"code" => "nb",
|
||||
"name" => "Norwegian Bokmål",
|
||||
"nativeName" => "Norsk bokmål"
|
||||
],
|
||||
[
|
||||
"code" => "nd",
|
||||
"name" => "North Ndebele",
|
||||
"nativeName" => "Sindebele"
|
||||
],
|
||||
[
|
||||
"code" => "ne",
|
||||
"name" => "Nepali",
|
||||
"nativeName" => "नेपाली"
|
||||
],
|
||||
[
|
||||
"code" => "ng",
|
||||
"name" => "Ndonga",
|
||||
"nativeName" => "Oshiwambo"
|
||||
],
|
||||
[
|
||||
"code" => "nl",
|
||||
"name" => "Dutch",
|
||||
"nativeName" => "Nederlands"
|
||||
],
|
||||
[
|
||||
"code" => "nn",
|
||||
"name" => "Norwegian Nynorsk",
|
||||
"nativeName" => "Norsk nynorsk"
|
||||
],
|
||||
[
|
||||
"code" => "no",
|
||||
"name" => "Norwegian",
|
||||
"nativeName" => "Norsk"
|
||||
],
|
||||
[
|
||||
"code" => "nr",
|
||||
"name" => "South Ndebele",
|
||||
"nativeName" => "isiNdebele"
|
||||
],
|
||||
[
|
||||
"code" => "nv",
|
||||
"name" => "Navajo",
|
||||
"nativeName" => "Diné bizaad"
|
||||
],
|
||||
[
|
||||
"code" => "ny",
|
||||
"name" => "Chichewa",
|
||||
"nativeName" => "Chi-Chewa"
|
||||
],
|
||||
[
|
||||
"code" => "oc",
|
||||
"name" => "Occitan",
|
||||
"nativeName" => "Occitan"
|
||||
],
|
||||
[
|
||||
"code" => "oj",
|
||||
"name" => "Ojibwa",
|
||||
"nativeName" => "ᐊᓂᔑᓈᐯᒧᐎᓐ / Anishinaabemowin"
|
||||
],
|
||||
[
|
||||
"code" => "om",
|
||||
"name" => "Oromo",
|
||||
"nativeName" => "Oromoo"
|
||||
],
|
||||
[
|
||||
"code" => "or",
|
||||
"name" => "Oriya",
|
||||
"nativeName" => "ଓଡ଼ିଆ"
|
||||
],
|
||||
[
|
||||
"code" => "os",
|
||||
"name" => "Ossetian / Ossetic",
|
||||
"nativeName" => "Иронау"
|
||||
],
|
||||
[
|
||||
"code" => "pa",
|
||||
"name" => "Panjabi / Punjabi",
|
||||
"nativeName" => "ਪੰਜਾਬੀ / पंजाबी / پنجابي"
|
||||
],
|
||||
[
|
||||
"code" => "pi",
|
||||
"name" => "Pali",
|
||||
"nativeName" => "Pāli / पाऴि"
|
||||
],
|
||||
[
|
||||
"code" => "pl",
|
||||
"name" => "Polish",
|
||||
"nativeName" => "Polski"
|
||||
],
|
||||
[
|
||||
"code" => "ps",
|
||||
"name" => "Pashto",
|
||||
"nativeName" => "پښتو"
|
||||
],
|
||||
[
|
||||
"code" => "pt",
|
||||
"name" => "Portuguese",
|
||||
"nativeName" => "Português"
|
||||
],
|
||||
[
|
||||
"code" => "qu",
|
||||
"name" => "Quechua",
|
||||
"nativeName" => "Runa Simi"
|
||||
],
|
||||
[
|
||||
"code" => "rm",
|
||||
"name" => "Raeto Romance",
|
||||
"nativeName" => "Rumantsch"
|
||||
],
|
||||
[
|
||||
"code" => "rn",
|
||||
"name" => "Kirundi",
|
||||
"nativeName" => "Kirundi"
|
||||
],
|
||||
[
|
||||
"code" => "ro",
|
||||
"name" => "Romanian",
|
||||
"nativeName" => "Română"
|
||||
],
|
||||
[
|
||||
"code" => "ru",
|
||||
"name" => "Russian",
|
||||
"nativeName" => "Русский"
|
||||
],
|
||||
[
|
||||
"code" => "rw",
|
||||
"name" => "Rwandi",
|
||||
"nativeName" => "Kinyarwandi"
|
||||
],
|
||||
[
|
||||
"code" => "sa",
|
||||
"name" => "Sanskrit",
|
||||
"nativeName" => "संस्कृतम्"
|
||||
],
|
||||
[
|
||||
"code" => "sc",
|
||||
"name" => "Sardinian",
|
||||
"nativeName" => "Sardu"
|
||||
],
|
||||
[
|
||||
"code" => "sd",
|
||||
"name" => "Sindhi",
|
||||
"nativeName" => "सिनधि"
|
||||
],
|
||||
[
|
||||
"code" => "se",
|
||||
"name" => "Northern Sami",
|
||||
"nativeName" => "Sámegiella"
|
||||
],
|
||||
[
|
||||
"code" => "sg",
|
||||
"name" => "Sango",
|
||||
"nativeName" => "Sängö"
|
||||
],
|
||||
[
|
||||
"code" => "sh",
|
||||
"name" => "Serbo-Croatian",
|
||||
"nativeName" => "Srpskohrvatski / Српскохрватски"
|
||||
],
|
||||
[
|
||||
"code" => "si",
|
||||
"name" => "Sinhalese",
|
||||
"nativeName" => "සිංහල"
|
||||
],
|
||||
[
|
||||
"code" => "sk",
|
||||
"name" => "Slovak",
|
||||
"nativeName" => "Slovenčina"
|
||||
],
|
||||
[
|
||||
"code" => "sl",
|
||||
"name" => "Slovenian",
|
||||
"nativeName" => "Slovenščina"
|
||||
],
|
||||
[
|
||||
"code" => "sm",
|
||||
"name" => "Samoan",
|
||||
"nativeName" => "Gagana Samoa"
|
||||
],
|
||||
[
|
||||
"code" => "sn",
|
||||
"name" => "Shona",
|
||||
"nativeName" => "chiShona"
|
||||
],
|
||||
[
|
||||
"code" => "so",
|
||||
"name" => "Somalia",
|
||||
"nativeName" => "Soomaaliga"
|
||||
],
|
||||
[
|
||||
"code" => "sq",
|
||||
"name" => "Albanian",
|
||||
"nativeName" => "Shqip"
|
||||
],
|
||||
[
|
||||
"code" => "sr",
|
||||
"name" => "Serbian",
|
||||
"nativeName" => "Српски"
|
||||
],
|
||||
[
|
||||
"code" => "ss",
|
||||
"name" => "Swati",
|
||||
"nativeName" => "SiSwati"
|
||||
],
|
||||
[
|
||||
"code" => "st",
|
||||
"name" => "Southern Sotho",
|
||||
"nativeName" => "Sesotho"
|
||||
],
|
||||
[
|
||||
"code" => "su",
|
||||
"name" => "Sundanese",
|
||||
"nativeName" => "Basa Sunda"
|
||||
],
|
||||
[
|
||||
"code" => "sv",
|
||||
"name" => "Swedish",
|
||||
"nativeName" => "Svenska"
|
||||
],
|
||||
[
|
||||
"code" => "sw",
|
||||
"name" => "Swahili",
|
||||
"nativeName" => "Kiswahili"
|
||||
],
|
||||
[
|
||||
"code" => "ta",
|
||||
"name" => "Tamil",
|
||||
"nativeName" => "தமிழ்"
|
||||
],
|
||||
[
|
||||
"code" => "te",
|
||||
"name" => "Telugu",
|
||||
"nativeName" => "తెలుగు"
|
||||
],
|
||||
[
|
||||
"code" => "tg",
|
||||
"name" => "Tajik",
|
||||
"nativeName" => "Тоҷикӣ"
|
||||
],
|
||||
[
|
||||
"code" => "th",
|
||||
"name" => "Thai",
|
||||
"nativeName" => "ไทย / Phasa Thai"
|
||||
],
|
||||
[
|
||||
"code" => "ti",
|
||||
"name" => "Tigrinya",
|
||||
"nativeName" => "ትግርኛ"
|
||||
],
|
||||
[
|
||||
"code" => "tk",
|
||||
"name" => "Turkmen",
|
||||
"nativeName" => "Туркмен / تركمن"
|
||||
],
|
||||
[
|
||||
"code" => "tl",
|
||||
"name" => "Tagalog / Filipino",
|
||||
"nativeName" => "Tagalog"
|
||||
],
|
||||
[
|
||||
"code" => "tn",
|
||||
"name" => "Tswana",
|
||||
"nativeName" => "Setswana"
|
||||
],
|
||||
[
|
||||
"code" => "to",
|
||||
"name" => "Tonga",
|
||||
"nativeName" => "Lea Faka-Tonga"
|
||||
],
|
||||
[
|
||||
"code" => "tr",
|
||||
"name" => "Turkish",
|
||||
"nativeName" => "Türkçe"
|
||||
],
|
||||
[
|
||||
"code" => "ts",
|
||||
"name" => "Tsonga",
|
||||
"nativeName" => "Xitsonga"
|
||||
],
|
||||
[
|
||||
"code" => "tt",
|
||||
"name" => "Tatar",
|
||||
"nativeName" => "Tatarça"
|
||||
],
|
||||
[
|
||||
"code" => "tw",
|
||||
"name" => "Twi",
|
||||
"nativeName" => "Twi"
|
||||
],
|
||||
[
|
||||
"code" => "ty",
|
||||
"name" => "Tahitian",
|
||||
"nativeName" => "Reo Mā`ohi"
|
||||
],
|
||||
[
|
||||
"code" => "ug",
|
||||
"name" => "Uyghur",
|
||||
"nativeName" => "Uyƣurqə / ئۇيغۇرچە"
|
||||
],
|
||||
[
|
||||
"code" => "uk",
|
||||
"name" => "Ukrainian",
|
||||
"nativeName" => "Українська"
|
||||
],
|
||||
[
|
||||
"code" => "ur",
|
||||
"name" => "Urdu",
|
||||
"nativeName" => "اردو"
|
||||
],
|
||||
[
|
||||
"code" => "uz",
|
||||
"name" => "Uzbek",
|
||||
"nativeName" => "Ўзбек"
|
||||
],
|
||||
[
|
||||
"code" => "ve",
|
||||
"name" => "Venda",
|
||||
"nativeName" => "Tshivenḓa"
|
||||
],
|
||||
[
|
||||
"code" => "vi",
|
||||
"name" => "Vietnamese",
|
||||
"nativeName" => "Tiếng Việt"
|
||||
],
|
||||
[
|
||||
"code" => "vo",
|
||||
"name" => "Volapük",
|
||||
"nativeName" => "Volapük"
|
||||
],
|
||||
[
|
||||
"code" => "wa",
|
||||
"name" => "Walloon",
|
||||
"nativeName" => "Walon"
|
||||
],
|
||||
[
|
||||
"code" => "wo",
|
||||
"name" => "Wolof",
|
||||
"nativeName" => "Wollof"
|
||||
],
|
||||
[
|
||||
"code" => "xh",
|
||||
"name" => "Xhosa",
|
||||
"nativeName" => "isiXhosa"
|
||||
],
|
||||
[
|
||||
"code" => "yi",
|
||||
"name" => "Yiddish",
|
||||
"nativeName" => "ייִדיש"
|
||||
],
|
||||
[
|
||||
"code" => "yo",
|
||||
"name" => "Yoruba",
|
||||
"nativeName" => "Yorùbá"
|
||||
],
|
||||
[
|
||||
"code" => "za",
|
||||
"name" => "Zhuang",
|
||||
"nativeName" => "Cuengh / Tôô / 壮语"
|
||||
],
|
||||
[
|
||||
"code" => "zh",
|
||||
"name" => "Chinese",
|
||||
"nativeName" => "中文"
|
||||
],
|
||||
[
|
||||
"code" => "zu",
|
||||
"name" => "Zulu",
|
||||
"nativeName" => "isiZulu"
|
||||
]
|
||||
];
|
|
@ -444,8 +444,8 @@ $utopia->get('/v1/avatars/initials')
|
|||
$draw = new \ImagickDraw();
|
||||
$fontSize = min($width, $height) / 2;
|
||||
|
||||
$draw->setFont(__DIR__."/../../../public/fonts/poppins-v9-latin-600.ttf");
|
||||
$image->setFont(__DIR__."/../../../public/fonts/poppins-v9-latin-600.ttf");
|
||||
$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);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
global $utopia, $request, $response, $register, $project;
|
||||
|
||||
use Utopia\Exception;
|
||||
use Appwrite\Storage\Devices\Local;
|
||||
use Appwrite\Storage\Device\Local;
|
||||
use Appwrite\Storage\Storage;
|
||||
use Appwrite\ClamAV\Network;
|
||||
|
||||
|
|
|
@ -165,3 +165,19 @@ $utopia->get('/v1/locale/currencies')
|
|||
$response->json($currencies);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
$utopia->get('/v1/locale/languages')
|
||||
->desc('List Languages')
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
|
||||
->label('sdk.namespace', 'locale')
|
||||
->label('sdk.method', 'getLanguages')
|
||||
->label('sdk.description', '/docs/references/locale/get-languages.md')
|
||||
->action(
|
||||
function () use ($response) {
|
||||
$languages = include __DIR__.'/../../config/languages.php';
|
||||
|
||||
$response->json($languages);
|
||||
}
|
||||
);
|
|
@ -18,7 +18,7 @@ use Appwrite\Database\Database;
|
|||
use Appwrite\Database\Document;
|
||||
use Appwrite\Database\Validator\UID;
|
||||
use Appwrite\OpenSSL\OpenSSL;
|
||||
use Appwrite\Network\Validators\CNAME;
|
||||
use Appwrite\Network\Validator\CNAME;
|
||||
use Cron\CronExpression;
|
||||
|
||||
include_once __DIR__ . '/../shared/api.php';
|
||||
|
|
|
@ -15,10 +15,10 @@ use Appwrite\ClamAV\Network;
|
|||
use Appwrite\Database\Database;
|
||||
use Appwrite\Database\Validator\UID;
|
||||
use Appwrite\Storage\Storage;
|
||||
use Appwrite\Storage\Devices\Local;
|
||||
use Appwrite\Storage\Validators\File;
|
||||
use Appwrite\Storage\Validators\FileSize;
|
||||
use Appwrite\Storage\Validators\Upload;
|
||||
use Appwrite\Storage\Device\Local;
|
||||
use Appwrite\Storage\Validator\File;
|
||||
use Appwrite\Storage\Validator\FileSize;
|
||||
use Appwrite\Storage\Validator\Upload;
|
||||
use Appwrite\Storage\Compression\Algorithms\GZIP;
|
||||
use Appwrite\Resize\Resize;
|
||||
use Appwrite\OpenSSL\OpenSSL;
|
||||
|
|
|
@ -215,7 +215,7 @@ $utopia->post('/v1/teams/:teamId/memberships')
|
|||
->param('roles', [], function () { return new ArrayList(new Text(128)); }, 'Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions).')
|
||||
->param('url', '', function () use ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.') // TODO add our own built-in confirm page
|
||||
->action(
|
||||
function ($teamId, $email, $name, $roles, $url) use ($response, $register, $project, $user, $audit, $projectDB) {
|
||||
function ($teamId, $email, $name, $roles, $url) use ($response, $register, $project, $user, $audit, $projectDB, $mode) {
|
||||
$name = (empty($name)) ? $email : $name;
|
||||
$team = $projectDB->getDocument($teamId);
|
||||
|
||||
|
@ -285,7 +285,7 @@ $utopia->post('/v1/teams/:teamId/memberships')
|
|||
}
|
||||
}
|
||||
|
||||
if (!$isOwner) {
|
||||
if (!$isOwner && (APP_MODE_ADMIN !== $mode)) {
|
||||
throw new Exception('User is not allowed to send invitations for this team', 401);
|
||||
}
|
||||
|
||||
|
@ -302,11 +302,18 @@ $utopia->post('/v1/teams/:teamId/memberships')
|
|||
'roles' => $roles,
|
||||
'invited' => time(),
|
||||
'joined' => 0,
|
||||
'confirm' => false,
|
||||
'confirm' => (APP_MODE_ADMIN === $mode),
|
||||
'secret' => Auth::hash($secret),
|
||||
]);
|
||||
|
||||
$membership = $projectDB->createDocument($membership->getArrayCopy());
|
||||
if(APP_MODE_ADMIN === $mode) { // Allow admin to create membership
|
||||
Authorization::disable();
|
||||
$membership = $projectDB->createDocument($membership->getArrayCopy());
|
||||
Authorization::reset();
|
||||
}
|
||||
else {
|
||||
$membership = $projectDB->createDocument($membership->getArrayCopy());
|
||||
}
|
||||
|
||||
if (false === $membership) {
|
||||
throw new Exception('Failed saving membership to DB', 500);
|
||||
|
@ -334,7 +341,9 @@ $utopia->post('/v1/teams/:teamId/memberships')
|
|||
$mail->AltBody = strip_tags($body->render());
|
||||
|
||||
try {
|
||||
$mail->send();
|
||||
if(APP_MODE_ADMIN !== $mode) { // No need in comfirmation when in admin mode
|
||||
$mail->send();
|
||||
}
|
||||
} catch (\Exception $error) {
|
||||
throw new Exception('Error sending mail: ' . $error->getMessage(), 500);
|
||||
}
|
||||
|
@ -371,8 +380,12 @@ $utopia->get('/v1/teams/:teamId/memberships')
|
|||
->label('sdk.method', 'getMemberships')
|
||||
->label('sdk.description', '/docs/references/teams/get-team-members.md')
|
||||
->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
|
||||
->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true)
|
||||
->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
|
||||
->param('offset', 0, function () { return new Range(0, 2000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true)
|
||||
->param('orderType', 'ASC', function () { return new WhiteList(['ASC', 'DESC']); }, 'Order result by ASC or DESC order.', true)
|
||||
->action(
|
||||
function ($teamId) use ($response, $projectDB) {
|
||||
function ($teamId, $search, $limit, $offset, $orderType) use ($response, $projectDB) {
|
||||
$team = $projectDB->getDocument($teamId);
|
||||
|
||||
if (empty($team->getId()) || Database::SYSTEM_COLLECTION_TEAMS != $team->getCollection()) {
|
||||
|
@ -380,8 +393,12 @@ $utopia->get('/v1/teams/:teamId/memberships')
|
|||
}
|
||||
|
||||
$memberships = $projectDB->getCollection([
|
||||
'limit' => 50,
|
||||
'offset' => 0,
|
||||
'limit' => $limit,
|
||||
'offset' => $offset,
|
||||
'orderField' => 'joined',
|
||||
'orderType' => $orderType,
|
||||
'orderCast' => 'int',
|
||||
'search' => $search,
|
||||
'filters' => [
|
||||
'$collection='.Database::SYSTEM_COLLECTION_MEMBERSHIPS,
|
||||
'teamId='.$teamId,
|
||||
|
@ -408,15 +425,8 @@ $utopia->get('/v1/teams/:teamId/memberships')
|
|||
]));
|
||||
}
|
||||
|
||||
usort($users, function ($a, $b) {
|
||||
if ($a['joined'] === 0 || $b['joined'] === 0) {
|
||||
return $b['joined'] - $a['joined'];
|
||||
}
|
||||
$response->json(['sum' => $projectDB->getSum(), 'memberships' => $users]);
|
||||
|
||||
return $a['joined'] - $b['joined'];
|
||||
});
|
||||
|
||||
$response->json($users);
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -583,9 +593,11 @@ $utopia->delete('/v1/teams/:teamId/memberships/:inviteId')
|
|||
throw new Exception('Failed to remove membership from DB', 500);
|
||||
}
|
||||
|
||||
$team = $projectDB->updateDocument(array_merge($team->getArrayCopy(), [
|
||||
'sum' => $team->getAttribute('sum', 0) - 1,
|
||||
]));
|
||||
if ($membership->getAttribute('confirm')) { // Count only confirmed members
|
||||
$team = $projectDB->updateDocument(array_merge($team->getArrayCopy(), [
|
||||
'sum' => $team->getAttribute('sum', 0) - 1,
|
||||
]));
|
||||
}
|
||||
|
||||
if (false === $team) {
|
||||
throw new Exception('Failed saving team to DB', 500);
|
||||
|
|
|
@ -7,7 +7,7 @@ use Utopia\Validator\Text;
|
|||
use Utopia\Validator\ArrayList;
|
||||
use Utopia\Response;
|
||||
use Utopia\Validator\Host;
|
||||
use Appwrite\Storage\Validators\File;
|
||||
use Appwrite\Storage\Validator\File;
|
||||
|
||||
$result = [];
|
||||
|
||||
|
|
|
@ -277,14 +277,26 @@ $utopia->get('/console/users')
|
|||
->setParam('body', $page);
|
||||
});
|
||||
|
||||
$utopia->get('/console/users/view')
|
||||
$utopia->get('/console/users/user')
|
||||
->desc('Platform console project user')
|
||||
->label('permission', 'public')
|
||||
->label('scope', 'console')
|
||||
->action(function () use ($layout) {
|
||||
$page = new View(__DIR__.'/../../views/console/users/view.phtml');
|
||||
$page = new View(__DIR__.'/../../views/console/users/user.phtml');
|
||||
|
||||
$layout
|
||||
->setParam('title', APP_NAME.' - View User')
|
||||
->setParam('title', APP_NAME.' - User')
|
||||
->setParam('body', $page);
|
||||
});
|
||||
|
||||
$utopia->get('/console/users/teams/team')
|
||||
->desc('Platform console project team')
|
||||
->label('permission', 'public')
|
||||
->label('scope', 'console')
|
||||
->action(function () use ($layout) {
|
||||
$page = new View(__DIR__.'/../../views/console/users/team.phtml');
|
||||
|
||||
$layout
|
||||
->setParam('title', APP_NAME.' - Team')
|
||||
->setParam('body', $page);
|
||||
});
|
||||
|
|
|
@ -475,7 +475,7 @@ $utopia->get('/open-api-2.json')
|
|||
$node['x-example'] = '{}';
|
||||
//$node['format'] = 'json';
|
||||
break;
|
||||
case 'Appwrite\Storage\Validators\File':
|
||||
case 'Appwrite\Storage\Validator\File':
|
||||
$consumes = ['multipart/form-data'];
|
||||
$node['type'] = 'file';
|
||||
break;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Appwrite Web SDK
|
||||
|
||||
![License](https://img.shields.io/github/license/appwrite/sdk-for-js.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.6.1-blue.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.6.2-blue.svg?v=1)
|
||||
|
||||
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way.
|
||||
Use the Web SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.
|
||||
|
|
|
@ -5,7 +5,7 @@ sdk
|
|||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
;
|
||||
|
||||
let promise = sdk.account.createOAuth2Session('bitbucket');
|
||||
let promise = sdk.account.createOAuth2Session('amazon');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
|
|
|
@ -276,10 +276,10 @@
|
|||
*
|
||||
* Use this endpoint to allow a new user to register a new account in your
|
||||
* project. After the user registration completes successfully, you can use
|
||||
* the [/account/verfication](/docs/account#createVerification) route to start
|
||||
* verifying the user email address. To allow your new user to login to his
|
||||
* new account, you need to create a new [account
|
||||
* session](/docs/account#createSession).
|
||||
* the [/account/verfication](/docs/client/account#createVerification) route
|
||||
* to start verifying the user email address. To allow your new user to login
|
||||
* to his new account, you need to create a new [account
|
||||
* session](/docs/client/account#createSession).
|
||||
*
|
||||
* @param {string} email
|
||||
* @param {string} password
|
||||
|
@ -522,7 +522,7 @@
|
|||
* When the user clicks the confirmation link he is redirected back to your
|
||||
* app password reset URL with the secret key and email address values
|
||||
* attached to the URL query string. Use the query string params to submit a
|
||||
* request to the [PUT /account/recovery](/docs/account#updateRecovery)
|
||||
* request to the [PUT /account/recovery](/docs/client/account#updateRecovery)
|
||||
* endpoint to complete the process.
|
||||
*
|
||||
* @param {string} email
|
||||
|
@ -563,7 +563,7 @@
|
|||
* Use this endpoint to complete the user account password reset. Both the
|
||||
* **userId** and **secret** arguments will be passed as query parameters to
|
||||
* the redirect URL you have provided when sending your request to the [POST
|
||||
* /account/recovery](/docs/account#createRecovery) endpoint.
|
||||
* /account/recovery](/docs/client/account#createRecovery) endpoint.
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -772,7 +772,7 @@
|
|||
* should redirect the user back for your app and allow you to complete the
|
||||
* verification process by verifying both the **userId** and **secret**
|
||||
* parameters. Learn more about how to [complete the verification
|
||||
* process](/docs/account#updateAccountVerification).
|
||||
* process](/docs/client/account#updateAccountVerification).
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -1168,7 +1168,10 @@
|
|||
/**
|
||||
* Create Document
|
||||
*
|
||||
* Create a new Document.
|
||||
* Create a new Document. Before using this route, you should create a new
|
||||
* collection resource using either a [server
|
||||
* integration](/docs/server/database?sdk=nodejs#createCollection) API or
|
||||
* directly from your database console.
|
||||
*
|
||||
* @param {string} collectionId
|
||||
* @param {object} data
|
||||
|
@ -1942,10 +1945,14 @@
|
|||
* for this list of resources.
|
||||
*
|
||||
* @param {string} teamId
|
||||
* @param {string} search
|
||||
* @param {number} limit
|
||||
* @param {number} offset
|
||||
* @param {string} orderType
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getMemberships: function(teamId) {
|
||||
getMemberships: function(teamId, search = '', limit = 25, offset = 0, orderType = 'ASC') {
|
||||
if(teamId === undefined) {
|
||||
throw new Error('Missing required parameter: "teamId"');
|
||||
}
|
||||
|
@ -1954,6 +1961,22 @@
|
|||
|
||||
let payload = {};
|
||||
|
||||
if(search) {
|
||||
payload['search'] = search;
|
||||
}
|
||||
|
||||
if(limit) {
|
||||
payload['limit'] = limit;
|
||||
}
|
||||
|
||||
if(offset) {
|
||||
payload['offset'] = offset;
|
||||
}
|
||||
|
||||
if(orderType) {
|
||||
payload['orderType'] = orderType;
|
||||
}
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -1969,8 +1992,8 @@
|
|||
*
|
||||
* Use the 'URL' parameter to redirect the user from the invitation email back
|
||||
* to your app. When the user is redirected, use the [Update Team Membership
|
||||
* Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to
|
||||
* accept the invitation to the team.
|
||||
* Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the
|
||||
* user to accept the invitation to the team.
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
|
8
app/sdks/client-web/src/sdk.min.js
vendored
8
app/sdks/client-web/src/sdk.min.js
vendored
|
@ -148,8 +148,12 @@ let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payloa
|
|||
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(name){payload.name=name}
|
||||
return http.put(path,{'content-type':'application/json',},payload)},delete:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getMemberships:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createMembership:function(teamId,email,roles,url,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getMemberships:function(teamId,search='',limit=25,offset=0,orderType='ASC'){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(search){payload.search=search}
|
||||
if(limit){payload.limit=limit}
|
||||
if(offset){payload.offset=offset}
|
||||
if(orderType){payload.orderType=orderType}
|
||||
return http.get(path,{'content-type':'application/json',},payload)},createMembership:function(teamId,email,roles,url,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
if(email===undefined){throw new Error('Missing required parameter: "email"')}
|
||||
if(roles===undefined){throw new Error('Missing required parameter: "roles"')}
|
||||
if(url===undefined){throw new Error('Missing required parameter: "url"')}
|
||||
|
|
29
app/sdks/client-web/types/index.d.ts
vendored
29
app/sdks/client-web/types/index.d.ts
vendored
|
@ -64,10 +64,10 @@ declare namespace Appwrite {
|
|||
*
|
||||
* Use this endpoint to allow a new user to register a new account in your
|
||||
* project. After the user registration completes successfully, you can use
|
||||
* the [/account/verfication](/docs/account#createVerification) route to start
|
||||
* verifying the user email address. To allow your new user to login to his
|
||||
* new account, you need to create a new [account
|
||||
* session](/docs/account#createSession).
|
||||
* the [/account/verfication](/docs/client/account#createVerification) route
|
||||
* to start verifying the user email address. To allow your new user to login
|
||||
* to his new account, you need to create a new [account
|
||||
* session](/docs/client/account#createSession).
|
||||
*
|
||||
* @param {string} email
|
||||
* @param {string} password
|
||||
|
@ -170,7 +170,7 @@ declare namespace Appwrite {
|
|||
* When the user clicks the confirmation link he is redirected back to your
|
||||
* app password reset URL with the secret key and email address values
|
||||
* attached to the URL query string. Use the query string params to submit a
|
||||
* request to the [PUT /account/recovery](/docs/account#updateRecovery)
|
||||
* request to the [PUT /account/recovery](/docs/client/account#updateRecovery)
|
||||
* endpoint to complete the process.
|
||||
*
|
||||
* @param {string} email
|
||||
|
@ -186,7 +186,7 @@ declare namespace Appwrite {
|
|||
* Use this endpoint to complete the user account password reset. Both the
|
||||
* **userId** and **secret** arguments will be passed as query parameters to
|
||||
* the redirect URL you have provided when sending your request to the [POST
|
||||
* /account/recovery](/docs/account#createRecovery) endpoint.
|
||||
* /account/recovery](/docs/client/account#createRecovery) endpoint.
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -276,7 +276,7 @@ declare namespace Appwrite {
|
|||
* should redirect the user back for your app and allow you to complete the
|
||||
* verification process by verifying both the **userId** and **secret**
|
||||
* parameters. Learn more about how to [complete the verification
|
||||
* process](/docs/account#updateAccountVerification).
|
||||
* process](/docs/client/account#updateAccountVerification).
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -431,7 +431,10 @@ declare namespace Appwrite {
|
|||
/**
|
||||
* Create Document
|
||||
*
|
||||
* Create a new Document.
|
||||
* Create a new Document. Before using this route, you should create a new
|
||||
* collection resource using either a [server
|
||||
* integration](/docs/server/database?sdk=nodejs#createCollection) API or
|
||||
* directly from your database console.
|
||||
*
|
||||
* @param {string} collectionId
|
||||
* @param {object} data
|
||||
|
@ -758,10 +761,14 @@ declare namespace Appwrite {
|
|||
* for this list of resources.
|
||||
*
|
||||
* @param {string} teamId
|
||||
* @param {string} search
|
||||
* @param {number} limit
|
||||
* @param {number} offset
|
||||
* @param {string} orderType
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getMemberships(teamId: string): Promise<object>;
|
||||
getMemberships(teamId: string, search: string, limit: number, offset: number, orderType: string): Promise<object>;
|
||||
|
||||
/**
|
||||
* Create Team Membership
|
||||
|
@ -772,8 +779,8 @@ declare namespace Appwrite {
|
|||
*
|
||||
* Use the 'URL' parameter to redirect the user from the invitation email back
|
||||
* to your app. When the user is redirected, use the [Update Team Membership
|
||||
* Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to
|
||||
* accept the invitation to the team.
|
||||
* Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the
|
||||
* user to accept the invitation to the team.
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Appwrite Console SDK
|
||||
|
||||
![License](https://img.shields.io/github/license/appwrite/sdk-for-console.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.6.1-blue.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.6.2-blue.svg?v=1)
|
||||
|
||||
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way.
|
||||
Use the Console SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.
|
||||
|
|
|
@ -6,7 +6,7 @@ sdk
|
|||
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
||||
;
|
||||
|
||||
let promise = sdk.account.createOAuth2Session('bitbucket');
|
||||
let promise = sdk.account.createOAuth2Session('amazon');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
|
|
|
@ -6,7 +6,7 @@ sdk
|
|||
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
||||
;
|
||||
|
||||
let promise = sdk.projects.updateOAuth2('[PROJECT_ID]', 'bitbucket');
|
||||
let promise = sdk.projects.updateOAuth2('[PROJECT_ID]', 'amazon');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
|
|
|
@ -312,10 +312,10 @@
|
|||
*
|
||||
* Use this endpoint to allow a new user to register a new account in your
|
||||
* project. After the user registration completes successfully, you can use
|
||||
* the [/account/verfication](/docs/account#createVerification) route to start
|
||||
* verifying the user email address. To allow your new user to login to his
|
||||
* new account, you need to create a new [account
|
||||
* session](/docs/account#createSession).
|
||||
* the [/account/verfication](/docs/client/account#createVerification) route
|
||||
* to start verifying the user email address. To allow your new user to login
|
||||
* to his new account, you need to create a new [account
|
||||
* session](/docs/client/account#createSession).
|
||||
*
|
||||
* @param {string} email
|
||||
* @param {string} password
|
||||
|
@ -558,7 +558,7 @@
|
|||
* When the user clicks the confirmation link he is redirected back to your
|
||||
* app password reset URL with the secret key and email address values
|
||||
* attached to the URL query string. Use the query string params to submit a
|
||||
* request to the [PUT /account/recovery](/docs/account#updateRecovery)
|
||||
* request to the [PUT /account/recovery](/docs/client/account#updateRecovery)
|
||||
* endpoint to complete the process.
|
||||
*
|
||||
* @param {string} email
|
||||
|
@ -599,7 +599,7 @@
|
|||
* Use this endpoint to complete the user account password reset. Both the
|
||||
* **userId** and **secret** arguments will be passed as query parameters to
|
||||
* the redirect URL you have provided when sending your request to the [POST
|
||||
* /account/recovery](/docs/account#createRecovery) endpoint.
|
||||
* /account/recovery](/docs/client/account#createRecovery) endpoint.
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -810,7 +810,7 @@
|
|||
* should redirect the user back for your app and allow you to complete the
|
||||
* verification process by verifying both the **userId** and **secret**
|
||||
* parameters. Learn more about how to [complete the verification
|
||||
* process](/docs/account#updateAccountVerification).
|
||||
* process](/docs/client/account#updateAccountVerification).
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -1421,7 +1421,10 @@
|
|||
/**
|
||||
* Create Document
|
||||
*
|
||||
* Create a new Document.
|
||||
* Create a new Document. Before using this route, you should create a new
|
||||
* collection resource using either a [server
|
||||
* integration](/docs/server/database?sdk=nodejs#createCollection) API or
|
||||
* directly from your database console.
|
||||
*
|
||||
* @param {string} collectionId
|
||||
* @param {object} data
|
||||
|
@ -3753,10 +3756,14 @@
|
|||
* for this list of resources.
|
||||
*
|
||||
* @param {string} teamId
|
||||
* @param {string} search
|
||||
* @param {number} limit
|
||||
* @param {number} offset
|
||||
* @param {string} orderType
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getMemberships: function(teamId) {
|
||||
getMemberships: function(teamId, search = '', limit = 25, offset = 0, orderType = 'ASC') {
|
||||
if(teamId === undefined) {
|
||||
throw new Error('Missing required parameter: "teamId"');
|
||||
}
|
||||
|
@ -3765,6 +3772,22 @@
|
|||
|
||||
let payload = {};
|
||||
|
||||
if(search) {
|
||||
payload['search'] = search;
|
||||
}
|
||||
|
||||
if(limit) {
|
||||
payload['limit'] = limit;
|
||||
}
|
||||
|
||||
if(offset) {
|
||||
payload['offset'] = offset;
|
||||
}
|
||||
|
||||
if(orderType) {
|
||||
payload['orderType'] = orderType;
|
||||
}
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -3780,8 +3803,8 @@
|
|||
*
|
||||
* Use the 'URL' parameter to redirect the user from the invitation email back
|
||||
* to your app. When the user is redirected, use the [Update Team Membership
|
||||
* Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to
|
||||
* accept the invitation to the team.
|
||||
* Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the
|
||||
* user to accept the invitation to the team.
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
|
8
app/sdks/console-web/src/sdk.min.js
vendored
8
app/sdks/console-web/src/sdk.min.js
vendored
|
@ -319,8 +319,12 @@ let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payloa
|
|||
if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(name){payload.name=name}
|
||||
return http.put(path,{'content-type':'application/json',},payload)},delete:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getMemberships:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createMembership:function(teamId,email,roles,url,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getMemberships:function(teamId,search='',limit=25,offset=0,orderType='ASC'){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(search){payload.search=search}
|
||||
if(limit){payload.limit=limit}
|
||||
if(offset){payload.offset=offset}
|
||||
if(orderType){payload.orderType=orderType}
|
||||
return http.get(path,{'content-type':'application/json',},payload)},createMembership:function(teamId,email,roles,url,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')}
|
||||
if(email===undefined){throw new Error('Missing required parameter: "email"')}
|
||||
if(roles===undefined){throw new Error('Missing required parameter: "roles"')}
|
||||
if(url===undefined){throw new Error('Missing required parameter: "url"')}
|
||||
|
|
29
app/sdks/console-web/types/index.d.ts
vendored
29
app/sdks/console-web/types/index.d.ts
vendored
|
@ -85,10 +85,10 @@ declare namespace Appwrite {
|
|||
*
|
||||
* Use this endpoint to allow a new user to register a new account in your
|
||||
* project. After the user registration completes successfully, you can use
|
||||
* the [/account/verfication](/docs/account#createVerification) route to start
|
||||
* verifying the user email address. To allow your new user to login to his
|
||||
* new account, you need to create a new [account
|
||||
* session](/docs/account#createSession).
|
||||
* the [/account/verfication](/docs/client/account#createVerification) route
|
||||
* to start verifying the user email address. To allow your new user to login
|
||||
* to his new account, you need to create a new [account
|
||||
* session](/docs/client/account#createSession).
|
||||
*
|
||||
* @param {string} email
|
||||
* @param {string} password
|
||||
|
@ -191,7 +191,7 @@ declare namespace Appwrite {
|
|||
* When the user clicks the confirmation link he is redirected back to your
|
||||
* app password reset URL with the secret key and email address values
|
||||
* attached to the URL query string. Use the query string params to submit a
|
||||
* request to the [PUT /account/recovery](/docs/account#updateRecovery)
|
||||
* request to the [PUT /account/recovery](/docs/client/account#updateRecovery)
|
||||
* endpoint to complete the process.
|
||||
*
|
||||
* @param {string} email
|
||||
|
@ -207,7 +207,7 @@ declare namespace Appwrite {
|
|||
* Use this endpoint to complete the user account password reset. Both the
|
||||
* **userId** and **secret** arguments will be passed as query parameters to
|
||||
* the redirect URL you have provided when sending your request to the [POST
|
||||
* /account/recovery](/docs/account#createRecovery) endpoint.
|
||||
* /account/recovery](/docs/client/account#createRecovery) endpoint.
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -297,7 +297,7 @@ declare namespace Appwrite {
|
|||
* should redirect the user back for your app and allow you to complete the
|
||||
* verification process by verifying both the **userId** and **secret**
|
||||
* parameters. Learn more about how to [complete the verification
|
||||
* process](/docs/account#updateAccountVerification).
|
||||
* process](/docs/client/account#updateAccountVerification).
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -522,7 +522,10 @@ declare namespace Appwrite {
|
|||
/**
|
||||
* Create Document
|
||||
*
|
||||
* Create a new Document.
|
||||
* Create a new Document. Before using this route, you should create a new
|
||||
* collection resource using either a [server
|
||||
* integration](/docs/server/database?sdk=nodejs#createCollection) API or
|
||||
* directly from your database console.
|
||||
*
|
||||
* @param {string} collectionId
|
||||
* @param {object} data
|
||||
|
@ -1402,10 +1405,14 @@ declare namespace Appwrite {
|
|||
* for this list of resources.
|
||||
*
|
||||
* @param {string} teamId
|
||||
* @param {string} search
|
||||
* @param {number} limit
|
||||
* @param {number} offset
|
||||
* @param {string} orderType
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getMemberships(teamId: string): Promise<object>;
|
||||
getMemberships(teamId: string, search: string, limit: number, offset: number, orderType: string): Promise<object>;
|
||||
|
||||
/**
|
||||
* Create Team Membership
|
||||
|
@ -1416,8 +1423,8 @@ declare namespace Appwrite {
|
|||
*
|
||||
* Use the 'URL' parameter to redirect the user from the invitation email back
|
||||
* to your app. When the user is redirected, use the [Update Team Membership
|
||||
* Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to
|
||||
* accept the invitation to the team.
|
||||
* Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the
|
||||
* user to accept the invitation to the team.
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
|
|
@ -22,15 +22,7 @@
|
|||
|
||||
<div class="row responsive force-reverse">
|
||||
<div class="col span-3 text-align-center margin-bottom">
|
||||
<img src="" data-ls-attrs="src={{account|gravatar}}" data-size="200" height="150" alt="User Avatar" class="avatar huge huge margin-bottom-small" />
|
||||
|
||||
<br />
|
||||
|
||||
<a href="https://en.gravatar.com/gravatars/new/" rel="noopener" class="button margin-bottom-small link-animation-disabled" target="_blank"><i class="icon-upload"></i> Upload</a>
|
||||
|
||||
<br />
|
||||
|
||||
<small class="text-size-small">(via <a href="https://gravatar.com/" target="_blank" rel="noopener">gravatar.com <i class="icon-link-ext"></i></a>)</small>
|
||||
<img src="" data-ls-attrs="src={{account|avatar}}" data-size="200" height="150" alt="User Avatar" class="avatar huge huge margin-bottom-small" />
|
||||
</div>
|
||||
|
||||
<div class="col span-9">
|
||||
|
@ -57,7 +49,7 @@
|
|||
<input name="name" id="name" type="text" autocomplete="off" data-ls-bind="{{account.name}}" required class="margin-bottom-no">
|
||||
</div>
|
||||
<div class="col span-4">
|
||||
<button type="submit" class="fill reverse margin-bottom-no">Update Name</button>
|
||||
<button type="submit" class="fill margin-bottom-no">Update Name</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -85,7 +77,7 @@
|
|||
<input name="email" type="email" class="margin-bottom-no" autocomplete="off" placeholder="me@example.com" data-ls-bind="{{account.email}}" required>
|
||||
</div>
|
||||
<div class="col span-4">
|
||||
<div data-ui-modal class="modal box close width-small height-small" data-button-text="Update Email" data-button-class="fill reverse">
|
||||
<div data-ui-modal class="modal box close width-small height-small" data-button-text="Update Email" data-button-class="fill">
|
||||
<h3>Confirm Password</h3>
|
||||
|
||||
<hr />
|
||||
|
@ -103,7 +95,7 @@
|
|||
|
||||
<hr />
|
||||
|
||||
<div data-ui-modal class="modal box close width-small" data-button-text="Update Password" data-button-class="reverse">
|
||||
<div data-ui-modal class="modal box close width-small" data-button-text="Update Password" data-button-class="">
|
||||
<h1>Update Password</h1>
|
||||
|
||||
<form name="update-password"
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
</div>
|
||||
|
||||
<div class="account link link-animation-disabled pull-end clear">
|
||||
<img src="" data-ls-attrs="src={{account|gravatar}}" alt="User Avatar" class="avatar margin-start pull-end" />
|
||||
<img src="" data-ls-attrs="src={{account|avatar}}" alt="User Avatar" class="avatar margin-start pull-end" />
|
||||
<span class="name pull-end desktops-only" data-ls-bind="{{account.name}}"></span>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -385,7 +385,7 @@ $customDomainsTarget = $this->getParam('customDomainsTarget', false);
|
|||
data-success-param-trigger-events="teams.getMemberships">
|
||||
|
||||
<div class="box margin-bottom">
|
||||
<ul data-ls-loop="members" data-ls-as="member" class="list">
|
||||
<ul data-ls-loop="members.memberships" data-ls-as="member" class="list">
|
||||
<li class="clear">
|
||||
<form class="pull-end"
|
||||
data-analytics-event="submit"
|
||||
|
@ -432,10 +432,10 @@ $customDomainsTarget = $this->getParam('customDomainsTarget', false);
|
|||
data-scope="console"
|
||||
data-event="teams.deleteMembership.resend"
|
||||
data-success="alert,trigger"
|
||||
data-success-param-alert-text="Invitation Sent Successfully"
|
||||
data-success-param-alert-text="Invitation sent successfully"
|
||||
data-success-param-trigger-events="teams.createMembership.resent"
|
||||
data-failure="alert"
|
||||
data-failure-param-alert-text="Failed to Send inivitation"
|
||||
data-failure-param-alert-text="Failed to send inivitation"
|
||||
data-failure-param-alert-classname="error">
|
||||
|
||||
<input name="teamId" type="hidden" data-ls-bind="{{member.teamId}}">
|
||||
|
@ -446,7 +446,7 @@ $customDomainsTarget = $this->getParam('customDomainsTarget', false);
|
|||
</form>
|
||||
</div>
|
||||
|
||||
<img src="" data-ls-attrs="src={{member|gravatar}}" data-size="200" alt="User Avatar" class="avatar pull-start margin-end" loading="lazy" width="60" height="60" />
|
||||
<img src="" data-ls-attrs="src={{member|avatar}}" data-size="200" alt="User Avatar" class="avatar pull-start margin-end" loading="lazy" width="60" height="60" />
|
||||
|
||||
<div class="margin-bottom-tiny">
|
||||
<span data-ls-bind="{{member.name}}"></span> <span class="tag" data-ls-bind="{{member.roles.0}}"></span> <span data-ls-if="false === {{member.confirm}}" class="tag red">Pending Approval</span>
|
||||
|
@ -470,10 +470,10 @@ $customDomainsTarget = $this->getParam('customDomainsTarget', false);
|
|||
data-event="submit"
|
||||
data-loading="Sending invitation, please wait..."
|
||||
data-success="alert,trigger,reset"
|
||||
data-success-param-alert-text="Invitation Sent Successfully"
|
||||
data-success-param-alert-text="Invitation sent successfully"
|
||||
data-success-param-trigger-events="teams.createMembership"
|
||||
data-failure="alert"
|
||||
data-failure-param-alert-text="Failed to Send Invite"
|
||||
data-failure-param-alert-text="Failed to send invite"
|
||||
data-failure-param-alert-classname="error">
|
||||
|
||||
<input name="teamId" id="team-teamId" type="hidden" data-ls-bind="{{console-project.teamId}}">
|
||||
|
|
|
@ -104,10 +104,10 @@ $providers = $this->getParam('providers', []);
|
|||
<tbody data-ls-loop="project-users.users" data-ls-as="user">
|
||||
<tr>
|
||||
<td class="hide">
|
||||
<img src="" data-ls-attrs="src={{user|gravatar}}" data-size="45" alt="User Avatar" class="avatar pull-start" loading="lazy" width="30" height="30" />
|
||||
<img src="" data-ls-attrs="src={{user|avatar}}" data-size="45" alt="User Avatar" class="avatar pull-start" loading="lazy" width="30" height="30" />
|
||||
</td>
|
||||
<td data-title="Name: ">
|
||||
<a data-ls-attrs="href=/console/users/view?id={{user.$id}}&project={{router.params.project}}">
|
||||
<a data-ls-attrs="href=/console/users/user?id={{user.$id}}&project={{router.params.project}}">
|
||||
<span data-ls-bind="{{user.name}}"></span>
|
||||
<span data-ls-if="{{user.name}} === ''">-----</span>
|
||||
</a>
|
||||
|
@ -250,39 +250,10 @@ $providers = $this->getParam('providers', []);
|
|||
<tbody data-ls-loop="project-teams.teams" data-ls-as="team">
|
||||
<tr>
|
||||
<td class="hide">
|
||||
<img src="" data-ls-attrs="src={{team.name|gravatar}}" data-size="45" alt="Collection Avatar" class="avatar margin-end pull-start" loading="lazy" width="30" height="30" />
|
||||
<img src="" data-ls-attrs="src={{team.name|avatar}}" data-size="45" alt="Collection Avatar" class="avatar margin-end pull-start" loading="lazy" width="30" height="30" />
|
||||
</td>
|
||||
<td data-title="Name: ">
|
||||
<div data-ui-modal class="box modal close" data-button-text="{{team.name}}" data-button-class="link">
|
||||
<h1>Update Team</h1>
|
||||
|
||||
<form
|
||||
data-analytics-event="submit"
|
||||
data-analytics-category="console"
|
||||
data-analytics-label="Update Team"
|
||||
data-service="teams.update"
|
||||
data-scope="sdk"
|
||||
data-event="submit"
|
||||
data-success="alert,trigger"
|
||||
data-success-param-alert-text="Updated team successfully"
|
||||
data-success-param-trigger-events="teams.update"
|
||||
data-failure="alert"
|
||||
data-failure-param-alert-text="Failed to update team"
|
||||
data-failure-param-alert-classname="error">
|
||||
|
||||
<label for="name">ID</label>
|
||||
<div class="input-copy">
|
||||
<input data-ls-attrs="id=team-id-{{team.$id}}" name="teamId" data-forms-copy type="text" disabled data-ls-bind="{{team.$id}}" />
|
||||
</div>
|
||||
|
||||
<label for="name">Name</label>
|
||||
<input data-ls-attrs="id=team-name-{{team.$id}}" name="name" type="text" autocomplete="off" data-ls-bind="{{team.name}}">
|
||||
|
||||
<hr />
|
||||
|
||||
<button>Update</button> <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
<a data-ls-attrs="href=/console/users/teams/team?id={{team.$id}}&project={{router.params.project}}" data-ls-bind="{{team.name}}"></a>
|
||||
</td>
|
||||
<td data-title="Members: "><span data-ls-bind="{{team.sum}} members"></span></td>
|
||||
<td data-title="Date Created: "><small data-ls-bind="{{team.dateCreated|date-text}}"></small></td>
|
||||
|
|
230
app/views/console/users/team.phtml
Normal file
230
app/views/console/users/team.phtml
Normal file
|
@ -0,0 +1,230 @@
|
|||
<div
|
||||
data-service="teams.get"
|
||||
data-name="team"
|
||||
data-event="load,teams.update,teams.deleteMembership,teams.createMembership"
|
||||
data-param-team-id="{{router.params.id}}"
|
||||
data-success="trigger"
|
||||
data-success-param-trigger-events="teams.get">
|
||||
|
||||
<div class="cover">
|
||||
<h1 class="zone xl margin-bottom-large">
|
||||
<a data-ls-attrs="href=/console/users/teams?project={{router.params.project}}" class="back text-size-small"><i class="icon-left-open"></i> Teams</a>
|
||||
<br />
|
||||
|
||||
<span data-ls-bind="{{team.name}}"> </span>
|
||||
<span data-ls-if="{{team.name}} === ''">Unknown</span>
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div data-ui-modal class="modal width-large box close" data-button-hide="on" data-open-event="open-json">
|
||||
<button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
|
||||
|
||||
<h2>JSON View</h2>
|
||||
|
||||
<div class="margin-bottom">
|
||||
<input type="hidden" data-ls-bind="{{team}}" data-forms-code />
|
||||
</div>
|
||||
|
||||
<button data-ui-modal-close="" type="button" class="reverse">Cancel</button>
|
||||
</div>
|
||||
|
||||
<div class="zone xl">
|
||||
<ul class="phases clear" data-ui-phases data-selected="{{router.params.tab}}">
|
||||
<li data-state="/console/users/teams/team?id={{router.params.id}}&project={{router.params.project}}">
|
||||
<h2>General</h2>
|
||||
|
||||
<div class="row responsive margin-top-negative">
|
||||
<div class="col span-8 margin-bottom-large">
|
||||
<label> </label>
|
||||
|
||||
<div class="box margin-bottom-large">
|
||||
<form
|
||||
data-analytics-event="submit"
|
||||
data-analytics-category="console"
|
||||
data-analytics-label="Update Team"
|
||||
data-service="teams.update"
|
||||
data-scope="sdk"
|
||||
data-event="submit"
|
||||
data-success="alert,trigger"
|
||||
data-success-param-alert-text="Updated team successfully"
|
||||
data-success-param-trigger-events="teams.update"
|
||||
data-failure="alert"
|
||||
data-failure-param-alert-text="Failed to update team"
|
||||
data-failure-param-alert-classname="error">
|
||||
|
||||
<input data-ls-attrs="id=team-id-{{team.$id}}" name="teamId" type="hidden" disabled data-ls-bind="{{team.$id}}" />
|
||||
|
||||
<label for="name">Name</label>
|
||||
<input data-ls-attrs="id=team-name-{{team.$id}}" name="name" type="text" autocomplete="off" data-ls-bind="{{team.name}}">
|
||||
|
||||
<hr />
|
||||
|
||||
<button>Update</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<h3 class="margin-bottom">Members</h3>
|
||||
|
||||
<div
|
||||
data-service="teams.getMemberships"
|
||||
data-event="load,teams.create,teams.update,teams.delete,teams.deleteMembership,teams.createMembership"
|
||||
data-param-team-id="{{router.params.id}}"
|
||||
data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
|
||||
data-param-offset="{{router.params.offset}}"
|
||||
data-param-order-type="DESC"
|
||||
data-scope="sdk"
|
||||
data-name="project-members">
|
||||
|
||||
<div data-ls-if="0 == {{project-members.sum}}" class="box margin-bottom">
|
||||
<h3 class="margin-bottom-small text-bold">No Memberships Found</h3>
|
||||
|
||||
<p class="margin-bottom-no">Add your first team member to get started</p>
|
||||
</div>
|
||||
|
||||
<div data-ls-if="0 != {{project-members.sum}}">
|
||||
<div class="margin-bottom-small margin-end-small text-align-end text-size-small margin-top-negative"><span data-ls-bind="{{project-members.sum}}"></span> memberships found</div>
|
||||
|
||||
<div class="box margin-bottom">
|
||||
<ul data-ls-loop="project-members.memberships" data-ls-as="member" class="list">
|
||||
<li class="clear">
|
||||
<form class="pull-end"
|
||||
data-analytics-event="submit"
|
||||
data-analytics-category="console"
|
||||
data-analytics-label="Delete Team Membership"
|
||||
data-service="teams.deleteMembership"
|
||||
data-event="submit"
|
||||
data-success="alert,trigger"
|
||||
data-success-param-alert-text="Member Removed Successfully"
|
||||
data-success-param-trigger-events="teams.deleteMembership"
|
||||
data-failure="alert"
|
||||
data-failure-param-alert-text="Failed to Remove Member"
|
||||
data-failure-param-alert-classname="error">
|
||||
|
||||
<input name="teamId" data-ls-attrs="id={{member.$id}}" type="hidden" data-ls-bind="{{router.params.id}}">
|
||||
<input name="inviteId" data-ls-attrs="id=leave-inviteId-{{member.$id}}" type="hidden" data-ls-bind="{{member.$id}}">
|
||||
|
||||
<button class="danger">Remove</button>
|
||||
</form>
|
||||
|
||||
<img src="" data-ls-attrs="src={{member|avatar}}" data-size="200" alt="User Avatar" class="avatar pull-start margin-end" loading="lazy" width="60" height="60" />
|
||||
|
||||
<div class="margin-bottom-tiny">
|
||||
<a data-ls-attrs="href=/console/users/user?id={{member.userId}}&project={{router.params.project}}"><span data-ls-bind="{{member.name}}"></span></a>
|
||||
<span data-ls-if="1 == {{member.roles.length}}" class="text-fade tooltip" data-ls-bind="({{member.roles.length}} role)" data-ls-attrs="data-tooltip={{member.roles|arraySentence}}"></span>
|
||||
<span data-ls-if="2 <= {{member.roles.length}}" class="text-fade tooltip" data-ls-bind="({{member.roles.length}} roles)" data-ls-attrs="data-tooltip={{member.roles|arraySentence}}"></span>
|
||||
</div>
|
||||
<small class="text-size-small text-fade" data-ls-bind="{{member.email}}"></small> <span data-ls-if="false === {{member.confirm}}" class="text-danger text-size-small">Pending Approval</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-ui-modal class="box modal close" data-button-text="Add Member" data-button-class="pull-start">
|
||||
<button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
|
||||
|
||||
<h1>Add Member</h1>
|
||||
|
||||
<form name="teams.createTeamMembership"
|
||||
data-analytics-event="submit"
|
||||
data-analytics-category="console"
|
||||
data-analytics-label="Create Team Membership"
|
||||
data-service="teams.createMembership"
|
||||
data-event="submit"
|
||||
data-loading="Sending invitation, please wait..."
|
||||
data-success="alert,trigger,reset"
|
||||
data-success-param-alert-text="Invitation sent successfully"
|
||||
data-success-param-trigger-events="teams.createMembership"
|
||||
data-failure="alert"
|
||||
data-failure-param-alert-text="Failed to send invite"
|
||||
data-failure-param-alert-classname="error">
|
||||
|
||||
<input name="teamId" id="team-teamId" type="hidden" data-ls-bind="{{team.$id}}">
|
||||
<input name="url" type="hidden" data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}" />
|
||||
|
||||
<label for="email">Email</label>
|
||||
<input name="email" id="email" type="email" autocomplete="email" required>
|
||||
|
||||
<label for="team-name">Name <small>(optional)</small></label>
|
||||
<input name="name" id="team-name" type="text" autocomplete="name">
|
||||
|
||||
<label for="roles">Roles</label>
|
||||
<input type="hidden" id="team-roles" name="roles" data-forms-tags data-cast-to="json" data-ls-bind="<?php echo $this->escape(json_encode(['owner'])); ?>" placeholder="Add any role you like" />
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="clear">
|
||||
<button>Add Member</button>
|
||||
<button data-ui-modal-close="" type="button" class="reverse">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="clear text-align-center paging pull-end">
|
||||
<form
|
||||
data-service="teams.getMemberships"
|
||||
data-event="submit"
|
||||
data-param-team-id="{{router.params.id}}"
|
||||
data-param-search="{{router.params.search}}"
|
||||
data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
|
||||
data-param-order-type="DESC"
|
||||
data-scope="sdk"
|
||||
data-name="project-members"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{project-members.sum}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
</form>
|
||||
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-members.sum|pageTotal}}"></span>
|
||||
|
||||
<form
|
||||
data-service="teams.getMemberships"
|
||||
data-event="submit"
|
||||
data-param-team-id="{{router.params.id}}"
|
||||
data-param-search="{{router.params.search}}"
|
||||
data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
|
||||
data-param-order-type="DESC"
|
||||
data-scope="sdk"
|
||||
data-name="project-members"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{project-members.sum}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col span-4 sticky-top">
|
||||
<label>Team ID</label>
|
||||
<div class="input-copy margin-bottom">
|
||||
<input id="uid" type="text" autocomplete="off" placeholder="" data-ls-bind="{{team.$id}}" disabled data-forms-copy>
|
||||
</div>
|
||||
|
||||
<ul class="margin-bottom-large text-fade text-size-small">
|
||||
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> <button data-ls-ui-trigger="open-json" class="link text-size-small">View as JSON</button></li>
|
||||
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Created: <span data-ls-bind="{{team.dateCreated|date-text}}"></span></li>
|
||||
</ul>
|
||||
|
||||
<form name="teams.delete" class="margin-bottom"
|
||||
data-analytics-event="submit"
|
||||
data-analytics-category="console"
|
||||
data-analytics-label="Delete Team"
|
||||
data-service="teams.delete"
|
||||
data-event="submit"
|
||||
data-confirm="Are you sure you want to delete this team?"
|
||||
data-param-team-id="{{router.params.id}}"
|
||||
data-success="alert,trigger,redirect"
|
||||
data-success-param-alert-text="Team deleted successfully"
|
||||
data-success-param-trigger-events="users.update"
|
||||
data-success-param-redirect-url="/console/users/teams?project={{router.params.project}}"
|
||||
data-failure="alert"
|
||||
data-failure-param-alert-text="Failed to delete team"
|
||||
data-failure-param-alert-classname="error">
|
||||
|
||||
<button type="submit" class="danger fill">Delete Team</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
<div class="zone xl">
|
||||
<ul class="phases clear" data-ui-phases data-selected="{{router.params.tab}}">
|
||||
<li data-state="/console/users/view?id={{router.params.id}}&project={{router.params.project}}">
|
||||
<li data-state="/console/users/user?id={{router.params.id}}&project={{router.params.project}}">
|
||||
<h2>General</h2>
|
||||
|
||||
<div data-ls-if="{{user.status}} === <?php echo \Appwrite\Auth\Auth::USER_STATUS_BLOCKED; ?>" style="display: none" class="box padding-small danger margin-bottom-xxl text-align-center">
|
||||
|
@ -43,7 +43,7 @@
|
|||
|
||||
<div class="box margin-bottom-large">
|
||||
<div class="text-align-center">
|
||||
<img src="" data-ls-attrs="src={{user|gravatar}}" data-size="200" alt="User Avatar" class="avatar huge margin-top-negative-xxl" />
|
||||
<img src="" data-ls-attrs="src={{user|avatar}}" data-size="200" alt="User Avatar" class="avatar huge margin-top-negative-xxl" />
|
||||
|
||||
<div class="margin-top-small" data-ls-bind="Member since {{user.registration|date-text}}"></div>
|
||||
<div class="margin-top-small">
|
||||
|
@ -113,10 +113,10 @@
|
|||
data-event="submit"
|
||||
data-param-user-id="{{router.params.id}}"
|
||||
data-success="alert,trigger"
|
||||
data-success-param-alert-text="Blocked User Successfully"
|
||||
data-success-param-alert-text="Blocked user successfully"
|
||||
data-success-param-trigger-events="users.update"
|
||||
data-failure="alert"
|
||||
data-failure-param-alert-text="Failed to Block User"
|
||||
data-failure-param-alert-text="Failed to block user"
|
||||
data-failure-param-alert-classname="error">
|
||||
|
||||
<button name="status" type="submit" class="danger fill" value="<?php echo \Appwrite\Auth\Auth::USER_STATUS_BLOCKED; ?>">Block Account</button>
|
||||
|
@ -132,10 +132,10 @@
|
|||
data-event="submit"
|
||||
data-param-user-id="{{router.params.id}}"
|
||||
data-success="alert,trigger"
|
||||
data-success-param-alert-text="Activated User Successfully"
|
||||
data-success-param-alert-text="Activated user successfully"
|
||||
data-success-param-trigger-events="users.update"
|
||||
data-failure="alert"
|
||||
data-failure-param-alert-text="Failed to Activate User"
|
||||
data-failure-param-alert-text="Failed to activate user"
|
||||
data-failure-param-alert-classname="error">
|
||||
|
||||
<button name="status" type="submit" class="fill" value="<?php echo \Appwrite\Auth\Auth::USER_STATUS_ACTIVATED; ?>">Activate Account</button>
|
||||
|
@ -144,7 +144,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li data-state="/console/users/view/devices?id={{router.params.id}}&project={{router.params.project}}">
|
||||
<li data-state="/console/users/user/devices?id={{router.params.id}}&project={{router.params.project}}">
|
||||
<h2>Devices</h2>
|
||||
|
||||
<div
|
||||
|
@ -210,7 +210,7 @@
|
|||
</div>
|
||||
|
||||
</li>
|
||||
<li data-state="/console/users/view/audit?id={{router.params.id}}&project={{router.params.project}}">
|
||||
<li data-state="/console/users/user/audit?id={{router.params.id}}&project={{router.params.project}}">
|
||||
<h2>Activity</h2>
|
||||
|
||||
<div
|
|
@ -12,7 +12,7 @@
|
|||
data-param-secret="{{router.params.secret}}"
|
||||
data-success="redirect,alert,trigger"
|
||||
data-success-param-redirect-url="/console?project={{router.params.project}}"
|
||||
data-success-param-alert-text="Joined Team Successfully"
|
||||
data-success-param-alert-text="Joined team successfully"
|
||||
data-success-param-trigger-events="teams.updateMembershipStatus"
|
||||
data-failure="redirect,alert"
|
||||
data-success-param-redirect-url="/console"
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<div class="zone large padding margin-top" id="message" style="display: none">
|
||||
<h1 class="margin-bottom">Missing Redirect URL</h1>
|
||||
<p>Your OAuth login flow is missing a redirect URL. Please check the <a href="https://<?php echo APP_DOMAIN; ?>/docs/client/account?sdk=web#createOAuth2Session">OAuth docs</a> and send request for new session with a valid callback URL.</p>
|
||||
<p>Your OAuth login flow is missing a redirect URL. Please check the
|
||||
<a href="https://<?php echo APP_DOMAIN; ?>/docs/client/account?sdk=web#createOAuth2Session">OAuth docs</a>
|
||||
and send request for new session with a valid callback URL.</p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
|
|
@ -5,7 +5,7 @@ use Utopia\Config\Config;
|
|||
use Utopia\Domains\Domain;
|
||||
use Appwrite\Database\Database;
|
||||
use Appwrite\Database\Validator\Authorization;
|
||||
use Appwrite\Network\Validators\CNAME;
|
||||
use Appwrite\Network\Validator\CNAME;
|
||||
|
||||
require_once __DIR__.'/../init.php';
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ echo APP_NAME.' deletes worker v1 has started';
|
|||
|
||||
use Appwrite\Database\Database;
|
||||
use Appwrite\Database\Document;
|
||||
use Appwrite\Storage\Devices\Local;
|
||||
use Appwrite\Storage\Device\Local;
|
||||
|
||||
class DeletesV1
|
||||
{
|
||||
|
|
|
@ -46,6 +46,16 @@ http {
|
|||
gzip_http_version 1.1;
|
||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
|
||||
|
||||
# Brotli Settings
|
||||
brotli on;
|
||||
brotli_comp_level 5;
|
||||
brotli_static on;
|
||||
brotli_types application/atom+xml application/javascript application/json application/rss+xml
|
||||
application/vnd.ms-fontobject application/x-font-opentype application/x-font-truetype
|
||||
application/x-font-ttf application/x-javascript application/xhtml+xml application/xml
|
||||
font/eot font/opentype font/otf font/truetype image/svg+xml image/vnd.microsoft.icon
|
||||
image/x-icon image/x-win-bitmap text/css text/javascript text/plain text/xml;
|
||||
|
||||
# Virtual Host Configs
|
||||
server {
|
||||
listen 80; ## listen for ipv4; this line is default and implied
|
||||
|
|
|
@ -1 +1 @@
|
|||
List of all currencies, including currency symol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.
|
||||
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.
|
1
docs/references/locale/get-languages.md
Normal file
1
docs/references/locale/get-languages.md
Normal file
|
@ -0,0 +1 @@
|
|||
List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.
|
65
public/dist/scripts/app-all.js
vendored
65
public/dist/scripts/app-all.js
vendored
|
@ -18,8 +18,7 @@ request.setRequestHeader(key,headers[key]);}}
|
|||
request.onload=function(){if(4===request.readyState&&399>=request.status){let data=request.response;let contentType=this.getResponseHeader('content-type')||'';contentType=contentType.substring(0,contentType.indexOf(';'));switch(contentType){case'application/json':data=JSON.parse(data);break;}
|
||||
let cookieFallback=this.getResponseHeader('X-Fallback-Cookies')||'';if(window.localStorage&&cookieFallback){window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.');window.localStorage.setItem('cookieFallback',cookieFallback);}
|
||||
resolve(data);}else{reject(new Error(request.statusText));}};if(progress){request.addEventListener('progress',progress);request.upload.addEventListener('progress',progress,false);}
|
||||
request.onerror=function(){reject(new Error("Network Error"));};request.send(params);})};return{'get':function(path,headers={},params={}){return call('GET',path+((Object.keys(params).length>0)?'?'+buildQuery(params):''),headers,{});},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress);},'put':function(path,headers={},params={},progress=null){return call('PUT',path,headers,params,progress);},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress);},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress);},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let iframe=function(method,url,params){let form=document.createElement('form');form.setAttribute('method',method);form.setAttribute('action',config.endpoint+url);for(let key in params){if(params.hasOwnProperty(key)){let hiddenField=document.createElement("input");hiddenField.setAttribute("type","hidden");hiddenField.setAttribute("name",key);hiddenField.setAttribute("value",params[key]);form.appendChild(hiddenField);}}
|
||||
document.body.appendChild(form);return form.submit();};let account={get:function(){let path='/account';let payload={};return http.get(path,{'content-type':'application/json',},payload);},create:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
request.onerror=function(){reject(new Error("Network Error"));};request.send(params);})};return{'get':function(path,headers={},params={}){return call('GET',path+((Object.keys(params).length>0)?'?'+buildQuery(params):''),headers,{});},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress);},'put':function(path,headers={},params={},progress=null){return call('PUT',path,headers,params,progress);},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress);},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress);},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let account={get:function(){let path='/account';let payload={};return http.get(path,{'content-type':'application/json',},payload);},create:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
if(password===undefined){throw new Error('Missing required parameter: "password"');}
|
||||
let path='/account';let payload={};if(email){payload['email']=email;}
|
||||
if(password){payload['password']=password;}
|
||||
|
@ -52,12 +51,10 @@ return http.put(path,{'content-type':'application/json',},payload);},getSessions
|
|||
if(password===undefined){throw new Error('Missing required parameter: "password"');}
|
||||
let path='/account/sessions';let payload={};if(email){payload['email']=email;}
|
||||
if(password){payload['password']=password;}
|
||||
return http.post(path,{'content-type':'application/json',},payload);},deleteSessions:function(){let path='/account/sessions';let payload={};return http.delete(path,{'content-type':'application/json',},payload);},createOAuth2Session:function(provider,success,failure){if(provider===undefined){throw new Error('Missing required parameter: "provider"');}
|
||||
if(success===undefined){throw new Error('Missing required parameter: "success"');}
|
||||
if(failure===undefined){throw new Error('Missing required parameter: "failure"');}
|
||||
return http.post(path,{'content-type':'application/json',},payload);},deleteSessions:function(){let path='/account/sessions';let payload={};return http.delete(path,{'content-type':'application/json',},payload);},createOAuth2Session:function(provider,success='https://appwrite.io/auth/oauth2/success',failure='https://appwrite.io/auth/oauth2/failure'){if(provider===undefined){throw new Error('Missing required parameter: "provider"');}
|
||||
let path='/account/sessions/oauth2/{provider}'.replace(new RegExp('{provider}','g'),provider);let payload={};if(success){payload['success']=success;}
|
||||
if(failure){payload['failure']=failure;}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},deleteSession:function(sessionId){if(sessionId===undefined){throw new Error('Missing required parameter: "sessionId"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');window.location=config.endpoint+path+((query)?'?'+query:'');},deleteSession:function(sessionId){if(sessionId===undefined){throw new Error('Missing required parameter: "sessionId"');}
|
||||
let path='/account/sessions/{sessionId}'.replace(new RegExp('{sessionId}','g'),sessionId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},createVerification:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
let path='/account/verification';let payload={};if(url){payload['url']=url;}
|
||||
return http.post(path,{'content-type':'application/json',},payload);},updateVerification:function(userId,secret){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
|
@ -68,26 +65,26 @@ return http.put(path,{'content-type':'application/json',},payload);}};let avatar
|
|||
let path='/avatars/browsers/{code}'.replace(new RegExp('{code}','g'),code);let payload={};if(width){payload['width']=width;}
|
||||
if(height){payload['height']=height;}
|
||||
if(quality){payload['quality']=quality;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);},getCreditCard:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},getCreditCard:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
let path='/avatars/credit-cards/{code}'.replace(new RegExp('{code}','g'),code);let payload={};if(width){payload['width']=width;}
|
||||
if(height){payload['height']=height;}
|
||||
if(quality){payload['quality']=quality;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
let path='/avatars/favicon';let payload={};if(url){payload['url']=url;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);},getFlag:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},getFlag:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
let path='/avatars/flags/{code}'.replace(new RegExp('{code}','g'),code);let payload={};if(width){payload['width']=width;}
|
||||
if(height){payload['height']=height;}
|
||||
if(quality){payload['quality']=quality;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);},getImage:function(url,width=400,height=400){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},getImage:function(url,width=400,height=400){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
let path='/avatars/image';let payload={};if(url){payload['url']=url;}
|
||||
if(width){payload['width']=width;}
|
||||
if(height){payload['height']=height;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"');}
|
||||
let path='/avatars/qr';let payload={};if(text){payload['text']=text;}
|
||||
if(size){payload['size']=size;}
|
||||
if(margin){payload['margin']=margin;}
|
||||
if(download){payload['download']=download;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);}};let database={listCollections:function(search='',limit=25,offset=0,orderType='ASC'){let path='/database/collections';let payload={};if(search){payload['search']=search;}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');}};let database={listCollections:function(search='',limit=25,offset=0,orderType='ASC'){let path='/database/collections';let payload={};if(search){payload['search']=search;}
|
||||
if(limit){payload['limit']=limit;}
|
||||
if(offset){payload['offset']=offset;}
|
||||
if(orderType){payload['orderType']=orderType;}
|
||||
|
@ -141,7 +138,8 @@ if(read){payload['read']=read;}
|
|||
if(write){payload['write']=write;}
|
||||
return http.patch(path,{'content-type':'application/json',},payload);},deleteDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
if(documentId===undefined){throw new Error('Missing required parameter: "documentId"');}
|
||||
let path='/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);}};let locale={get:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getContinents:function(){let path='/locale/continents';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let projects={list:function(){let path='/projects';let payload={};return http.get(path,{'content-type':'application/json',},payload);},create:function(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getCollectionLogs:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/collections/{collectionId}/logs'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let health={get:function(){let path='/health';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getAntiVirus:function(){let path='/health/anti-virus';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCache:function(){let path='/health/cache';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getDB:function(){let path='/health/db';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueCertificates:function(){let path='/health/queue/certificates';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueFunctions:function(){let path='/health/queue/functions';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueLogs:function(){let path='/health/queue/logs';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueTasks:function(){let path='/health/queue/tasks';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueUsage:function(){let path='/health/queue/usage';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueWebhooks:function(){let path='/health/queue/webhooks';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getStorageLocal:function(){let path='/health/storage/local';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getTime:function(){let path='/health/time';let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let locale={get:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getContinents:function(){let path='/locale/continents';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let projects={list:function(){let path='/projects';let payload={};return http.get(path,{'content-type':'application/json',},payload);},create:function(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/projects';let payload={};if(name){payload['name']=name;}
|
||||
if(teamId){payload['teamId']=teamId;}
|
||||
|
@ -259,7 +257,7 @@ if(httpUser){payload['httpUser']=httpUser;}
|
|||
if(httpPass){payload['httpPass']=httpPass;}
|
||||
return http.put(path,{'content-type':'application/json',},payload);},deleteTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(taskId===undefined){throw new Error('Missing required parameter: "taskId"');}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getUsage:function(projectId,range='monthly'){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getUsage:function(projectId,range='last30'){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/usage'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(range){payload['range']=range;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);},listWebhooks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},createWebhook:function(projectId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
|
@ -327,8 +325,12 @@ let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payloa
|
|||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(name){payload['name']=name;}
|
||||
return http.put(path,{'content-type':'application/json',},payload);},delete:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getMemberships:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},createMembership:function(teamId,email,roles,url,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getMemberships:function(teamId,search='',limit=25,offset=0,orderType='ASC'){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(search){payload['search']=search;}
|
||||
if(limit){payload['limit']=limit;}
|
||||
if(offset){payload['offset']=offset;}
|
||||
if(orderType){payload['orderType']=orderType;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);},createMembership:function(teamId,email,roles,url,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
if(roles===undefined){throw new Error('Missing required parameter: "roles"');}
|
||||
if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
|
@ -366,7 +368,7 @@ if(sessionId===undefined){throw new Error('Missing required parameter: "sessionI
|
|||
let path='/users/{userId}/sessions/{sessionId}'.replace(new RegExp('{userId}','g'),userId).replace(new RegExp('{sessionId}','g'),sessionId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},updateStatus:function(userId,status){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
if(status===undefined){throw new Error('Missing required parameter: "status"');}
|
||||
let path='/users/{userId}/status'.replace(new RegExp('{userId}','g'),userId);let payload={};if(status){payload['status']=status;}
|
||||
return http.patch(path,{'content-type':'application/json',},payload);}};return{setEndpoint:setEndpoint,setProject:setProject,setKey:setKey,setLocale:setLocale,setMode:setMode,account:account,avatars:avatars,database:database,locale:locale,projects:projects,storage:storage,teams:teams,users:users};};if(typeof module!=="undefined"){module.exports=window.Appwrite;}})((typeof window!=="undefined")?window:{});(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<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){var colorNames=require(5);module.exports={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}
|
||||
return http.patch(path,{'content-type':'application/json',},payload);}};return{setEndpoint:setEndpoint,setProject:setProject,setKey:setKey,setLocale:setLocale,setMode:setMode,account:account,avatars:avatars,database:database,health:health,locale:locale,projects:projects,storage:storage,teams:teams,users:users};};if(typeof module!=="undefined"){module.exports=window.Appwrite;}})((typeof window!=="undefined")?window:{});(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<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){var colorNames=require(5);module.exports={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})$/i,hex=/^#([a-fA-F0-9]{6})$/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);if(match){match=match[1];for(var i=0;i<rgb.length;i++){rgb[i]=parseInt(match[i]+match[i],16);}}
|
||||
else if(match=string.match(hex)){match=match[1];for(var i=0;i<rgb.length;i++){rgb[i]=parseInt(match.slice(i*2,i*2+2),16);}}
|
||||
|
@ -2532,29 +2534,11 @@ 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<value.length;i++){if(/\s/g.test(value[i])){continue;}
|
||||
if(-1===special.indexOf(value[i])){var firstChar=value[i];break;}}
|
||||
if(-1<rtlStock.indexOf("^"+firstChar+"^")){return true;}
|
||||
return false;};return{isRTL:isRTL,};},true);})(window);(function(window){"use strict";window.ls.container.set('sdk',function(window,router){var sdk=new window.Appwrite();sdk.setEndpoint(APP_ENV.API).setProject(router.params.project||'').setLocale(APP_ENV.LOCALE).setMode('admin');return sdk;},false);})(window);(function(window){"use strict";window.ls.container.set('search',function(window){return{params:{},path:'',pointer:'',selected:'',};},true,true);})(window);(function(window){"use strict";window.ls.container.set('timezone',function(){return{convert:function(unixTime){var timezoneMinutes=new Date().getTimezoneOffset();timezoneMinutes=(timezoneMinutes===0)?0:-timezoneMinutes;return parseInt(unixTime)+(timezoneMinutes*60);}};},true);})(window);window.ls.router.add("/auth/signin",{template:"/auth/signin?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/signup",{template:"/auth/signup?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/recovery",{template:"/auth/recovery?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/recovery/reset",{template:"/auth/recovery/reset?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/confirm",{template:"/auth/confirm?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/join",{template:"/auth/join?version="+APP_ENV.VERSION,scope:"home"}).add("/console",{template:"/console?version="+APP_ENV.VERSION,scope:"console"}).add("/console/account",{template:"/console/account?version="+APP_ENV.VERSION,scope:"console"}).add("/console/account/:tab",{template:"/console/account?version="+APP_ENV.VERSION,scope:"console"}).add("/console/home",{template:"/console/home?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/home/:tab",{template:"/console/home?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/platforms/:platform",{template:function(window){return window.location.pathname+"?version="+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/notifications",{template:"/console/notifications?version="+APP_ENV.VERSION,scope:"console"}).add("/console/settings",{template:"/console/settings?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/settings/:tab",{template:"/console/settings?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/webhooks",{template:"/console/webhooks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/webhooks/:tab",{template:"/console/webhooks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/keys",{template:"/console/keys?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/keys/:tab",{template:"/console/keys?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/tasks",{template:"/console/tasks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/tasks/:tab",{template:"/console/tasks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/database",{template:"/console/database?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/database/collection",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/database/collection/:tab",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/database/document",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/database/document/:tab",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/storage",{template:"/console/storage?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/storage/:tab",{template:"/console/storage?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users",{template:"/console/users?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/view",{template:"/console/users/view?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/view/:tab",{template:"/console/users/view?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/:tab",{template:"/console/users?version="+APP_ENV.VERSION,scope:"console",project:true});window.ls.filter.add("gravatar",function($value,element){if(!$value){return"";}
|
||||
let MD5=function(s){function L(k,d){return(k<<d)|(k>>>(32-d));}
|
||||
function K(G,k){let I,d,F,H,x;F=G&2147483648;H=k&2147483648;I=G&1073741824;d=k&1073741824;x=(G&1073741823)+(k&1073741823);if(I&d){return x^2147483648^F^H;}
|
||||
if(I|d){if(x&1073741824){return x^3221225472^F^H;}else{return x^1073741824^F^H;}}else{return x^F^H;}}
|
||||
function r(d,F,k){return(d&F)|(~d&k);}
|
||||
function q(d,F,k){return(d&k)|(F&~k);}
|
||||
function p(d,F,k){return d^F^k;}
|
||||
function n(d,F,k){return F^(d|~k);}
|
||||
function u(G,F,aa,Z,k,H,I){G=K(G,K(K(r(F,aa,Z),k),I));return K(L(G,H),F);}
|
||||
function f(G,F,aa,Z,k,H,I){G=K(G,K(K(q(F,aa,Z),k),I));return K(L(G,H),F);}
|
||||
function D(G,F,aa,Z,k,H,I){G=K(G,K(K(p(F,aa,Z),k),I));return K(L(G,H),F);}
|
||||
function t(G,F,aa,Z,k,H,I){G=K(G,K(K(n(F,aa,Z),k),I));return K(L(G,H),F);}
|
||||
function e(G){let Z;let F=G.length;let x=F+8;let k=(x-(x%64))/64;let I=(k+1)*16;let aa=Array(I-1);let d=0;let H=0;while(H<F){Z=(H-(H%4))/4;d=(H%4)*8;aa[Z]=aa[Z]|(G.charCodeAt(H)<<d);H++;}
|
||||
Z=(H-(H%4))/4;d=(H%4)*8;aa[Z]=aa[Z]|(128<<d);aa[I-2]=F<<3;aa[I-1]=F>>>29;return aa;}
|
||||
function B(x){let k="",F="",G,d;for(d=0;d<=3;d++){G=(x>>>(d*8))&255;F="0"+G.toString(16);k=k+F.substr(F.length-2,2);}
|
||||
return k;}
|
||||
function J(k){k=k.replace(/rn/g,"n");let d="";for(let F=0;F<k.length;F++){let x=k.charCodeAt(F);if(x<128){d+=String.fromCharCode(x);}else{if(x>127&&x<2048){d+=String.fromCharCode((x>>6)|192);d+=String.fromCharCode((x&63)|128);}else{d+=String.fromCharCode((x>>12)|224);d+=String.fromCharCode(((x>>6)&63)|128);d+=String.fromCharCode((x&63)|128);}}}
|
||||
return d;}
|
||||
let C=Array();let P,h,E,v,g,Y,X,W,V;let S=7,Q=12,N=17,M=22;let A=5,z=9,y=14,w=20;let o=4,m=11,l=16,j=23;let U=6,T=10,R=15,O=21;s=J(s);C=e(s);Y=1732584193;X=4023233417;W=2562383102;V=271733878;for(P=0;P<C.length;P+=16){h=Y;E=X;v=W;g=V;Y=u(Y,X,W,V,C[P+0],S,3614090360);V=u(V,Y,X,W,C[P+1],Q,3905402710);W=u(W,V,Y,X,C[P+2],N,606105819);X=u(X,W,V,Y,C[P+3],M,3250441966);Y=u(Y,X,W,V,C[P+4],S,4118548399);V=u(V,Y,X,W,C[P+5],Q,1200080426);W=u(W,V,Y,X,C[P+6],N,2821735955);X=u(X,W,V,Y,C[P+7],M,4249261313);Y=u(Y,X,W,V,C[P+8],S,1770035416);V=u(V,Y,X,W,C[P+9],Q,2336552879);W=u(W,V,Y,X,C[P+10],N,4294925233);X=u(X,W,V,Y,C[P+11],M,2304563134);Y=u(Y,X,W,V,C[P+12],S,1804603682);V=u(V,Y,X,W,C[P+13],Q,4254626195);W=u(W,V,Y,X,C[P+14],N,2792965006);X=u(X,W,V,Y,C[P+15],M,1236535329);Y=f(Y,X,W,V,C[P+1],A,4129170786);V=f(V,Y,X,W,C[P+6],z,3225465664);W=f(W,V,Y,X,C[P+11],y,643717713);X=f(X,W,V,Y,C[P+0],w,3921069994);Y=f(Y,X,W,V,C[P+5],A,3593408605);V=f(V,Y,X,W,C[P+10],z,38016083);W=f(W,V,Y,X,C[P+15],y,3634488961);X=f(X,W,V,Y,C[P+4],w,3889429448);Y=f(Y,X,W,V,C[P+9],A,568446438);V=f(V,Y,X,W,C[P+14],z,3275163606);W=f(W,V,Y,X,C[P+3],y,4107603335);X=f(X,W,V,Y,C[P+8],w,1163531501);Y=f(Y,X,W,V,C[P+13],A,2850285829);V=f(V,Y,X,W,C[P+2],z,4243563512);W=f(W,V,Y,X,C[P+7],y,1735328473);X=f(X,W,V,Y,C[P+12],w,2368359562);Y=D(Y,X,W,V,C[P+5],o,4294588738);V=D(V,Y,X,W,C[P+8],m,2272392833);W=D(W,V,Y,X,C[P+11],l,1839030562);X=D(X,W,V,Y,C[P+14],j,4259657740);Y=D(Y,X,W,V,C[P+1],o,2763975236);V=D(V,Y,X,W,C[P+4],m,1272893353);W=D(W,V,Y,X,C[P+7],l,4139469664);X=D(X,W,V,Y,C[P+10],j,3200236656);Y=D(Y,X,W,V,C[P+13],o,681279174);V=D(V,Y,X,W,C[P+0],m,3936430074);W=D(W,V,Y,X,C[P+3],l,3572445317);X=D(X,W,V,Y,C[P+6],j,76029189);Y=D(Y,X,W,V,C[P+9],o,3654602809);V=D(V,Y,X,W,C[P+12],m,3873151461);W=D(W,V,Y,X,C[P+15],l,530742520);X=D(X,W,V,Y,C[P+2],j,3299628645);Y=t(Y,X,W,V,C[P+0],U,4096336452);V=t(V,Y,X,W,C[P+7],T,1126891415);W=t(W,V,Y,X,C[P+14],R,2878612391);X=t(X,W,V,Y,C[P+5],O,4237533241);Y=t(Y,X,W,V,C[P+12],U,1700485571);V=t(V,Y,X,W,C[P+3],T,2399980690);W=t(W,V,Y,X,C[P+10],R,4293915773);X=t(X,W,V,Y,C[P+1],O,2240044497);Y=t(Y,X,W,V,C[P+8],U,1873313359);V=t(V,Y,X,W,C[P+15],T,4264355552);W=t(W,V,Y,X,C[P+6],R,2734768916);X=t(X,W,V,Y,C[P+13],O,1309151649);Y=t(Y,X,W,V,C[P+4],U,4149444226);V=t(V,Y,X,W,C[P+11],T,3174756917);W=t(W,V,Y,X,C[P+2],R,718787259);X=t(X,W,V,Y,C[P+9],O,3951481745);Y=K(Y,h);X=K(X,E);W=K(W,v);V=K(V,g);}
|
||||
let i=B(Y)+B(X)+B(W)+B(V);return i.toLowerCase();};let size=element.dataset["size"]||80;let email=$value.email||$value||"";let name=$value.name||$value||"";name=(typeof name!=='string')?'--':name;let def="/v1/avatars/initials?project=console"+"&name="+
|
||||
return false;};return{isRTL:isRTL,};},true);})(window);(function(window){"use strict";window.ls.container.set('sdk',function(window,router){var sdk=new window.Appwrite();sdk.setEndpoint(APP_ENV.API).setProject(router.params.project||'').setLocale(APP_ENV.LOCALE).setMode('admin');return sdk;},false);})(window);(function(window){"use strict";window.ls.container.set('search',function(window){return{params:{},path:'',pointer:'',selected:'',};},true,true);})(window);(function(window){"use strict";window.ls.container.set('timezone',function(){return{convert:function(unixTime){var timezoneMinutes=new Date().getTimezoneOffset();timezoneMinutes=(timezoneMinutes===0)?0:-timezoneMinutes;return parseInt(unixTime)+(timezoneMinutes*60);}};},true);})(window);window.ls.router.add("/auth/signin",{template:"/auth/signin?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/signup",{template:"/auth/signup?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/recovery",{template:"/auth/recovery?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/recovery/reset",{template:"/auth/recovery/reset?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/confirm",{template:"/auth/confirm?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/join",{template:"/auth/join?version="+APP_ENV.VERSION,scope:"home"}).add("/console",{template:"/console?version="+APP_ENV.VERSION,scope:"console"}).add("/console/account",{template:"/console/account?version="+APP_ENV.VERSION,scope:"console"}).add("/console/account/:tab",{template:"/console/account?version="+APP_ENV.VERSION,scope:"console"}).add("/console/home",{template:"/console/home?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/home/:tab",{template:"/console/home?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/platforms/:platform",{template:function(window){return window.location.pathname+"?version="+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/notifications",{template:"/console/notifications?version="+APP_ENV.VERSION,scope:"console"}).add("/console/settings",{template:"/console/settings?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/settings/:tab",{template:"/console/settings?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/webhooks",{template:"/console/webhooks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/webhooks/:tab",{template:"/console/webhooks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/keys",{template:"/console/keys?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/keys/:tab",{template:"/console/keys?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/tasks",{template:"/console/tasks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/tasks/:tab",{template:"/console/tasks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/database",{template:"/console/database?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/database/collection",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/database/collection/:tab",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/database/document",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/database/document/:tab",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/storage",{template:"/console/storage?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/storage/:tab",{template:"/console/storage?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users",{template:"/console/users?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/user",{template:"/console/users/user?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/user/:tab",{template:"/console/users/user?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/teams/team",{template:"/console/users/teams/team?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/teams/team/:tab",{template:"/console/users/teams/team?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/:tab",{template:"/console/users?version="+APP_ENV.VERSION,scope:"console",project:true});window.ls.filter.add("avatar",function($value,element){if(!$value){return"";}
|
||||
let size=element.dataset["size"]||80;let name=$value.name||$value||"";name=(typeof name!=='string')?'--':name;return def="/v1/avatars/initials?project=console"+"&name="+
|
||||
encodeURIComponent(name)+"&width="+
|
||||
size+"&height="+
|
||||
size;return def;}).add("selectedCollection",function($value,router){return $value===router.params.collectionId?"selected":"";}).add("selectedDocument",function($value,router){return $value===router.params.documentId?"selected":"";}).add("localeString",function($value){$value=parseInt($value);return!Number.isNaN($value)?$value.toLocaleString():"";}).add("date",function($value,date){return date.format("Y-m-d",$value);}).add("date-time",function($value,date){return date.format("Y-m-d H:i",$value);}).add("date-text",function($value,date){return date.format("d M Y",$value);}).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 ":"")+
|
||||
size;}).add("selectedCollection",function($value,router){return $value===router.params.collectionId?"selected":"";}).add("selectedDocument",function($value,router){return $value===router.params.documentId?"selected":"";}).add("localeString",function($value){$value=parseInt($value);return!Number.isNaN($value)?$value.toLocaleString():"";}).add("date",function($value,date){return date.format("Y-m-d",$value);}).add("date-time",function($value,date){return date.format("Y-m-d H:i",$value);}).add("date-text",function($value,date){return date.format("d M Y",$value);}).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 ":"")+
|
||||
|
@ -2567,7 +2551,8 @@ $value=abbreviate($value,0,false,false);return $value==="0"?"N/A":$value;}).add(
|
|||
return result.length;}).add("documentAction",function(container){let collection=container.get('project-collection');let document=container.get('project-document');if(collection&&document&&!document.$id){return'database.createDocument';}
|
||||
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;;});function abbreviate(number,maxPlaces,forcePlaces,forceLetter){number=Number(number);forceLetter=forceLetter||false;if(forceLetter!==false){return annotate(number,maxPlaces,forcePlaces,forceLetter);}
|
||||
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);}
|
||||
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;}
|
||||
|
@ -2634,7 +2619,7 @@ return{key:filter[0],value:filter[1],operator:operator};};let flatten=function(p
|
|||
list["filters-"+filter.key]=params[key][i];}}}}
|
||||
return list;};let apply=function(params){let cached=container.get(name);cached=cached?cached.params:[];params=Object.assign(cached,params);container.set(name,{name:name,params:params,query:serialize(params),forward:parseInt(params.offset)+parseInt(params.limit),backward:parseInt(params.offset)-parseInt(params.limit),keys:flatten(params)},true,name);document.dispatchEvent(new CustomEvent(name+"-changed",{bubbles:false,cancelable:true}));};switch(element.tagName){case"INPUT":break;case"TEXTAREA":break;case"BUTTON":element.addEventListener("click",function(){apply(JSON.parse(expression.parse(element.dataset["params"]||"{}")));});break;case"FORM":element.addEventListener("input",function(){apply(form.toJson(element));});element.addEventListener("change",function(){apply(form.toJson(element));});element.addEventListener("reset",function(){setTimeout(function(){apply(form.toJson(element));},0);});events=events.trim().split(",");for(let y=0;y<events.length;y++){if(events[y]==="init"){element.addEventListener("rendered",function(){apply(form.toJson(element));},{once:true});}else{}
|
||||
element.setAttribute("data-event","none");}
|
||||
break;default:break;}}});})(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){element.parentNode.insertBefore(element.nextElementSibling,element);element.scrollIntoView(true);}});});}});})(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){element.parentNode.insertBefore(element,element.previousElementSibling);element.scrollIntoView(true);}});});}});})(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<titles.length;++i){let title=titles[i];let distance=title.getBoundingClientRect().top;console.log(i);if((minDistance===null||minDistance>=distance)&&(distance>=0)){if(minLink){minLink.classList.remove('selected');}
|
||||
break;default:break;}}});})(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<titles.length;++i){let title=titles[i];let distance=title.getBoundingClientRect().top;console.log(i);if((minDistance===null||minDistance>=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');}
|
||||
|
|
36
public/dist/scripts/app-dep.js
vendored
36
public/dist/scripts/app-dep.js
vendored
|
@ -18,8 +18,7 @@ request.setRequestHeader(key,headers[key]);}}
|
|||
request.onload=function(){if(4===request.readyState&&399>=request.status){let data=request.response;let contentType=this.getResponseHeader('content-type')||'';contentType=contentType.substring(0,contentType.indexOf(';'));switch(contentType){case'application/json':data=JSON.parse(data);break;}
|
||||
let cookieFallback=this.getResponseHeader('X-Fallback-Cookies')||'';if(window.localStorage&&cookieFallback){window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.');window.localStorage.setItem('cookieFallback',cookieFallback);}
|
||||
resolve(data);}else{reject(new Error(request.statusText));}};if(progress){request.addEventListener('progress',progress);request.upload.addEventListener('progress',progress,false);}
|
||||
request.onerror=function(){reject(new Error("Network Error"));};request.send(params);})};return{'get':function(path,headers={},params={}){return call('GET',path+((Object.keys(params).length>0)?'?'+buildQuery(params):''),headers,{});},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress);},'put':function(path,headers={},params={},progress=null){return call('PUT',path,headers,params,progress);},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress);},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress);},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let iframe=function(method,url,params){let form=document.createElement('form');form.setAttribute('method',method);form.setAttribute('action',config.endpoint+url);for(let key in params){if(params.hasOwnProperty(key)){let hiddenField=document.createElement("input");hiddenField.setAttribute("type","hidden");hiddenField.setAttribute("name",key);hiddenField.setAttribute("value",params[key]);form.appendChild(hiddenField);}}
|
||||
document.body.appendChild(form);return form.submit();};let account={get:function(){let path='/account';let payload={};return http.get(path,{'content-type':'application/json',},payload);},create:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
request.onerror=function(){reject(new Error("Network Error"));};request.send(params);})};return{'get':function(path,headers={},params={}){return call('GET',path+((Object.keys(params).length>0)?'?'+buildQuery(params):''),headers,{});},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress);},'put':function(path,headers={},params={},progress=null){return call('PUT',path,headers,params,progress);},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress);},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress);},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let account={get:function(){let path='/account';let payload={};return http.get(path,{'content-type':'application/json',},payload);},create:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
if(password===undefined){throw new Error('Missing required parameter: "password"');}
|
||||
let path='/account';let payload={};if(email){payload['email']=email;}
|
||||
if(password){payload['password']=password;}
|
||||
|
@ -52,12 +51,10 @@ return http.put(path,{'content-type':'application/json',},payload);},getSessions
|
|||
if(password===undefined){throw new Error('Missing required parameter: "password"');}
|
||||
let path='/account/sessions';let payload={};if(email){payload['email']=email;}
|
||||
if(password){payload['password']=password;}
|
||||
return http.post(path,{'content-type':'application/json',},payload);},deleteSessions:function(){let path='/account/sessions';let payload={};return http.delete(path,{'content-type':'application/json',},payload);},createOAuth2Session:function(provider,success,failure){if(provider===undefined){throw new Error('Missing required parameter: "provider"');}
|
||||
if(success===undefined){throw new Error('Missing required parameter: "success"');}
|
||||
if(failure===undefined){throw new Error('Missing required parameter: "failure"');}
|
||||
return http.post(path,{'content-type':'application/json',},payload);},deleteSessions:function(){let path='/account/sessions';let payload={};return http.delete(path,{'content-type':'application/json',},payload);},createOAuth2Session:function(provider,success='https://appwrite.io/auth/oauth2/success',failure='https://appwrite.io/auth/oauth2/failure'){if(provider===undefined){throw new Error('Missing required parameter: "provider"');}
|
||||
let path='/account/sessions/oauth2/{provider}'.replace(new RegExp('{provider}','g'),provider);let payload={};if(success){payload['success']=success;}
|
||||
if(failure){payload['failure']=failure;}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},deleteSession:function(sessionId){if(sessionId===undefined){throw new Error('Missing required parameter: "sessionId"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');window.location=config.endpoint+path+((query)?'?'+query:'');},deleteSession:function(sessionId){if(sessionId===undefined){throw new Error('Missing required parameter: "sessionId"');}
|
||||
let path='/account/sessions/{sessionId}'.replace(new RegExp('{sessionId}','g'),sessionId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},createVerification:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
let path='/account/verification';let payload={};if(url){payload['url']=url;}
|
||||
return http.post(path,{'content-type':'application/json',},payload);},updateVerification:function(userId,secret){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
|
@ -68,26 +65,26 @@ return http.put(path,{'content-type':'application/json',},payload);}};let avatar
|
|||
let path='/avatars/browsers/{code}'.replace(new RegExp('{code}','g'),code);let payload={};if(width){payload['width']=width;}
|
||||
if(height){payload['height']=height;}
|
||||
if(quality){payload['quality']=quality;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);},getCreditCard:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},getCreditCard:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
let path='/avatars/credit-cards/{code}'.replace(new RegExp('{code}','g'),code);let payload={};if(width){payload['width']=width;}
|
||||
if(height){payload['height']=height;}
|
||||
if(quality){payload['quality']=quality;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},getFavicon:function(url){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
let path='/avatars/favicon';let payload={};if(url){payload['url']=url;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);},getFlag:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},getFlag:function(code,width=100,height=100,quality=100){if(code===undefined){throw new Error('Missing required parameter: "code"');}
|
||||
let path='/avatars/flags/{code}'.replace(new RegExp('{code}','g'),code);let payload={};if(width){payload['width']=width;}
|
||||
if(height){payload['height']=height;}
|
||||
if(quality){payload['quality']=quality;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);},getImage:function(url,width=400,height=400){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},getImage:function(url,width=400,height=400){if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
let path='/avatars/image';let payload={};if(url){payload['url']=url;}
|
||||
if(width){payload['width']=width;}
|
||||
if(height){payload['height']=height;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"');}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');},getQR:function(text,size=400,margin=1,download=0){if(text===undefined){throw new Error('Missing required parameter: "text"');}
|
||||
let path='/avatars/qr';let payload={};if(text){payload['text']=text;}
|
||||
if(size){payload['size']=size;}
|
||||
if(margin){payload['margin']=margin;}
|
||||
if(download){payload['download']=download;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);}};let database={listCollections:function(search='',limit=25,offset=0,orderType='ASC'){let path='/database/collections';let payload={};if(search){payload['search']=search;}
|
||||
payload['project']=config.project;payload['key']=config.key;let query=Object.keys(payload).map(key=>key+'='+encodeURIComponent(payload[key])).join('&');return config.endpoint+path+((query)?'?'+query:'');}};let database={listCollections:function(search='',limit=25,offset=0,orderType='ASC'){let path='/database/collections';let payload={};if(search){payload['search']=search;}
|
||||
if(limit){payload['limit']=limit;}
|
||||
if(offset){payload['offset']=offset;}
|
||||
if(orderType){payload['orderType']=orderType;}
|
||||
|
@ -141,7 +138,8 @@ if(read){payload['read']=read;}
|
|||
if(write){payload['write']=write;}
|
||||
return http.patch(path,{'content-type':'application/json',},payload);},deleteDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
if(documentId===undefined){throw new Error('Missing required parameter: "documentId"');}
|
||||
let path='/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);}};let locale={get:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getContinents:function(){let path='/locale/continents';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let projects={list:function(){let path='/projects';let payload={};return http.get(path,{'content-type':'application/json',},payload);},create:function(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getCollectionLogs:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');}
|
||||
let path='/database/collections/{collectionId}/logs'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let health={get:function(){let path='/health';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getAntiVirus:function(){let path='/health/anti-virus';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCache:function(){let path='/health/cache';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getDB:function(){let path='/health/db';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueCertificates:function(){let path='/health/queue/certificates';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueFunctions:function(){let path='/health/queue/functions';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueLogs:function(){let path='/health/queue/logs';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueTasks:function(){let path='/health/queue/tasks';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueUsage:function(){let path='/health/queue/usage';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueWebhooks:function(){let path='/health/queue/webhooks';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getStorageLocal:function(){let path='/health/storage/local';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getTime:function(){let path='/health/time';let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let locale={get:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getContinents:function(){let path='/locale/continents';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let projects={list:function(){let path='/projects';let payload={};return http.get(path,{'content-type':'application/json',},payload);},create:function(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/projects';let payload={};if(name){payload['name']=name;}
|
||||
if(teamId){payload['teamId']=teamId;}
|
||||
|
@ -259,7 +257,7 @@ if(httpUser){payload['httpUser']=httpUser;}
|
|||
if(httpPass){payload['httpPass']=httpPass;}
|
||||
return http.put(path,{'content-type':'application/json',},payload);},deleteTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
if(taskId===undefined){throw new Error('Missing required parameter: "taskId"');}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getUsage:function(projectId,range='monthly'){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getUsage:function(projectId,range='last30'){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/usage'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(range){payload['range']=range;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);},listWebhooks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},createWebhook:function(projectId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');}
|
||||
|
@ -327,8 +325,12 @@ let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payloa
|
|||
if(name===undefined){throw new Error('Missing required parameter: "name"');}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(name){payload['name']=name;}
|
||||
return http.put(path,{'content-type':'application/json',},payload);},delete:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getMemberships:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},createMembership:function(teamId,email,roles,url,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getMemberships:function(teamId,search='',limit=25,offset=0,orderType='ASC'){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(search){payload['search']=search;}
|
||||
if(limit){payload['limit']=limit;}
|
||||
if(offset){payload['offset']=offset;}
|
||||
if(orderType){payload['orderType']=orderType;}
|
||||
return http.get(path,{'content-type':'application/json',},payload);},createMembership:function(teamId,email,roles,url,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');}
|
||||
if(email===undefined){throw new Error('Missing required parameter: "email"');}
|
||||
if(roles===undefined){throw new Error('Missing required parameter: "roles"');}
|
||||
if(url===undefined){throw new Error('Missing required parameter: "url"');}
|
||||
|
@ -366,7 +368,7 @@ if(sessionId===undefined){throw new Error('Missing required parameter: "sessionI
|
|||
let path='/users/{userId}/sessions/{sessionId}'.replace(new RegExp('{userId}','g'),userId).replace(new RegExp('{sessionId}','g'),sessionId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},updateStatus:function(userId,status){if(userId===undefined){throw new Error('Missing required parameter: "userId"');}
|
||||
if(status===undefined){throw new Error('Missing required parameter: "status"');}
|
||||
let path='/users/{userId}/status'.replace(new RegExp('{userId}','g'),userId);let payload={};if(status){payload['status']=status;}
|
||||
return http.patch(path,{'content-type':'application/json',},payload);}};return{setEndpoint:setEndpoint,setProject:setProject,setKey:setKey,setLocale:setLocale,setMode:setMode,account:account,avatars:avatars,database:database,locale:locale,projects:projects,storage:storage,teams:teams,users:users};};if(typeof module!=="undefined"){module.exports=window.Appwrite;}})((typeof window!=="undefined")?window:{});(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<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){var colorNames=require(5);module.exports={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}
|
||||
return http.patch(path,{'content-type':'application/json',},payload);}};return{setEndpoint:setEndpoint,setProject:setProject,setKey:setKey,setLocale:setLocale,setMode:setMode,account:account,avatars:avatars,database:database,health:health,locale:locale,projects:projects,storage:storage,teams:teams,users:users};};if(typeof module!=="undefined"){module.exports=window.Appwrite;}})((typeof window!=="undefined")?window:{});(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<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){var colorNames=require(5);module.exports={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})$/i,hex=/^#([a-fA-F0-9]{6})$/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);if(match){match=match[1];for(var i=0;i<rgb.length;i++){rgb[i]=parseInt(match[i]+match[i],16);}}
|
||||
else if(match=string.match(hex)){match=match[1];for(var i=0;i<rgb.length;i++){rgb[i]=parseInt(match.slice(i*2,i*2+2),16);}}
|
||||
|
|
29
public/dist/scripts/app.js
vendored
29
public/dist/scripts/app.js
vendored
|
@ -248,29 +248,11 @@ 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<value.length;i++){if(/\s/g.test(value[i])){continue;}
|
||||
if(-1===special.indexOf(value[i])){var firstChar=value[i];break;}}
|
||||
if(-1<rtlStock.indexOf("^"+firstChar+"^")){return true;}
|
||||
return false;};return{isRTL:isRTL,};},true);})(window);(function(window){"use strict";window.ls.container.set('sdk',function(window,router){var sdk=new window.Appwrite();sdk.setEndpoint(APP_ENV.API).setProject(router.params.project||'').setLocale(APP_ENV.LOCALE).setMode('admin');return sdk;},false);})(window);(function(window){"use strict";window.ls.container.set('search',function(window){return{params:{},path:'',pointer:'',selected:'',};},true,true);})(window);(function(window){"use strict";window.ls.container.set('timezone',function(){return{convert:function(unixTime){var timezoneMinutes=new Date().getTimezoneOffset();timezoneMinutes=(timezoneMinutes===0)?0:-timezoneMinutes;return parseInt(unixTime)+(timezoneMinutes*60);}};},true);})(window);window.ls.router.add("/auth/signin",{template:"/auth/signin?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/signup",{template:"/auth/signup?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/recovery",{template:"/auth/recovery?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/recovery/reset",{template:"/auth/recovery/reset?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/confirm",{template:"/auth/confirm?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/join",{template:"/auth/join?version="+APP_ENV.VERSION,scope:"home"}).add("/console",{template:"/console?version="+APP_ENV.VERSION,scope:"console"}).add("/console/account",{template:"/console/account?version="+APP_ENV.VERSION,scope:"console"}).add("/console/account/:tab",{template:"/console/account?version="+APP_ENV.VERSION,scope:"console"}).add("/console/home",{template:"/console/home?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/home/:tab",{template:"/console/home?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/platforms/:platform",{template:function(window){return window.location.pathname+"?version="+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/notifications",{template:"/console/notifications?version="+APP_ENV.VERSION,scope:"console"}).add("/console/settings",{template:"/console/settings?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/settings/:tab",{template:"/console/settings?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/webhooks",{template:"/console/webhooks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/webhooks/:tab",{template:"/console/webhooks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/keys",{template:"/console/keys?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/keys/:tab",{template:"/console/keys?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/tasks",{template:"/console/tasks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/tasks/:tab",{template:"/console/tasks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/database",{template:"/console/database?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/database/collection",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/database/collection/:tab",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/database/document",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/database/document/:tab",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/storage",{template:"/console/storage?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/storage/:tab",{template:"/console/storage?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users",{template:"/console/users?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/view",{template:"/console/users/view?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/view/:tab",{template:"/console/users/view?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/:tab",{template:"/console/users?version="+APP_ENV.VERSION,scope:"console",project:true});window.ls.filter.add("gravatar",function($value,element){if(!$value){return"";}
|
||||
let MD5=function(s){function L(k,d){return(k<<d)|(k>>>(32-d));}
|
||||
function K(G,k){let I,d,F,H,x;F=G&2147483648;H=k&2147483648;I=G&1073741824;d=k&1073741824;x=(G&1073741823)+(k&1073741823);if(I&d){return x^2147483648^F^H;}
|
||||
if(I|d){if(x&1073741824){return x^3221225472^F^H;}else{return x^1073741824^F^H;}}else{return x^F^H;}}
|
||||
function r(d,F,k){return(d&F)|(~d&k);}
|
||||
function q(d,F,k){return(d&k)|(F&~k);}
|
||||
function p(d,F,k){return d^F^k;}
|
||||
function n(d,F,k){return F^(d|~k);}
|
||||
function u(G,F,aa,Z,k,H,I){G=K(G,K(K(r(F,aa,Z),k),I));return K(L(G,H),F);}
|
||||
function f(G,F,aa,Z,k,H,I){G=K(G,K(K(q(F,aa,Z),k),I));return K(L(G,H),F);}
|
||||
function D(G,F,aa,Z,k,H,I){G=K(G,K(K(p(F,aa,Z),k),I));return K(L(G,H),F);}
|
||||
function t(G,F,aa,Z,k,H,I){G=K(G,K(K(n(F,aa,Z),k),I));return K(L(G,H),F);}
|
||||
function e(G){let Z;let F=G.length;let x=F+8;let k=(x-(x%64))/64;let I=(k+1)*16;let aa=Array(I-1);let d=0;let H=0;while(H<F){Z=(H-(H%4))/4;d=(H%4)*8;aa[Z]=aa[Z]|(G.charCodeAt(H)<<d);H++;}
|
||||
Z=(H-(H%4))/4;d=(H%4)*8;aa[Z]=aa[Z]|(128<<d);aa[I-2]=F<<3;aa[I-1]=F>>>29;return aa;}
|
||||
function B(x){let k="",F="",G,d;for(d=0;d<=3;d++){G=(x>>>(d*8))&255;F="0"+G.toString(16);k=k+F.substr(F.length-2,2);}
|
||||
return k;}
|
||||
function J(k){k=k.replace(/rn/g,"n");let d="";for(let F=0;F<k.length;F++){let x=k.charCodeAt(F);if(x<128){d+=String.fromCharCode(x);}else{if(x>127&&x<2048){d+=String.fromCharCode((x>>6)|192);d+=String.fromCharCode((x&63)|128);}else{d+=String.fromCharCode((x>>12)|224);d+=String.fromCharCode(((x>>6)&63)|128);d+=String.fromCharCode((x&63)|128);}}}
|
||||
return d;}
|
||||
let C=Array();let P,h,E,v,g,Y,X,W,V;let S=7,Q=12,N=17,M=22;let A=5,z=9,y=14,w=20;let o=4,m=11,l=16,j=23;let U=6,T=10,R=15,O=21;s=J(s);C=e(s);Y=1732584193;X=4023233417;W=2562383102;V=271733878;for(P=0;P<C.length;P+=16){h=Y;E=X;v=W;g=V;Y=u(Y,X,W,V,C[P+0],S,3614090360);V=u(V,Y,X,W,C[P+1],Q,3905402710);W=u(W,V,Y,X,C[P+2],N,606105819);X=u(X,W,V,Y,C[P+3],M,3250441966);Y=u(Y,X,W,V,C[P+4],S,4118548399);V=u(V,Y,X,W,C[P+5],Q,1200080426);W=u(W,V,Y,X,C[P+6],N,2821735955);X=u(X,W,V,Y,C[P+7],M,4249261313);Y=u(Y,X,W,V,C[P+8],S,1770035416);V=u(V,Y,X,W,C[P+9],Q,2336552879);W=u(W,V,Y,X,C[P+10],N,4294925233);X=u(X,W,V,Y,C[P+11],M,2304563134);Y=u(Y,X,W,V,C[P+12],S,1804603682);V=u(V,Y,X,W,C[P+13],Q,4254626195);W=u(W,V,Y,X,C[P+14],N,2792965006);X=u(X,W,V,Y,C[P+15],M,1236535329);Y=f(Y,X,W,V,C[P+1],A,4129170786);V=f(V,Y,X,W,C[P+6],z,3225465664);W=f(W,V,Y,X,C[P+11],y,643717713);X=f(X,W,V,Y,C[P+0],w,3921069994);Y=f(Y,X,W,V,C[P+5],A,3593408605);V=f(V,Y,X,W,C[P+10],z,38016083);W=f(W,V,Y,X,C[P+15],y,3634488961);X=f(X,W,V,Y,C[P+4],w,3889429448);Y=f(Y,X,W,V,C[P+9],A,568446438);V=f(V,Y,X,W,C[P+14],z,3275163606);W=f(W,V,Y,X,C[P+3],y,4107603335);X=f(X,W,V,Y,C[P+8],w,1163531501);Y=f(Y,X,W,V,C[P+13],A,2850285829);V=f(V,Y,X,W,C[P+2],z,4243563512);W=f(W,V,Y,X,C[P+7],y,1735328473);X=f(X,W,V,Y,C[P+12],w,2368359562);Y=D(Y,X,W,V,C[P+5],o,4294588738);V=D(V,Y,X,W,C[P+8],m,2272392833);W=D(W,V,Y,X,C[P+11],l,1839030562);X=D(X,W,V,Y,C[P+14],j,4259657740);Y=D(Y,X,W,V,C[P+1],o,2763975236);V=D(V,Y,X,W,C[P+4],m,1272893353);W=D(W,V,Y,X,C[P+7],l,4139469664);X=D(X,W,V,Y,C[P+10],j,3200236656);Y=D(Y,X,W,V,C[P+13],o,681279174);V=D(V,Y,X,W,C[P+0],m,3936430074);W=D(W,V,Y,X,C[P+3],l,3572445317);X=D(X,W,V,Y,C[P+6],j,76029189);Y=D(Y,X,W,V,C[P+9],o,3654602809);V=D(V,Y,X,W,C[P+12],m,3873151461);W=D(W,V,Y,X,C[P+15],l,530742520);X=D(X,W,V,Y,C[P+2],j,3299628645);Y=t(Y,X,W,V,C[P+0],U,4096336452);V=t(V,Y,X,W,C[P+7],T,1126891415);W=t(W,V,Y,X,C[P+14],R,2878612391);X=t(X,W,V,Y,C[P+5],O,4237533241);Y=t(Y,X,W,V,C[P+12],U,1700485571);V=t(V,Y,X,W,C[P+3],T,2399980690);W=t(W,V,Y,X,C[P+10],R,4293915773);X=t(X,W,V,Y,C[P+1],O,2240044497);Y=t(Y,X,W,V,C[P+8],U,1873313359);V=t(V,Y,X,W,C[P+15],T,4264355552);W=t(W,V,Y,X,C[P+6],R,2734768916);X=t(X,W,V,Y,C[P+13],O,1309151649);Y=t(Y,X,W,V,C[P+4],U,4149444226);V=t(V,Y,X,W,C[P+11],T,3174756917);W=t(W,V,Y,X,C[P+2],R,718787259);X=t(X,W,V,Y,C[P+9],O,3951481745);Y=K(Y,h);X=K(X,E);W=K(W,v);V=K(V,g);}
|
||||
let i=B(Y)+B(X)+B(W)+B(V);return i.toLowerCase();};let size=element.dataset["size"]||80;let email=$value.email||$value||"";let name=$value.name||$value||"";name=(typeof name!=='string')?'--':name;let def="/v1/avatars/initials?project=console"+"&name="+
|
||||
return false;};return{isRTL:isRTL,};},true);})(window);(function(window){"use strict";window.ls.container.set('sdk',function(window,router){var sdk=new window.Appwrite();sdk.setEndpoint(APP_ENV.API).setProject(router.params.project||'').setLocale(APP_ENV.LOCALE).setMode('admin');return sdk;},false);})(window);(function(window){"use strict";window.ls.container.set('search',function(window){return{params:{},path:'',pointer:'',selected:'',};},true,true);})(window);(function(window){"use strict";window.ls.container.set('timezone',function(){return{convert:function(unixTime){var timezoneMinutes=new Date().getTimezoneOffset();timezoneMinutes=(timezoneMinutes===0)?0:-timezoneMinutes;return parseInt(unixTime)+(timezoneMinutes*60);}};},true);})(window);window.ls.router.add("/auth/signin",{template:"/auth/signin?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/signup",{template:"/auth/signup?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/recovery",{template:"/auth/recovery?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/recovery/reset",{template:"/auth/recovery/reset?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/confirm",{template:"/auth/confirm?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/join",{template:"/auth/join?version="+APP_ENV.VERSION,scope:"home"}).add("/console",{template:"/console?version="+APP_ENV.VERSION,scope:"console"}).add("/console/account",{template:"/console/account?version="+APP_ENV.VERSION,scope:"console"}).add("/console/account/:tab",{template:"/console/account?version="+APP_ENV.VERSION,scope:"console"}).add("/console/home",{template:"/console/home?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/home/:tab",{template:"/console/home?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/platforms/:platform",{template:function(window){return window.location.pathname+"?version="+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/notifications",{template:"/console/notifications?version="+APP_ENV.VERSION,scope:"console"}).add("/console/settings",{template:"/console/settings?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/settings/:tab",{template:"/console/settings?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/webhooks",{template:"/console/webhooks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/webhooks/:tab",{template:"/console/webhooks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/keys",{template:"/console/keys?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/keys/:tab",{template:"/console/keys?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/tasks",{template:"/console/tasks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/tasks/:tab",{template:"/console/tasks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/database",{template:"/console/database?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/database/collection",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/database/collection/:tab",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/database/document",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/database/document/:tab",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/storage",{template:"/console/storage?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/storage/:tab",{template:"/console/storage?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users",{template:"/console/users?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/user",{template:"/console/users/user?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/user/:tab",{template:"/console/users/user?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/teams/team",{template:"/console/users/teams/team?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/teams/team/:tab",{template:"/console/users/teams/team?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/:tab",{template:"/console/users?version="+APP_ENV.VERSION,scope:"console",project:true});window.ls.filter.add("avatar",function($value,element){if(!$value){return"";}
|
||||
let size=element.dataset["size"]||80;let name=$value.name||$value||"";name=(typeof name!=='string')?'--':name;return def="/v1/avatars/initials?project=console"+"&name="+
|
||||
encodeURIComponent(name)+"&width="+
|
||||
size+"&height="+
|
||||
size;return def;}).add("selectedCollection",function($value,router){return $value===router.params.collectionId?"selected":"";}).add("selectedDocument",function($value,router){return $value===router.params.documentId?"selected":"";}).add("localeString",function($value){$value=parseInt($value);return!Number.isNaN($value)?$value.toLocaleString():"";}).add("date",function($value,date){return date.format("Y-m-d",$value);}).add("date-time",function($value,date){return date.format("Y-m-d H:i",$value);}).add("date-text",function($value,date){return date.format("d M Y",$value);}).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 ":"")+
|
||||
size;}).add("selectedCollection",function($value,router){return $value===router.params.collectionId?"selected":"";}).add("selectedDocument",function($value,router){return $value===router.params.documentId?"selected":"";}).add("localeString",function($value){$value=parseInt($value);return!Number.isNaN($value)?$value.toLocaleString():"";}).add("date",function($value,date){return date.format("Y-m-d",$value);}).add("date-time",function($value,date){return date.format("Y-m-d H:i",$value);}).add("date-text",function($value,date){return date.format("d M Y",$value);}).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 ":"")+
|
||||
|
@ -283,7 +265,8 @@ $value=abbreviate($value,0,false,false);return $value==="0"?"N/A":$value;}).add(
|
|||
return result.length;}).add("documentAction",function(container){let collection=container.get('project-collection');let document=container.get('project-document');if(collection&&document&&!document.$id){return'database.createDocument';}
|
||||
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;;});function abbreviate(number,maxPlaces,forcePlaces,forceLetter){number=Number(number);forceLetter=forceLetter||false;if(forceLetter!==false){return annotate(number,maxPlaces,forcePlaces,forceLetter);}
|
||||
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);}
|
||||
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;}
|
||||
|
@ -350,7 +333,7 @@ return{key:filter[0],value:filter[1],operator:operator};};let flatten=function(p
|
|||
list["filters-"+filter.key]=params[key][i];}}}}
|
||||
return list;};let apply=function(params){let cached=container.get(name);cached=cached?cached.params:[];params=Object.assign(cached,params);container.set(name,{name:name,params:params,query:serialize(params),forward:parseInt(params.offset)+parseInt(params.limit),backward:parseInt(params.offset)-parseInt(params.limit),keys:flatten(params)},true,name);document.dispatchEvent(new CustomEvent(name+"-changed",{bubbles:false,cancelable:true}));};switch(element.tagName){case"INPUT":break;case"TEXTAREA":break;case"BUTTON":element.addEventListener("click",function(){apply(JSON.parse(expression.parse(element.dataset["params"]||"{}")));});break;case"FORM":element.addEventListener("input",function(){apply(form.toJson(element));});element.addEventListener("change",function(){apply(form.toJson(element));});element.addEventListener("reset",function(){setTimeout(function(){apply(form.toJson(element));},0);});events=events.trim().split(",");for(let y=0;y<events.length;y++){if(events[y]==="init"){element.addEventListener("rendered",function(){apply(form.toJson(element));},{once:true});}else{}
|
||||
element.setAttribute("data-event","none");}
|
||||
break;default:break;}}});})(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){element.parentNode.insertBefore(element.nextElementSibling,element);element.scrollIntoView(true);}});});}});})(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){element.parentNode.insertBefore(element,element.previousElementSibling);element.scrollIntoView(true);}});});}});})(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<titles.length;++i){let title=titles[i];let distance=title.getBoundingClientRect().top;console.log(i);if((minDistance===null||minDistance>=distance)&&(distance>=0)){if(minLink){minLink.classList.remove('selected');}
|
||||
break;default:break;}}});})(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<titles.length;++i){let title=titles[i];let distance=title.getBoundingClientRect().top;console.log(i);if((minDistance===null||minDistance>=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');}
|
||||
|
|
2
public/dist/styles/default-ltr.css
vendored
2
public/dist/styles/default-ltr.css
vendored
File diff suppressed because one or more lines are too long
2
public/dist/styles/default-rtl.css
vendored
2
public/dist/styles/default-rtl.css
vendored
File diff suppressed because one or more lines are too long
|
@ -286,28 +286,6 @@
|
|||
}
|
||||
}(window.document);
|
||||
|
||||
let iframe = function(method, url, params) {
|
||||
let form = document.createElement('form');
|
||||
|
||||
form.setAttribute('method', method);
|
||||
form.setAttribute('action', config.endpoint + url);
|
||||
|
||||
for(let key in params) {
|
||||
if(params.hasOwnProperty(key)) {
|
||||
let hiddenField = document.createElement("input");
|
||||
hiddenField.setAttribute("type", "hidden");
|
||||
hiddenField.setAttribute("name", key);
|
||||
hiddenField.setAttribute("value", params[key]);
|
||||
|
||||
form.appendChild(hiddenField);
|
||||
}
|
||||
}
|
||||
|
||||
document.body.appendChild(form);
|
||||
|
||||
return form.submit();
|
||||
};
|
||||
|
||||
let account = {
|
||||
|
||||
/**
|
||||
|
@ -334,10 +312,10 @@
|
|||
*
|
||||
* Use this endpoint to allow a new user to register a new account in your
|
||||
* project. After the user registration completes successfully, you can use
|
||||
* the [/account/verfication](/docs/account#createVerification) route to start
|
||||
* verifying the user email address. To allow your new user to login to his
|
||||
* new account, you need to create a new [account
|
||||
* session](/docs/account#createSession).
|
||||
* the [/account/verfication](/docs/client/account#createVerification) route
|
||||
* to start verifying the user email address. To allow your new user to login
|
||||
* to his new account, you need to create a new [account
|
||||
* session](/docs/client/account#createSession).
|
||||
*
|
||||
* @param {string} email
|
||||
* @param {string} password
|
||||
|
@ -580,7 +558,7 @@
|
|||
* When the user clicks the confirmation link he is redirected back to your
|
||||
* app password reset URL with the secret key and email address values
|
||||
* attached to the URL query string. Use the query string params to submit a
|
||||
* request to the [PUT /account/recovery](/docs/account#updateRecovery)
|
||||
* request to the [PUT /account/recovery](/docs/client/account#updateRecovery)
|
||||
* endpoint to complete the process.
|
||||
*
|
||||
* @param {string} email
|
||||
|
@ -621,7 +599,7 @@
|
|||
* Use this endpoint to complete the user account password reset. Both the
|
||||
* **userId** and **secret** arguments will be passed as query parameters to
|
||||
* the redirect URL you have provided when sending your request to the [POST
|
||||
* /account/recovery](/docs/account#createRecovery) endpoint.
|
||||
* /account/recovery](/docs/client/account#createRecovery) endpoint.
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -768,21 +746,13 @@
|
|||
* @param {string} success
|
||||
* @param {string} failure
|
||||
* @throws {Error}
|
||||
* @return {string}
|
||||
* @return {Promise}
|
||||
*/
|
||||
createOAuth2Session: function(provider, success, failure) {
|
||||
createOAuth2Session: function(provider, success = 'https://appwrite.io/auth/oauth2/success', failure = 'https://appwrite.io/auth/oauth2/failure') {
|
||||
if(provider === undefined) {
|
||||
throw new Error('Missing required parameter: "provider"');
|
||||
}
|
||||
|
||||
if(success === undefined) {
|
||||
throw new Error('Missing required parameter: "success"');
|
||||
}
|
||||
|
||||
if(failure === undefined) {
|
||||
throw new Error('Missing required parameter: "failure"');
|
||||
}
|
||||
|
||||
let path = '/account/sessions/oauth2/{provider}'.replace(new RegExp('{provider}', 'g'), provider);
|
||||
|
||||
let payload = {};
|
||||
|
@ -800,8 +770,8 @@
|
|||
payload['key'] = config.key;
|
||||
|
||||
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
|
||||
|
||||
return config.endpoint + path + ((query) ? '?' + query : '');
|
||||
|
||||
window.location = config.endpoint + path + ((query) ? '?' + query : '');
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -840,7 +810,7 @@
|
|||
* should redirect the user back for your app and allow you to complete the
|
||||
* verification process by verifying both the **userId** and **secret**
|
||||
* parameters. Learn more about how to [complete the verification
|
||||
* process](/docs/account#updateAccountVerification).
|
||||
* process](/docs/client/account#updateAccountVerification).
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -926,7 +896,7 @@
|
|||
* @param {number} height
|
||||
* @param {number} quality
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
* @return {string}
|
||||
*/
|
||||
getBrowser: function(code, width = 100, height = 100, quality = 100) {
|
||||
if(code === undefined) {
|
||||
|
@ -949,10 +919,13 @@
|
|||
payload['quality'] = quality;
|
||||
}
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
payload['project'] = config.project;
|
||||
|
||||
payload['key'] = config.key;
|
||||
|
||||
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
|
||||
|
||||
return config.endpoint + path + ((query) ? '?' + query : '');
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -968,7 +941,7 @@
|
|||
* @param {number} height
|
||||
* @param {number} quality
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
* @return {string}
|
||||
*/
|
||||
getCreditCard: function(code, width = 100, height = 100, quality = 100) {
|
||||
if(code === undefined) {
|
||||
|
@ -991,10 +964,13 @@
|
|||
payload['quality'] = quality;
|
||||
}
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
payload['project'] = config.project;
|
||||
|
||||
payload['key'] = config.key;
|
||||
|
||||
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
|
||||
|
||||
return config.endpoint + path + ((query) ? '?' + query : '');
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1005,7 +981,7 @@
|
|||
*
|
||||
* @param {string} url
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
* @return {string}
|
||||
*/
|
||||
getFavicon: function(url) {
|
||||
if(url === undefined) {
|
||||
|
@ -1020,10 +996,13 @@
|
|||
payload['url'] = url;
|
||||
}
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
payload['project'] = config.project;
|
||||
|
||||
payload['key'] = config.key;
|
||||
|
||||
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
|
||||
|
||||
return config.endpoint + path + ((query) ? '?' + query : '');
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1038,7 +1017,7 @@
|
|||
* @param {number} height
|
||||
* @param {number} quality
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
* @return {string}
|
||||
*/
|
||||
getFlag: function(code, width = 100, height = 100, quality = 100) {
|
||||
if(code === undefined) {
|
||||
|
@ -1061,10 +1040,13 @@
|
|||
payload['quality'] = quality;
|
||||
}
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
payload['project'] = config.project;
|
||||
|
||||
payload['key'] = config.key;
|
||||
|
||||
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
|
||||
|
||||
return config.endpoint + path + ((query) ? '?' + query : '');
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1079,7 +1061,7 @@
|
|||
* @param {number} width
|
||||
* @param {number} height
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
* @return {string}
|
||||
*/
|
||||
getImage: function(url, width = 400, height = 400) {
|
||||
if(url === undefined) {
|
||||
|
@ -1102,10 +1084,13 @@
|
|||
payload['height'] = height;
|
||||
}
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
payload['project'] = config.project;
|
||||
|
||||
payload['key'] = config.key;
|
||||
|
||||
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
|
||||
|
||||
return config.endpoint + path + ((query) ? '?' + query : '');
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1119,7 +1104,7 @@
|
|||
* @param {number} margin
|
||||
* @param {number} download
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
* @return {string}
|
||||
*/
|
||||
getQR: function(text, size = 400, margin = 1, download = 0) {
|
||||
if(text === undefined) {
|
||||
|
@ -1146,10 +1131,13 @@
|
|||
payload['download'] = download;
|
||||
}
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
payload['project'] = config.project;
|
||||
|
||||
payload['key'] = config.key;
|
||||
|
||||
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
|
||||
|
||||
return config.endpoint + path + ((query) ? '?' + query : '');
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1203,9 +1191,9 @@
|
|||
* Create a new Collection.
|
||||
*
|
||||
* @param {string} name
|
||||
* @param {array} read
|
||||
* @param {array} write
|
||||
* @param {array} rules
|
||||
* @param {string[]} read
|
||||
* @param {string[]} write
|
||||
* @param {string[]} rules
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
@ -1284,9 +1272,9 @@
|
|||
*
|
||||
* @param {string} collectionId
|
||||
* @param {string} name
|
||||
* @param {array} read
|
||||
* @param {array} write
|
||||
* @param {array} rules
|
||||
* @param {string[]} read
|
||||
* @param {string[]} write
|
||||
* @param {string[]} rules
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
@ -1367,7 +1355,7 @@
|
|||
* modes](/docs/admin).
|
||||
*
|
||||
* @param {string} collectionId
|
||||
* @param {array} filters
|
||||
* @param {string[]} filters
|
||||
* @param {number} offset
|
||||
* @param {number} limit
|
||||
* @param {string} orderField
|
||||
|
@ -1433,12 +1421,15 @@
|
|||
/**
|
||||
* Create Document
|
||||
*
|
||||
* Create a new Document.
|
||||
* Create a new Document. Before using this route, you should create a new
|
||||
* collection resource using either a [server
|
||||
* integration](/docs/server/database?sdk=nodejs#createCollection) API or
|
||||
* directly from your database console.
|
||||
*
|
||||
* @param {string} collectionId
|
||||
* @param {object} data
|
||||
* @param {array} read
|
||||
* @param {array} write
|
||||
* @param {string[]} read
|
||||
* @param {string[]} write
|
||||
* @param {string} parentDocument
|
||||
* @param {string} parentProperty
|
||||
* @param {string} parentPropertyType
|
||||
|
@ -1533,8 +1524,8 @@
|
|||
* @param {string} collectionId
|
||||
* @param {string} documentId
|
||||
* @param {object} data
|
||||
* @param {array} read
|
||||
* @param {array} write
|
||||
* @param {string[]} read
|
||||
* @param {string[]} write
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
@ -1610,6 +1601,272 @@
|
|||
.delete(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Collection Logs
|
||||
*
|
||||
*
|
||||
* @param {string} collectionId
|
||||
* @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);
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
}
|
||||
};
|
||||
|
||||
let health = {
|
||||
|
||||
/**
|
||||
* Get HTTP
|
||||
*
|
||||
* Check the Appwrite HTTP server is up and responsive.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
get: function() {
|
||||
let path = '/health';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Anti virus
|
||||
*
|
||||
* Check the Appwrite Anti Virus server is up and connection is successful.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getAntiVirus: function() {
|
||||
let path = '/health/anti-virus';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Cache
|
||||
*
|
||||
* Check the Appwrite in-memory cache server is up and connection is
|
||||
* successful.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getCache: function() {
|
||||
let path = '/health/cache';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get DB
|
||||
*
|
||||
* Check the Appwrite database server is up and connection is successful.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getDB: function() {
|
||||
let path = '/health/db';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Certificate Queue
|
||||
*
|
||||
* Get the number of certificates that are waiting to be issued against
|
||||
* [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue
|
||||
* server.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getQueueCertificates: function() {
|
||||
let path = '/health/queue/certificates';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Functions Queue
|
||||
*
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getQueueFunctions: function() {
|
||||
let path = '/health/queue/functions';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Logs Queue
|
||||
*
|
||||
* Get the number of logs that are waiting to be processed in the Appwrite
|
||||
* internal queue server.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getQueueLogs: function() {
|
||||
let path = '/health/queue/logs';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Tasks Queue
|
||||
*
|
||||
* Get the number of tasks that are waiting to be processed in the Appwrite
|
||||
* internal queue server.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getQueueTasks: function() {
|
||||
let path = '/health/queue/tasks';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Usage Queue
|
||||
*
|
||||
* Get the number of usage stats that are waiting to be processed in the
|
||||
* Appwrite internal queue server.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getQueueUsage: function() {
|
||||
let path = '/health/queue/usage';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Webhooks Queue
|
||||
*
|
||||
* Get the number of webhooks that are waiting to be processed in the Appwrite
|
||||
* internal queue server.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getQueueWebhooks: function() {
|
||||
let path = '/health/queue/webhooks';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Local Storage
|
||||
*
|
||||
* Check the Appwrite local storage device is up and connection is successful.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getStorageLocal: function() {
|
||||
let path = '/health/storage/local';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get Time
|
||||
*
|
||||
* Check the Appwrite server time is synced with Google remote NTP server. We
|
||||
* use this technology to smoothly handle leap seconds with no disruptive
|
||||
* events. The [Network Time
|
||||
* Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is
|
||||
* used by hundreds of millions of computers and devices to synchronize their
|
||||
* clocks over the Internet. If your computer sets its own clock, it likely
|
||||
* uses NTP.
|
||||
*
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getTime: function() {
|
||||
let path = '/health/time';
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1640,7 +1897,7 @@
|
|||
},
|
||||
|
||||
/**
|
||||
* List Countries
|
||||
* List Continents
|
||||
*
|
||||
* List of all continents. You can use the locale header to get the data in a
|
||||
* supported language.
|
||||
|
@ -2142,7 +2399,7 @@
|
|||
*
|
||||
* @param {string} projectId
|
||||
* @param {string} name
|
||||
* @param {array} scopes
|
||||
* @param {string[]} scopes
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
@ -2212,7 +2469,7 @@
|
|||
* @param {string} projectId
|
||||
* @param {string} keyId
|
||||
* @param {string} name
|
||||
* @param {array} scopes
|
||||
* @param {string[]} scopes
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
@ -2542,7 +2799,7 @@
|
|||
* @param {number} security
|
||||
* @param {string} httpMethod
|
||||
* @param {string} httpUrl
|
||||
* @param {array} httpHeaders
|
||||
* @param {string[]} httpHeaders
|
||||
* @param {string} httpUser
|
||||
* @param {string} httpPass
|
||||
* @throws {Error}
|
||||
|
@ -2663,7 +2920,7 @@
|
|||
* @param {number} security
|
||||
* @param {string} httpMethod
|
||||
* @param {string} httpUrl
|
||||
* @param {array} httpHeaders
|
||||
* @param {string[]} httpHeaders
|
||||
* @param {string} httpUser
|
||||
* @param {string} httpPass
|
||||
* @throws {Error}
|
||||
|
@ -2781,10 +3038,11 @@
|
|||
*
|
||||
*
|
||||
* @param {string} projectId
|
||||
* @param {string} range
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getUsage: function(projectId, range = 'monthly') {
|
||||
getUsage: function(projectId, range = 'last30') {
|
||||
if(projectId === undefined) {
|
||||
throw new Error('Missing required parameter: "projectId"');
|
||||
}
|
||||
|
@ -2832,7 +3090,7 @@
|
|||
*
|
||||
* @param {string} projectId
|
||||
* @param {string} name
|
||||
* @param {array} events
|
||||
* @param {string[]} events
|
||||
* @param {string} url
|
||||
* @param {number} security
|
||||
* @param {string} httpUser
|
||||
|
@ -2930,7 +3188,7 @@
|
|||
* @param {string} projectId
|
||||
* @param {string} webhookId
|
||||
* @param {string} name
|
||||
* @param {array} events
|
||||
* @param {string[]} events
|
||||
* @param {string} url
|
||||
* @param {number} security
|
||||
* @param {string} httpUser
|
||||
|
@ -3077,8 +3335,8 @@
|
|||
* read and write arguments.
|
||||
*
|
||||
* @param {File} file
|
||||
* @param {array} read
|
||||
* @param {array} write
|
||||
* @param {string[]} read
|
||||
* @param {string[]} write
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
@ -3149,8 +3407,8 @@
|
|||
* to update this resource.
|
||||
*
|
||||
* @param {string} fileId
|
||||
* @param {array} read
|
||||
* @param {array} write
|
||||
* @param {string[]} read
|
||||
* @param {string[]} write
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
@ -3235,7 +3493,7 @@
|
|||
payload['key'] = config.key;
|
||||
|
||||
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
|
||||
|
||||
|
||||
return config.endpoint + path + ((query) ? '?' + query : '');
|
||||
},
|
||||
|
||||
|
@ -3290,7 +3548,7 @@
|
|||
payload['key'] = config.key;
|
||||
|
||||
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
|
||||
|
||||
|
||||
return config.endpoint + path + ((query) ? '?' + query : '');
|
||||
},
|
||||
|
||||
|
@ -3323,7 +3581,7 @@
|
|||
payload['key'] = config.key;
|
||||
|
||||
let query = Object.keys(payload).map(key => key + '=' + encodeURIComponent(payload[key])).join('&');
|
||||
|
||||
|
||||
return config.endpoint + path + ((query) ? '?' + query : '');
|
||||
}
|
||||
};
|
||||
|
@ -3380,7 +3638,7 @@
|
|||
* project.
|
||||
*
|
||||
* @param {string} name
|
||||
* @param {array} roles
|
||||
* @param {string[]} roles
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
@ -3498,10 +3756,14 @@
|
|||
* for this list of resources.
|
||||
*
|
||||
* @param {string} teamId
|
||||
* @param {string} search
|
||||
* @param {number} limit
|
||||
* @param {number} offset
|
||||
* @param {string} orderType
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
getMemberships: function(teamId) {
|
||||
getMemberships: function(teamId, search = '', limit = 25, offset = 0, orderType = 'ASC') {
|
||||
if(teamId === undefined) {
|
||||
throw new Error('Missing required parameter: "teamId"');
|
||||
}
|
||||
|
@ -3510,6 +3772,22 @@
|
|||
|
||||
let payload = {};
|
||||
|
||||
if(search) {
|
||||
payload['search'] = search;
|
||||
}
|
||||
|
||||
if(limit) {
|
||||
payload['limit'] = limit;
|
||||
}
|
||||
|
||||
if(offset) {
|
||||
payload['offset'] = offset;
|
||||
}
|
||||
|
||||
if(orderType) {
|
||||
payload['orderType'] = orderType;
|
||||
}
|
||||
|
||||
return http
|
||||
.get(path, {
|
||||
'content-type': 'application/json',
|
||||
|
@ -3525,8 +3803,8 @@
|
|||
*
|
||||
* Use the 'URL' parameter to redirect the user from the invitation email back
|
||||
* to your app. When the user is redirected, use the [Update Team Membership
|
||||
* Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to
|
||||
* accept the invitation to the team.
|
||||
* Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the
|
||||
* user to accept the invitation to the team.
|
||||
*
|
||||
* Please note that in order to avoid a [Redirect
|
||||
* Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
|
@ -3535,7 +3813,7 @@
|
|||
*
|
||||
* @param {string} teamId
|
||||
* @param {string} email
|
||||
* @param {array} roles
|
||||
* @param {string[]} roles
|
||||
* @param {string} url
|
||||
* @param {string} name
|
||||
* @throws {Error}
|
||||
|
@ -3922,10 +4200,7 @@
|
|||
throw new Error('Missing required parameter: "sessionId"');
|
||||
}
|
||||
|
||||
let path = '/users/{userId}/sessions/{sessionId}'
|
||||
.replace(new RegExp('{userId}', 'g'), userId)
|
||||
.replace(new RegExp('{sessionId}', 'g'), sessionId)
|
||||
;
|
||||
let path = '/users/{userId}/sessions/{sessionId}'.replace(new RegExp('{userId}', 'g'), userId).replace(new RegExp('{sessionId}', 'g'), sessionId);
|
||||
|
||||
let payload = {};
|
||||
|
||||
|
@ -3978,6 +4253,7 @@
|
|||
account: account,
|
||||
avatars: avatars,
|
||||
database: database,
|
||||
health: health,
|
||||
locale: locale,
|
||||
projects: projects,
|
||||
storage: storage,
|
||||
|
|
|
@ -1,257 +1,15 @@
|
|||
window.ls.filter
|
||||
.add("gravatar", function($value, element) {
|
||||
.add("avatar", function($value, element) {
|
||||
if (!$value) {
|
||||
return "";
|
||||
}
|
||||
|
||||
// MD5 (Message-Digest Algorithm) by WebToolkit
|
||||
let MD5 = function(s) {
|
||||
function L(k, d) {
|
||||
return (k << d) | (k >>> (32 - d));
|
||||
}
|
||||
function K(G, k) {
|
||||
let I, d, F, H, x;
|
||||
F = G & 2147483648;
|
||||
H = k & 2147483648;
|
||||
I = G & 1073741824;
|
||||
d = k & 1073741824;
|
||||
x = (G & 1073741823) + (k & 1073741823);
|
||||
if (I & d) {
|
||||
return x ^ 2147483648 ^ F ^ H;
|
||||
}
|
||||
if (I | d) {
|
||||
if (x & 1073741824) {
|
||||
return x ^ 3221225472 ^ F ^ H;
|
||||
} else {
|
||||
return x ^ 1073741824 ^ F ^ H;
|
||||
}
|
||||
} else {
|
||||
return x ^ F ^ H;
|
||||
}
|
||||
}
|
||||
function r(d, F, k) {
|
||||
return (d & F) | (~d & k);
|
||||
}
|
||||
function q(d, F, k) {
|
||||
return (d & k) | (F & ~k);
|
||||
}
|
||||
function p(d, F, k) {
|
||||
return d ^ F ^ k;
|
||||
}
|
||||
function n(d, F, k) {
|
||||
return F ^ (d | ~k);
|
||||
}
|
||||
function u(G, F, aa, Z, k, H, I) {
|
||||
G = K(G, K(K(r(F, aa, Z), k), I));
|
||||
return K(L(G, H), F);
|
||||
}
|
||||
function f(G, F, aa, Z, k, H, I) {
|
||||
G = K(G, K(K(q(F, aa, Z), k), I));
|
||||
return K(L(G, H), F);
|
||||
}
|
||||
function D(G, F, aa, Z, k, H, I) {
|
||||
G = K(G, K(K(p(F, aa, Z), k), I));
|
||||
return K(L(G, H), F);
|
||||
}
|
||||
function t(G, F, aa, Z, k, H, I) {
|
||||
G = K(G, K(K(n(F, aa, Z), k), I));
|
||||
return K(L(G, H), F);
|
||||
}
|
||||
function e(G) {
|
||||
let Z;
|
||||
let F = G.length;
|
||||
let x = F + 8;
|
||||
let k = (x - (x % 64)) / 64;
|
||||
let I = (k + 1) * 16;
|
||||
let aa = Array(I - 1);
|
||||
let d = 0;
|
||||
let H = 0;
|
||||
while (H < F) {
|
||||
Z = (H - (H % 4)) / 4;
|
||||
d = (H % 4) * 8;
|
||||
aa[Z] = aa[Z] | (G.charCodeAt(H) << d);
|
||||
H++;
|
||||
}
|
||||
Z = (H - (H % 4)) / 4;
|
||||
d = (H % 4) * 8;
|
||||
aa[Z] = aa[Z] | (128 << d);
|
||||
aa[I - 2] = F << 3;
|
||||
aa[I - 1] = F >>> 29;
|
||||
return aa;
|
||||
}
|
||||
function B(x) {
|
||||
let k = "",
|
||||
F = "",
|
||||
G,
|
||||
d;
|
||||
for (d = 0; d <= 3; d++) {
|
||||
G = (x >>> (d * 8)) & 255;
|
||||
F = "0" + G.toString(16);
|
||||
k = k + F.substr(F.length - 2, 2);
|
||||
}
|
||||
return k;
|
||||
}
|
||||
function J(k) {
|
||||
k = k.replace(/rn/g, "n");
|
||||
let d = "";
|
||||
for (let F = 0; F < k.length; F++) {
|
||||
let x = k.charCodeAt(F);
|
||||
if (x < 128) {
|
||||
d += String.fromCharCode(x);
|
||||
} else {
|
||||
if (x > 127 && x < 2048) {
|
||||
d += String.fromCharCode((x >> 6) | 192);
|
||||
d += String.fromCharCode((x & 63) | 128);
|
||||
} else {
|
||||
d += String.fromCharCode((x >> 12) | 224);
|
||||
d += String.fromCharCode(((x >> 6) & 63) | 128);
|
||||
d += String.fromCharCode((x & 63) | 128);
|
||||
}
|
||||
}
|
||||
}
|
||||
return d;
|
||||
}
|
||||
let C = Array();
|
||||
let P, h, E, v, g, Y, X, W, V;
|
||||
let S = 7,
|
||||
Q = 12,
|
||||
N = 17,
|
||||
M = 22;
|
||||
let A = 5,
|
||||
z = 9,
|
||||
y = 14,
|
||||
w = 20;
|
||||
let o = 4,
|
||||
m = 11,
|
||||
l = 16,
|
||||
j = 23;
|
||||
let U = 6,
|
||||
T = 10,
|
||||
R = 15,
|
||||
O = 21;
|
||||
s = J(s);
|
||||
C = e(s);
|
||||
Y = 1732584193;
|
||||
X = 4023233417;
|
||||
W = 2562383102;
|
||||
V = 271733878;
|
||||
for (P = 0; P < C.length; P += 16) {
|
||||
h = Y;
|
||||
E = X;
|
||||
v = W;
|
||||
g = V;
|
||||
Y = u(Y, X, W, V, C[P + 0], S, 3614090360);
|
||||
V = u(V, Y, X, W, C[P + 1], Q, 3905402710);
|
||||
W = u(W, V, Y, X, C[P + 2], N, 606105819);
|
||||
X = u(X, W, V, Y, C[P + 3], M, 3250441966);
|
||||
Y = u(Y, X, W, V, C[P + 4], S, 4118548399);
|
||||
V = u(V, Y, X, W, C[P + 5], Q, 1200080426);
|
||||
W = u(W, V, Y, X, C[P + 6], N, 2821735955);
|
||||
X = u(X, W, V, Y, C[P + 7], M, 4249261313);
|
||||
Y = u(Y, X, W, V, C[P + 8], S, 1770035416);
|
||||
V = u(V, Y, X, W, C[P + 9], Q, 2336552879);
|
||||
W = u(W, V, Y, X, C[P + 10], N, 4294925233);
|
||||
X = u(X, W, V, Y, C[P + 11], M, 2304563134);
|
||||
Y = u(Y, X, W, V, C[P + 12], S, 1804603682);
|
||||
V = u(V, Y, X, W, C[P + 13], Q, 4254626195);
|
||||
W = u(W, V, Y, X, C[P + 14], N, 2792965006);
|
||||
X = u(X, W, V, Y, C[P + 15], M, 1236535329);
|
||||
Y = f(Y, X, W, V, C[P + 1], A, 4129170786);
|
||||
V = f(V, Y, X, W, C[P + 6], z, 3225465664);
|
||||
W = f(W, V, Y, X, C[P + 11], y, 643717713);
|
||||
X = f(X, W, V, Y, C[P + 0], w, 3921069994);
|
||||
Y = f(Y, X, W, V, C[P + 5], A, 3593408605);
|
||||
V = f(V, Y, X, W, C[P + 10], z, 38016083);
|
||||
W = f(W, V, Y, X, C[P + 15], y, 3634488961);
|
||||
X = f(X, W, V, Y, C[P + 4], w, 3889429448);
|
||||
Y = f(Y, X, W, V, C[P + 9], A, 568446438);
|
||||
V = f(V, Y, X, W, C[P + 14], z, 3275163606);
|
||||
W = f(W, V, Y, X, C[P + 3], y, 4107603335);
|
||||
X = f(X, W, V, Y, C[P + 8], w, 1163531501);
|
||||
Y = f(Y, X, W, V, C[P + 13], A, 2850285829);
|
||||
V = f(V, Y, X, W, C[P + 2], z, 4243563512);
|
||||
W = f(W, V, Y, X, C[P + 7], y, 1735328473);
|
||||
X = f(X, W, V, Y, C[P + 12], w, 2368359562);
|
||||
Y = D(Y, X, W, V, C[P + 5], o, 4294588738);
|
||||
V = D(V, Y, X, W, C[P + 8], m, 2272392833);
|
||||
W = D(W, V, Y, X, C[P + 11], l, 1839030562);
|
||||
X = D(X, W, V, Y, C[P + 14], j, 4259657740);
|
||||
Y = D(Y, X, W, V, C[P + 1], o, 2763975236);
|
||||
V = D(V, Y, X, W, C[P + 4], m, 1272893353);
|
||||
W = D(W, V, Y, X, C[P + 7], l, 4139469664);
|
||||
X = D(X, W, V, Y, C[P + 10], j, 3200236656);
|
||||
Y = D(Y, X, W, V, C[P + 13], o, 681279174);
|
||||
V = D(V, Y, X, W, C[P + 0], m, 3936430074);
|
||||
W = D(W, V, Y, X, C[P + 3], l, 3572445317);
|
||||
X = D(X, W, V, Y, C[P + 6], j, 76029189);
|
||||
Y = D(Y, X, W, V, C[P + 9], o, 3654602809);
|
||||
V = D(V, Y, X, W, C[P + 12], m, 3873151461);
|
||||
W = D(W, V, Y, X, C[P + 15], l, 530742520);
|
||||
X = D(X, W, V, Y, C[P + 2], j, 3299628645);
|
||||
Y = t(Y, X, W, V, C[P + 0], U, 4096336452);
|
||||
V = t(V, Y, X, W, C[P + 7], T, 1126891415);
|
||||
W = t(W, V, Y, X, C[P + 14], R, 2878612391);
|
||||
X = t(X, W, V, Y, C[P + 5], O, 4237533241);
|
||||
Y = t(Y, X, W, V, C[P + 12], U, 1700485571);
|
||||
V = t(V, Y, X, W, C[P + 3], T, 2399980690);
|
||||
W = t(W, V, Y, X, C[P + 10], R, 4293915773);
|
||||
X = t(X, W, V, Y, C[P + 1], O, 2240044497);
|
||||
Y = t(Y, X, W, V, C[P + 8], U, 1873313359);
|
||||
V = t(V, Y, X, W, C[P + 15], T, 4264355552);
|
||||
W = t(W, V, Y, X, C[P + 6], R, 2734768916);
|
||||
X = t(X, W, V, Y, C[P + 13], O, 1309151649);
|
||||
Y = t(Y, X, W, V, C[P + 4], U, 4149444226);
|
||||
V = t(V, Y, X, W, C[P + 11], T, 3174756917);
|
||||
W = t(W, V, Y, X, C[P + 2], R, 718787259);
|
||||
X = t(X, W, V, Y, C[P + 9], O, 3951481745);
|
||||
Y = K(Y, h);
|
||||
X = K(X, E);
|
||||
W = K(W, v);
|
||||
V = K(V, g);
|
||||
}
|
||||
let i = B(Y) + B(X) + B(W) + B(V);
|
||||
return i.toLowerCase();
|
||||
};
|
||||
let size = element.dataset["size"] || 80;
|
||||
let email = $value.email || $value || "";
|
||||
let name = $value.name || $value || "";
|
||||
|
||||
name = (typeof name !== 'string') ? '--' : name;
|
||||
|
||||
// let theme = name
|
||||
// .split("")
|
||||
// .map(char => char.charCodeAt(0))
|
||||
// .reduce((a, b) => a + b, 0)
|
||||
// .toString();
|
||||
// let 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 =
|
||||
// name
|
||||
// .split(" ")
|
||||
// .map(function(n) {
|
||||
// if (!isNaN(parseFloat(n)) && isFinite(n)) {
|
||||
// return "";
|
||||
// }
|
||||
|
||||
// return n[0];
|
||||
// })
|
||||
// .join("") || "--";
|
||||
|
||||
// let background = themes[theme[theme.length - 1]]["background"];
|
||||
// let color = themes[theme[theme.length - 1]]["color"];
|
||||
|
||||
let def =
|
||||
return def =
|
||||
"/v1/avatars/initials?project=console"+
|
||||
"&name=" +
|
||||
encodeURIComponent(name) +
|
||||
|
@ -259,25 +17,6 @@ window.ls.filter
|
|||
size +
|
||||
"&height=" +
|
||||
size;
|
||||
|
||||
return def;
|
||||
// let def =
|
||||
// "https://ui-avatars.com/api/" +
|
||||
// encodeURIComponent(name) +
|
||||
// "/" +
|
||||
// size +
|
||||
// "/" +
|
||||
// encodeURIComponent(background) +
|
||||
// "/" +
|
||||
// encodeURIComponent(color);
|
||||
// return (
|
||||
// "//www.gravatar.com/avatar/" +
|
||||
// MD5(email) +
|
||||
// ".jpg?s=" +
|
||||
// size +
|
||||
// "&d=" +
|
||||
// encodeURIComponent(def)
|
||||
// );
|
||||
})
|
||||
.add("selectedCollection", function($value, router) {
|
||||
return $value === router.params.collectionId ? "selected" : "";
|
||||
|
@ -415,6 +154,13 @@ window.ls.filter
|
|||
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) {
|
||||
|
|
|
@ -144,13 +144,23 @@ window.ls.router
|
|||
scope: "console",
|
||||
project: true
|
||||
})
|
||||
.add("/console/users/view", {
|
||||
template: "/console/users/view?version=" + APP_ENV.VERSION,
|
||||
.add("/console/users/user", {
|
||||
template: "/console/users/user?version=" + APP_ENV.VERSION,
|
||||
scope: "console",
|
||||
project: true
|
||||
})
|
||||
.add("/console/users/view/:tab", {
|
||||
template: "/console/users/view?version=" + APP_ENV.VERSION,
|
||||
.add("/console/users/user/:tab", {
|
||||
template: "/console/users/user?version=" + APP_ENV.VERSION,
|
||||
scope: "console",
|
||||
project: true
|
||||
})
|
||||
.add("/console/users/teams/team", {
|
||||
template: "/console/users/teams/team?version=" + APP_ENV.VERSION,
|
||||
scope: "console",
|
||||
project: true
|
||||
})
|
||||
.add("/console/users/teams/team/:tab", {
|
||||
template: "/console/users/teams/team?version=" + APP_ENV.VERSION,
|
||||
scope: "console",
|
||||
project: true
|
||||
})
|
||||
|
|
|
@ -9,8 +9,9 @@
|
|||
.map(function(obj) {
|
||||
obj.addEventListener("click", function() {
|
||||
if (element.nextElementSibling) {
|
||||
console.log('down', element.offsetHeight);
|
||||
element.parentNode.insertBefore(element.nextElementSibling, element);
|
||||
element.scrollIntoView(true);
|
||||
element.scrollIntoView({block: 'center'});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -9,8 +9,9 @@
|
|||
.map(function(obj) {
|
||||
obj.addEventListener("click", function() {
|
||||
if (element.previousElementSibling) {
|
||||
console.log('up', element);
|
||||
element.parentNode.insertBefore(element, element.previousElementSibling);
|
||||
element.scrollIntoView(true);
|
||||
element.scrollIntoView({block: 'center'});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -17,6 +17,11 @@ 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;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Appwrite\Network\Validators;
|
||||
namespace Appwrite\Network\Validator;
|
||||
|
||||
use Utopia\Validator;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Appwrite\Network\Validators;
|
||||
namespace Appwrite\Network\Validator;
|
||||
|
||||
use Utopia\Validator;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Appwrite\Storage\Devices;
|
||||
namespace Appwrite\Storage\Device;
|
||||
|
||||
use Exception;
|
||||
use Appwrite\Storage\Device;
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Appwrite\Storage\Devices;
|
||||
namespace Appwrite\Storage\Device;
|
||||
|
||||
use Appwrite\Storage\Device;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Appwrite\Storage\Validators;
|
||||
namespace Appwrite\Storage\Validator;
|
||||
|
||||
use Utopia\Validator;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Appwrite\Storage\Validators;
|
||||
namespace Appwrite\Storage\Validator;
|
||||
|
||||
use Utopia\Validator;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Appwrite\Storage\Validators;
|
||||
namespace Appwrite\Storage\Validator;
|
||||
|
||||
use Utopia\Validator;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Appwrite\Storage\Validators;
|
||||
namespace Appwrite\Storage\Validator;
|
||||
|
||||
use Exception;
|
||||
use Utopia\Validator;
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Appwrite\Storage\Validators;
|
||||
namespace Appwrite\Storage\Validator;
|
||||
|
||||
use Utopia\Validator;
|
||||
|
|
@ -183,6 +183,35 @@ trait LocaleBase
|
|||
return [];
|
||||
}
|
||||
|
||||
public function testGetLanguages():array
|
||||
{
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
$response = $this->client->call(Client::METHOD_GET, '/locale/languages', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertIsArray($response['body']);
|
||||
$this->assertCount(185, $response['body']);
|
||||
|
||||
$this->assertEquals($response['body'][0]['code'], 'aa');
|
||||
$this->assertEquals($response['body'][0]['name'], 'Afar');
|
||||
$this->assertEquals($response['body'][0]['nativeName'], 'Afar');
|
||||
|
||||
$this->assertEquals($response['body'][184]['code'], 'zu');
|
||||
$this->assertEquals($response['body'][184]['name'], 'Zulu');
|
||||
$this->assertEquals($response['body'][184]['nativeName'], 'isiZulu');
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
*/
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function testLangaugaes(): array
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -22,10 +22,11 @@ trait TeamsBaseClient
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertNotEmpty($response['body'][0]['$id']);
|
||||
$this->assertEquals($this->getUser()['name'], $response['body'][0]['name']);
|
||||
$this->assertEquals($this->getUser()['email'], $response['body'][0]['email']);
|
||||
$this->assertEquals('owner', $response['body'][0]['roles'][0]);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertNotEmpty($response['body']['memberships'][0]['$id']);
|
||||
$this->assertEquals($this->getUser()['name'], $response['body']['memberships'][0]['name']);
|
||||
$this->assertEquals($this->getUser()['email'], $response['body']['memberships'][0]['email']);
|
||||
$this->assertEquals('owner', $response['body']['memberships'][0]['roles'][0]);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
|
@ -231,7 +232,7 @@ trait TeamsBaseClient
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertCount(1, $response['body']);
|
||||
$this->assertCount(1, $response['body']['memberships']);
|
||||
|
||||
return [];
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ trait TeamsBaseServer
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertCount(0, $response['body']);
|
||||
$this->assertEquals(0, $response['body']['sum']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Appwrite\Tests;
|
||||
|
||||
use Appwrite\Network\Validators\CNAME;
|
||||
use Appwrite\Network\Validator\CNAME;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class CNAMETest extends TestCase
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Appwrite\Tests;
|
||||
|
||||
use Appwrite\Network\Validators\Origin;
|
||||
use Appwrite\Network\Validator\Origin;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class OriginTest extends TestCase
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Appwrite\Tests;
|
||||
|
||||
use Appwrite\Storage\Devices\Local;
|
||||
use Appwrite\Storage\Device\Local;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class LocalTest extends TestCase
|
|
@ -4,7 +4,7 @@ namespace Appwrite\Tests;
|
|||
|
||||
use Exception;
|
||||
use Appwrite\Storage\Storage;
|
||||
use Appwrite\Storage\Devices\Local;
|
||||
use Appwrite\Storage\Device\Local;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
Storage::addDevice('disk-a', new Local(__DIR__ . '/../../resources/disk-a'));
|
||||
|
@ -22,8 +22,8 @@ class StorageTest extends TestCase
|
|||
|
||||
public function testGetters()
|
||||
{
|
||||
$this->assertEquals(get_class(Storage::getDevice('disk-a')), 'Appwrite\Storage\Devices\Local');
|
||||
$this->assertEquals(get_class(Storage::getDevice('disk-b')), 'Appwrite\Storage\Devices\Local');
|
||||
$this->assertEquals(get_class(Storage::getDevice('disk-a')), 'Appwrite\Storage\Device\Local');
|
||||
$this->assertEquals(get_class(Storage::getDevice('disk-b')), 'Appwrite\Storage\Device\Local');
|
||||
|
||||
try {
|
||||
get_class(Storage::getDevice('disk-c'));
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Appwrite\Tests;
|
||||
|
||||
use Appwrite\Storage\Validators\FileName;
|
||||
use Appwrite\Storage\Validator\FileName;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class FileNameTest extends TestCase
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Appwrite\Tests;
|
||||
|
||||
use Appwrite\Storage\Validators\FileSize;
|
||||
use Appwrite\Storage\Validator\FileSize;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class FileSizeTest extends TestCase
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Appwrite\Tests;
|
||||
|
||||
use Appwrite\Storage\Validators\FileType;
|
||||
use Appwrite\Storage\Validator\FileType;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class FileTypeTest extends TestCase
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Appwrite\Tests;
|
||||
|
||||
use Appwrite\Storage\Validators\Upload;
|
||||
use Appwrite\Storage\Validator\Upload;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class UploadTest extends TestCase
|
Loading…
Reference in a new issue