diff --git a/CHANGES.md b/CHANGES.md index d27cb023c..f37bd7bf5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/Dockerfile b/Dockerfile index efd1344c5..1f41c3e33 100644 --- a/Dockerfile +++ b/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) diff --git a/app/app.php b/app/app.php index ed8c30f93..35f208b33 100644 --- a/app/app.php +++ b/app/app.php @@ -16,7 +16,7 @@ use Appwrite\Database\Database; use Appwrite\Database\Document; use Appwrite\Database\Validator\Authorization; use Appwrite\Event\Event; -use Appwrite\Network\Validators\Origin; +use Appwrite\Network\Validator\Origin; /* * Configuration files diff --git a/app/config/languages.php b/app/config/languages.php new file mode 100644 index 000000000..5f0434b4d --- /dev/null +++ b/app/config/languages.php @@ -0,0 +1,936 @@ + "aa", + "name" => "Afar", + "nativeName" => "Afar" + ], + [ + "code" => "ab", + "name" => "Abkhazian", + "nativeName" => "Аҧсуа" + ], + [ + "code" => "af", + "name" => "Afrikaans", + "nativeName" => "Afrikaans" + ], + [ + "code" => "ak", + "name" => "Akan", + "nativeName" => "Akana" + ], + [ + "code" => "am", + "name" => "Amharic", + "nativeName" => "አማርኛ" + ], + [ + "code" => "an", + "name" => "Aragonese", + "nativeName" => "Aragonés" + ], + [ + "code" => "ar", + "name" => "Arabic", + "nativeName" => "العربية" + ], + [ + "code" => "as", + "name" => "Assamese", + "nativeName" => "অসমীয়া" + ], + [ + "code" => "av", + "name" => "Avar", + "nativeName" => "Авар" + ], + [ + "code" => "ay", + "name" => "Aymara", + "nativeName" => "Aymar" + ], + [ + "code" => "az", + "name" => "Azerbaijani", + "nativeName" => "Azərbaycanca / آذربايجان" + ], + [ + "code" => "ba", + "name" => "Bashkir", + "nativeName" => "Башҡорт" + ], + [ + "code" => "be", + "name" => "Belarusian", + "nativeName" => "Беларуская" + ], + [ + "code" => "bg", + "name" => "Bulgarian", + "nativeName" => "Български" + ], + [ + "code" => "bh", + "name" => "Bihari", + "nativeName" => "भोजपुरी" + ], + [ + "code" => "bi", + "name" => "Bislama", + "nativeName" => "Bislama" + ], + [ + "code" => "bm", + "name" => "Bambara", + "nativeName" => "Bamanankan" + ], + [ + "code" => "bn", + "name" => "Bengali", + "nativeName" => "বাংলা" + ], + [ + "code" => "bo", + "name" => "Tibetan", + "nativeName" => "བོད་ཡིག / Bod skad" + ], + [ + "code" => "br", + "name" => "Breton", + "nativeName" => "Brezhoneg" + ], + [ + "code" => "bs", + "name" => "Bosnian", + "nativeName" => "Bosanski" + ], + [ + "code" => "ca", + "name" => "Catalan", + "nativeName" => "Català" + ], + [ + "code" => "ce", + "name" => "Chechen", + "nativeName" => "Нохчийн" + ], + [ + "code" => "ch", + "name" => "Chamorro", + "nativeName" => "Chamoru" + ], + [ + "code" => "co", + "name" => "Corsican", + "nativeName" => "Corsu" + ], + [ + "code" => "cr", + "name" => "Cree", + "nativeName" => "Nehiyaw" + ], + [ + "code" => "cs", + "name" => "Czech", + "nativeName" => "Česky" + ], + [ + "code" => "cu", + "name" => "Old Church Slavonic / Old Bulgarian", + "nativeName" => "словѣньскъ / slověnĭskŭ" + ], + [ + "code" => "cv", + "name" => "Chuvash", + "nativeName" => "Чăваш" + ], + [ + "code" => "cy", + "name" => "Welsh", + "nativeName" => "Cymraeg" + ], + [ + "code" => "da", + "name" => "Danish", + "nativeName" => "Dansk" + ], + [ + "code" => "de", + "name" => "German", + "nativeName" => "Deutsch" + ], + [ + "code" => "dv", + "name" => "Divehi", + "nativeName" => "ދިވެހިބަސް" + ], + [ + "code" => "dz", + "name" => "Dzongkha", + "nativeName" => "ཇོང་ཁ" + ], + [ + "code" => "ee", + "name" => "Ewe", + "nativeName" => "Ɛʋɛ" + ], + [ + "code" => "el", + "name" => "Greek", + "nativeName" => "Ελληνικά" + ], + [ + "code" => "en", + "name" => "English", + "nativeName" => "English" + ], + [ + "code" => "eo", + "name" => "Esperanto", + "nativeName" => "Esperanto" + ], + [ + "code" => "es", + "name" => "Spanish", + "nativeName" => "Español" + ], + [ + "code" => "et", + "name" => "Estonian", + "nativeName" => "Eesti" + ], + [ + "code" => "eu", + "name" => "Basque", + "nativeName" => "Euskara" + ], + [ + "code" => "fa", + "name" => "Persian", + "nativeName" => "فارسی" + ], + [ + "code" => "ff", + "name" => "Peul", + "nativeName" => "Fulfulde" + ], + [ + "code" => "fi", + "name" => "Finnish", + "nativeName" => "Suomi" + ], + [ + "code" => "fj", + "name" => "Fijian", + "nativeName" => "Na Vosa Vakaviti" + ], + [ + "code" => "fo", + "name" => "Faroese", + "nativeName" => "Føroyskt" + ], + [ + "code" => "fr", + "name" => "French", + "nativeName" => "Français" + ], + [ + "code" => "fy", + "name" => "West Frisian", + "nativeName" => "Frysk" + ], + [ + "code" => "ga", + "name" => "Irish", + "nativeName" => "Gaeilge" + ], + [ + "code" => "gd", + "name" => "Scottish Gaelic", + "nativeName" => "Gàidhlig" + ], + [ + "code" => "gl", + "name" => "Galician", + "nativeName" => "Galego" + ], + [ + "code" => "gn", + "name" => "Guarani", + "nativeName" => "Avañe'ẽ" + ], + [ + "code" => "gu", + "name" => "Gujarati", + "nativeName" => "ગુજરાતી" + ], + [ + "code" => "gv", + "name" => "Manx", + "nativeName" => "Gaelg" + ], + [ + "code" => "ha", + "name" => "Hausa", + "nativeName" => "هَوُسَ" + ], + [ + "code" => "he", + "name" => "Hebrew", + "nativeName" => "עברית" + ], + [ + "code" => "hi", + "name" => "Hindi", + "nativeName" => "हिन्दी" + ], + [ + "code" => "ho", + "name" => "Hiri Motu", + "nativeName" => "Hiri Motu" + ], + [ + "code" => "hr", + "name" => "Croatian", + "nativeName" => "Hrvatski" + ], + [ + "code" => "ht", + "name" => "Haitian", + "nativeName" => "Krèyol ayisyen" + ], + [ + "code" => "hu", + "name" => "Hungarian", + "nativeName" => "Magyar" + ], + [ + "code" => "hy", + "name" => "Armenian", + "nativeName" => "Հայերեն" + ], + [ + "code" => "hz", + "name" => "Herero", + "nativeName" => "Otsiherero" + ], + [ + "code" => "ia", + "name" => "Interlingua", + "nativeName" => "Interlingua" + ], + [ + "code" => "id", + "name" => "Indonesian", + "nativeName" => "Bahasa Indonesia" + ], + [ + "code" => "ie", + "name" => "Interlingue", + "nativeName" => "Interlingue" + ], + [ + "code" => "ig", + "name" => "Igbo", + "nativeName" => "Igbo" + ], + [ + "code" => "ii", + "name" => "Sichuan Yi", + "nativeName" => "ꆇꉙ / 四川彝语" + ], + [ + "code" => "ik", + "name" => "Inupiak", + "nativeName" => "Iñupiak" + ], + [ + "code" => "io", + "name" => "Ido", + "nativeName" => "Ido" + ], + [ + "code" => "is", + "name" => "Icelandic", + "nativeName" => "Íslenska" + ], + [ + "code" => "it", + "name" => "Italian", + "nativeName" => "Italiano" + ], + [ + "code" => "iu", + "name" => "Inuktitut", + "nativeName" => "ᐃᓄᒃᑎᑐᑦ" + ], + [ + "code" => "ja", + "name" => "Japanese", + "nativeName" => "日本語" + ], + [ + "code" => "jv", + "name" => "Javanese", + "nativeName" => "Basa Jawa" + ], + [ + "code" => "ka", + "name" => "Georgian", + "nativeName" => "ქართული" + ], + [ + "code" => "kg", + "name" => "Kongo", + "nativeName" => "KiKongo" + ], + [ + "code" => "ki", + "name" => "Kikuyu", + "nativeName" => "Gĩkũyũ" + ], + [ + "code" => "kj", + "name" => "Kuanyama", + "nativeName" => "Kuanyama" + ], + [ + "code" => "kk", + "name" => "Kazakh", + "nativeName" => "Қазақша" + ], + [ + "code" => "kl", + "name" => "Greenlandic", + "nativeName" => "Kalaallisut" + ], + [ + "code" => "km", + "name" => "Cambodian", + "nativeName" => "ភាសាខ្មែរ" + ], + [ + "code" => "kn", + "name" => "Kannada", + "nativeName" => "ಕನ್ನಡ" + ], + [ + "code" => "ko", + "name" => "Korean", + "nativeName" => "한국어" + ], + [ + "code" => "kr", + "name" => "Kanuri", + "nativeName" => "Kanuri" + ], + [ + "code" => "ks", + "name" => "Kashmiri", + "nativeName" => "कश्मीरी / كشميري" + ], + [ + "code" => "ku", + "name" => "Kurdish", + "nativeName" => "Kurdî / كوردی" + ], + [ + "code" => "kv", + "name" => "Komi", + "nativeName" => "Коми" + ], + [ + "code" => "kw", + "name" => "Cornish", + "nativeName" => "Kernewek" + ], + [ + "code" => "ky", + "name" => "Kirghiz", + "nativeName" => "Kırgızca / Кыргызча" + ], + [ + "code" => "la", + "name" => "Latin", + "nativeName" => "Latina" + ], + [ + "code" => "lb", + "name" => "Luxembourgish", + "nativeName" => "Lëtzebuergesch" + ], + [ + "code" => "lg", + "name" => "Ganda", + "nativeName" => "Luganda" + ], + [ + "code" => "li", + "name" => "Limburgian", + "nativeName" => "Limburgs" + ], + [ + "code" => "ln", + "name" => "Lingala", + "nativeName" => "Lingála" + ], + [ + "code" => "lo", + "name" => "Laotian", + "nativeName" => "ລາວ / Pha xa lao" + ], + [ + "code" => "lt", + "name" => "Lithuanian", + "nativeName" => "Lietuvių" + ], + [ + "code" => "lu", + "name" => "Luba-Katanga", + "nativeName" => "Tshiluba" + ], + [ + "code" => "lv", + "name" => "Latvian", + "nativeName" => "Latviešu" + ], + [ + "code" => "mg", + "name" => "Malagasy", + "nativeName" => "Malagasy" + ], + [ + "code" => "mh", + "name" => "Marshallese", + "nativeName" => "Kajin Majel / Ebon" + ], + [ + "code" => "mi", + "name" => "Maori", + "nativeName" => "Māori" + ], + [ + "code" => "mk", + "name" => "Macedonian", + "nativeName" => "Македонски" + ], + [ + "code" => "ml", + "name" => "Malayalam", + "nativeName" => "മലയാളം" + ], + [ + "code" => "mn", + "name" => "Mongolian", + "nativeName" => "Монгол" + ], + [ + "code" => "mo", + "name" => "Moldovan", + "nativeName" => "Moldovenească" + ], + [ + "code" => "mr", + "name" => "Marathi", + "nativeName" => "मराठी" + ], + [ + "code" => "ms", + "name" => "Malay", + "nativeName" => "Bahasa Melayu" + ], + [ + "code" => "mt", + "name" => "Maltese", + "nativeName" => "bil-Malti" + ], + [ + "code" => "my", + "name" => "Burmese", + "nativeName" => "မြန်မာစာ" + ], + [ + "code" => "na", + "name" => "Nauruan", + "nativeName" => "Dorerin Naoero" + ], + [ + "code" => "nb", + "name" => "Norwegian Bokmål", + "nativeName" => "Norsk bokmål" + ], + [ + "code" => "nd", + "name" => "North Ndebele", + "nativeName" => "Sindebele" + ], + [ + "code" => "ne", + "name" => "Nepali", + "nativeName" => "नेपाली" + ], + [ + "code" => "ng", + "name" => "Ndonga", + "nativeName" => "Oshiwambo" + ], + [ + "code" => "nl", + "name" => "Dutch", + "nativeName" => "Nederlands" + ], + [ + "code" => "nn", + "name" => "Norwegian Nynorsk", + "nativeName" => "Norsk nynorsk" + ], + [ + "code" => "no", + "name" => "Norwegian", + "nativeName" => "Norsk" + ], + [ + "code" => "nr", + "name" => "South Ndebele", + "nativeName" => "isiNdebele" + ], + [ + "code" => "nv", + "name" => "Navajo", + "nativeName" => "Diné bizaad" + ], + [ + "code" => "ny", + "name" => "Chichewa", + "nativeName" => "Chi-Chewa" + ], + [ + "code" => "oc", + "name" => "Occitan", + "nativeName" => "Occitan" + ], + [ + "code" => "oj", + "name" => "Ojibwa", + "nativeName" => "ᐊᓂᔑᓈᐯᒧᐎᓐ / Anishinaabemowin" + ], + [ + "code" => "om", + "name" => "Oromo", + "nativeName" => "Oromoo" + ], + [ + "code" => "or", + "name" => "Oriya", + "nativeName" => "ଓଡ଼ିଆ" + ], + [ + "code" => "os", + "name" => "Ossetian / Ossetic", + "nativeName" => "Иронау" + ], + [ + "code" => "pa", + "name" => "Panjabi / Punjabi", + "nativeName" => "ਪੰਜਾਬੀ / पंजाबी / پنجابي" + ], + [ + "code" => "pi", + "name" => "Pali", + "nativeName" => "Pāli / पाऴि" + ], + [ + "code" => "pl", + "name" => "Polish", + "nativeName" => "Polski" + ], + [ + "code" => "ps", + "name" => "Pashto", + "nativeName" => "پښتو" + ], + [ + "code" => "pt", + "name" => "Portuguese", + "nativeName" => "Português" + ], + [ + "code" => "qu", + "name" => "Quechua", + "nativeName" => "Runa Simi" + ], + [ + "code" => "rm", + "name" => "Raeto Romance", + "nativeName" => "Rumantsch" + ], + [ + "code" => "rn", + "name" => "Kirundi", + "nativeName" => "Kirundi" + ], + [ + "code" => "ro", + "name" => "Romanian", + "nativeName" => "Română" + ], + [ + "code" => "ru", + "name" => "Russian", + "nativeName" => "Русский" + ], + [ + "code" => "rw", + "name" => "Rwandi", + "nativeName" => "Kinyarwandi" + ], + [ + "code" => "sa", + "name" => "Sanskrit", + "nativeName" => "संस्कृतम्" + ], + [ + "code" => "sc", + "name" => "Sardinian", + "nativeName" => "Sardu" + ], + [ + "code" => "sd", + "name" => "Sindhi", + "nativeName" => "सिनधि" + ], + [ + "code" => "se", + "name" => "Northern Sami", + "nativeName" => "Sámegiella" + ], + [ + "code" => "sg", + "name" => "Sango", + "nativeName" => "Sängö" + ], + [ + "code" => "sh", + "name" => "Serbo-Croatian", + "nativeName" => "Srpskohrvatski / Српскохрватски" + ], + [ + "code" => "si", + "name" => "Sinhalese", + "nativeName" => "සිංහල" + ], + [ + "code" => "sk", + "name" => "Slovak", + "nativeName" => "Slovenčina" + ], + [ + "code" => "sl", + "name" => "Slovenian", + "nativeName" => "Slovenščina" + ], + [ + "code" => "sm", + "name" => "Samoan", + "nativeName" => "Gagana Samoa" + ], + [ + "code" => "sn", + "name" => "Shona", + "nativeName" => "chiShona" + ], + [ + "code" => "so", + "name" => "Somalia", + "nativeName" => "Soomaaliga" + ], + [ + "code" => "sq", + "name" => "Albanian", + "nativeName" => "Shqip" + ], + [ + "code" => "sr", + "name" => "Serbian", + "nativeName" => "Српски" + ], + [ + "code" => "ss", + "name" => "Swati", + "nativeName" => "SiSwati" + ], + [ + "code" => "st", + "name" => "Southern Sotho", + "nativeName" => "Sesotho" + ], + [ + "code" => "su", + "name" => "Sundanese", + "nativeName" => "Basa Sunda" + ], + [ + "code" => "sv", + "name" => "Swedish", + "nativeName" => "Svenska" + ], + [ + "code" => "sw", + "name" => "Swahili", + "nativeName" => "Kiswahili" + ], + [ + "code" => "ta", + "name" => "Tamil", + "nativeName" => "தமிழ்" + ], + [ + "code" => "te", + "name" => "Telugu", + "nativeName" => "తెలుగు" + ], + [ + "code" => "tg", + "name" => "Tajik", + "nativeName" => "Тоҷикӣ" + ], + [ + "code" => "th", + "name" => "Thai", + "nativeName" => "ไทย / Phasa Thai" + ], + [ + "code" => "ti", + "name" => "Tigrinya", + "nativeName" => "ትግርኛ" + ], + [ + "code" => "tk", + "name" => "Turkmen", + "nativeName" => "Туркмен / تركمن" + ], + [ + "code" => "tl", + "name" => "Tagalog / Filipino", + "nativeName" => "Tagalog" + ], + [ + "code" => "tn", + "name" => "Tswana", + "nativeName" => "Setswana" + ], + [ + "code" => "to", + "name" => "Tonga", + "nativeName" => "Lea Faka-Tonga" + ], + [ + "code" => "tr", + "name" => "Turkish", + "nativeName" => "Türkçe" + ], + [ + "code" => "ts", + "name" => "Tsonga", + "nativeName" => "Xitsonga" + ], + [ + "code" => "tt", + "name" => "Tatar", + "nativeName" => "Tatarça" + ], + [ + "code" => "tw", + "name" => "Twi", + "nativeName" => "Twi" + ], + [ + "code" => "ty", + "name" => "Tahitian", + "nativeName" => "Reo Mā`ohi" + ], + [ + "code" => "ug", + "name" => "Uyghur", + "nativeName" => "Uyƣurqə / ئۇيغۇرچە" + ], + [ + "code" => "uk", + "name" => "Ukrainian", + "nativeName" => "Українська" + ], + [ + "code" => "ur", + "name" => "Urdu", + "nativeName" => "اردو" + ], + [ + "code" => "uz", + "name" => "Uzbek", + "nativeName" => "Ўзбек" + ], + [ + "code" => "ve", + "name" => "Venda", + "nativeName" => "Tshivenḓa" + ], + [ + "code" => "vi", + "name" => "Vietnamese", + "nativeName" => "Tiếng Việt" + ], + [ + "code" => "vo", + "name" => "Volapük", + "nativeName" => "Volapük" + ], + [ + "code" => "wa", + "name" => "Walloon", + "nativeName" => "Walon" + ], + [ + "code" => "wo", + "name" => "Wolof", + "nativeName" => "Wollof" + ], + [ + "code" => "xh", + "name" => "Xhosa", + "nativeName" => "isiXhosa" + ], + [ + "code" => "yi", + "name" => "Yiddish", + "nativeName" => "ייִדיש" + ], + [ + "code" => "yo", + "name" => "Yoruba", + "nativeName" => "Yorùbá" + ], + [ + "code" => "za", + "name" => "Zhuang", + "nativeName" => "Cuengh / Tôô / 壮语" + ], + [ + "code" => "zh", + "name" => "Chinese", + "nativeName" => "中文" + ], + [ + "code" => "zu", + "name" => "Zulu", + "nativeName" => "isiZulu" + ] +]; diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index f2a3c7bbf..b1c8d352b 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -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); diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index e2b3c3776..db95fe5db 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -3,7 +3,7 @@ global $utopia, $request, $response, $register, $project; use Utopia\Exception; -use Appwrite\Storage\Devices\Local; +use Appwrite\Storage\Device\Local; use Appwrite\Storage\Storage; use Appwrite\ClamAV\Network; diff --git a/app/controllers/api/locale.php b/app/controllers/api/locale.php index 8f4f2e327..64978ac35 100644 --- a/app/controllers/api/locale.php +++ b/app/controllers/api/locale.php @@ -165,3 +165,19 @@ $utopia->get('/v1/locale/currencies') $response->json($currencies); } ); + + +$utopia->get('/v1/locale/languages') + ->desc('List Languages') + ->label('scope', 'locale.read') + ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) + ->label('sdk.namespace', 'locale') + ->label('sdk.method', 'getLanguages') + ->label('sdk.description', '/docs/references/locale/get-languages.md') + ->action( + function () use ($response) { + $languages = include __DIR__.'/../../config/languages.php'; + + $response->json($languages); + } + ); \ No newline at end of file diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 530c39c9b..ee1929a21 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -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'; diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 18a8c98c2..ebcb85f32 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -15,10 +15,10 @@ use Appwrite\ClamAV\Network; use Appwrite\Database\Database; use Appwrite\Database\Validator\UID; use Appwrite\Storage\Storage; -use Appwrite\Storage\Devices\Local; -use Appwrite\Storage\Validators\File; -use Appwrite\Storage\Validators\FileSize; -use Appwrite\Storage\Validators\Upload; +use Appwrite\Storage\Device\Local; +use Appwrite\Storage\Validator\File; +use Appwrite\Storage\Validator\FileSize; +use Appwrite\Storage\Validator\Upload; use Appwrite\Storage\Compression\Algorithms\GZIP; use Appwrite\Resize\Resize; use Appwrite\OpenSSL\OpenSSL; diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index fad09b695..ded2445fa 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -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); diff --git a/app/controllers/mock.php b/app/controllers/mock.php index 0a75d85d7..1600fa857 100644 --- a/app/controllers/mock.php +++ b/app/controllers/mock.php @@ -7,7 +7,7 @@ use Utopia\Validator\Text; use Utopia\Validator\ArrayList; use Utopia\Response; use Utopia\Validator\Host; -use Appwrite\Storage\Validators\File; +use Appwrite\Storage\Validator\File; $result = []; diff --git a/app/controllers/web/console.php b/app/controllers/web/console.php index 480c4ff9b..d90966ba7 100644 --- a/app/controllers/web/console.php +++ b/app/controllers/web/console.php @@ -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); }); diff --git a/app/controllers/web/home.php b/app/controllers/web/home.php index eee41c4d4..093faf3eb 100644 --- a/app/controllers/web/home.php +++ b/app/controllers/web/home.php @@ -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; diff --git a/app/sdks/client-web/README.md b/app/sdks/client-web/README.md index e59480b4a..093783ab4 100644 --- a/app/sdks/client-web/README.md +++ b/app/sdks/client-web/README.md @@ -1,7 +1,7 @@ # Appwrite Web SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-js.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.6.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. diff --git a/app/sdks/client-web/docs/examples/account/create-o-auth2session.md b/app/sdks/client-web/docs/examples/account/create-o-auth2session.md index 5cc825a27..0c7430741 100644 --- a/app/sdks/client-web/docs/examples/account/create-o-auth2session.md +++ b/app/sdks/client-web/docs/examples/account/create-o-auth2session.md @@ -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 diff --git a/app/sdks/client-web/src/sdk.js b/app/sdks/client-web/src/sdk.js index 0d7a7deaa..a423ae9cf 100644 --- a/app/sdks/client-web/src/sdk.js +++ b/app/sdks/client-web/src/sdk.js @@ -276,10 +276,10 @@ * * Use this endpoint to allow a new user to register a new account in your * project. After the user registration completes successfully, you can use - * the [/account/verfication](/docs/account#createVerification) route to start - * verifying the user email address. To allow your new user to login to his - * new account, you need to create a new [account - * session](/docs/account#createSession). + * the [/account/verfication](/docs/client/account#createVerification) route + * to start verifying the user email address. To allow your new user to login + * to his new account, you need to create a new [account + * session](/docs/client/account#createSession). * * @param {string} email * @param {string} password @@ -522,7 +522,7 @@ * When the user clicks the confirmation link he is redirected back to your * app password reset URL with the secret key and email address values * attached to the URL query string. Use the query string params to submit a - * request to the [PUT /account/recovery](/docs/account#updateRecovery) + * request to the [PUT /account/recovery](/docs/client/account#updateRecovery) * endpoint to complete the process. * * @param {string} email @@ -563,7 +563,7 @@ * Use this endpoint to complete the user account password reset. Both the * **userId** and **secret** arguments will be passed as query parameters to * the redirect URL you have provided when sending your request to the [POST - * /account/recovery](/docs/account#createRecovery) endpoint. + * /account/recovery](/docs/client/account#createRecovery) endpoint. * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) @@ -772,7 +772,7 @@ * should redirect the user back for your app and allow you to complete the * verification process by verifying both the **userId** and **secret** * parameters. Learn more about how to [complete the verification - * process](/docs/account#updateAccountVerification). + * process](/docs/client/account#updateAccountVerification). * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) @@ -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) diff --git a/app/sdks/client-web/src/sdk.min.js b/app/sdks/client-web/src/sdk.min.js index 113a3402b..bef842f31 100644 --- a/app/sdks/client-web/src/sdk.min.js +++ b/app/sdks/client-web/src/sdk.min.js @@ -148,8 +148,12 @@ let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payloa if(name===undefined){throw new Error('Missing required parameter: "name"')} let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(name){payload.name=name} return http.put(path,{'content-type':'application/json',},payload)},delete:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} -let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getMemberships:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} -let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createMembership:function(teamId,email,roles,url,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} +let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getMemberships:function(teamId,search='',limit=25,offset=0,orderType='ASC'){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} +let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(search){payload.search=search} +if(limit){payload.limit=limit} +if(offset){payload.offset=offset} +if(orderType){payload.orderType=orderType} +return http.get(path,{'content-type':'application/json',},payload)},createMembership:function(teamId,email,roles,url,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} if(email===undefined){throw new Error('Missing required parameter: "email"')} if(roles===undefined){throw new Error('Missing required parameter: "roles"')} if(url===undefined){throw new Error('Missing required parameter: "url"')} diff --git a/app/sdks/client-web/types/index.d.ts b/app/sdks/client-web/types/index.d.ts index f2bc108bc..2715af9f8 100644 --- a/app/sdks/client-web/types/index.d.ts +++ b/app/sdks/client-web/types/index.d.ts @@ -64,10 +64,10 @@ declare namespace Appwrite { * * Use this endpoint to allow a new user to register a new account in your * project. After the user registration completes successfully, you can use - * the [/account/verfication](/docs/account#createVerification) route to start - * verifying the user email address. To allow your new user to login to his - * new account, you need to create a new [account - * session](/docs/account#createSession). + * the [/account/verfication](/docs/client/account#createVerification) route + * to start verifying the user email address. To allow your new user to login + * to his new account, you need to create a new [account + * session](/docs/client/account#createSession). * * @param {string} email * @param {string} password @@ -170,7 +170,7 @@ declare namespace Appwrite { * When the user clicks the confirmation link he is redirected back to your * app password reset URL with the secret key and email address values * attached to the URL query string. Use the query string params to submit a - * request to the [PUT /account/recovery](/docs/account#updateRecovery) + * request to the [PUT /account/recovery](/docs/client/account#updateRecovery) * endpoint to complete the process. * * @param {string} email @@ -186,7 +186,7 @@ declare namespace Appwrite { * Use this endpoint to complete the user account password reset. Both the * **userId** and **secret** arguments will be passed as query parameters to * the redirect URL you have provided when sending your request to the [POST - * /account/recovery](/docs/account#createRecovery) endpoint. + * /account/recovery](/docs/client/account#createRecovery) endpoint. * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) @@ -276,7 +276,7 @@ declare namespace Appwrite { * should redirect the user back for your app and allow you to complete the * verification process by verifying both the **userId** and **secret** * parameters. Learn more about how to [complete the verification - * process](/docs/account#updateAccountVerification). + * process](/docs/client/account#updateAccountVerification). * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) @@ -431,7 +431,10 @@ declare namespace Appwrite { /** * Create Document * - * Create a new Document. + * Create a new Document. Before using this route, you should create a new + * collection resource using either a [server + * integration](/docs/server/database?sdk=nodejs#createCollection) API or + * directly from your database console. * * @param {string} collectionId * @param {object} data @@ -758,10 +761,14 @@ declare namespace Appwrite { * for this list of resources. * * @param {string} teamId + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType * @throws {Error} * @return {Promise} */ - getMemberships(teamId: string): Promise; + getMemberships(teamId: string, search: string, limit: number, offset: number, orderType: string): Promise; /** * Create Team Membership @@ -772,8 +779,8 @@ declare namespace Appwrite { * * Use the 'URL' parameter to redirect the user from the invitation email back * to your app. When the user is redirected, use the [Update Team Membership - * Status](/docs/teams#updateMembershipStatus) endpoint to allow the user to - * accept the invitation to the team. + * Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the + * user to accept the invitation to the team. * * Please note that in order to avoid a [Redirect * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) diff --git a/app/sdks/console-web/README.md b/app/sdks/console-web/README.md index 8d44e2769..68b7e8ff9 100644 --- a/app/sdks/console-web/README.md +++ b/app/sdks/console-web/README.md @@ -1,7 +1,7 @@ # Appwrite Console SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-console.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.6.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. diff --git a/app/sdks/console-web/docs/examples/account/create-o-auth2session.md b/app/sdks/console-web/docs/examples/account/create-o-auth2session.md index bea25a368..4a3523693 100644 --- a/app/sdks/console-web/docs/examples/account/create-o-auth2session.md +++ b/app/sdks/console-web/docs/examples/account/create-o-auth2session.md @@ -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 diff --git a/app/sdks/console-web/docs/examples/projects/update-o-auth2.md b/app/sdks/console-web/docs/examples/projects/update-o-auth2.md index 4a82548a6..479c5e9d3 100644 --- a/app/sdks/console-web/docs/examples/projects/update-o-auth2.md +++ b/app/sdks/console-web/docs/examples/projects/update-o-auth2.md @@ -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 diff --git a/app/sdks/console-web/src/sdk.js b/app/sdks/console-web/src/sdk.js index 86e219cde..08f0501f2 100644 --- a/app/sdks/console-web/src/sdk.js +++ b/app/sdks/console-web/src/sdk.js @@ -312,10 +312,10 @@ * * Use this endpoint to allow a new user to register a new account in your * project. After the user registration completes successfully, you can use - * the [/account/verfication](/docs/account#createVerification) route to start - * verifying the user email address. To allow your new user to login to his - * new account, you need to create a new [account - * session](/docs/account#createSession). + * the [/account/verfication](/docs/client/account#createVerification) route + * to start verifying the user email address. To allow your new user to login + * to his new account, you need to create a new [account + * session](/docs/client/account#createSession). * * @param {string} email * @param {string} password @@ -558,7 +558,7 @@ * When the user clicks the confirmation link he is redirected back to your * app password reset URL with the secret key and email address values * attached to the URL query string. Use the query string params to submit a - * request to the [PUT /account/recovery](/docs/account#updateRecovery) + * request to the [PUT /account/recovery](/docs/client/account#updateRecovery) * endpoint to complete the process. * * @param {string} email @@ -599,7 +599,7 @@ * Use this endpoint to complete the user account password reset. Both the * **userId** and **secret** arguments will be passed as query parameters to * the redirect URL you have provided when sending your request to the [POST - * /account/recovery](/docs/account#createRecovery) endpoint. + * /account/recovery](/docs/client/account#createRecovery) endpoint. * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) @@ -810,7 +810,7 @@ * should redirect the user back for your app and allow you to complete the * verification process by verifying both the **userId** and **secret** * parameters. Learn more about how to [complete the verification - * process](/docs/account#updateAccountVerification). + * process](/docs/client/account#updateAccountVerification). * * Please note that in order to avoid a [Redirect * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) @@ -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) diff --git a/app/sdks/console-web/src/sdk.min.js b/app/sdks/console-web/src/sdk.min.js index b43f612ff..f0951f503 100644 --- a/app/sdks/console-web/src/sdk.min.js +++ b/app/sdks/console-web/src/sdk.min.js @@ -319,8 +319,12 @@ let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payloa if(name===undefined){throw new Error('Missing required parameter: "name"')} let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(name){payload.name=name} return http.put(path,{'content-type':'application/json',},payload)},delete:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} -let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getMemberships:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} -let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},createMembership:function(teamId,email,roles,url,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} +let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getMemberships:function(teamId,search='',limit=25,offset=0,orderType='ASC'){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} +let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(search){payload.search=search} +if(limit){payload.limit=limit} +if(offset){payload.offset=offset} +if(orderType){payload.orderType=orderType} +return http.get(path,{'content-type':'application/json',},payload)},createMembership:function(teamId,email,roles,url,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"')} if(email===undefined){throw new Error('Missing required parameter: "email"')} if(roles===undefined){throw new Error('Missing required parameter: "roles"')} if(url===undefined){throw new Error('Missing required parameter: "url"')} diff --git a/app/sdks/console-web/types/index.d.ts b/app/sdks/console-web/types/index.d.ts index 08f42c7cf..65da15001 100644 --- a/app/sdks/console-web/types/index.d.ts +++ b/app/sdks/console-web/types/index.d.ts @@ -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; + getMemberships(teamId: string, search: string, limit: number, offset: number, orderType: string): Promise; /** * 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) diff --git a/app/views/console/account/index.phtml b/app/views/console/account/index.phtml index 8843636ea..da40715f1 100644 --- a/app/views/console/account/index.phtml +++ b/app/views/console/account/index.phtml @@ -22,15 +22,7 @@
- User Avatar - -
- - Upload - -
- - (via gravatar.com ) + User Avatar
@@ -57,7 +49,7 @@
- +
@@ -85,7 +77,7 @@
-