From f36d266a649b88c8aae4a40b8183bffdd24c8787 Mon Sep 17 00:00:00 2001 From: lucianosz7 Date: Sat, 5 Oct 2019 09:13:13 -0300 Subject: [PATCH 01/24] =?UTF-8?q?Added=20javanese=20translation.=C2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/config/locale/jv.continents.php | 11 + app/config/locale/jv.countries.php | 198 ++++++++++++++++++ app/config/locale/jv.php | 21 ++ .../templates/jv.email.auth.confirm.tpl | 24 +++ .../templates/jv.email.auth.invitation.tpl | 28 +++ .../templates/jv.email.auth.recovery.tpl | 24 +++ 6 files changed, 306 insertions(+) create mode 100644 app/config/locale/jv.continents.php create mode 100644 app/config/locale/jv.countries.php create mode 100644 app/config/locale/jv.php create mode 100644 app/config/locale/templates/jv.email.auth.confirm.tpl create mode 100644 app/config/locale/templates/jv.email.auth.invitation.tpl create mode 100644 app/config/locale/templates/jv.email.auth.recovery.tpl diff --git a/app/config/locale/jv.continents.php b/app/config/locale/jv.continents.php new file mode 100644 index 0000000000..f20efb8cfa --- /dev/null +++ b/app/config/locale/jv.continents.php @@ -0,0 +1,11 @@ + 'Afrika', +    'AN' => 'Antartika', +    'AS' => 'Asia', +    'EU' => 'Eropa', +    'NA' => 'Amérika Lor', +    'OC' => 'Oseania', +    'SA' => 'Amérika Kidul', +]; diff --git a/app/config/locale/jv.countries.php b/app/config/locale/jv.countries.php new file mode 100644 index 0000000000..1b781e36bf --- /dev/null +++ b/app/config/locale/jv.countries.php @@ -0,0 +1,198 @@ + 'Afghanistan', +    'AO' => 'Angola', +    'AL' => 'Albania', +    'AD' => 'Andorra', +    'AE' => 'Uni Emirat Arab', +    'AR' => 'Argentina', +    'AM' => 'Armenia', +    'AG' => 'Antigua lan Barbuda', +    'AU' => 'Australia', +    'AT' => 'Austria', +    'AZ' => 'Azerbaijan', +    'BI' => 'Burundi', +    'BE' => 'Belgia', +    'BJ' => 'Benin', +    'BF' => 'Burkina Faso', +    'BD' => 'Bangladesh', +    'BG' => 'Bulgaria', +    'BH' => 'Bahrain', +    'BS' => 'Bahamas', +    'BA' => 'Bosnia lan Herzegovina', +    'BY' => 'Belarus', +    'BZ' => 'Belize', +    'BO' => 'Bolivia', +    'BR' => 'Brasil', +    'BB' => 'Barbados', +    'BN' => 'Brunei', +    'BT' => 'Bhutan', +    'BW' => 'Botswana', +    'CF' => 'Republik Afrika Tengah', +    'CA' => 'Kanada', +    'CH' => 'Swiss', +    'CL' => 'Chile', +    'CN' => 'China', +    'CI' => 'Pantai Gading', +    'CM' => 'Kamerun', +    'CD' => 'DR Kongo', +    'CG' => 'Republik Kongo', +    'CO' => 'Kolombia', +    'KM' => 'Comoros', +    'CV' => 'Cape Verde', +    'CR' => 'Costa Rica', +    'CU' => 'Kuba', +    'CY' => 'Siprus', +    'CZ' => 'Czechia', +    'DE' => 'Jerman', +    'DJ' => 'Djibouti', +    'DM' => 'Dominika', +    'DK' => 'Denmark', +    'DO' => 'Republik Dominika', +    'DZ' => 'Algeria', +    'EC' => 'Ekuador', +    'EG' => 'Mesir', +    'ER' => 'Eritrea', +    'ES' => 'Spanyol', +    'EE' => 'Estonia', +    'ET' => 'Ethiopia', +    'FI' => 'Finlandia', + 'FJ' => 'Fiji', +    'FR' => 'Prancis', +    'FM' => 'Mikronesia', +    'GA' => 'Gabon', +    'GB' => 'Inggris', +    'GE' => 'Georgia', +    'GH' => 'Ghana', +    'GN' => 'Guinea', +    'GM' => 'Gambia', +    'GW' => 'Guinea-Bissau', +    'GQ' => 'Guinea Khatulistiwa', +    'GR' => 'Yunani', +    'GD' => 'Grenada', +    'GT' => 'Guatemala', +    'GY' => 'Guyana', +    'HN' => 'Honduras', +    'HR' => 'Croatia', +    'HT' => 'Haiti', +    'HU' => 'Hongaria', +    'ID' => 'Indonesia', +    'IN' => 'India', +    'IE' => 'Irlandia', +    'IR' => 'Iran', +    'IQ' => 'Irak', +    'IS' => 'Islandia', +    'IL' => 'Israel', +    'IT' => 'Italia', +    'JM' => 'Jamaika', +    'JO' => 'Yordania', +    'JP' => 'Jepang', +    'KZ' => 'Kazakhstan', +    'KE' => 'Kenya', +    'KG' => 'Kyrgyzstan', +    'KH' => 'Kamboja', +    'KI' => 'Kiribati', +    'KN' => 'Saint Kitts lan Nevis', +    'KR' => 'Korea Kidul', +    'KW' => 'Kuwait', +    'LA' => 'Laos', +    'LB' => 'Libanon', +    'LR' => 'Liberia', +    'LY' => 'Libya', +    'LC' => 'Saint Lucia', +    'LI' => 'Liechtenstein', +    'LK' => 'Sri Lanka', +    'LS' => 'Lesotho', +    'LT' => 'Lithuania', +    'LU' => 'Luksemburg', +    'LV' => 'Latvia', +    'MA' => 'Maroko', +    'MC' => 'Monaco', +    'MD' => 'Moldova', +    'MG' => 'Madagascar', +    'MV' => 'Maldives', +    'MX' => 'Meksiko', +    'MH' => 'Kepulauan Marshall', +    'MK' => 'Makedonia', +    'ML' => 'Mali', +    'MT' => 'Malta', +    'MM' => 'Myanmar', + 'ME' => 'Montenegro', +    'MN' => 'Mongolia', +    'MZ' => 'Mozambique', +    'MR' => 'Mauritania', +    'MU' => 'Mauritius', +    'MW' => 'Malawi', +    'MY' => 'Malaysia', +    'NA' => 'Namibia', +    'NE' => 'Niger', +    'NG' => 'Nigeria', +    'NI' => 'Nikaragua', +    'NL' => 'Belanda', +    'NO' => 'Norwegia', +    'NP' => 'Nepal', +    'NR' => 'Nauru', +    'NZ' => 'Selandia Anyar', +    'OM' => 'Oman', +    'PK' => 'Pakistan', +    'PA' => 'Panama', +    'PE' => 'Peru', +    'PH' => 'Filipina', +    'PW' => 'Palau', +    'PG' => 'Papua Nugini', +    'PL' => 'Polandia', +    'KP' => 'Korea Lor', +    'PT' => 'Portugal', +    'PY' => 'Paraguay', +    'QA' => 'Qatar', +    'RO' => 'Romania', +    'RU' => 'Rusia', +    'RW' => 'Rwanda', +    'SA' => 'Arab Saudi', +    'SD' => 'Sudan', +    'SN' => 'Senegal', +    'SG' => 'Singapura', +    'SB' => 'Kepulauan Solomon', +    'SL' => 'Sierra Leone', +    'SV' => 'El Salvador', +    'SM' => 'San Marino', +    'SO' => 'Somalia', +    'RS' => 'Serbia', +    'SS' => 'Sudan Kidul', +    'ST' => 'São Tomé lan Príncipe', +    'SR' => 'Suriname', +    'SK' => 'Slowakia', +    'SI' => 'Slovenia', +    'SE' => 'Swedia', +    'SZ' => 'Swaziland', +    'SC' => 'Seychelles', +    'SY' => 'Suriah', +    'TD' => 'Chad', +    'TG' => 'Togo', +    'TH' => 'Thailand', +    'TJ' => 'Tajikistan', +    'TM' => 'Turkmenistan', +    'TL' => 'Timor-Leste', +    'TO' => 'Tonga', +    'TT' => 'Trinidad lan Tobago', +    'TN' => 'Tunisia', +    'TR' => 'Turki', + 'TV' => 'Tuvalu', +    'TZ' => 'Tanzania', +    'UG' => 'Uganda', +    'UA' => 'Ukraina', +    'UY' => 'Uruguay', +    'US' => 'Amerika Serikat', +    'UZ' => 'Uzbekistan', +    'VA' => 'Kota Vatikan', +    'VC' => 'Saint Vincent lan Grenadines', +    'VE' => 'Venezuela', +    'VN' => 'Vietnam', +    'VU' => 'Vanuatu', +    'WS' => 'Samoa', +    'YE' => 'Yaman', +    'ZA' => 'Afrika Kidul', +    'ZM' => 'Zambia', +    'ZW' => 'Zimbabwe', +]; diff --git a/app/config/locale/jv.php b/app/config/locale/jv.php new file mode 100644 index 0000000000..2326430e57 --- /dev/null +++ b/app/config/locale/jv.php @@ -0,0 +1,21 @@ + '"Kesenian sing wicaksana yaiku seni sing ngerti apa sing kudu dilalekake."', // This is the line printed in the homepage and console 'view-source' + 'settings.locale' => 'jv', + 'settings.direction' => 'ltr', + + // Service - Users + 'auth.emails.team' => 'Tim %s', + 'auth.emails.confirm.title' => 'Konfirmasi akun', + 'auth.emails.confirm.body' => 'jv.email.auth.confirm.tpl', + 'auth.emails.recovery.title' => 'Reset Sandi', + 'auth.emails.recovery.body' => 'jv.email.auth.recovery.tpl', + 'auth.emails.invitation.title' => 'Undangan menyang %s Tim ing %s', + 'auth.emails.invitation.body' => 'jv.email.auth.invitation.tpl', + + 'locale.country.unknown' => 'Ora dingerteni', + + 'countries' => include 'jv.countries.php', + 'continents' => include 'jv.continents.php', +]; diff --git a/app/config/locale/templates/jv.email.auth.confirm.tpl b/app/config/locale/templates/jv.email.auth.confirm.tpl new file mode 100644 index 0000000000..c1afdc69a9 --- /dev/null +++ b/app/config/locale/templates/jv.email.auth.confirm.tpl @@ -0,0 +1,24 @@ + + +
+ Halo, {{name}}, +
+
+ Tindakake tautan iki kanggo verifikasi alamat email sampeyan. +
+ {{redirect}} +
+
+ Yen sampeyan ora njaluk verifikasi alamat iki, sampeyan bisa nglalekake pesen iki. +
+
+ Matur suwun, +
+ tim {{project}} +
diff --git a/app/config/locale/templates/jv.email.auth.invitation.tpl b/app/config/locale/templates/jv.email.auth.invitation.tpl new file mode 100644 index 0000000000..8c5de0f419 --- /dev/null +++ b/app/config/locale/templates/jv.email.auth.invitation.tpl @@ -0,0 +1,28 @@ + + + +
+ Halo, +
+
+ Email iki dikirim menyang sampeyan amarga {{owner}} pengin ngajak sampeyan dadi anggota tim ing {{team}} tim ing {{project}}. +
+
+ Tindakake link iki kanggo gabung ing {{team}}: +
+ {{redirect}} +
+
+ Yen sampeyan ora kasengsem, sampeyan bisa nglirwakake pesen iki. +
+
+ Matur suwun, +
+ tim {{project}} +
\ No newline at end of file diff --git a/app/config/locale/templates/jv.email.auth.recovery.tpl b/app/config/locale/templates/jv.email.auth.recovery.tpl new file mode 100644 index 0000000000..ed6c879aeb --- /dev/null +++ b/app/config/locale/templates/jv.email.auth.recovery.tpl @@ -0,0 +1,24 @@ + + +
+ Halo {{name}}, +
+
+ Tindakake link iki kanggo ngreset {{project}} sandhi. +
+ {{redirect}} +
+
+ Yen sampeyan ora njaluk ngreset sandhi, sampeyan bisa nglalekake pesen iki. +
+
+ Matur suwun, +
+ tim {{project}} +
From b7e524f12587767617487dc05197b74c2925e38f Mon Sep 17 00:00:00 2001 From: Silvia O'Dwyer Date: Sat, 5 Oct 2019 16:20:41 +0100 Subject: [PATCH 02/24] Updated documentation and contributor guidelines. --- CONTRIBUTING.md | 16 ++++++++-------- docs/AddOAuthProvider.md | 15 +++++++++------ docs/EnvironmentVariables.md | 12 ++++++------ 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a1d0e90ec4..9cf174abfd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -We would ❤️ for you to contribute to Appwrite and help make it better! As a contributor, here are the guidelines we would like you to follow: +We would ❤️ for you to contribute to Appwrite and help make it better! As a contributor, here are the guidelines we would like you to follow: ## Code of Conduct @@ -8,7 +8,7 @@ Help us keep Appwrite open and inclusive. Please read and follow our [Code of Co ## Technology Stack -To start helping us to improve Appwrite server, prior knowledge of Appwrite technology stack can help you with getting started. +To start helping us to improve Appwrite server, prior knowledge of Appwrite's technology stack can help you with getting started. Appwrite stack is combined from a variety of open-source technologies and tools. Appwrite backend API is written primarily with PHP version 7 and above on top of the Utopia PHP framework. Appwrite frontend is built with tools like gulp, less and litespeed.js. We use Docker as the container technology to package the Appwrite server for easy integration on cloud, on-premise or local hosts. @@ -26,9 +26,9 @@ Appwrite stack is combined from a variety of open-source technologies and tools. ## Package Managers -Appwrite is using a package manager for managing code dependencies for both backend and frontend development. We try our best to avoid creating any unnecessary and any new dependency to the project is subjected to a lead developer review and approval. +Appwrite uses a package manager for managing code dependencies for both backend and frontend development. We try our best to avoid creating any unnecessary and any new dependency to the project is subjected to a lead developer review and approval. -Many of Appwrite internal modules are also used as dependencies to allow other Appwrite's projects to reuse them and as a way to contribute them back to the community. +Many of Appwrite's internal modules are also used as dependencies to allow other Appwrite's projects to reuse them and as a way to contribute them back to the community. Appwrite uses PHPs Composer for managing dependencies on the server-side and JS NPM for managing dependencies on the frontend side. @@ -44,7 +44,7 @@ Appwrite is built to scale. Please keep in mind that the Appwrite stack can run We wish Appwrite will be as easy to set up and in a single, localhost and easy to grow to a large environment with thousands and even hundreds of instances. -When contributing code please take into account the following considerations: +When contributing code, please take into account the following considerations: * Response Time * Throughput @@ -57,11 +57,11 @@ When contributing code please take into account the following considerations: ## Architecture -Appwrite current structure is a combination of both Monolithic and Microservice architectures, but our final goal, as we grow is to be using only microservices. +Appwrite's current structure is a combination of both Monolithic and Microservice architectures, but our final goal, as we grow is to be using only microservices. ### The Monolithic Part -Appwrite main API container is designed as a monolithic app. This is a decision we made to allow us to develop the project faster while still being a very small team. +Appwrite's main API container is designed as a monolithic app. This is a decision we made to allow us to develop the project faster while still being a very small team. Although the Appwrite API is a monolithic app, it has a very clear separation of concern as each internal service or worker is separated by its container which will allow us as we grow to start breaking services for better maintenance and scalability. @@ -121,6 +121,6 @@ Before running the command make sure you have proper write permissions to Appwri ## Tutorials -From time to time our team will add tutorials that will help contributors find there way in the Appwrite source code. Below is a list of currently available tutorials: +From time to time our team will add tutorials that will help contributors find their way in the Appwrite source code. Below is a list of currently available tutorials: * [Adding Support for a New OAuth Provider](./docs/AddOAuthProvider.md) diff --git a/docs/AddOAuthProvider.md b/docs/AddOAuthProvider.md index c6eb210a3c..bbb20e138f 100644 --- a/docs/AddOAuthProvider.md +++ b/docs/AddOAuthProvider.md @@ -1,24 +1,27 @@ # Adding a New OAuth Provider -This document is part of the Appwrite contributors' guide. Before you continue reading this document make sure you have read the [code of conduct](../CODE_OF_CONDUCT.md) and the [contributing guide](../CONTRIBUTING.md). +This document is part of the Appwrite contributors' guide. Before you continue reading this document make sure you have read the [Code of Conduct](../CODE_OF_CONDUCT.md) and the [Contributing Guide](../CONTRIBUTING.md). ## Getting Started ### Agenda -OAuth providers help users to log in easily to apps and websites without the need to provide passwords or any other type of credentials. Appwrite goal is to have support from as many **major** OAuth providers as possible. +OAuth providers help users to log in easily to apps and websites without the need to provide passwords or any other type of credentials. Appwrite's goal is to have support from as many **major** OAuth providers as possible. As of the writing of these lines, we do not accept any minor OAuth providers. For us to accept some smaller and potentially unlimited number of OAuth providers, some product design and software architecture changes must be applied first. ### List Your new Provider -The first step to follow in adding a new OAuth provider is to add it to the list in providers config file array, located at: +The first step in adding a new OAuth provider is to add it to the list in providers config file array, located at: ``` ./app/config/providers.php ``` -Make sure to fill all data needed and that your provider array key name is in camelCase format and has no spaces or special characters. +Make sure to fill all data needed and that your provider array key name: + +- is in camelCase format +- has no spaces or special characters. ### Add Provider Logo @@ -36,7 +39,7 @@ Create a new class that extends the basic OAuth provider abstract class in this Note that the class name should start with a capital letter as PHP FIG standards suggest. -Once a new class is created, you can start to implement your new provider's login flow. The best way to do this right is to have a look at another provider's implementation and try to follow the same standards. +Once a new class is created, you can start to implement your new provider's login flow. The best way to do this corrrectly is to have a look at another provider's implementation and try to follow the same standards. Please mention in your documentation what resources or API docs you used to implement the provider's OAuth protocol. @@ -46,4 +49,4 @@ After you finished adding your new provider to Appwrite you should be able to se Add credentials and check both a successful and a failed login (where the user rejects integration on provider page). -If everything goes well, just send us the pull request and be ready to respond to any feedback which can arise during our code review. +If everything goes well, just submit a pull request and be ready to respond to any feedback which can arise during our code review. diff --git a/docs/EnvironmentVariables.md b/docs/EnvironmentVariables.md index cd2d55ea92..ad2adae667 100644 --- a/docs/EnvironmentVariables.md +++ b/docs/EnvironmentVariables.md @@ -6,15 +6,15 @@ Appwrite environment variables allow you to edit your server setup configuration ### _APP_ENV -Set your server running environment. By default the var is set to 'development' when deploying to production, change to: 'production'. +Set your server running environment. By default the var is set to 'development'. When deploying to production, change to: 'production'. ### _APP_OPTIONS_ABUSE -Allows you to disabled abuse checks and API rate limiting. By default set to 'enabled'. To cancel the abuse checking set to 'disabled'. It is not recommended to disable this check-in production environment. +Allows you to disable abuse checks and API rate limiting. By default set to 'enabled'. To cancel the abuse checking, set to 'disabled'. It is not recommended to disable this check in a production environment. ### _APP_OPENSSL_KEY_V1 -This is your server private secret key that is used to encrypt all sensitive data on your server. Appwrite server is encrypting all secret data on your server like webhooks HTTP passwords, user sessions, and the storage files. The var is not set by default, if you wish to take advantage of Appwrite encryption capabilities you should change it and make sure to keep it a secret. +This is your server private secret key that is used to encrypt all sensitive data on your server. Appwrite server encrypts all secret data on your server like webhooks, HTTP passwords, user sessions, and storage files. The var is not set by default, if you wish to take advantage of Appwrite encryption capabilities you should change it and make sure to keep it a secret. ### _APP_CONSOLE_WHITELIST_EMAILS @@ -34,7 +34,7 @@ To enable activate this option, pass a list of allowed IP addresses separated by ## Redis Server -Appwrite is using a Redis server for managing cache, queues and scheduled tasks. The Redis env vars are used to allow Appwrite server to connect to the Redis container. +Appwrite uses a Redis server for managing cache, queues and scheduled tasks. The Redis env vars are used to allow Appwrite server to connect to the Redis container. ### _APP_REDIS_HOST @@ -70,7 +70,7 @@ MariaDB server database schema. Default value is: 'appwrite' ## InfluxDB -Appwrite is using an InfluxDB server for managing time-series data and server stats. The InfluxDB env vars are used to allow Appwrite server to connect to the InfluxDB container. +Appwrite uses an InfluxDB server for managing time-series data and server stats. The InfluxDB env vars are used to allow Appwrite server to connect to the InfluxDB container. ### _APP_INFLUXDB_HOST @@ -82,7 +82,7 @@ InfluxDB server TCP port. Default value is: '8086' ## StatsD -Appwrite is using a StatsD server for aggregating and sending stats data over a fast UDP connection. The StatsD env vars are used to allow Appwrite server to connect to the StatsD container. +Appwrite uses a StatsD server for aggregating and sending stats data over a fast UDP connection. The StatsD env vars are used to allow Appwrite server to connect to the StatsD container. ### _APP_INFLUXDB_HOST From 590f089375bb40d520038fb038f88a57084ba32b Mon Sep 17 00:00:00 2001 From: Sumit Kharche <43902034+sumitkharche@users.noreply.github.com> Date: Sat, 5 Oct 2019 22:48:09 +0530 Subject: [PATCH 03/24] corrected grammar issues --- docs/EnvironmentVariables.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/EnvironmentVariables.md b/docs/EnvironmentVariables.md index cd2d55ea92..8ffdcab7c6 100644 --- a/docs/EnvironmentVariables.md +++ b/docs/EnvironmentVariables.md @@ -6,7 +6,7 @@ Appwrite environment variables allow you to edit your server setup configuration ### _APP_ENV -Set your server running environment. By default the var is set to 'development' when deploying to production, change to: 'production'. +Set your server running environment. By default the var is set to 'development' when deploying to production, change it to: 'production'. ### _APP_OPTIONS_ABUSE @@ -28,9 +28,9 @@ To enable this option, pass a list of allowed email domains separated by a comma ### _APP_CONSOLE_WHITELIST_IPS -This last option available allows you to restrict access to Appwrite console for users sharing the same set op IP addresses. This option is very useful for team working with a VPN service or a company IP. +This last option allows you to restrict access to Appwrite console for users sharing the same set op IP addresses. This option is very useful for team working with a VPN service or a company IP. -To enable activate this option, pass a list of allowed IP addresses separated by a comma. +To enable/activate this option, pass a list of allowed IP addresses separated by a comma. ## Redis Server @@ -116,4 +116,4 @@ SMTP server user name. Empty by default. ### _APP_SMTP_PASSWORD -SMTP server user password. Empty by default. \ No newline at end of file +SMTP server user password. Empty by default. From b19f62b6b0e779ace7a624bd508282998483bd28 Mon Sep 17 00:00:00 2001 From: sevenindirecto Date: Sat, 5 Oct 2019 19:36:29 +0200 Subject: [PATCH 04/24] Add Slovenian localization --- app/config/locale/sl.continents.php | 11 + app/config/locale/sl.countries.php | 198 ++++++++++++++++++ app/config/locale/sl.php | 21 ++ .../templates/sl.email.auth.confirm.tpl | 24 +++ .../templates/sl.email.auth.invitation.tpl | 27 +++ .../templates/sl.email.auth.recovery.tpl | 24 +++ 6 files changed, 305 insertions(+) create mode 100644 app/config/locale/sl.continents.php create mode 100644 app/config/locale/sl.countries.php create mode 100644 app/config/locale/sl.php create mode 100644 app/config/locale/templates/sl.email.auth.confirm.tpl create mode 100644 app/config/locale/templates/sl.email.auth.invitation.tpl create mode 100644 app/config/locale/templates/sl.email.auth.recovery.tpl diff --git a/app/config/locale/sl.continents.php b/app/config/locale/sl.continents.php new file mode 100644 index 0000000000..365662d62c --- /dev/null +++ b/app/config/locale/sl.continents.php @@ -0,0 +1,11 @@ + 'Afrika', + 'AN' => 'Antarktika', + 'AS' => 'Azija', + 'EU' => 'Evropa', + 'NA' => 'Severna Amerika', + 'OC' => 'Oceanija', + 'SA' => 'Južna Amerika', +]; diff --git a/app/config/locale/sl.countries.php b/app/config/locale/sl.countries.php new file mode 100644 index 0000000000..79589a345f --- /dev/null +++ b/app/config/locale/sl.countries.php @@ -0,0 +1,198 @@ + 'Afganistan', + 'AO' => 'Angola', + 'AL' => 'Albanija', + 'AD' => 'Andora', + 'AE' => 'Združeni Arabski Emirati', + 'AR' => 'Argenitna', + 'AM' => 'Armenija', + 'AG' => 'Antigva in Barbuda', + 'AU' => 'Avstralija', + 'AT' => 'Avstrija', + 'AZ' => 'Azerbajdžan', + 'BI' => 'Burundi ', + 'BE' => 'Belgija', + 'BJ' => 'Benin', + 'BF' => 'Burkina Faso', + 'BD' => 'Bangladeš', + 'BG' => 'Bolgarija', + 'BH' => 'Bahrajn', + 'BS' => 'Bahami', + 'BA' => 'Bosna in Hercegovina', + 'BY' => 'Belorusija', + 'BZ' => 'Belize', + 'BO' => 'Bolivija', + 'BR' => 'Brazilija', + 'BB' => 'Barbados', + 'BN' => 'Brunej', + 'BT' => 'Butan', + 'BW' => 'Bocvana', + 'CF' => 'Srednjeafriška republika', + 'CA' => 'Kanada', + 'CH' => 'Švica', + 'CL' => 'Čile', + 'CN' => 'Kitajska', + 'CI' => 'Slonokoščena obala', + 'CM' => 'Kamerun', + 'CD' => 'Demokratična republika Kongo', + 'CG' => 'Kongo', + 'CO' => 'Kolumbija', + 'KM' => 'Komori', + 'CV' => 'Kapverdski otoki (Zelenortski otoki)', + 'CR' => 'Kostarika', + 'CU' => 'Kuba', + 'CY' => 'Ciper', + 'CZ' => 'Češka', + 'DE' => 'Nemčija', + 'DJ' => 'Džibuti', + 'DM' => 'Dominika', + 'DK' => 'Danska', + 'DO' => 'Dominikanska republika', + 'DZ' => 'Alžirija', + 'EC' => 'Ekvador', + 'EG' => 'Egipt', + 'ER' => 'Eritreja', + 'ES' => 'Španija', + 'EE' => 'Estonija', + 'ET' => 'Etiopija', + 'FI' => 'Finska', + 'FJ' => 'Fidži', + 'FR' => 'Francija', + 'FM' => 'Mikronezija', + 'GA' => 'Gabon', + 'GB' => 'Velika Britanija', + 'GE' => 'Gruzija', + 'GH' => 'Gana', + 'GN' => 'Gvineja', + 'GM' => 'Gambija', + 'GW' => 'Gvineja-Bissau', + 'GQ' => 'Ekvatorialna Gvineja', + 'GR' => 'Grčija', + 'GD' => 'Grenada', + 'GT' => 'Gvatemala', + 'GY' => 'Gvajana', + 'HN' => 'Honduras', + 'HR' => 'Hrvaška', + 'HT' => 'Haiti', + 'HU' => 'Madžarska', + 'ID' => 'Indonezija', + 'IN' => 'Indija', + 'IE' => 'Irska', + 'IR' => 'Iran', + 'IQ' => 'Irak', + 'IS' => 'Islandija', + 'IL' => 'Izrael', + 'IT' => 'Italija', + 'JM' => 'Jamajka', + 'JO' => 'Jordanija', + 'JP' => 'Japonska', + 'KZ' => 'Kazahstan', + 'KE' => 'Kenija', + 'KG' => 'Kirgizistan (Kirgizija)', + 'KH' => 'Kambodža', + 'KI' => 'Kiribati', + 'KN' => 'Sveti Kits in Nevis', + 'KR' => 'Južna Koreja', + 'KW' => 'Kuvajt', + 'LA' => 'Laos', + 'LB' => 'Libanon', + 'LR' => 'Liberija', + 'LY' => 'Libija', + 'LC' => 'Sveta Lucija', + 'LI' => 'Lihtenštajn', + 'LK' => 'Šri Lanka', + 'LS' => 'Lesoto', + 'LT' => 'Litva', + 'LU' => 'Luksemburg', + 'LV' => 'Latvija', + 'MA' => 'Maroko', + 'MC' => 'Monako', + 'MD' => 'Moldavija', + 'MG' => 'Madagaskar', + 'MV' => 'Maldivi', + 'MX' => 'Mehika', + 'MH' => 'Maršalovi otoki', + 'MK' => 'Makedonija', + 'ML' => 'Mali', + 'MT' => 'Malta', + 'MM' => 'Mjanmar', + 'ME' => 'Črna Gora', + 'MN' => 'Mongolija', + 'MZ' => 'Mozambik', + 'MR' => 'Mavretanija', + 'MU' => 'Mauricius (Moris)', + 'MW' => 'Malavi', + 'MY' => 'Malezija', + 'NA' => 'Namibija', + 'NE' => 'Niger ', + 'NG' => 'Nigerija', + 'NI' => 'Nikaragva', + 'NL' => 'Nizozemska', + 'NO' => 'Norveška', + 'NP' => 'Nepal', + 'NR' => 'Nauru', + 'NZ' => 'Nova Zelandija', + 'OM' => 'Oman', + 'PK' => 'Pakistan', + 'PA' => 'Panama', + 'PE' => 'Peru', + 'PH' => 'Filipini', + 'PW' => 'Palau ', + 'PG' => 'Papua Nova Gvineja', + 'PL' => 'Poljska', + 'KP' => 'Severna Koreja', + 'PT' => 'Portugalska', + 'PY' => 'Paragvaj', + 'QA' => 'Katar', + 'RO' => 'Romunija', + 'RU' => 'Ruska federacija', + 'RW' => 'Ruanda', + 'SA' => 'Savdska Arabija', + 'SD' => 'Sudan', + 'SN' => 'Senegal', + 'SG' => 'Singapur', + 'SB' => 'Solomonovi otoki', + 'SL' => 'Siera Leone', + 'SV' => 'Salvador', + 'SM' => 'San Marino', + 'SO' => 'Somalija', + 'RS' => 'Srbija', + 'SS' => 'Južni Sudan', + 'ST' => 'Sao Tome in Principe', + 'SR' => 'Surinam', + 'SK' => 'Slovaška', + 'SI' => 'Slovenija', + 'SE' => 'Švedska', + 'SZ' => 'Svazi', + 'SC' => 'Sejšeli', + 'SY' => 'Sirija', + 'TD' => 'Čad', + 'TG' => 'Togo', + 'TH' => 'Tajska', + 'TJ' => 'Tadžikistan', + 'TM' => 'Turkmenistan', + 'TL' => 'Vzhodni Timor', + 'TO' => 'Tonga', + 'TT' => 'Trinidad in Tobago', + 'TN' => 'Tunizija', + 'TR' => 'Turčija', + 'TV' => 'Tuvalu', + 'TZ' => 'Tanzanija', + 'UG' => 'Uganda', + 'UA' => 'Ukrajina', + 'UY' => 'Urugvaj', + 'US' => 'Združene države Amerike', + 'UZ' => 'Uzbekistan', + 'VA' => 'Vatikan', + 'VC' => 'Sveti Vincent in Grenadini', + 'VE' => 'Venezuela', + 'VN' => 'Vietnam', + 'VU' => 'Republika Vanuatu', + 'WS' => 'Samoa', + 'YE' => 'Jemen', + 'ZA' => 'Južna afrika', + 'ZM' => 'Zambija', + 'ZW' => 'Zimbabve', +]; diff --git a/app/config/locale/sl.php b/app/config/locale/sl.php new file mode 100644 index 0000000000..4098628c29 --- /dev/null +++ b/app/config/locale/sl.php @@ -0,0 +1,21 @@ + '"Srčika modrosti je umetnost védenja, kaj spregledati."', // This is the line printed in the homepage and console 'view-source' + 'settings.locale' => 'sl', + 'settings.direction' => 'ltr', + + // Service - Users + 'auth.emails.team' => '%s Ekipa', + 'auth.emails.confirm.title' => 'Potrditev računa', + 'auth.emails.confirm.body' => 'sl.email.auth.confirm.tpl', + 'auth.emails.recovery.title' => 'Ponastavitev gesla', + 'auth.emails.recovery.body' => 'sl.email.auth.recovery.tpl', + 'auth.emails.invitation.title' => 'Povabilo v %s Ekipo za %s', + 'auth.emails.invitation.body' => 'sl.email.auth.invitation.tpl', + + 'locale.country.unknown' => 'Neznano', + + 'countries' => include 'sl.countries.php', + 'continents' => include 'sl.continents.php', +]; diff --git a/app/config/locale/templates/sl.email.auth.confirm.tpl b/app/config/locale/templates/sl.email.auth.confirm.tpl new file mode 100644 index 0000000000..e7f15272da --- /dev/null +++ b/app/config/locale/templates/sl.email.auth.confirm.tpl @@ -0,0 +1,24 @@ + + +
+ Pozdravljeni {{name}}, +
+
+ Sledite tej povezavi za potrditev vašega email naslova. +
+ {{redirect}} +
+
+ Če niste zahtevali potrditve tega naslova, lahko to sporočilo prezrete. +
+
+ Hvala, +
+ {{project}} ekipa +
\ No newline at end of file diff --git a/app/config/locale/templates/sl.email.auth.invitation.tpl b/app/config/locale/templates/sl.email.auth.invitation.tpl new file mode 100644 index 0000000000..13467789a3 --- /dev/null +++ b/app/config/locale/templates/sl.email.auth.invitation.tpl @@ -0,0 +1,27 @@ + + +
+ Pozdravljeni, +
+
+ To sporočilo vam je bilo posredovano, ker vas je {{owner}} povabil/a, da postanete član {{team}} ekipe za {{project}}. +
+
+ Sledite tej povezavi, da se pridružite {{team}} ekipi: +
+ {{redirect}} +
+
+ Če vas ne zanima, lahko to sporočilo prezrete. +
+
+ Hvala, +
+ {{project}} ekipa +
diff --git a/app/config/locale/templates/sl.email.auth.recovery.tpl b/app/config/locale/templates/sl.email.auth.recovery.tpl new file mode 100644 index 0000000000..701805e12e --- /dev/null +++ b/app/config/locale/templates/sl.email.auth.recovery.tpl @@ -0,0 +1,24 @@ + + +
+ Pozdravljeni {{name}}, +
+
+ Za ponastavitev vašega {{project}} gesla sledite tej povezavi. +
+ {{redirect}} +
+
+ Če niste zahtevali ponastavitve gesla, lahko to sporočilo prezrete. +
+
+ Hvala, +
+ {{project}} ekipa +
From 480bea1fecd0ef22882945e7d8016f2f5331d977 Mon Sep 17 00:00:00 2001 From: Lorenz Henk Date: Sat, 5 Oct 2019 22:08:32 +0200 Subject: [PATCH 05/24] Fix typos in german translation of template files --- app/config/locale/templates/de.email.auth.confirm.tpl | 2 +- app/config/locale/templates/de.email.auth.invitation.tpl | 4 ++-- app/config/locale/templates/de.email.auth.recovery.tpl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/config/locale/templates/de.email.auth.confirm.tpl b/app/config/locale/templates/de.email.auth.confirm.tpl index ae4ff2729b..2a3211bbab 100644 --- a/app/config/locale/templates/de.email.auth.confirm.tpl +++ b/app/config/locale/templates/de.email.auth.confirm.tpl @@ -18,7 +18,7 @@ Bitte ignoriere diese Nachricht, wenn du das Verifizieren deiner E-Mail Adresse nicht beantragt hast.

- Vielen dank, + Vielen Dank,
{{project}} Team \ No newline at end of file diff --git a/app/config/locale/templates/de.email.auth.invitation.tpl b/app/config/locale/templates/de.email.auth.invitation.tpl index dc218116a5..c6d9162730 100644 --- a/app/config/locale/templates/de.email.auth.invitation.tpl +++ b/app/config/locale/templates/de.email.auth.invitation.tpl @@ -13,7 +13,7 @@ diese E-Mail wurde dir geschickt, weil {{owner}} dich eingeladen hat Teammitglied im Team {{team}} bei {{project}} zu werden.

- Folge diesem Link um dem {{team}} Team beizutreten: + Folge diesem Link um dem Team {{team}} beizutreten:
{{redirect}}
@@ -21,7 +21,7 @@ Wenn du daran nicht interessiert bist, kannst du diese Nachricht ignorieren.

- Vielen dank, + Vielen Dank,
{{project}} Team diff --git a/app/config/locale/templates/de.email.auth.recovery.tpl b/app/config/locale/templates/de.email.auth.recovery.tpl index c9484a011c..6d2ccd7bae 100644 --- a/app/config/locale/templates/de.email.auth.recovery.tpl +++ b/app/config/locale/templates/de.email.auth.recovery.tpl @@ -18,7 +18,7 @@ Bitte ignoriere diese Nachricht, wenn du das Zurücksetzen deines Passworts nicht beantragt hast.

- Vielen dank, + Vielen Dank,
{{project}} Team From c21327efe9fa8eae513c9389904c46dbd826ee69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Skowro=C5=84ski?= <> Date: Sat, 5 Oct 2019 22:14:58 +0200 Subject: [PATCH 06/24] Translate Appwrite Locale and Email templates to Polish (#25) --- app/config/locale/pl.continents.php | 11 + app/config/locale/pl.countries.php | 198 ++++++++++++++++++ app/config/locale/pl.php | 21 ++ .../templates/pl.email.auth.confirm.tpl | 24 +++ .../templates/pl.email.auth.invitation.tpl | 27 +++ .../templates/pl.email.auth.recovery.tpl | 24 +++ 6 files changed, 305 insertions(+) create mode 100644 app/config/locale/pl.continents.php create mode 100644 app/config/locale/pl.countries.php create mode 100644 app/config/locale/pl.php create mode 100644 app/config/locale/templates/pl.email.auth.confirm.tpl create mode 100644 app/config/locale/templates/pl.email.auth.invitation.tpl create mode 100644 app/config/locale/templates/pl.email.auth.recovery.tpl diff --git a/app/config/locale/pl.continents.php b/app/config/locale/pl.continents.php new file mode 100644 index 0000000000..48a0b54435 --- /dev/null +++ b/app/config/locale/pl.continents.php @@ -0,0 +1,11 @@ + 'Africa', + 'AN' => 'Antarctica', + 'AS' => 'Asia', + 'EU' => 'Europe', + 'NA' => 'North America', + 'OC' => 'Oceania', + 'SA' => 'South America', +]; diff --git a/app/config/locale/pl.countries.php b/app/config/locale/pl.countries.php new file mode 100644 index 0000000000..60c75792b7 --- /dev/null +++ b/app/config/locale/pl.countries.php @@ -0,0 +1,198 @@ + 'Afghanistan', + 'AO' => 'Angola', + 'AL' => 'Albania', + 'AD' => 'Andorra', + 'AE' => 'United Arab Emirates', + 'AR' => 'Argentina', + 'AM' => 'Armenia', + 'AG' => 'Antigua and Barbuda', + 'AU' => 'Australia', + 'AT' => 'Austria', + 'AZ' => 'Azerbaijan', + 'BI' => 'Burundi', + 'BE' => 'Belgium', + 'BJ' => 'Benin', + 'BF' => 'Burkina Faso', + 'BD' => 'Bangladesh', + 'BG' => 'Bulgaria', + 'BH' => 'Bahrain', + 'BS' => 'Bahamas', + 'BA' => 'Bosnia and Herzegovina', + 'BY' => 'Belarus', + 'BZ' => 'Belize', + 'BO' => 'Bolivia', + 'BR' => 'Brazil', + 'BB' => 'Barbados', + 'BN' => 'Brunei', + 'BT' => 'Bhutan', + 'BW' => 'Botswana', + 'CF' => 'Central African Republic', + 'CA' => 'Canada', + 'CH' => 'Switzerland', + 'CL' => 'Chile', + 'CN' => 'China', + 'CI' => 'Ivory Coast', + 'CM' => 'Cameroon', + 'CD' => 'DR Congo', + 'CG' => 'Republic of the Congo', + 'CO' => 'Colombia', + 'KM' => 'Comoros', + 'CV' => 'Cape Verde', + 'CR' => 'Costa Rica', + 'CU' => 'Cuba', + 'CY' => 'Cyprus', + 'CZ' => 'Czechia', + 'DE' => 'Germany', + 'DJ' => 'Djibouti', + 'DM' => 'Dominica', + 'DK' => 'Denmark', + 'DO' => 'Dominican Republic', + 'DZ' => 'Algeria', + 'EC' => 'Ecuador', + 'EG' => 'Egypt', + 'ER' => 'Eritrea', + 'ES' => 'Spain', + 'EE' => 'Estonia', + 'ET' => 'Ethiopia', + 'FI' => 'Finland', + 'FJ' => 'Fiji', + 'FR' => 'France', + 'FM' => 'Micronesia', + 'GA' => 'Gabon', + 'GB' => 'United Kingdom', + 'GE' => 'Georgia', + 'GH' => 'Ghana', + 'GN' => 'Guinea', + 'GM' => 'Gambia', + 'GW' => 'Guinea-Bissau', + 'GQ' => 'Equatorial Guinea', + 'GR' => 'Greece', + 'GD' => 'Grenada', + 'GT' => 'Guatemala', + 'GY' => 'Guyana', + 'HN' => 'Honduras', + 'HR' => 'Croatia', + 'HT' => 'Haiti', + 'HU' => 'Hungary', + 'ID' => 'Indonesia', + 'IN' => 'India', + 'IE' => 'Ireland', + 'IR' => 'Iran', + 'IQ' => 'Iraq', + 'IS' => 'Iceland', + 'IL' => 'Israel', + 'IT' => 'Italy', + 'JM' => 'Jamaica', + 'JO' => 'Jordan', + 'JP' => 'Japan', + 'KZ' => 'Kazakhstan', + 'KE' => 'Kenya', + 'KG' => 'Kyrgyzstan', + 'KH' => 'Cambodia', + 'KI' => 'Kiribati', + 'KN' => 'Saint Kitts and Nevis', + 'KR' => 'South Korea', + 'KW' => 'Kuwait', + 'LA' => 'Laos', + 'LB' => 'Lebanon', + 'LR' => 'Liberia', + 'LY' => 'Libya', + 'LC' => 'Saint Lucia', + 'LI' => 'Liechtenstein', + 'LK' => 'Sri Lanka', + 'LS' => 'Lesotho', + 'LT' => 'Lithuania', + 'LU' => 'Luxembourg', + 'LV' => 'Latvia', + 'MA' => 'Morocco', + 'MC' => 'Monaco', + 'MD' => 'Moldova', + 'MG' => 'Madagascar', + 'MV' => 'Maldives', + 'MX' => 'Mexico', + 'MH' => 'Marshall Islands', + 'MK' => 'Macedonia', + 'ML' => 'Mali', + 'MT' => 'Malta', + 'MM' => 'Myanmar', + 'ME' => 'Montenegro', + 'MN' => 'Mongolia', + 'MZ' => 'Mozambique', + 'MR' => 'Mauritania', + 'MU' => 'Mauritius', + 'MW' => 'Malawi', + 'MY' => 'Malaysia', + 'NA' => 'Namibia', + 'NE' => 'Niger', + 'NG' => 'Nigeria', + 'NI' => 'Nicaragua', + 'NL' => 'Netherlands', + 'NO' => 'Norway', + 'NP' => 'Nepal', + 'NR' => 'Nauru', + 'NZ' => 'New Zealand', + 'OM' => 'Oman', + 'PK' => 'Pakistan', + 'PA' => 'Panama', + 'PE' => 'Peru', + 'PH' => 'Philippines', + 'PW' => 'Palau', + 'PG' => 'Papua New Guinea', + 'PL' => 'Poland', + 'KP' => 'North Korea', + 'PT' => 'Portugal', + 'PY' => 'Paraguay', + 'QA' => 'Qatar', + 'RO' => 'Romania', + 'RU' => 'Russia', + 'RW' => 'Rwanda', + 'SA' => 'Saudi Arabia', + 'SD' => 'Sudan', + 'SN' => 'Senegal', + 'SG' => 'Singapore', + 'SB' => 'Solomon Islands', + 'SL' => 'Sierra Leone', + 'SV' => 'El Salvador', + 'SM' => 'San Marino', + 'SO' => 'Somalia', + 'RS' => 'Serbia', + 'SS' => 'South Sudan', + 'ST' => 'São Tomé and Príncipe', + 'SR' => 'Suriname', + 'SK' => 'Slovakia', + 'SI' => 'Slovenia', + 'SE' => 'Sweden', + 'SZ' => 'Swaziland', + 'SC' => 'Seychelles', + 'SY' => 'Syria', + 'TD' => 'Chad', + 'TG' => 'Togo', + 'TH' => 'Thailand', + 'TJ' => 'Tajikistan', + 'TM' => 'Turkmenistan', + 'TL' => 'Timor-Leste', + 'TO' => 'Tonga', + 'TT' => 'Trinidad and Tobago', + 'TN' => 'Tunisia', + 'TR' => 'Turkey', + 'TV' => 'Tuvalu', + 'TZ' => 'Tanzania', + 'UG' => 'Uganda', + 'UA' => 'Ukraine', + 'UY' => 'Uruguay', + 'US' => 'United States', + 'UZ' => 'Uzbekistan', + 'VA' => 'Vatican City', + 'VC' => 'Saint Vincent and the Grenadines', + 'VE' => 'Venezuela', + 'VN' => 'Vietnam', + 'VU' => 'Vanuatu', + 'WS' => 'Samoa', + 'YE' => 'Yemen', + 'ZA' => 'South Africa', + 'ZM' => 'Zambia', + 'ZW' => 'Zimbabwe', +]; diff --git a/app/config/locale/pl.php b/app/config/locale/pl.php new file mode 100644 index 0000000000..cbd1dd2f51 --- /dev/null +++ b/app/config/locale/pl.php @@ -0,0 +1,21 @@ + '"The art of being wise is the art of knowing what to overlook."', // This is the line printed in the homepage and console 'view-source' + 'settings.locale' => 'en', + 'settings.direction' => 'ltr', + + // Service - Users + 'auth.emails.team' => '%s Team', + 'auth.emails.confirm.title' => 'Account Confirmation', + 'auth.emails.confirm.body' => 'en.email.auth.confirm.tpl', + 'auth.emails.recovery.title' => 'Password Reset', + 'auth.emails.recovery.body' => 'en.email.auth.recovery.tpl', + 'auth.emails.invitation.title' => 'Invitation to %s Team at %s', + 'auth.emails.invitation.body' => 'en.email.auth.invitation.tpl', + + 'locale.country.unknown' => 'Unknown', + + 'countries' => include 'en.countries.php', + 'continents' => include 'en.continents.php', +]; diff --git a/app/config/locale/templates/pl.email.auth.confirm.tpl b/app/config/locale/templates/pl.email.auth.confirm.tpl new file mode 100644 index 0000000000..92078114e3 --- /dev/null +++ b/app/config/locale/templates/pl.email.auth.confirm.tpl @@ -0,0 +1,24 @@ + + +
+ Hello {{name}}, +
+
+ Follow this link to verify your email address. +
+ {{redirect}} +
+
+ If you didn’t ask to verify this address, you can ignore this message. +
+
+ Thanks, +
+ {{project}} team +
\ No newline at end of file diff --git a/app/config/locale/templates/pl.email.auth.invitation.tpl b/app/config/locale/templates/pl.email.auth.invitation.tpl new file mode 100644 index 0000000000..fda2bbcce0 --- /dev/null +++ b/app/config/locale/templates/pl.email.auth.invitation.tpl @@ -0,0 +1,27 @@ + + +
+ Hello, +
+
+ This mail was sent to you because {{owner}} wanted to invite you to become a team member at the {{team}} team over at {{project}}. +
+
+ Follow this link to join the {{team}} team: +
+ {{redirect}} +
+
+ If you are not interested, you can ignore this message. +
+
+ Thanks, +
+ {{project}} team +
diff --git a/app/config/locale/templates/pl.email.auth.recovery.tpl b/app/config/locale/templates/pl.email.auth.recovery.tpl new file mode 100644 index 0000000000..7a6fa2fa60 --- /dev/null +++ b/app/config/locale/templates/pl.email.auth.recovery.tpl @@ -0,0 +1,24 @@ + + +
+ Hello {{name}}, +
+
+ Follow this link to reset your {{project}} password. +
+ {{redirect}} +
+
+ If you didn’t ask to reset your password, you can ignore this message. +
+
+ Thanks, +
+ {{project}} team +
From 2bffab343d177981499f76e6de1b19548c04a95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Skowro=C5=84ski?= <> Date: Sat, 5 Oct 2019 22:41:17 +0200 Subject: [PATCH 07/24] Translate Appwrite Locale and Email templates to Polish (#25) --- app/config/locale/pl.continents.php | 12 +- app/config/locale/pl.countries.php | 248 +++++++++--------- app/config/locale/pl.php | 12 +- .../templates/pl.email.auth.confirm.tpl | 10 +- .../templates/pl.email.auth.invitation.tpl | 12 +- .../templates/pl.email.auth.recovery.tpl | 10 +- 6 files changed, 152 insertions(+), 152 deletions(-) diff --git a/app/config/locale/pl.continents.php b/app/config/locale/pl.continents.php index 48a0b54435..a3ab2b28f9 100644 --- a/app/config/locale/pl.continents.php +++ b/app/config/locale/pl.continents.php @@ -1,11 +1,11 @@ 'Africa', - 'AN' => 'Antarctica', - 'AS' => 'Asia', - 'EU' => 'Europe', - 'NA' => 'North America', + 'AF' => 'Afryka', + 'AN' => 'Antarktyda', + 'AS' => 'Azja', + 'EU' => 'Europa', + 'NA' => 'Ameryka Północna', 'OC' => 'Oceania', - 'SA' => 'South America', + 'SA' => 'Ameryka południowa', ]; diff --git a/app/config/locale/pl.countries.php b/app/config/locale/pl.countries.php index 60c75792b7..a0b4183c13 100644 --- a/app/config/locale/pl.countries.php +++ b/app/config/locale/pl.countries.php @@ -1,198 +1,198 @@ 'Afghanistan', + 'AF' => 'Afganistan', 'AO' => 'Angola', 'AL' => 'Albania', - 'AD' => 'Andorra', - 'AE' => 'United Arab Emirates', - 'AR' => 'Argentina', + 'AD' => 'Andora', + 'AE' => 'Zjednoczone Emiraty Arabskie', + 'AR' => 'Argentyna', 'AM' => 'Armenia', - 'AG' => 'Antigua and Barbuda', + 'AG' => 'Antigua i Barbuda', 'AU' => 'Australia', 'AT' => 'Austria', - 'AZ' => 'Azerbaijan', + 'AZ' => 'Azerbejdżan', 'BI' => 'Burundi', - 'BE' => 'Belgium', + 'BE' => 'Belgia', 'BJ' => 'Benin', 'BF' => 'Burkina Faso', - 'BD' => 'Bangladesh', - 'BG' => 'Bulgaria', - 'BH' => 'Bahrain', - 'BS' => 'Bahamas', - 'BA' => 'Bosnia and Herzegovina', - 'BY' => 'Belarus', + 'BD' => 'Bangladesz', + 'BG' => 'Bułgaria', + 'BH' => 'Bahrajn', + 'BS' => 'Bahamy', + 'BA' => 'Bośnia i Hercegowina', + 'BY' => 'Białoruś', 'BZ' => 'Belize', - 'BO' => 'Bolivia', - 'BR' => 'Brazil', + 'BO' => 'Boliwia', + 'BR' => 'Brazylia', 'BB' => 'Barbados', 'BN' => 'Brunei', 'BT' => 'Bhutan', 'BW' => 'Botswana', - 'CF' => 'Central African Republic', - 'CA' => 'Canada', - 'CH' => 'Switzerland', + 'CF' => 'Republika Środkowoafrykańska', + 'CA' => 'Kanada', + 'CH' => 'Szwajcaria', 'CL' => 'Chile', - 'CN' => 'China', - 'CI' => 'Ivory Coast', - 'CM' => 'Cameroon', + 'CN' => 'Chiny', + 'CI' => 'Wybrzeże Kości Słoniowej', + 'CM' => 'Kamerun', 'CD' => 'DR Congo', - 'CG' => 'Republic of the Congo', - 'CO' => 'Colombia', - 'KM' => 'Comoros', - 'CV' => 'Cape Verde', - 'CR' => 'Costa Rica', - 'CU' => 'Cuba', - 'CY' => 'Cyprus', - 'CZ' => 'Czechia', - 'DE' => 'Germany', - 'DJ' => 'Djibouti', + 'CG' => 'Republika Konga', + 'CO' => 'Kolumbia', + 'KM' => 'Komory', + 'CV' => 'Republika Zielonego Przylądka', + 'CR' => 'Kostaryka', + 'CU' => 'Kuba', + 'CY' => 'Cypr', + 'CZ' => 'Czechy', + 'DE' => 'Niemcy', + 'DJ' => 'Dżibuti', 'DM' => 'Dominica', - 'DK' => 'Denmark', - 'DO' => 'Dominican Republic', - 'DZ' => 'Algeria', - 'EC' => 'Ecuador', - 'EG' => 'Egypt', - 'ER' => 'Eritrea', - 'ES' => 'Spain', + 'DK' => 'Dania', + 'DO' => 'Republika Dominikańska', + 'DZ' => 'Algieria', + 'EC' => 'Ekwador', + 'EG' => 'Egipt', + 'ER' => 'Erytrea', + 'ES' => 'Hiszpania', 'EE' => 'Estonia', - 'ET' => 'Ethiopia', - 'FI' => 'Finland', - 'FJ' => 'Fiji', - 'FR' => 'France', - 'FM' => 'Micronesia', + 'ET' => 'Etiopia', + 'FI' => 'Finlandia', + 'FJ' => 'Fidżi', + 'FR' => 'Francja', + 'FM' => 'Mikronezja', 'GA' => 'Gabon', - 'GB' => 'United Kingdom', + 'GB' => 'Wielka Brytania', 'GE' => 'Georgia', 'GH' => 'Ghana', - 'GN' => 'Guinea', + 'GN' => 'Gwinea', 'GM' => 'Gambia', - 'GW' => 'Guinea-Bissau', - 'GQ' => 'Equatorial Guinea', - 'GR' => 'Greece', + 'GW' => 'Gwinea Bissau', + 'GQ' => 'Gwinea Równikowa', + 'GR' => 'Grecja', 'GD' => 'Grenada', - 'GT' => 'Guatemala', - 'GY' => 'Guyana', + 'GT' => 'Gwatemala', + 'GY' => 'Gujana', 'HN' => 'Honduras', - 'HR' => 'Croatia', + 'HR' => 'Chorwacja', 'HT' => 'Haiti', - 'HU' => 'Hungary', - 'ID' => 'Indonesia', - 'IN' => 'India', - 'IE' => 'Ireland', + 'HU' => 'Węgry', + 'ID' => 'Indonezja', + 'IN' => 'Indie', + 'IE' => 'Irlandia', 'IR' => 'Iran', - 'IQ' => 'Iraq', - 'IS' => 'Iceland', + 'IQ' => 'Irak', + 'IS' => 'Islandia', 'IL' => 'Israel', - 'IT' => 'Italy', - 'JM' => 'Jamaica', + 'IT' => 'Włochy', + 'JM' => 'Jamajka', 'JO' => 'Jordan', - 'JP' => 'Japan', - 'KZ' => 'Kazakhstan', - 'KE' => 'Kenya', - 'KG' => 'Kyrgyzstan', - 'KH' => 'Cambodia', + 'JP' => 'Japonia', + 'KZ' => 'Kazachstan', + 'KE' => 'Kenia', + 'KG' => 'Kirgistan', + 'KH' => 'Kambodża', 'KI' => 'Kiribati', - 'KN' => 'Saint Kitts and Nevis', - 'KR' => 'South Korea', - 'KW' => 'Kuwait', + 'KN' => 'Saint Kitts i Nevis', + 'KR' => 'Korea Południowa', + 'KW' => 'Kuwejt', 'LA' => 'Laos', - 'LB' => 'Lebanon', + 'LB' => 'Liban', 'LR' => 'Liberia', - 'LY' => 'Libya', + 'LY' => 'Libia', 'LC' => 'Saint Lucia', 'LI' => 'Liechtenstein', 'LK' => 'Sri Lanka', 'LS' => 'Lesotho', - 'LT' => 'Lithuania', - 'LU' => 'Luxembourg', - 'LV' => 'Latvia', - 'MA' => 'Morocco', + 'LT' => 'Litwa', + 'LU' => 'Luksemburg', + 'LV' => 'Łotwa', + 'MA' => 'Maroko', 'MC' => 'Monaco', - 'MD' => 'Moldova', - 'MG' => 'Madagascar', - 'MV' => 'Maldives', - 'MX' => 'Mexico', - 'MH' => 'Marshall Islands', + 'MD' => 'Mołdawia', + 'MG' => 'Madagaskar', + 'MV' => 'Malediwy', + 'MX' => 'Meksyk', + 'MH' => 'Wyspy Marshalla', 'MK' => 'Macedonia', 'ML' => 'Mali', 'MT' => 'Malta', - 'MM' => 'Myanmar', - 'ME' => 'Montenegro', + 'MM' => 'Birma', + 'ME' => 'Czarnogóra', 'MN' => 'Mongolia', - 'MZ' => 'Mozambique', - 'MR' => 'Mauritania', + 'MZ' => 'Mozambik', + 'MR' => 'Mauretania', 'MU' => 'Mauritius', 'MW' => 'Malawi', - 'MY' => 'Malaysia', + 'MY' => 'Malezja', 'NA' => 'Namibia', 'NE' => 'Niger', 'NG' => 'Nigeria', - 'NI' => 'Nicaragua', - 'NL' => 'Netherlands', - 'NO' => 'Norway', + 'NI' => 'Nikaragua', + 'NL' => 'Holandia', + 'NO' => 'Norwegia', 'NP' => 'Nepal', 'NR' => 'Nauru', - 'NZ' => 'New Zealand', + 'NZ' => 'Nowa Zelandia', 'OM' => 'Oman', 'PK' => 'Pakistan', 'PA' => 'Panama', 'PE' => 'Peru', - 'PH' => 'Philippines', + 'PH' => 'Filipiny', 'PW' => 'Palau', - 'PG' => 'Papua New Guinea', - 'PL' => 'Poland', - 'KP' => 'North Korea', - 'PT' => 'Portugal', - 'PY' => 'Paraguay', - 'QA' => 'Qatar', - 'RO' => 'Romania', - 'RU' => 'Russia', + 'PG' => 'Papua Nowa Gwinea', + 'PL' => 'Polska', + 'KP' => 'Korea Północna', + 'PT' => 'Portugalia', + 'PY' => 'Paragwaj', + 'QA' => 'Katar', + 'RO' => 'Rumunia', + 'RU' => 'Rosja', 'RW' => 'Rwanda', - 'SA' => 'Saudi Arabia', + 'SA' => 'Arabia Saudyjska', 'SD' => 'Sudan', 'SN' => 'Senegal', - 'SG' => 'Singapore', - 'SB' => 'Solomon Islands', + 'SG' => 'Singapur', + 'SB' => 'Wyspy Salomona', 'SL' => 'Sierra Leone', - 'SV' => 'El Salvador', + 'SV' => 'Salwador', 'SM' => 'San Marino', 'SO' => 'Somalia', 'RS' => 'Serbia', - 'SS' => 'South Sudan', - 'ST' => 'São Tomé and Príncipe', - 'SR' => 'Suriname', - 'SK' => 'Slovakia', - 'SI' => 'Slovenia', - 'SE' => 'Sweden', - 'SZ' => 'Swaziland', - 'SC' => 'Seychelles', + 'SS' => 'Sudan Południowy', + 'ST' => 'Wyspy Świętego Tomasza i Książęca', + 'SR' => 'Surinam', + 'SK' => 'Słowacja', + 'SI' => 'Słowenia', + 'SE' => 'Szwecja', + 'SZ' => 'Suazi', + 'SC' => 'Seszele', 'SY' => 'Syria', - 'TD' => 'Chad', + 'TD' => 'Czad', 'TG' => 'Togo', - 'TH' => 'Thailand', - 'TJ' => 'Tajikistan', + 'TH' => 'Tajlandia', + 'TJ' => 'Tadżykistan', 'TM' => 'Turkmenistan', - 'TL' => 'Timor-Leste', + 'TL' => 'Timor Wschodni', 'TO' => 'Tonga', - 'TT' => 'Trinidad and Tobago', - 'TN' => 'Tunisia', - 'TR' => 'Turkey', + 'TT' => 'Trynidad i Tobago', + 'TN' => 'Tunezja', + 'TR' => 'Turcja', 'TV' => 'Tuvalu', 'TZ' => 'Tanzania', 'UG' => 'Uganda', - 'UA' => 'Ukraine', - 'UY' => 'Uruguay', - 'US' => 'United States', + 'UA' => 'Ukraina', + 'UY' => 'Urugwaj', + 'US' => 'Stany Zjednoczone', 'UZ' => 'Uzbekistan', - 'VA' => 'Vatican City', - 'VC' => 'Saint Vincent and the Grenadines', - 'VE' => 'Venezuela', - 'VN' => 'Vietnam', + 'VA' => 'Watykan', + 'VC' => 'Saint Vincent i Grenadyny', + 'VE' => 'Wenezuela', + 'VN' => 'Wietnam', 'VU' => 'Vanuatu', 'WS' => 'Samoa', - 'YE' => 'Yemen', - 'ZA' => 'South Africa', + 'YE' => 'Jemen', + 'ZA' => 'Republika Południowej Afryki', 'ZM' => 'Zambia', 'ZW' => 'Zimbabwe', ]; diff --git a/app/config/locale/pl.php b/app/config/locale/pl.php index cbd1dd2f51..3c6ae708d4 100644 --- a/app/config/locale/pl.php +++ b/app/config/locale/pl.php @@ -1,20 +1,20 @@ '"The art of being wise is the art of knowing what to overlook."', // This is the line printed in the homepage and console 'view-source' + 'settings.inspire' => '"Sztuka bycia mądrym to sztuka wiedzieć, co przeoczyć."', // This is the line printed in the homepage and console 'view-source' 'settings.locale' => 'en', 'settings.direction' => 'ltr', // Service - Users - 'auth.emails.team' => '%s Team', - 'auth.emails.confirm.title' => 'Account Confirmation', + 'auth.emails.team' => 'Zespół %s', + 'auth.emails.confirm.title' => 'Potwierdzenie konta', 'auth.emails.confirm.body' => 'en.email.auth.confirm.tpl', - 'auth.emails.recovery.title' => 'Password Reset', + 'auth.emails.recovery.title' => 'Zresetowanie hasła', 'auth.emails.recovery.body' => 'en.email.auth.recovery.tpl', - 'auth.emails.invitation.title' => 'Invitation to %s Team at %s', + 'auth.emails.invitation.title' => 'Zaproszenie do zespołu %s - %s', 'auth.emails.invitation.body' => 'en.email.auth.invitation.tpl', - 'locale.country.unknown' => 'Unknown', + 'locale.country.unknown' => 'Nieznany', 'countries' => include 'en.countries.php', 'continents' => include 'en.continents.php', diff --git a/app/config/locale/templates/pl.email.auth.confirm.tpl b/app/config/locale/templates/pl.email.auth.confirm.tpl index 92078114e3..e46187999f 100644 --- a/app/config/locale/templates/pl.email.auth.confirm.tpl +++ b/app/config/locale/templates/pl.email.auth.confirm.tpl @@ -7,18 +7,18 @@
- Hello {{name}}, + Witaj {{name}},

- Follow this link to verify your email address. + Kliknij ten link, aby zweryfikować swój adres e-mail.
{{redirect}}

- If you didn’t ask to verify this address, you can ignore this message. + Jeśli nie prosiłeś o weryfikację tego adresu, możesz zignorować tę wiadomość.

- Thanks, + Dziękujemy,
- {{project}} team + zespół {{project}}
\ No newline at end of file diff --git a/app/config/locale/templates/pl.email.auth.invitation.tpl b/app/config/locale/templates/pl.email.auth.invitation.tpl index fda2bbcce0..d11586de75 100644 --- a/app/config/locale/templates/pl.email.auth.invitation.tpl +++ b/app/config/locale/templates/pl.email.auth.invitation.tpl @@ -7,21 +7,21 @@
- Hello, + Witaj,

- This mail was sent to you because {{owner}} wanted to invite you to become a team member at the {{team}} team over at {{project}}. + Ta wiadomość została do Ciebie wysłana, ponieważ {{owner}} chciałby zaprosić Cię do dołączenia do zespołu {{team}} w {{project}}.

- Follow this link to join the {{team}} team: + Kliknij ten link, aby dołączyć do zespołu {{team}}:
{{redirect}}

- If you are not interested, you can ignore this message. + Jeśli nie jesteś zainteresowany, możesz zignorować tę wiadomość.

- Thanks, + Dziękujemy,
- {{project}} team + zaspół {{project}}
diff --git a/app/config/locale/templates/pl.email.auth.recovery.tpl b/app/config/locale/templates/pl.email.auth.recovery.tpl index 7a6fa2fa60..78066ee064 100644 --- a/app/config/locale/templates/pl.email.auth.recovery.tpl +++ b/app/config/locale/templates/pl.email.auth.recovery.tpl @@ -7,18 +7,18 @@
- Hello {{name}}, + Witaj {{name}},

- Follow this link to reset your {{project}} password. + Kliknij ten link, aby zresetować hasło do {{project}}.
{{redirect}}

- If you didn’t ask to reset your password, you can ignore this message. + Jeśli nie prosiłeś o zresetowanie hasła, możesz zignorować tę wiadomość.

- Thanks, + Dziękujemy,
- {{project}} team + zaspół {{project}}
From a375a82e42ed27ce3c09804b0bd7ca9085946636 Mon Sep 17 00:00:00 2001 From: Ahmed Karaman <20889958+ahmedkrmn@users.noreply.github.com> Date: Sat, 5 Oct 2019 23:21:32 +0200 Subject: [PATCH 08/24] Add Arabic locales --- app/config/locale/ar.continents.php | 11 + app/config/locale/ar.countries.php | 198 ++++++++++++++++++ app/config/locale/ar.php | 21 ++ .../templates/ar.email.auth.confirm.tpl | 24 +++ .../templates/ar.email.auth.invitation.tpl | 27 +++ .../templates/ar.email.auth.recovery.tpl | 24 +++ 6 files changed, 305 insertions(+) create mode 100644 app/config/locale/ar.continents.php create mode 100644 app/config/locale/ar.countries.php create mode 100644 app/config/locale/ar.php create mode 100644 app/config/locale/templates/ar.email.auth.confirm.tpl create mode 100644 app/config/locale/templates/ar.email.auth.invitation.tpl create mode 100644 app/config/locale/templates/ar.email.auth.recovery.tpl diff --git a/app/config/locale/ar.continents.php b/app/config/locale/ar.continents.php new file mode 100644 index 0000000000..8b1c3132f7 --- /dev/null +++ b/app/config/locale/ar.continents.php @@ -0,0 +1,11 @@ + 'أفريقيا', + 'AN' => 'القارة القطبية الجنوبية', + 'AS' => 'آسيا', + 'EU' => 'أوروبا', + 'NA' => 'امريكا الشمالية', + 'OC' => 'أوقيانوسيا', + 'SA' => 'امريكا الجنوبية', +]; diff --git a/app/config/locale/ar.countries.php b/app/config/locale/ar.countries.php new file mode 100644 index 0000000000..e5f1bb9cdc --- /dev/null +++ b/app/config/locale/ar.countries.php @@ -0,0 +1,198 @@ + 'أفغانستان', + 'AO' => 'أنغولا', + 'AL' => 'ألبانيا', + 'AD' => 'أندورا', + 'AE' => 'الإمارات العربية المتحدة', +    'AR' => 'الأرجنتين', +    'AM' => 'أرمينيا', +    'AG' => 'أنتيغوا وبربودا', +    'AU' => 'أستراليا', +    'AT' => 'النمسا', +    'AZ' => 'أذربيجان', +    'BI' => 'بوروندي', +    'BE' => 'بلجيكا', +    'BJ' => 'بنين', +    'BF' => 'بوركينا فاسو', +    'BD' => 'بنغلاديش', +    'BG' => 'بلغاريا', +    'BH' => 'البحرين', +    'BS' => 'جزر البهاما', +    'BA' => 'البوسنة والهرسك', +    'BY' => 'بيلاروسيا', +    'BZ' => 'بليز', +    'BO' => 'بوليفيا', +    'BR' => 'البرازيل', +    'BB' => 'بربادوس', +    'BN' => 'بروناي', +    'BT' => 'بوتان', +    'BW' => 'بوتسوانا', +    'CF' => 'جمهورية إفريقيا الوسطى', +    'CA' => 'كندا', +    'CH' => 'سويسرا', +    'CL' => 'تشيلي', +    'CN' => 'الصين', +    'CI' => 'ساحل العاج', +    'CM' => 'الكاميرون', +    'CD' => 'جمهورية الكونغو الديمقراطية', +    'CG' => 'جمهورية الكونغو', +    'CO' => 'كولومبيا', +    'KM' => 'جزر القمر', +    'CV' => 'الرأس الأخضر', +    'CR' => 'كوستاريكا', +    'CU' => 'كوبا', +    'CY' => 'قبرص', +    'CZ' => 'تشيكيا', +    'DE' => 'ألمانيا', +    'DJ' => 'جيبوتي', +    'DM' => 'دومينيكا', +    'DK' => 'الدنمارك', +    'DO' => 'جمهورية الدومينيكان', +    'DZ' => 'الجزائر', +    'EC' => 'إكوادور', +    'EG' => 'مصر', +    'ER' => 'إريتريا', +    'ES' => 'إسبانيا', +    'EE' => 'إستونيا', +    'ET' => 'إثيوبيا', +    'FI' => 'فنلندا', +    'FJ' => 'فيجي', +    'FR' => 'فرنسا', +    'FM' => 'ميكرونيزيا', +    'GA' => 'الغابون', +    'GB' => 'المملكة المتحدة', +    'GE' => 'جورجيا', +    'GH' => 'غانا', +    'GN' => 'غينيا', +    'GM' => 'غامبيا', +    'GW' => 'غينيا بيساو', +    'GQ' => 'غينيا الاستوائية', +    'GR' => 'اليونان', +    'GD' => 'غرينادا', +    'GT' => 'غواتيمالا', +    'GY' => 'غيانا', +    'HN' => 'هندوراس', +    'HR' => 'كرواتيا', +    'HT' => 'هايتي', +    'HU' => 'المجر', +    'ID' => 'إندونيسيا', +    'IN' => 'الهند', +    'IE' => 'أيرلندا', +    'IR' => 'إيران', +    'IQ' => 'العراق', +    'IS' => 'أيسلندا', +    'IL' => 'إسرائيل', +    'IT' => 'إيطاليا', +    'JM' => 'جامايكا', +    'JO' => 'الأردن', +    'JP' => 'اليابان', +    'KZ' => 'كازاخستان', +    'KE' => 'كينيا', +    'KG' => 'قيرغيزستان', +    'KH' => 'كمبوديا', +    'KI' => 'كيريباتي', +    'KN' => 'سانت كيتس ونيفيس', +    'KR' => 'كوريا الجنوبية', +    'KW' => 'الكويت', +    'LA' => 'لاوس', +    'LB' => 'لبنان', +    'LR' => 'ليبيريا', +    'LY' => 'ليبيا', +    'LC' => 'سانت لوسيا', +    'LI' => 'ليختنشتاين', +    'LK' => 'سري لانكا', +    'LS' => 'ليسوتو', +    'LT' => 'ليتوانيا', +    'LU' => 'لوكسمبورغ', +    'LV' => 'لاتفيا', +    'MA' => 'المغرب', +    'MC' => 'موناكو', +    'MD' => 'مولدوفا', +    'MG' => 'مدغشقر', +    'MV' => 'جزر المالديف', +    'MX' => 'المكسيك', +    'MH' => 'جزر مارشال', +    'MK' => 'مقدونيا', +    'ML' => 'مالي', +    'MT' => 'مالطا', +    'MM' => 'ميانمار', +    'ME' => 'الجبل الأسود', +    'MN' => 'منغوليا', +    'MZ' => 'موزمبيق', +    'MR' => 'موريتانيا', +    'MU' => 'موريشيوس', +    'MW' => 'ملاوي', +    'MY' => 'ماليزيا', +    'NA' => 'ناميبيا', +    'NE' => 'النيجر', +    'NG' => 'نيجيريا', +    'NI' => 'نيكاراغوا', +    'NL' => 'هولندا', +    'NO' => 'النرويج', +    'NP' => 'نيبال', +    'NR' => 'ناورو', +    'NZ' => 'نيوزيلندا', +    'OM' => 'عمان', +    'PK' => 'باكستان', +    'PA' => 'بنما', +    'PE' => 'بيرو', +    'PH' => 'الفلبين', +    'PW' => 'بالاو', +    'PG' => 'بابوا غينيا الجديدة', +    'PL' => 'بولندا', +    'KP' => 'كوريا الشمالية', +    'PT' => 'البرتغال', +    'PY' => 'باراجواي', +    'QA' => 'قطر', +    'RO' => 'رومانيا', +    'RU' => 'روسيا', +    'RW' => 'رواندا', +    'SA' => 'المملكة العربية السعودية', +    'SD' => 'السودان', +    'SN' => 'السنغال', +    'SG' => 'سنغافورة', +    'SB' => 'جزر سليمان', +    'SL' => 'سيراليون', +    'SV' => 'السلفادور', +    'SM' => 'سان مارينو', +    'SO' => 'الصومال', +    'RS' => 'صربيا', +    'SS' => 'جنوب السودان', +    'ST' => 'ساو تومي وبرينسيبي', +    'SR' => 'سورينام', +    'SK' => 'سلوفاكيا', +    'SI' => 'سلوفينيا', +    'SE' => 'السويد', +    'SZ' => 'سوازيلند', +    'SC' => 'سيشيل', +    'SY' => 'سوريا', +    'TD' => 'تشاد', +    'TG' => 'توغو', +    'TH' => 'تايلاند', +    'TJ' => 'طاجيكستان', +    'TM' => 'تركمانستان', +    'TL' => 'تيمور الشرقية', +    'TO' => 'تونجا', +    'TT' => 'ترينيداد وتوباغو', +    'TN' => 'تونس', +    'TR' => 'تركيا', +    'TV' => 'توفالو', +    'TZ' => 'تنزانيا', +    'UG' => 'أوغندا', +    'UA' => 'أوكرانيا', +    'UY' => 'أوروغواي', +    'UK' => 'الولايات المتحدة', +    'UZ' => 'أوزبكستان', +    'VA' => 'مدينة الفاتيكان', +    'VC' => 'سانت فنسنت وجزر غرينادين', +    'VE' => 'فنزويلا', +    'VN' => 'فيتنام', +    'VU' => 'فانواتو', +    'WS' => 'ساموا', +    'YE' => 'اليمن', +    'ZA' => 'جنوب إفريقيا', +    'ZM' => 'زامبيا', +    'ZW' => 'زيمبابوي', +]; diff --git a/app/config/locale/ar.php b/app/config/locale/ar.php new file mode 100644 index 0000000000..623df549d3 --- /dev/null +++ b/app/config/locale/ar.php @@ -0,0 +1,21 @@ + '"فن الحكمة هو فن معرفة ما يجب التغاضي عنه."', // This is the line printed in the homepage and console 'view-source' + 'settings.locale' => 'ar', + 'settings.direction' => 'rtl', + + // Service - Users + 'auth.emails.team' => 'فريق %s', + 'auth.emails.confirm.title' => 'تأكيد الحساب', + 'auth.emails.confirm.body' => 'ar.email.auth.confirm.tpl', + 'auth.emails.recovery.title' => 'إعادة تعيين كلمة المرور', + 'auth.emails.recovery.body' => 'ar.email.auth.recovery.tpl', + 'auth.emails.invitation.title' => 'دعوة لفريق %s في %s', + 'auth.emails.invitation.body' => 'ar.email.auth.invitation.tpl', + + 'locale.country.unknown' => 'مجهول', + + 'countries' => include 'ar.countries.php', + 'continents' => include 'ar.continents.php', +]; diff --git a/app/config/locale/templates/ar.email.auth.confirm.tpl b/app/config/locale/templates/ar.email.auth.confirm.tpl new file mode 100644 index 0000000000..8cd1929dd9 --- /dev/null +++ b/app/config/locale/templates/ar.email.auth.confirm.tpl @@ -0,0 +1,24 @@ + + +
+ مرحبا {{name}}, +
+
+ اتبع هذا الرابط للتحقق من عنوان بريدك الإلكتروني. +
+ {{redirect}} +
+
+ إذا لم تطلب التحقق من هذا العنوان، فيمكنك تجاهل هذه الرسالة. +
+
+ Thanks, +
+ فريق {{project}} +
\ No newline at end of file diff --git a/app/config/locale/templates/ar.email.auth.invitation.tpl b/app/config/locale/templates/ar.email.auth.invitation.tpl new file mode 100644 index 0000000000..fba4a731e3 --- /dev/null +++ b/app/config/locale/templates/ar.email.auth.invitation.tpl @@ -0,0 +1,27 @@ + + +
+ مرحبا، +
+
+ تم إرسال هذه الرسالة إليك لأن {{owner}} أراد دعوتك لتصبح عضوًا في فريق {{team}} في {{project}}. +
+
+ اتبع هذا الرابط للانضمام إلى فريق {{team}}: +
+ {{redirect}} +
+
+ إذا لم تكن مهتمًا، يمكنك تجاهل هذه الرسالة. +
+
+ شكرا، +
+ فريق {{project}} +
diff --git a/app/config/locale/templates/ar.email.auth.recovery.tpl b/app/config/locale/templates/ar.email.auth.recovery.tpl new file mode 100644 index 0000000000..06ca47f35e --- /dev/null +++ b/app/config/locale/templates/ar.email.auth.recovery.tpl @@ -0,0 +1,24 @@ + + +
+ مرحبا {{name}}، +
+
+ اتبع هذا الرابط لإعادة تعيين كلمة مرور {{project}}. +
+ {{redirect}} +
+
+ إذا لم تطلب إعادة تعيين كلمة المرور الخاصة بك، فيمكنك تجاهل هذه الرسالة. +
+
+ شكرا، +
+ فريق {{project}} +
From c9100004269b5ac2d8207d2cd260f66746489fb3 Mon Sep 17 00:00:00 2001 From: Ahmed Karaman <20889958+ahmedkrmn@users.noreply.github.com> Date: Sat, 5 Oct 2019 23:52:02 +0200 Subject: [PATCH 09/24] Add Arabic locales to app/init.php --- app/init.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/init.php b/app/init.php index 0a35bad743..acc5f51cfa 100644 --- a/app/init.php +++ b/app/init.php @@ -24,7 +24,7 @@ const APP_EMAIL_TEAM = 'team@'.APP_DOMAIN; const APP_EMAIL_SECURITY = 'security@'.APP_DOMAIN; const APP_USERAGENT = APP_NAME.'-Server/%s Please report abuse at '.APP_EMAIL_SECURITY; const APP_MODE_ADMIN = 'admin'; -const APP_LOCALES = ['cat', 'de', 'en', 'es', 'fi', 'fr', 'gr', 'he', 'hi', 'id', 'it', 'nl', 'no', 'pt-br', 'pt-pt', 'ro', 'tr', 'ua', 'zh-cn', 'zh-tw']; +const APP_LOCALES = ['ar', 'cat', 'de', 'en', 'es', 'fi', 'fr', 'gr', 'he', 'hi', 'id', 'it', 'nl', 'no', 'pt-br', 'pt-pt', 'ro', 'tr', 'ua', 'zh-cn', 'zh-tw']; const APP_PAGING_LIMIT = 15; const APP_VERSION_STABLE = '0.2.0'; @@ -129,6 +129,7 @@ $locale = $request->getParam('locale', $request->getHeader('X-Appwrite-Locale', Locale::$exceptions = false; +Locale::setLanguage('ar', include __DIR__.'/config/locale/ar.php'); Locale::setLanguage('cat', include __DIR__.'/config/locale/cat.php'); Locale::setLanguage('de', include __DIR__.'/config/locale/de.php'); Locale::setLanguage('en', include __DIR__.'/config/locale/en.php'); From 66f9ef70918dae2afb13eecd8e054ab6f64a87a8 Mon Sep 17 00:00:00 2001 From: Ahmed Karaman <20889958+ahmedkrmn@users.noreply.github.com> Date: Sun, 6 Oct 2019 01:44:24 +0200 Subject: [PATCH 10/24] Fix Parse error --- app/config/locale/ar.countries.php | 378 ++++++++++++++--------------- 1 file changed, 189 insertions(+), 189 deletions(-) diff --git a/app/config/locale/ar.countries.php b/app/config/locale/ar.countries.php index e5f1bb9cdc..a7f4a02228 100644 --- a/app/config/locale/ar.countries.php +++ b/app/config/locale/ar.countries.php @@ -6,193 +6,193 @@ return [ 'AL' => 'ألبانيا', 'AD' => 'أندورا', 'AE' => 'الإمارات العربية المتحدة', -    'AR' => 'الأرجنتين', -    'AM' => 'أرمينيا', -    'AG' => 'أنتيغوا وبربودا', -    'AU' => 'أستراليا', -    'AT' => 'النمسا', -    'AZ' => 'أذربيجان', -    'BI' => 'بوروندي', -    'BE' => 'بلجيكا', -    'BJ' => 'بنين', -    'BF' => 'بوركينا فاسو', -    'BD' => 'بنغلاديش', -    'BG' => 'بلغاريا', -    'BH' => 'البحرين', -    'BS' => 'جزر البهاما', -    'BA' => 'البوسنة والهرسك', -    'BY' => 'بيلاروسيا', -    'BZ' => 'بليز', -    'BO' => 'بوليفيا', -    'BR' => 'البرازيل', -    'BB' => 'بربادوس', -    'BN' => 'بروناي', -    'BT' => 'بوتان', -    'BW' => 'بوتسوانا', -    'CF' => 'جمهورية إفريقيا الوسطى', -    'CA' => 'كندا', -    'CH' => 'سويسرا', -    'CL' => 'تشيلي', -    'CN' => 'الصين', -    'CI' => 'ساحل العاج', -    'CM' => 'الكاميرون', -    'CD' => 'جمهورية الكونغو الديمقراطية', -    'CG' => 'جمهورية الكونغو', -    'CO' => 'كولومبيا', -    'KM' => 'جزر القمر', -    'CV' => 'الرأس الأخضر', -    'CR' => 'كوستاريكا', -    'CU' => 'كوبا', -    'CY' => 'قبرص', -    'CZ' => 'تشيكيا', -    'DE' => 'ألمانيا', -    'DJ' => 'جيبوتي', -    'DM' => 'دومينيكا', -    'DK' => 'الدنمارك', -    'DO' => 'جمهورية الدومينيكان', -    'DZ' => 'الجزائر', -    'EC' => 'إكوادور', -    'EG' => 'مصر', -    'ER' => 'إريتريا', -    'ES' => 'إسبانيا', -    'EE' => 'إستونيا', -    'ET' => 'إثيوبيا', -    'FI' => 'فنلندا', -    'FJ' => 'فيجي', -    'FR' => 'فرنسا', -    'FM' => 'ميكرونيزيا', -    'GA' => 'الغابون', -    'GB' => 'المملكة المتحدة', -    'GE' => 'جورجيا', -    'GH' => 'غانا', -    'GN' => 'غينيا', -    'GM' => 'غامبيا', -    'GW' => 'غينيا بيساو', -    'GQ' => 'غينيا الاستوائية', -    'GR' => 'اليونان', -    'GD' => 'غرينادا', -    'GT' => 'غواتيمالا', -    'GY' => 'غيانا', -    'HN' => 'هندوراس', -    'HR' => 'كرواتيا', -    'HT' => 'هايتي', -    'HU' => 'المجر', -    'ID' => 'إندونيسيا', -    'IN' => 'الهند', -    'IE' => 'أيرلندا', -    'IR' => 'إيران', -    'IQ' => 'العراق', -    'IS' => 'أيسلندا', -    'IL' => 'إسرائيل', -    'IT' => 'إيطاليا', -    'JM' => 'جامايكا', -    'JO' => 'الأردن', -    'JP' => 'اليابان', -    'KZ' => 'كازاخستان', -    'KE' => 'كينيا', -    'KG' => 'قيرغيزستان', -    'KH' => 'كمبوديا', -    'KI' => 'كيريباتي', -    'KN' => 'سانت كيتس ونيفيس', -    'KR' => 'كوريا الجنوبية', -    'KW' => 'الكويت', -    'LA' => 'لاوس', -    'LB' => 'لبنان', -    'LR' => 'ليبيريا', -    'LY' => 'ليبيا', -    'LC' => 'سانت لوسيا', -    'LI' => 'ليختنشتاين', -    'LK' => 'سري لانكا', -    'LS' => 'ليسوتو', -    'LT' => 'ليتوانيا', -    'LU' => 'لوكسمبورغ', -    'LV' => 'لاتفيا', -    'MA' => 'المغرب', -    'MC' => 'موناكو', -    'MD' => 'مولدوفا', -    'MG' => 'مدغشقر', -    'MV' => 'جزر المالديف', -    'MX' => 'المكسيك', -    'MH' => 'جزر مارشال', -    'MK' => 'مقدونيا', -    'ML' => 'مالي', -    'MT' => 'مالطا', -    'MM' => 'ميانمار', -    'ME' => 'الجبل الأسود', -    'MN' => 'منغوليا', -    'MZ' => 'موزمبيق', -    'MR' => 'موريتانيا', -    'MU' => 'موريشيوس', -    'MW' => 'ملاوي', -    'MY' => 'ماليزيا', -    'NA' => 'ناميبيا', -    'NE' => 'النيجر', -    'NG' => 'نيجيريا', -    'NI' => 'نيكاراغوا', -    'NL' => 'هولندا', -    'NO' => 'النرويج', -    'NP' => 'نيبال', -    'NR' => 'ناورو', -    'NZ' => 'نيوزيلندا', -    'OM' => 'عمان', -    'PK' => 'باكستان', -    'PA' => 'بنما', -    'PE' => 'بيرو', -    'PH' => 'الفلبين', -    'PW' => 'بالاو', -    'PG' => 'بابوا غينيا الجديدة', -    'PL' => 'بولندا', -    'KP' => 'كوريا الشمالية', -    'PT' => 'البرتغال', -    'PY' => 'باراجواي', -    'QA' => 'قطر', -    'RO' => 'رومانيا', -    'RU' => 'روسيا', -    'RW' => 'رواندا', -    'SA' => 'المملكة العربية السعودية', -    'SD' => 'السودان', -    'SN' => 'السنغال', -    'SG' => 'سنغافورة', -    'SB' => 'جزر سليمان', -    'SL' => 'سيراليون', -    'SV' => 'السلفادور', -    'SM' => 'سان مارينو', -    'SO' => 'الصومال', -    'RS' => 'صربيا', -    'SS' => 'جنوب السودان', -    'ST' => 'ساو تومي وبرينسيبي', -    'SR' => 'سورينام', -    'SK' => 'سلوفاكيا', -    'SI' => 'سلوفينيا', -    'SE' => 'السويد', -    'SZ' => 'سوازيلند', -    'SC' => 'سيشيل', -    'SY' => 'سوريا', -    'TD' => 'تشاد', -    'TG' => 'توغو', -    'TH' => 'تايلاند', -    'TJ' => 'طاجيكستان', -    'TM' => 'تركمانستان', -    'TL' => 'تيمور الشرقية', -    'TO' => 'تونجا', -    'TT' => 'ترينيداد وتوباغو', -    'TN' => 'تونس', -    'TR' => 'تركيا', -    'TV' => 'توفالو', -    'TZ' => 'تنزانيا', -    'UG' => 'أوغندا', -    'UA' => 'أوكرانيا', -    'UY' => 'أوروغواي', -    'UK' => 'الولايات المتحدة', -    'UZ' => 'أوزبكستان', -    'VA' => 'مدينة الفاتيكان', -    'VC' => 'سانت فنسنت وجزر غرينادين', -    'VE' => 'فنزويلا', -    'VN' => 'فيتنام', -    'VU' => 'فانواتو', -    'WS' => 'ساموا', -    'YE' => 'اليمن', -    'ZA' => 'جنوب إفريقيا', -    'ZM' => 'زامبيا', -    'ZW' => 'زيمبابوي', + 'AR' => 'الأرجنتين', + 'AM' => 'أرمينيا', + 'AG' => 'أنتيغوا وبربودا', + 'AU' => 'أستراليا', + 'AT' => 'النمسا', + 'AZ' => 'أذربيجان', + 'BI' => 'بوروندي', + 'BE' => 'بلجيكا', + 'BJ' => 'بنين', + 'BF' => 'بوركينا فاسو', + 'BD' => 'بنغلاديش', + 'BG' => 'بلغاريا', + 'BH' => 'البحرين', + 'BS' => 'جزر البهاما', + 'BA' => 'البوسنة والهرسك', + 'BY' => 'بيلاروسيا', + 'BZ' => 'بليز', + 'BO' => 'بوليفيا', + 'BR' => 'البرازيل', + 'BB' => 'بربادوس', + 'BN' => 'بروناي', + 'BT' => 'بوتان', + 'BW' => 'بوتسوانا', + 'CF' => 'جمهورية إفريقيا الوسطى', + 'CA' => 'كندا', + 'CH' => 'سويسرا', + 'CL' => 'تشيلي', + 'CN' => 'الصين', + 'CI' => 'ساحل العاج', + 'CM' => 'الكاميرون', + 'CD' => 'جمهورية الكونغو الديمقراطية', + 'CG' => 'جمهورية الكونغو', + 'CO' => 'كولومبيا', + 'KM' => 'جزر القمر', + 'CV' => 'الرأس الأخضر', + 'CR' => 'كوستاريكا', + 'CU' => 'كوبا', + 'CY' => 'قبرص', + 'CZ' => 'تشيكيا', + 'DE' => 'ألمانيا', + 'DJ' => 'جيبوتي', + 'DM' => 'دومينيكا', + 'DK' => 'الدنمارك', + 'DO' => 'جمهورية الدومينيكان', + 'DZ' => 'الجزائر', + 'EC' => 'إكوادور', + 'EG' => 'مصر', + 'ER' => 'إريتريا', + 'ES' => 'إسبانيا', + 'EE' => 'إستونيا', + 'ET' => 'إثيوبيا', + 'FI' => 'فنلندا', + 'FJ' => 'فيجي', + 'FR' => 'فرنسا', + 'FM' => 'ميكرونيزيا', + 'GA' => 'الغابون', + 'GB' => 'المملكة المتحدة', + 'GE' => 'جورجيا', + 'GH' => 'غانا', + 'GN' => 'غينيا', + 'GM' => 'غامبيا', + 'GW' => 'غينيا بيساو', + 'GQ' => 'غينيا الاستوائية', + 'GR' => 'اليونان', + 'GD' => 'غرينادا', + 'GT' => 'غواتيمالا', + 'GY' => 'غيانا', + 'HN' => 'هندوراس', + 'HR' => 'كرواتيا', + 'HT' => 'هايتي', + 'HU' => 'المجر', + 'ID' => 'إندونيسيا', + 'IN' => 'الهند', + 'IE' => 'أيرلندا', + 'IR' => 'إيران', + 'IQ' => 'العراق', + 'IS' => 'أيسلندا', + 'IL' => 'إسرائيل', + 'IT' => 'إيطاليا', + 'JM' => 'جامايكا', + 'JO' => 'الأردن', + 'JP' => 'اليابان', + 'KZ' => 'كازاخستان', + 'KE' => 'كينيا', + 'KG' => 'قيرغيزستان', + 'KH' => 'كمبوديا', + 'KI' => 'كيريباتي', + 'KN' => 'سانت كيتس ونيفيس', + 'KR' => 'كوريا الجنوبية', + 'KW' => 'الكويت', + 'LA' => 'لاوس', + 'LB' => 'لبنان', + 'LR' => 'ليبيريا', + 'LY' => 'ليبيا', + 'LC' => 'سانت لوسيا', + 'LI' => 'ليختنشتاين', + 'LK' => 'سري لانكا', + 'LS' => 'ليسوتو', + 'LT' => 'ليتوانيا', + 'LU' => 'لوكسمبورغ', + 'LV' => 'لاتفيا', + 'MA' => 'المغرب', + 'MC' => 'موناكو', + 'MD' => 'مولدوفا', + 'MG' => 'مدغشقر', + 'MV' => 'جزر المالديف', + 'MX' => 'المكسيك', + 'MH' => 'جزر مارشال', + 'MK' => 'مقدونيا', + 'ML' => 'مالي', + 'MT' => 'مالطا', + 'MM' => 'ميانمار', + 'ME' => 'الجبل الأسود', + 'MN' => 'منغوليا', + 'MZ' => 'موزمبيق', + 'MR' => 'موريتانيا', + 'MU' => 'موريشيوس', + 'MW' => 'ملاوي', + 'MY' => 'ماليزيا', + 'NA' => 'ناميبيا', + 'NE' => 'النيجر', + 'NG' => 'نيجيريا', + 'NI' => 'نيكاراغوا', + 'NL' => 'هولندا', + 'NO' => 'النرويج', + 'NP' => 'نيبال', + 'NR' => 'ناورو', + 'NZ' => 'نيوزيلندا', + 'OM' => 'عمان', + 'PK' => 'باكستان', + 'PA' => 'بنما', + 'PE' => 'بيرو', + 'PH' => 'الفلبين', + 'PW' => 'بالاو', + 'PG' => 'بابوا غينيا الجديدة', + 'PL' => 'بولندا', + 'KP' => 'كوريا الشمالية', + 'PT' => 'البرتغال', + 'PY' => 'باراجواي', + 'QA' => 'قطر', + 'RO' => 'رومانيا', + 'RU' => 'روسيا', + 'RW' => 'رواندا', + 'SA' => 'المملكة العربية السعودية', + 'SD' => 'السودان', + 'SN' => 'السنغال', + 'SG' => 'سنغافورة', + 'SB' => 'جزر سليمان', + 'SL' => 'سيراليون', + 'SV' => 'السلفادور', + 'SM' => 'سان مارينو', + 'SO' => 'الصومال', + 'RS' => 'صربيا', + 'SS' => 'جنوب السودان', + 'ST' => 'ساو تومي وبرينسيبي', + 'SR' => 'سورينام', + 'SK' => 'سلوفاكيا', + 'SI' => 'سلوفينيا', + 'SE' => 'السويد', + 'SZ' => 'سوازيلند', + 'SC' => 'سيشيل', + 'SY' => 'سوريا', + 'TD' => 'تشاد', + 'TG' => 'توغو', + 'TH' => 'تايلاند', + 'TJ' => 'طاجيكستان', + 'TM' => 'تركمانستان', + 'TL' => 'تيمور الشرقية', + 'TO' => 'تونجا', + 'TT' => 'ترينيداد وتوباغو', + 'TN' => 'تونس', + 'TR' => 'تركيا', + 'TV' => 'توفالو', + 'TZ' => 'تنزانيا', + 'UG' => 'أوغندا', + 'UA' => 'أوكرانيا', + 'UY' => 'أوروغواي', + 'UK' => 'الولايات المتحدة', + 'UZ' => 'أوزبكستان', + 'VA' => 'مدينة الفاتيكان', + 'VC' => 'سانت فنسنت وجزر غرينادين', + 'VE' => 'فنزويلا', + 'VN' => 'فيتنام', + 'VU' => 'فانواتو', + 'WS' => 'ساموا', + 'YE' => 'اليمن', + 'ZA' => 'جنوب إفريقيا', + 'ZM' => 'زامبيا', + 'ZW' => 'زيمبابوي', ]; From 4a85382da4ec98b67630950778a3edb18262b2ac Mon Sep 17 00:00:00 2001 From: stvmachine Date: Sun, 6 Oct 2019 14:28:03 +1100 Subject: [PATCH 11/24] Update es.email.auth.confirm.tpl The original translation doesn't include the punctuation on that way. --- app/config/locale/templates/es.email.auth.confirm.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/config/locale/templates/es.email.auth.confirm.tpl b/app/config/locale/templates/es.email.auth.confirm.tpl index 3bb7e97b62..a5b9235be8 100644 --- a/app/config/locale/templates/es.email.auth.confirm.tpl +++ b/app/config/locale/templates/es.email.auth.confirm.tpl @@ -10,7 +10,7 @@ Hola {{name}},

- Sigue este enlace para verificar tu dirección de correo: + Sigue este enlace para verificar tu dirección de correo.
{{redirect}}
@@ -21,4 +21,4 @@ Gracias,
Equipo {{project}} - \ No newline at end of file + From d1735407dec405da25020b6ece38279aa70a12ca Mon Sep 17 00:00:00 2001 From: stvmachine Date: Sun, 6 Oct 2019 14:33:55 +1100 Subject: [PATCH 12/24] Update es.php On Spanish make more senses: "Team of" + team_name. --- app/config/locale/es.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/locale/es.php b/app/config/locale/es.php index 0a56743689..8c337051f8 100644 --- a/app/config/locale/es.php +++ b/app/config/locale/es.php @@ -6,7 +6,7 @@ return [ 'settings.direction' => 'ltr', // Service - Users - 'auth.emails.team' => '%s Equipo', + 'auth.emails.team' => 'Equipo de %s', 'auth.emails.confirm.title' => 'Confirmación de la cuenta', 'auth.emails.confirm.body' => 'es.email.auth.confirm.tpl', 'auth.emails.recovery.title' => 'Reestablecer contraseña', From 37240777e07e9008a206475e8961dc1d88824c2d Mon Sep 17 00:00:00 2001 From: stvmachine Date: Sun, 6 Oct 2019 14:53:06 +1100 Subject: [PATCH 13/24] Update es.countries.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Typo errors related to accentuation: - Irán: https://es.wikipedia.org/wiki/Ir%C3%A1n - Malí: https://es.wikipedia.org/wiki/Mal%C3%AD Is more widely accepted: - `República Checa` than `Chequia`: https://es.wikipedia.org/wiki/Rep%C3%BAblica_Checa --- app/config/locale/es.countries.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/config/locale/es.countries.php b/app/config/locale/es.countries.php index a0c11ae5c6..18fe488c17 100644 --- a/app/config/locale/es.countries.php +++ b/app/config/locale/es.countries.php @@ -37,14 +37,14 @@ return [ 'CI' => 'Costa de Marfil', 'CM' => 'Camerún', 'CD' => 'República Democrática del Congo', - 'CG' => 'República del congo', + 'CG' => 'República del Congo', 'CO' => 'Colombia', 'KM' => 'Comoras', 'CV' => 'Cabo Verde', 'CR' => 'Costa Rica', 'CU' => 'Cuba', 'CY' => 'Chipre', - 'CZ' => 'Chequia', + 'CZ' => 'República Checa', 'DE' => 'Alemania', 'DJ' => 'Yibuti', 'DM' => 'Dominica', @@ -80,7 +80,7 @@ return [ 'ID' => 'Indonesia', 'IN' => 'India', 'IE' => 'Irlanda', - 'IR' => 'Iran', + 'IR' => 'Irán', 'IQ' => 'Irak', 'IS' => 'Islandia', 'IL' => 'Israel', @@ -115,7 +115,7 @@ return [ 'MX' => 'Mexico', 'MH' => 'Islas Marshall', 'MK' => 'Macedonia', - 'ML' => 'Mali', + 'ML' => 'Malí', 'MT' => 'Malta', 'MM' => 'Myanmar', 'ME' => 'Montenegro', From f2139529ddebd2d5c04af9ac7d88e1122e3d2cd6 Mon Sep 17 00:00:00 2001 From: wenzdey <56051809+wenzdey@users.noreply.github.com> Date: Sun, 6 Oct 2019 12:33:42 -0500 Subject: [PATCH 14/24] Updated getcomposer url to supported secure link --- app/sdks/php/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/sdks/php/README.md b/app/sdks/php/README.md index 13c7005082..50f218e0df 100644 --- a/app/sdks/php/README.md +++ b/app/sdks/php/README.md @@ -13,7 +13,7 @@ Appwrite backend as a service cuts up to 70% of the time and costs required for ## Installation -To install via [Composer](http://getcomposer.org/): +To install via [Composer](https://getcomposer.org/): ```bash composer require appwrite/appwrite @@ -21,4 +21,4 @@ composer require appwrite/appwrite ## License -Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. \ No newline at end of file +Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. From 4e155bbcc3abcb8a08e095689ea5ffb3cb0e1dc9 Mon Sep 17 00:00:00 2001 From: eldadfux Date: Sun, 6 Oct 2019 20:38:55 +0300 Subject: [PATCH 15/24] Updated Changelog --- CHANGES.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3203c99063..3d8b3d7729 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,12 +3,13 @@ ## Planned Issues * Added 7 new locales for locale service and email templates (af, cz, hu, lt, no, ru, si, sv, ta, vi, zh-cn, zh-tw) -* New users service routes to allow updates pref, email and name update +* New users service routes to allow updates pref and name update * 2 stage Docker build * New database rule validation options * Update docs example with auth info * Limit HTTP origin check only to browser integrations * Allow electron apps to not pass origin header +* New OAuth adapters (Amazon, Dropbox, Microsoft, Slack, VK) # Version 0.2.0 (PRE-RELEASE) @@ -17,7 +18,7 @@ * Added option to limit access to the Appwrite console * Added option to disable abuse check and rate limits * Added input field with the server API endpoint for easy access -* Added new OAuth providers for Google and GitLab +* Added new OAuth providers for Google, Bitbucket and GitLab * Added 15 new locales for locale service and email templates (cat, de, es, fi, fr, gr, hi, id, it, nl, pt-br, pt-pt, ro, tr, ua) * Improved test coverage for the project and synced DEV & CI environments settings From 8a9990787e81d9fabb19dedcc29beeba003a9207 Mon Sep 17 00:00:00 2001 From: eldadfux Date: Sun, 6 Oct 2019 21:04:13 +0300 Subject: [PATCH 16/24] Updated locale settings --- CHANGES.md | 2 +- app/init.php | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3d8b3d7729..3f97b37063 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,7 @@ ## Planned Issues -* Added 7 new locales for locale service and email templates (af, cz, hu, lt, no, ru, si, sv, ta, vi, zh-cn, zh-tw) +* Added 7 new locales for locale service and email templates (af, ar, cz, hu, lt, no, ru, si, sv, ta, vi, zh-cn, zh-tw) * New users service routes to allow updates pref and name update * 2 stage Docker build * New database rule validation options diff --git a/app/init.php b/app/init.php index acc5f51cfa..43b8b0f68f 100644 --- a/app/init.php +++ b/app/init.php @@ -24,7 +24,7 @@ const APP_EMAIL_TEAM = 'team@'.APP_DOMAIN; const APP_EMAIL_SECURITY = 'security@'.APP_DOMAIN; const APP_USERAGENT = APP_NAME.'-Server/%s Please report abuse at '.APP_EMAIL_SECURITY; const APP_MODE_ADMIN = 'admin'; -const APP_LOCALES = ['ar', 'cat', 'de', 'en', 'es', 'fi', 'fr', 'gr', 'he', 'hi', 'id', 'it', 'nl', 'no', 'pt-br', 'pt-pt', 'ro', 'tr', 'ua', 'zh-cn', 'zh-tw']; +const APP_LOCALES = ['af', 'ar', 'cat', 'cz', 'de', 'en', 'es', 'fi', 'fr', 'gr', 'he', 'hi', 'hu', 'id', 'it', 'lt', 'nl', 'no', 'pl', 'pt-br', 'pt-pt', 'ro', 'ru', 'si', 'sv', 'ta', 'tr', 'ua', 'vi', 'zh-cn', 'zh-tw']; const APP_PAGING_LIMIT = 15; const APP_VERSION_STABLE = '0.2.0'; @@ -129,8 +129,10 @@ $locale = $request->getParam('locale', $request->getHeader('X-Appwrite-Locale', Locale::$exceptions = false; +Locale::setLanguage('af', include __DIR__.'/config/locale/af.php'); Locale::setLanguage('ar', include __DIR__.'/config/locale/ar.php'); Locale::setLanguage('cat', include __DIR__.'/config/locale/cat.php'); +Locale::setLanguage('cz', include __DIR__.'/config/locale/cz.php'); Locale::setLanguage('de', include __DIR__.'/config/locale/de.php'); Locale::setLanguage('en', include __DIR__.'/config/locale/en.php'); Locale::setLanguage('es', include __DIR__.'/config/locale/es.php'); @@ -139,17 +141,23 @@ Locale::setLanguage('fr', include __DIR__.'/config/locale/fr.php'); Locale::setLanguage('gr', include __DIR__.'/config/locale/gr.php'); Locale::setLanguage('he', include __DIR__.'/config/locale/he.php'); Locale::setLanguage('hi', include __DIR__.'/config/locale/hi.php'); +Locale::setLanguage('hu', include __DIR__.'/config/locale/hu.php'); Locale::setLanguage('id', include __DIR__.'/config/locale/id.php'); Locale::setLanguage('it', include __DIR__.'/config/locale/it.php'); +Locale::setLanguage('lt', include __DIR__.'/config/locale/lt.php'); Locale::setLanguage('nl', include __DIR__.'/config/locale/nl.php'); -//Locale::setLanguage('no', include __DIR__.'/config/locale/no.php'); +Locale::setLanguage('no', include __DIR__.'/config/locale/no.php'); +Locale::setLanguage('pl', include __DIR__.'/config/locale/pl.php'); Locale::setLanguage('pt-br', include __DIR__.'/config/locale/pt-br.php'); Locale::setLanguage('pt-pt', include __DIR__.'/config/locale/pt-pt.php'); Locale::setLanguage('ro', include __DIR__.'/config/locale/ro.php'); Locale::setLanguage('ru', include __DIR__ . '/config/locale/ru.php'); +Locale::setLanguage('si', include __DIR__ . '/config/locale/si.php'); +Locale::setLanguage('sv', include __DIR__ . '/config/locale/sv.php'); +Locale::setLanguage('ta', include __DIR__ . '/config/locale/ta.php'); Locale::setLanguage('tr', include __DIR__.'/config/locale/tr.php'); Locale::setLanguage('ua', include __DIR__.'/config/locale/ua.php'); -Locale::setLanguage('si', include __DIR__ . '/config/locale/si.php'); +Locale::setLanguage('vi', include __DIR__.'/config/locale/vi.php'); Locale::setLanguage('zh-cn', include __DIR__.'/config/locale/zh-cn.php'); Locale::setLanguage('zh-tw', include __DIR__.'/config/locale/zh-tw.php'); From 2c08003de1f9ab175b70ef6cf2e044f28d192c77 Mon Sep 17 00:00:00 2001 From: eldadfux Date: Sun, 6 Oct 2019 21:26:34 +0300 Subject: [PATCH 17/24] Fixed encoding --- app/config/locale/lt.countries.php | 371 +++++++++++++++-------------- app/init.php | 4 +- 2 files changed, 189 insertions(+), 186 deletions(-) diff --git a/app/config/locale/lt.countries.php b/app/config/locale/lt.countries.php index 4a80d3f129..b34622c071 100644 --- a/app/config/locale/lt.countries.php +++ b/app/config/locale/lt.countries.php @@ -1,4 +1,5 @@ 'Afganistanas', 'AO' => 'Angola', @@ -9,189 +10,189 @@ return [ 'AM' => 'Armėnija', 'AG' => 'Antigva ir Barbuda', 'AU' => 'Australija', -    'AT' => 'Austrija', -    'AZ' => 'Azerbaidžanas', -    'BI' => 'Burundi', -    'BE' => 'Belgija', -    'BJ' => 'Beninas', -    'BF' => 'Burkina Faso', -    'BD' => 'Bangladešas', -    'BG' => 'Bulgarija', -    'BH' => 'Bahreinas', -    'BS' => 'Bahamai', -    'BA' => 'Bosnija ir Hercegovina', -    'BY' => 'Baltarusija', -    'BZ' => 'Baileys', -    'BO' => 'Bolivija', -    'BR' => 'Brazilija', -    'BB' => 'Barbadosas', -    'BN' => 'Brunėjus', -    'BT' => 'Butanas', -    'BW' => 'Botsvana', -    'CF' => 'Centrinės Afrikos Respublika', -    'CA' => 'Kanada', -    'CH' => 'Šveicarija', -    'CL' => 'Čilė', -    'CN' => 'Kinija', -    'CI' => 'Dramblio Kaulo Krantas', -    'CM' => 'Kamerūnas', -    'CD' => 'Kongo Demokratinė Respublika', -    'CG' => 'Kongo Respublika', -    'CO' => 'Kolumbija', -    'KM' => 'Komorai', -    'CV' => 'Žaliasis Kyšulys', -    'CR' => 'Kosta Rika', -    'CU' => 'Kuba', -    'CY' => 'Kipras', -    'CZ' => 'Čekija', -    'DE' => 'Vokietija', -    'DJ' => 'Džibutis', -    'DM' => 'Dominika', -    'DK' => 'Danija', -    'DO' => 'Dominikos Respublika', -    'DZ' => 'Alžyras', -    'EC' => 'Ekvadoras', -    'EG' => 'Egiptas', -    'ER' => 'Eritrėja', -    'ES' => 'Ispanija', -    'EE' => 'Estija', -    'ET' => 'Etiopija', -    'FI' => 'Suomija', -    'FJ' => 'Fidžis', -    'FR' => 'Prancūzija', -    'FM' => 'Mikronezija', -    'GA' => 'Gabonas', -    'GB' => 'Jungtinė Karalystė', -    'GE' => 'Gruzija', -    'GH' => 'Gana', -    'GN' => 'Gvinėja', -    'GM' => 'Gambija', -    'GW' => 'Bisau Gvinėja', -    'GQ' => 'Pusiaujo Gvinėja', -    'GR' => 'Graikija', -    'GD' => 'Grenada', -    'GT' => 'Gvatemala', -    'GY' => 'Gajana', -    'HN' => 'Hondūras', -    'HR' => 'Kroatija', -    'HT' => 'Haitis', -    'HU' => 'Vengrija', -    'ID' => 'Indonezija', -    'IN' => 'Indija', -    'IE' => 'Airija', -    'IR' => 'Iranas', -    'IQ' => 'Irakas', -    'IS' => 'Islandija', -    'IL' => 'Izraelis', -    'IT' => 'Italija', -    'JM' => 'Jamaika', -    'JO' => 'Jordanija', -    'JP' => 'Japonija', -    'KZ' => 'Kazachstanas', -    'KE' => 'Kenija', -    'KG' => 'Kirgizija', -    'KH' => 'Kambodža', -    'KI' => 'Kiribati', -    'KN' => 'Sent Kitsas ir Nevis', -    'KR' => 'Pietų Korėja', -    'KW' => 'Kuveitas', -    'LA' => 'Laosas', -    'LB' => 'Libanas', -    'LR' => 'Liberija', -    'LY' => 'Libija', -    'LC' => 'Sent Lusija', -    'LI' => 'Lichtenšteinas', -    'LK' => 'Šri Lanka', -    'LS' => 'Lesotas', -    'LT' => 'Lietuva', -    'LU' => 'Liuksemburgas', -    'LV' => 'Latvija', -    'MA' => 'Marokas', -    'MC' => 'Monaco', -    'MD' => 'Moldova', -    'MG' => 'Madagaskaras', -    'MV' => 'Maldyvai', -    'MX' => 'Meksika', -    'MH' => 'Maršalo salos', -    'MK' => 'Makedonija', -    'ML' => 'Malis', -    'MT' => 'Malta', -    'MM' => 'Mianmaras', -    'ME' => 'Juodkalnija', -    'MN' => 'Mongolija', -    'MZ' => 'Mozambikas', -    'MR' => 'Mauritanija', -    'MU' => 'Mauricijus', -    'MW' => 'Malavis', -    'MY' => 'Malaizija', -    'NA' => 'Namibija', -    'NE' => 'Nigeris', -    'NG' => 'Nigerija', -    'NI' => 'Nikaragva', -    'NL' => 'Nyderlandai', -    'NE' => 'Norvegija', -    'NP' => 'Nepalas', -    'NR' => 'Nauru', -    'NZ' => 'Naujoji Zelandija', -    'OM' => 'Omanas', -    'PK' => 'Pakistanas', -    'PA' => 'Panama', -    'PE' => 'Peru', -    'PH' => 'Filipinai', -    'PW' => 'Palau', -    'PG' => 'Papua Naujoji Gvinėja', -    'PL' => 'Lenkija', -    'KP' => 'Šiaurės Korėja', -    'PT' => 'Portugalija', -    'PY' => 'Paragvajus', -    'QA' => 'Qatar', -    'RO' => 'Rumunija', -    'RU' => 'Rusija', -    'RW' => 'Ruanda', -    'SA' => 'Saudo Arabija', -    'SD' => 'Sudanas', -    'SN' => 'Senegalas', -    'SG' => 'Singapūras', -    'SB' => 'Saliamono Salos', -    'SL' => 'Siera Leonė', -    'SV' => 'Salvadoras', -    'SM' => 'San Marino', -    'SO' => 'Somalis', -    'RS' => 'Serbija', -    'SS' => 'Pietų Sudanas', -    'ST' => 'San Tomė ir Prinsipė', -    'SR' => 'Surinamas', -    'SK' => 'Slovakija', -    'SI' => 'Slovėnija', -    'SE' => 'Švedija', -    'SZ' => 'Svazilandas', -    'SC' => 'Seišeliai', -    'SY' => 'Sirija', -    'TD' => 'Chadas', -    'TG' => 'Togo', -    'TH' => 'Tailandas', -    'TJ' => 'Tadžikistanas', -    'TM' => 'Turkmėnistanas', -    'TL' => 'Rytų Timoras', -    'TO' => 'Tonga', -    'TT' => 'Trinidadas ir Tobagas', -    'TN' => 'Tunisas', -    'TR' => 'Turkija', -    'TV' => 'Tuvalu', -    'TZ' => 'Tanzanija', -    'UG' => 'Uganda', -    'UA' => 'Ukraina', -    'UY' => 'Urugvajus', -    'US' => 'JAV', -    'UZ' => 'Uzbekistanas', -    'VA' => 'Vatikanas', -    'VC' => 'Sent Vinsentas ir Grenadinai', -    'VE' => 'Venesuela', -    'VN' => 'Vietnamas', -    'VU' => 'Vanuatu', -    'WS' => 'Samoa', -    'YE' => 'Jemenas', -    'ZA' => 'Pietų Afrika', -    'ZM' => 'Zambija', -    'ZW' => 'Zimbabvė', + 'AT' => 'Austrija', + 'AZ' => 'Azerbaidžanas', + 'BI' => 'Burundi', + 'BE' => 'Belgija', + 'BJ' => 'Beninas', + 'BF' => 'Burkina Faso', + 'BD' => 'Bangladešas', + 'BG' => 'Bulgarija', + 'BH' => 'Bahreinas', + 'BS' => 'Bahamai', + 'BA' => 'Bosnija ir Hercegovina', + 'BY' => 'Baltarusija', + 'BZ' => 'Baileys', + 'BO' => 'Bolivija', + 'BR' => 'Brazilija', + 'BB' => 'Barbadosas', + 'BN' => 'Brunėjus', + 'BT' => 'Butanas', + 'BW' => 'Botsvana', + 'CF' => 'Centrinės Afrikos Respublika', + 'CA' => 'Kanada', + 'CH' => 'Šveicarija', + 'CL' => 'Čilė', + 'CN' => 'Kinija', + 'CI' => 'Dramblio Kaulo Krantas', + 'CM' => 'Kamerūnas', + 'CD' => 'Kongo Demokratinė Respublika', + 'CG' => 'Kongo Respublika', + 'CO' => 'Kolumbija', + 'KM' => 'Komorai', + 'CV' => 'Žaliasis Kyšulys', + 'CR' => 'Kosta Rika', + 'CU' => 'Kuba', + 'CY' => 'Kipras', + 'CZ' => 'Čekija', + 'DE' => 'Vokietija', + 'DJ' => 'Džibutis', + 'DM' => 'Dominika', + 'DK' => 'Danija', + 'DO' => 'Dominikos Respublika', + 'DZ' => 'Alžyras', + 'EC' => 'Ekvadoras', + 'EG' => 'Egiptas', + 'ER' => 'Eritrėja', + 'ES' => 'Ispanija', + 'EE' => 'Estija', + 'ET' => 'Etiopija', + 'FI' => 'Suomija', + 'FJ' => 'Fidžis', + 'FR' => 'Prancūzija', + 'FM' => 'Mikronezija', + 'GA' => 'Gabonas', + 'GB' => 'Jungtinė Karalystė', + 'GE' => 'Gruzija', + 'GH' => 'Gana', + 'GN' => 'Gvinėja', + 'GM' => 'Gambija', + 'GW' => 'Bisau Gvinėja', + 'GQ' => 'Pusiaujo Gvinėja', + 'GR' => 'Graikija', + 'GD' => 'Grenada', + 'GT' => 'Gvatemala', + 'GY' => 'Gajana', + 'HN' => 'Hondūras', + 'HR' => 'Kroatija', + 'HT' => 'Haitis', + 'HU' => 'Vengrija', + 'ID' => 'Indonezija', + 'IN' => 'Indija', + 'IE' => 'Airija', + 'IR' => 'Iranas', + 'IQ' => 'Irakas', + 'IS' => 'Islandija', + 'IL' => 'Izraelis', + 'IT' => 'Italija', + 'JM' => 'Jamaika', + 'JO' => 'Jordanija', + 'JP' => 'Japonija', + 'KZ' => 'Kazachstanas', + 'KE' => 'Kenija', + 'KG' => 'Kirgizija', + 'KH' => 'Kambodža', + 'KI' => 'Kiribati', + 'KN' => 'Sent Kitsas ir Nevis', + 'KR' => 'Pietų Korėja', + 'KW' => 'Kuveitas', + 'LA' => 'Laosas', + 'LB' => 'Libanas', + 'LR' => 'Liberija', + 'LY' => 'Libija', + 'LC' => 'Sent Lusija', + 'LI' => 'Lichtenšteinas', + 'LK' => 'Šri Lanka', + 'LS' => 'Lesotas', + 'LT' => 'Lietuva', + 'LU' => 'Liuksemburgas', + 'LV' => 'Latvija', + 'MA' => 'Marokas', + 'MC' => 'Monaco', + 'MD' => 'Moldova', + 'MG' => 'Madagaskaras', + 'MV' => 'Maldyvai', + 'MX' => 'Meksika', + 'MH' => 'Maršalo salos', + 'MK' => 'Makedonija', + 'ML' => 'Malis', + 'MT' => 'Malta', + 'MM' => 'Mianmaras', + 'ME' => 'Juodkalnija', + 'MN' => 'Mongolija', + 'MZ' => 'Mozambikas', + 'MR' => 'Mauritanija', + 'MU' => 'Mauricijus', + 'MW' => 'Malavis', + 'MY' => 'Malaizija', + 'NA' => 'Namibija', + 'NE' => 'Nigeris', + 'NG' => 'Nigerija', + 'NI' => 'Nikaragva', + 'NL' => 'Nyderlandai', + 'NE' => 'Norvegija', + 'NP' => 'Nepalas', + 'NR' => 'Nauru', + 'NZ' => 'Naujoji Zelandija', + 'OM' => 'Omanas', + 'PK' => 'Pakistanas', + 'PA' => 'Panama', + 'PE' => 'Peru', + 'PH' => 'Filipinai', + 'PW' => 'Palau', + 'PG' => 'Papua Naujoji Gvinėja', + 'PL' => 'Lenkija', + 'KP' => 'Šiaurės Korėja', + 'PT' => 'Portugalija', + 'PY' => 'Paragvajus', + 'QA' => 'Qatar', + 'RO' => 'Rumunija', + 'RU' => 'Rusija', + 'RW' => 'Ruanda', + 'SA' => 'Saudo Arabija', + 'SD' => 'Sudanas', + 'SN' => 'Senegalas', + 'SG' => 'Singapūras', + 'SB' => 'Saliamono Salos', + 'SL' => 'Siera Leonė', + 'SV' => 'Salvadoras', + 'SM' => 'San Marino', + 'SO' => 'Somalis', + 'RS' => 'Serbija', + 'SS' => 'Pietų Sudanas', + 'ST' => 'San Tomė ir Prinsipė', + 'SR' => 'Surinamas', + 'SK' => 'Slovakija', + 'SI' => 'Slovėnija', + 'SE' => 'Švedija', + 'SZ' => 'Svazilandas', + 'SC' => 'Seišeliai', + 'SY' => 'Sirija', + 'TD' => 'Chadas', + 'TG' => 'Togo', + 'TH' => 'Tailandas', + 'TJ' => 'Tadžikistanas', + 'TM' => 'Turkmėnistanas', + 'TL' => 'Rytų Timoras', + 'TO' => 'Tonga', + 'TT' => 'Trinidadas ir Tobagas', + 'TN' => 'Tunisas', + 'TR' => 'Turkija', + 'TV' => 'Tuvalu', + 'TZ' => 'Tanzanija', + 'UG' => 'Uganda', + 'UA' => 'Ukraina', + 'UY' => 'Urugvajus', + 'US' => 'JAV', + 'UZ' => 'Uzbekistanas', + 'VA' => 'Vatikanas', + 'VC' => 'Sent Vinsentas ir Grenadinai', + 'VE' => 'Venesuela', + 'VN' => 'Vietnamas', + 'VU' => 'Vanuatu', + 'WS' => 'Samoa', + 'YE' => 'Jemenas', + 'ZA' => 'Pietų Afrika', + 'ZM' => 'Zambija', + 'ZW' => 'Zimbabvė', ]; diff --git a/app/init.php b/app/init.php index 43b8b0f68f..d399a59dc6 100644 --- a/app/init.php +++ b/app/init.php @@ -24,7 +24,7 @@ const APP_EMAIL_TEAM = 'team@'.APP_DOMAIN; const APP_EMAIL_SECURITY = 'security@'.APP_DOMAIN; const APP_USERAGENT = APP_NAME.'-Server/%s Please report abuse at '.APP_EMAIL_SECURITY; const APP_MODE_ADMIN = 'admin'; -const APP_LOCALES = ['af', 'ar', 'cat', 'cz', 'de', 'en', 'es', 'fi', 'fr', 'gr', 'he', 'hi', 'hu', 'id', 'it', 'lt', 'nl', 'no', 'pl', 'pt-br', 'pt-pt', 'ro', 'ru', 'si', 'sv', 'ta', 'tr', 'ua', 'vi', 'zh-cn', 'zh-tw']; +const APP_LOCALES = ['af', 'ar', 'cat', 'cz', 'de', 'en', 'es', 'fi', 'fr', 'gr', 'he', 'hi', 'hu', 'id', 'it', 'jv', 'lt', 'nl', 'no', 'pl', 'pt-br', 'pt-pt', 'ro', 'ru', 'si', 'sl', 'sv', 'ta', 'tr', 'ua', 'vi', 'zh-cn', 'zh-tw']; const APP_PAGING_LIMIT = 15; const APP_VERSION_STABLE = '0.2.0'; @@ -144,6 +144,7 @@ Locale::setLanguage('hi', include __DIR__.'/config/locale/hi.php'); Locale::setLanguage('hu', include __DIR__.'/config/locale/hu.php'); Locale::setLanguage('id', include __DIR__.'/config/locale/id.php'); Locale::setLanguage('it', include __DIR__.'/config/locale/it.php'); +Locale::setLanguage('jv', include __DIR__.'/config/locale/jv.php'); Locale::setLanguage('lt', include __DIR__.'/config/locale/lt.php'); Locale::setLanguage('nl', include __DIR__.'/config/locale/nl.php'); Locale::setLanguage('no', include __DIR__.'/config/locale/no.php'); @@ -153,6 +154,7 @@ Locale::setLanguage('pt-pt', include __DIR__.'/config/locale/pt-pt.php'); Locale::setLanguage('ro', include __DIR__.'/config/locale/ro.php'); Locale::setLanguage('ru', include __DIR__ . '/config/locale/ru.php'); Locale::setLanguage('si', include __DIR__ . '/config/locale/si.php'); +Locale::setLanguage('sl', include __DIR__ . '/config/locale/sl.php'); Locale::setLanguage('sv', include __DIR__ . '/config/locale/sv.php'); Locale::setLanguage('ta', include __DIR__ . '/config/locale/ta.php'); Locale::setLanguage('tr', include __DIR__.'/config/locale/tr.php'); From 79de27fa27ec6d0e2b3fa34d3cba6fb85b5d6083 Mon Sep 17 00:00:00 2001 From: eldadfux Date: Sun, 6 Oct 2019 21:28:58 +0300 Subject: [PATCH 18/24] Updated encoding --- app/config/locale/jv.continents.php | 12 +- app/config/locale/jv.countries.php | 380 ++++++++++++++-------------- 2 files changed, 196 insertions(+), 196 deletions(-) diff --git a/app/config/locale/jv.continents.php b/app/config/locale/jv.continents.php index f20efb8cfa..0170466ce4 100644 --- a/app/config/locale/jv.continents.php +++ b/app/config/locale/jv.continents.php @@ -2,10 +2,10 @@ return [ 'AF' => 'Afrika', -    'AN' => 'Antartika', -    'AS' => 'Asia', -    'EU' => 'Eropa', -    'NA' => 'Amérika Lor', -    'OC' => 'Oseania', -    'SA' => 'Amérika Kidul', + 'AN' => 'Antartika', + 'AS' => 'Asia', + 'EU' => 'Eropa', + 'NA' => 'Amérika Lor', + 'OC' => 'Oseania', + 'SA' => 'Amérika Kidul', ]; diff --git a/app/config/locale/jv.countries.php b/app/config/locale/jv.countries.php index 1b781e36bf..fd48dfa891 100644 --- a/app/config/locale/jv.countries.php +++ b/app/config/locale/jv.countries.php @@ -2,197 +2,197 @@ return [ 'AF' => 'Afghanistan', -    'AO' => 'Angola', -    'AL' => 'Albania', -    'AD' => 'Andorra', -    'AE' => 'Uni Emirat Arab', -    'AR' => 'Argentina', -    'AM' => 'Armenia', -    'AG' => 'Antigua lan Barbuda', -    'AU' => 'Australia', -    'AT' => 'Austria', -    'AZ' => 'Azerbaijan', -    'BI' => 'Burundi', -    'BE' => 'Belgia', -    'BJ' => 'Benin', -    'BF' => 'Burkina Faso', -    'BD' => 'Bangladesh', -    'BG' => 'Bulgaria', -    'BH' => 'Bahrain', -    'BS' => 'Bahamas', -    'BA' => 'Bosnia lan Herzegovina', -    'BY' => 'Belarus', -    'BZ' => 'Belize', -    'BO' => 'Bolivia', -    'BR' => 'Brasil', -    'BB' => 'Barbados', -    'BN' => 'Brunei', -    'BT' => 'Bhutan', -    'BW' => 'Botswana', -    'CF' => 'Republik Afrika Tengah', -    'CA' => 'Kanada', -    'CH' => 'Swiss', -    'CL' => 'Chile', -    'CN' => 'China', -    'CI' => 'Pantai Gading', -    'CM' => 'Kamerun', -    'CD' => 'DR Kongo', -    'CG' => 'Republik Kongo', -    'CO' => 'Kolombia', -    'KM' => 'Comoros', -    'CV' => 'Cape Verde', -    'CR' => 'Costa Rica', -    'CU' => 'Kuba', -    'CY' => 'Siprus', -    'CZ' => 'Czechia', -    'DE' => 'Jerman', -    'DJ' => 'Djibouti', -    'DM' => 'Dominika', -    'DK' => 'Denmark', -    'DO' => 'Republik Dominika', -    'DZ' => 'Algeria', -    'EC' => 'Ekuador', -    'EG' => 'Mesir', -    'ER' => 'Eritrea', -    'ES' => 'Spanyol', -    'EE' => 'Estonia', -    'ET' => 'Ethiopia', -    'FI' => 'Finlandia', + 'AO' => 'Angola', + 'AL' => 'Albania', + 'AD' => 'Andorra', + 'AE' => 'Uni Emirat Arab', + 'AR' => 'Argentina', + 'AM' => 'Armenia', + 'AG' => 'Antigua lan Barbuda', + 'AU' => 'Australia', + 'AT' => 'Austria', + 'AZ' => 'Azerbaijan', + 'BI' => 'Burundi', + 'BE' => 'Belgia', + 'BJ' => 'Benin', + 'BF' => 'Burkina Faso', + 'BD' => 'Bangladesh', + 'BG' => 'Bulgaria', + 'BH' => 'Bahrain', + 'BS' => 'Bahamas', + 'BA' => 'Bosnia lan Herzegovina', + 'BY' => 'Belarus', + 'BZ' => 'Belize', + 'BO' => 'Bolivia', + 'BR' => 'Brasil', + 'BB' => 'Barbados', + 'BN' => 'Brunei', + 'BT' => 'Bhutan', + 'BW' => 'Botswana', + 'CF' => 'Republik Afrika Tengah', + 'CA' => 'Kanada', + 'CH' => 'Swiss', + 'CL' => 'Chile', + 'CN' => 'China', + 'CI' => 'Pantai Gading', + 'CM' => 'Kamerun', + 'CD' => 'DR Kongo', + 'CG' => 'Republik Kongo', + 'CO' => 'Kolombia', + 'KM' => 'Comoros', + 'CV' => 'Cape Verde', + 'CR' => 'Costa Rica', + 'CU' => 'Kuba', + 'CY' => 'Siprus', + 'CZ' => 'Czechia', + 'DE' => 'Jerman', + 'DJ' => 'Djibouti', + 'DM' => 'Dominika', + 'DK' => 'Denmark', + 'DO' => 'Republik Dominika', + 'DZ' => 'Algeria', + 'EC' => 'Ekuador', + 'EG' => 'Mesir', + 'ER' => 'Eritrea', + 'ES' => 'Spanyol', + 'EE' => 'Estonia', + 'ET' => 'Ethiopia', + 'FI' => 'Finlandia', 'FJ' => 'Fiji', -    'FR' => 'Prancis', -    'FM' => 'Mikronesia', -    'GA' => 'Gabon', -    'GB' => 'Inggris', -    'GE' => 'Georgia', -    'GH' => 'Ghana', -    'GN' => 'Guinea', -    'GM' => 'Gambia', -    'GW' => 'Guinea-Bissau', -    'GQ' => 'Guinea Khatulistiwa', -    'GR' => 'Yunani', -    'GD' => 'Grenada', -    'GT' => 'Guatemala', -    'GY' => 'Guyana', -    'HN' => 'Honduras', -    'HR' => 'Croatia', -    'HT' => 'Haiti', -    'HU' => 'Hongaria', -    'ID' => 'Indonesia', -    'IN' => 'India', -    'IE' => 'Irlandia', -    'IR' => 'Iran', -    'IQ' => 'Irak', -    'IS' => 'Islandia', -    'IL' => 'Israel', -    'IT' => 'Italia', -    'JM' => 'Jamaika', -    'JO' => 'Yordania', -    'JP' => 'Jepang', -    'KZ' => 'Kazakhstan', -    'KE' => 'Kenya', -    'KG' => 'Kyrgyzstan', -    'KH' => 'Kamboja', -    'KI' => 'Kiribati', -    'KN' => 'Saint Kitts lan Nevis', -    'KR' => 'Korea Kidul', -    'KW' => 'Kuwait', -    'LA' => 'Laos', -    'LB' => 'Libanon', -    'LR' => 'Liberia', -    'LY' => 'Libya', -    'LC' => 'Saint Lucia', -    'LI' => 'Liechtenstein', -    'LK' => 'Sri Lanka', -    'LS' => 'Lesotho', -    'LT' => 'Lithuania', -    'LU' => 'Luksemburg', -    'LV' => 'Latvia', -    'MA' => 'Maroko', -    'MC' => 'Monaco', -    'MD' => 'Moldova', -    'MG' => 'Madagascar', -    'MV' => 'Maldives', -    'MX' => 'Meksiko', -    'MH' => 'Kepulauan Marshall', -    'MK' => 'Makedonia', -    'ML' => 'Mali', -    'MT' => 'Malta', -    'MM' => 'Myanmar', + 'FR' => 'Prancis', + 'FM' => 'Mikronesia', + 'GA' => 'Gabon', + 'GB' => 'Inggris', + 'GE' => 'Georgia', + 'GH' => 'Ghana', + 'GN' => 'Guinea', + 'GM' => 'Gambia', + 'GW' => 'Guinea-Bissau', + 'GQ' => 'Guinea Khatulistiwa', + 'GR' => 'Yunani', + 'GD' => 'Grenada', + 'GT' => 'Guatemala', + 'GY' => 'Guyana', + 'HN' => 'Honduras', + 'HR' => 'Croatia', + 'HT' => 'Haiti', + 'HU' => 'Hongaria', + 'ID' => 'Indonesia', + 'IN' => 'India', + 'IE' => 'Irlandia', + 'IR' => 'Iran', + 'IQ' => 'Irak', + 'IS' => 'Islandia', + 'IL' => 'Israel', + 'IT' => 'Italia', + 'JM' => 'Jamaika', + 'JO' => 'Yordania', + 'JP' => 'Jepang', + 'KZ' => 'Kazakhstan', + 'KE' => 'Kenya', + 'KG' => 'Kyrgyzstan', + 'KH' => 'Kamboja', + 'KI' => 'Kiribati', + 'KN' => 'Saint Kitts lan Nevis', + 'KR' => 'Korea Kidul', + 'KW' => 'Kuwait', + 'LA' => 'Laos', + 'LB' => 'Libanon', + 'LR' => 'Liberia', + 'LY' => 'Libya', + 'LC' => 'Saint Lucia', + 'LI' => 'Liechtenstein', + 'LK' => 'Sri Lanka', + 'LS' => 'Lesotho', + 'LT' => 'Lithuania', + 'LU' => 'Luksemburg', + 'LV' => 'Latvia', + 'MA' => 'Maroko', + 'MC' => 'Monaco', + 'MD' => 'Moldova', + 'MG' => 'Madagascar', + 'MV' => 'Maldives', + 'MX' => 'Meksiko', + 'MH' => 'Kepulauan Marshall', + 'MK' => 'Makedonia', + 'ML' => 'Mali', + 'MT' => 'Malta', + 'MM' => 'Myanmar', 'ME' => 'Montenegro', -    'MN' => 'Mongolia', -    'MZ' => 'Mozambique', -    'MR' => 'Mauritania', -    'MU' => 'Mauritius', -    'MW' => 'Malawi', -    'MY' => 'Malaysia', -    'NA' => 'Namibia', -    'NE' => 'Niger', -    'NG' => 'Nigeria', -    'NI' => 'Nikaragua', -    'NL' => 'Belanda', -    'NO' => 'Norwegia', -    'NP' => 'Nepal', -    'NR' => 'Nauru', -    'NZ' => 'Selandia Anyar', -    'OM' => 'Oman', -    'PK' => 'Pakistan', -    'PA' => 'Panama', -    'PE' => 'Peru', -    'PH' => 'Filipina', -    'PW' => 'Palau', -    'PG' => 'Papua Nugini', -    'PL' => 'Polandia', -    'KP' => 'Korea Lor', -    'PT' => 'Portugal', -    'PY' => 'Paraguay', -    'QA' => 'Qatar', -    'RO' => 'Romania', -    'RU' => 'Rusia', -    'RW' => 'Rwanda', -    'SA' => 'Arab Saudi', -    'SD' => 'Sudan', -    'SN' => 'Senegal', -    'SG' => 'Singapura', -    'SB' => 'Kepulauan Solomon', -    'SL' => 'Sierra Leone', -    'SV' => 'El Salvador', -    'SM' => 'San Marino', -    'SO' => 'Somalia', -    'RS' => 'Serbia', -    'SS' => 'Sudan Kidul', -    'ST' => 'São Tomé lan Príncipe', -    'SR' => 'Suriname', -    'SK' => 'Slowakia', -    'SI' => 'Slovenia', -    'SE' => 'Swedia', -    'SZ' => 'Swaziland', -    'SC' => 'Seychelles', -    'SY' => 'Suriah', -    'TD' => 'Chad', -    'TG' => 'Togo', -    'TH' => 'Thailand', -    'TJ' => 'Tajikistan', -    'TM' => 'Turkmenistan', -    'TL' => 'Timor-Leste', -    'TO' => 'Tonga', -    'TT' => 'Trinidad lan Tobago', -    'TN' => 'Tunisia', -    'TR' => 'Turki', + 'MN' => 'Mongolia', + 'MZ' => 'Mozambique', + 'MR' => 'Mauritania', + 'MU' => 'Mauritius', + 'MW' => 'Malawi', + 'MY' => 'Malaysia', + 'NA' => 'Namibia', + 'NE' => 'Niger', + 'NG' => 'Nigeria', + 'NI' => 'Nikaragua', + 'NL' => 'Belanda', + 'NO' => 'Norwegia', + 'NP' => 'Nepal', + 'NR' => 'Nauru', + 'NZ' => 'Selandia Anyar', + 'OM' => 'Oman', + 'PK' => 'Pakistan', + 'PA' => 'Panama', + 'PE' => 'Peru', + 'PH' => 'Filipina', + 'PW' => 'Palau', + 'PG' => 'Papua Nugini', + 'PL' => 'Polandia', + 'KP' => 'Korea Lor', + 'PT' => 'Portugal', + 'PY' => 'Paraguay', + 'QA' => 'Qatar', + 'RO' => 'Romania', + 'RU' => 'Rusia', + 'RW' => 'Rwanda', + 'SA' => 'Arab Saudi', + 'SD' => 'Sudan', + 'SN' => 'Senegal', + 'SG' => 'Singapura', + 'SB' => 'Kepulauan Solomon', + 'SL' => 'Sierra Leone', + 'SV' => 'El Salvador', + 'SM' => 'San Marino', + 'SO' => 'Somalia', + 'RS' => 'Serbia', + 'SS' => 'Sudan Kidul', + 'ST' => 'São Tomé lan Príncipe', + 'SR' => 'Suriname', + 'SK' => 'Slowakia', + 'SI' => 'Slovenia', + 'SE' => 'Swedia', + 'SZ' => 'Swaziland', + 'SC' => 'Seychelles', + 'SY' => 'Suriah', + 'TD' => 'Chad', + 'TG' => 'Togo', + 'TH' => 'Thailand', + 'TJ' => 'Tajikistan', + 'TM' => 'Turkmenistan', + 'TL' => 'Timor-Leste', + 'TO' => 'Tonga', + 'TT' => 'Trinidad lan Tobago', + 'TN' => 'Tunisia', + 'TR' => 'Turki', 'TV' => 'Tuvalu', -    'TZ' => 'Tanzania', -    'UG' => 'Uganda', -    'UA' => 'Ukraina', -    'UY' => 'Uruguay', -    'US' => 'Amerika Serikat', -    'UZ' => 'Uzbekistan', -    'VA' => 'Kota Vatikan', -    'VC' => 'Saint Vincent lan Grenadines', -    'VE' => 'Venezuela', -    'VN' => 'Vietnam', -    'VU' => 'Vanuatu', -    'WS' => 'Samoa', -    'YE' => 'Yaman', -    'ZA' => 'Afrika Kidul', -    'ZM' => 'Zambia', -    'ZW' => 'Zimbabwe', + 'TZ' => 'Tanzania', + 'UG' => 'Uganda', + 'UA' => 'Ukraina', + 'UY' => 'Uruguay', + 'US' => 'Amerika Serikat', + 'UZ' => 'Uzbekistan', + 'VA' => 'Kota Vatikan', + 'VC' => 'Saint Vincent lan Grenadines', + 'VE' => 'Venezuela', + 'VN' => 'Vietnam', + 'VU' => 'Vanuatu', + 'WS' => 'Samoa', + 'YE' => 'Yaman', + 'ZA' => 'Afrika Kidul', + 'ZM' => 'Zambia', + 'ZW' => 'Zimbabwe', ]; From 228096434d2f765a3cc8a3a7850a7a299dd367fe Mon Sep 17 00:00:00 2001 From: eldadfux Date: Sun, 6 Oct 2019 22:37:55 +0300 Subject: [PATCH 19/24] resorted docs --- CONTRIBUTING.md | 2 +- docs/{AddOAuthProvider.md => tutorials/add-oauth-provider.md} | 0 .../environment-variables.md} | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename docs/{AddOAuthProvider.md => tutorials/add-oauth-provider.md} (100%) rename docs/{EnvironmentVariables.md => tutorials/environment-variables.md} (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a1d0e90ec4..6d84a6b9be 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -123,4 +123,4 @@ Before running the command make sure you have proper write permissions to Appwri From time to time our team will add tutorials that will help contributors find there way in the Appwrite source code. Below is a list of currently available tutorials: -* [Adding Support for a New OAuth Provider](./docs/AddOAuthProvider.md) +* [Adding Support for a New OAuth Provider](./docs/tutorials/add-oauth-provider.md) diff --git a/docs/AddOAuthProvider.md b/docs/tutorials/add-oauth-provider.md similarity index 100% rename from docs/AddOAuthProvider.md rename to docs/tutorials/add-oauth-provider.md diff --git a/docs/EnvironmentVariables.md b/docs/tutorials/environment-variables.md similarity index 100% rename from docs/EnvironmentVariables.md rename to docs/tutorials/environment-variables.md From f3ce86ed6321405b66c1e7f1e745956cc259158b Mon Sep 17 00:00:00 2001 From: eldadfux Date: Sun, 6 Oct 2019 23:10:52 +0300 Subject: [PATCH 20/24] Exporting docs to md file+fixed routes indentation --- app/controllers/account.php | 24 +- app/controllers/auth.php | 140 ++------ app/controllers/avatars.php | 89 ++--- app/controllers/console.php | 4 +- app/controllers/database.php | 164 +++------ app/controllers/projects.php | 416 ++++++---------------- app/controllers/storage.php | 99 ++--- app/controllers/teams.php | 108 ++---- app/controllers/users.php | 72 +--- docs/references/auth/confirm-resend.md | 3 + docs/references/auth/confirm.md | 1 + docs/references/auth/login.md | 5 + docs/references/auth/logout-by-session.md | 1 + docs/references/auth/logout.md | 1 + docs/references/auth/recovery-reset.md | 3 + docs/references/auth/recovery.md | 1 + docs/references/auth/register.md | 7 + 17 files changed, 305 insertions(+), 833 deletions(-) create mode 100644 docs/references/auth/confirm-resend.md create mode 100644 docs/references/auth/confirm.md create mode 100644 docs/references/auth/login.md create mode 100644 docs/references/auth/logout-by-session.md create mode 100644 docs/references/auth/logout.md create mode 100644 docs/references/auth/recovery-reset.md create mode 100644 docs/references/auth/recovery.md create mode 100644 docs/references/auth/register.md diff --git a/app/controllers/account.php b/app/controllers/account.php index cb95a0f3e1..1809ade66b 100644 --- a/app/controllers/account.php +++ b/app/controllers/account.php @@ -202,9 +202,7 @@ $utopia->patch('/v1/account/name') ->label('sdk.namespace', 'account') ->label('sdk.method', 'updateName') ->label('sdk.description', 'Update currently logged in user account name.') - ->param('name', '', function () { - return new Text(100); - }, 'User name') + ->param('name', '', function () { return new Text(100); }, 'User name') ->action( function ($name) use ($response, $user, $projectDB, $audit) { $user = $projectDB->updateDocument(array_merge($user->getArrayCopy(), [ @@ -228,12 +226,8 @@ $utopia->patch('/v1/account/password') ->label('sdk.namespace', 'account') ->label('sdk.method', 'updatePassword') ->label('sdk.description', 'Update currently logged in user password. For validation, user is required to pass the password twice.') - ->param('password', '', function () { - return new Password(); - }, 'New password') - ->param('old-password', '', function () { - return new Password(); - }, 'Old password') + ->param('password', '', function () { return new Password(); }, 'New password') + ->param('old-password', '', function () { return new Password(); }, 'Old password') ->action( function ($password, $oldPassword) use ($response, $user, $projectDB, $audit) { if (!Auth::passwordVerify($oldPassword, $user->getAttribute('password'))) { // Double check user password @@ -261,12 +255,8 @@ $utopia->patch('/v1/account/email') ->label('sdk.namespace', 'account') ->label('sdk.method', 'updateEmail') ->label('sdk.description', 'Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.') - ->param('email', '', function () { - return new Email(); - }, 'Email Address') - ->param('password', '', function () { - return new Password(); - }, 'User Password') + ->param('email', '', function () { return new Email(); }, 'Email Address') + ->param('password', '', function () { return new Password(); }, 'User Password') ->action( function ($email, $password) use ($response, $user, $projectDB, $audit) { if (!Auth::passwordVerify($password, $user->getAttribute('password'))) { // Double check user password @@ -308,9 +298,7 @@ $utopia->patch('/v1/account/prefs') ->label('scope', 'account') ->label('sdk.namespace', 'account') ->label('sdk.method', 'updatePrefs') - ->param('prefs', '', function () { - return new \Utopia\Validator\Mock(); - }, 'Prefs key-value JSON object string.') + ->param('prefs', '', function () { return new \Utopia\Validator\Mock();}, 'Prefs key-value JSON object string.') ->label('sdk.description', 'Update currently logged in user account preferences. You can pass only the specific settings you wish to update.') ->action( function ($prefs) use ($response, $user, $projectDB, $audit) { diff --git a/app/controllers/auth.php b/app/controllers/auth.php index 849f783113..1d0e260c9c 100644 --- a/app/controllers/auth.php +++ b/app/controllers/auth.php @@ -24,27 +24,15 @@ $utopia->post('/v1/auth/register') ->label('scope', 'auth') ->label('sdk.namespace', 'auth') ->label('sdk.method', 'register') - ->label('sdk.description', "Use this endpoint to allow a new user to register an account in your project. Use the success and failure URL's to redirect users back to your application after signup completes.\n\nIf registration completes successfully user will be sent with a confirmation email in order to confirm he is the owner of the account email address. Use the confirmation parameter to redirect the user from the confirmation email back to your app. When the user is redirected, use the /auth/confirm endpoint to complete the account confirmation.\n\nPlease notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.\n\nWhen accessing this route using JavaScript from the browser, success and failure parameter URLs are required. Appwrite server will respond with a 301 redirect status code and will set the user session cookie. This behavior is enforced because modern browsers are limiting 3rd party cookies in XHR of fetch requests to protect user privacy.") + ->label('sdk.description', '/docs/refernces/register.md') ->label('sdk.cookies', true) ->label('abuse-limit', 10) - ->param('email', '', function () { - return new Email(); - }, 'Account email') - ->param('password', '', function () { - return new Password(); - }, 'User password') - ->param('confirm', '', function () use ($clients) { - return new Host($clients); - }, 'Confirmation URL to redirect user after confirm token has been sent to user email') // TODO add our own built-in confirm page - ->param('success', null, function () use ($clients) { - return new Host($clients); - }, 'Redirect when registration succeed', true) - ->param('failure', null, function () use ($clients) { - return new Host($clients); - }, 'Redirect when registration failed', true) - ->param('name', '', function () { - return new Text(100); - }, 'User name', true) + ->param('email', '', function () { return new Email(); }, 'Account email') + ->param('password', '', function () { return new Password(); }, 'User password') + ->param('confirm', '', function () use ($clients) { return new Host($clients); }, 'Confirmation URL to redirect user after confirm token has been sent to user email') // TODO add our own built-in confirm page + ->param('success', null, function () use ($clients) { return new Host($clients); }, 'Redirect when registration succeed', true) + ->param('failure', null, function () use ($clients) { return new Host($clients); }, 'Redirect when registration failed', true) + ->param('name', '', function () { return new Text(100); }, 'User name', true) ->action( function ($email, $password, $confirm, $success, $failure, $name) use ($request, $response, $register, $audit, $projectDB, $project, $webhook) { if ('console' === $project->getUid()) { @@ -202,15 +190,11 @@ $utopia->post('/v1/auth/register/confirm') ->label('scope', 'public') ->label('sdk.namespace', 'auth') ->label('sdk.method', 'confirm') - ->label('sdk.description', 'Use this endpoint to complete the confirmation of the user account email address. Both the **userId** and **token** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the /auth/register endpoint.') + ->label('sdk.description', '/docs/refernces/confirm.md') ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{param-userId}') - ->param('userId', '', function () { - return new UID(); - }, 'User unique ID') - ->param('token', '', function () { - return new Text(256); - }, 'Confirmation secret token') + ->param('userId', '', function () { return new UID(); }, 'User unique ID') + ->param('token', '', function () { return new Text(256); }, 'Confirmation secret token') ->action( function ($userId, $token) use ($response, $request, $projectDB, $audit) { $profile = $projectDB->getCollection([ // Get user by email address @@ -256,12 +240,10 @@ $utopia->post('/v1/auth/register/confirm/resend') ->label('scope', 'account') ->label('sdk.namespace', 'auth') ->label('sdk.method', 'confirmResend') - ->label('sdk.description', "This endpoint allows the user to request your app to resend him his email confirmation message. The redirect arguments acts the same way as in /auth/register endpoint.\n\nPlease notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.") + ->label('sdk.description', '/docs/refernces/confirm-resend.md') ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{param-userId}') - ->param('confirm', '', function () use ($clients) { - return new Host($clients); - }, 'Confirmation URL to redirect user to your app after confirm token has been sent to user email.') + ->param('confirm', '', function () use ($clients) { return new Host($clients); }, 'Confirmation URL to redirect user to your app after confirm token has been sent to user email.') ->action( function ($confirm) use ($response, $request, $projectDB, $user, $register, $project) { if ($user->getAttribute('confirm', false)) { @@ -322,22 +304,14 @@ $utopia->post('/v1/auth/login') ->label('scope', 'auth') ->label('sdk.namespace', 'auth') ->label('sdk.method', 'login') - ->label('sdk.description', "Allow the user to login into his account by providing a valid email and password combination. Use the success and failure arguments to provide a redirect URL\'s back to your app when login is completed. \n\nPlease notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.\n\nWhen accessing this route using JavaScript from the browser, success and failure parameter URLs are required. Appwrite server will respond with a 301 redirect status code and will set the user session cookie. This behavior is enforced because modern browsers are limiting 3rd party cookies in XHR of fetch requests to protect user privacy.") + ->label('sdk.description', '/docs/refernces/login.md') ->label('sdk.cookies', true) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') - ->param('email', '', function () { - return new Email(); - }, 'User account email address') - ->param('password', '', function () { - return new Password(); - }, 'User account password') - ->param('success', null, function () use ($clients) { - return new Host($clients); - }, 'URL to redirect back to your app after a successful login attempt.') - ->param('failure', null, function () use ($clients) { - return new Host($clients); - }, 'URL to redirect back to your app after a failed login attempt.') + ->param('email', '', function () { return new Email(); }, 'User account email address') + ->param('password', '', function () { return new Password(); }, 'User account password') + ->param('success', null, function () use ($clients) { return new Host($clients); }, 'URL to redirect back to your app after a successful login attempt.') + ->param('failure', null, function () use ($clients) { return new Host($clients); }, 'URL to redirect back to your app after a failed login attempt.') ->action( function ($email, $password, $success, $failure) use ($response, $request, $projectDB, $audit, $webhook) { $profile = $projectDB->getCollection([ // Get user by email address @@ -415,7 +389,7 @@ $utopia->delete('/v1/auth/logout') ->label('scope', 'account') ->label('sdk.namespace', 'auth') ->label('sdk.method', 'logout') - ->label('sdk.description', 'Use this endpoint to log out the currently logged in user from his account. When succeed this endpoint will delete the user session and remove the session secret cookie from the user client.') + ->label('sdk.description', '/docs/refernces/logout.md') ->label('abuse-limit', 100) ->action( function () use ($response, $request, $user, $projectDB, $audit, $webhook) { @@ -446,11 +420,9 @@ $utopia->delete('/v1/auth/logout/:id') ->label('scope', 'account') ->label('sdk.namespace', 'auth') ->label('sdk.method', 'logoutBySession') - ->label('sdk.description', 'Use this endpoint to log out the currently logged in user from all his account sessions across all his different devices. When using the option id argument, only the session unique ID provider will be deleted.') + ->label('sdk.description', '/docs/refernces/logout-by-session.md') ->label('abuse-limit', 100) - ->param('id', null, function () { - return new UID(); - }, 'User specific session unique ID number. if 0 delete all sessions.') + ->param('id', null, function () { return new UID(); }, 'User specific session unique ID number. if 0 delete all sessions.') ->action( function ($id) use ($response, $request, $user, $projectDB, $audit) { $tokens = $user->getAttribute('tokens', []); @@ -481,15 +453,11 @@ $utopia->post('/v1/auth/recovery') ->label('scope', 'auth') ->label('sdk.namespace', 'auth') ->label('sdk.method', 'recovery') - ->label('sdk.description', 'Sends the user an email with a temporary secret token for password reset. When the user clicks the confirmation link he is redirected back to your app password reset redirect URL with a secret token and email address values attached to the URL query string. Use the query string params to submit a request to the /auth/password/reset endpoint to complete the process.') + ->label('sdk.description', '/docs/refernces/recovery.md') ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') - ->param('email', '', function () { - return new Email(); - }, 'User account email address.') - ->param('reset', '', function () use ($clients) { - return new Host($clients); - }, 'Reset URL in your app to redirect the user after the reset token has been sent to the user email.') + ->param('email', '', function () { return new Email(); }, 'User account email address.') + ->param('reset', '', function () use ($clients) { return new Host($clients); }, 'Reset URL in your app to redirect the user after the reset token has been sent to the user email.') ->action( function ($email, $reset) use ($request, $response, $projectDB, $register, $audit, $project) { $profile = $projectDB->getCollection([ // Get user by email address @@ -565,21 +533,13 @@ $utopia->put('/v1/auth/recovery/reset') ->label('scope', 'auth') ->label('sdk.namespace', 'auth') ->label('sdk.method', 'recoveryReset') - ->label('sdk.description', "Use this endpoint to complete the user account password reset. Both the **userId** and **token** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the /auth/recovery endpoint.\n\nPlease notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.") + ->label('sdk.description', '/docs/refernces/recovery-reset.md') ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{param-userId}') - ->param('userId', '', function () { - return new UID(); - }, 'User account email address.') - ->param('token', '', function () { - return new Text(256); - }, 'Valid reset token.') - ->param('password-a', '', function () { - return new Password(); - }, 'New password.') - ->param('password-b', '', function () { - return new Password(); - }, 'New password again.') + ->param('userId', '', function () { return new UID(); }, 'User account email address.') + ->param('token', '', function () { return new Text(256); }, 'Valid reset token.') + ->param('password-a', '', function () { return new Password(); }, 'New password.') + ->param('password-b', '', function () {return new Password(); }, 'New password again.') ->action( function ($userId, $token, $passwordA, $passwordB) use ($response, $projectDB, $audit) { if ($passwordA !== $passwordB) { @@ -639,15 +599,9 @@ $utopia->get('/v1/auth/oauth/:provider') ->label('sdk.location', true) ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') - ->param('provider', '', function () use ($providers) { - return new WhiteList(array_keys($providers)); - }, 'OAuth Provider') - ->param('success', '', function () use ($clients) { - return new Host($clients); - }, 'URL to redirect back to your app after a successful login attempt.', true) - ->param('failure', '', function () use ($clients) { - return new Host($clients); - }, 'URL to redirect back to your app after a failed login attempt.', true) + ->param('provider', '', function () use ($providers) { return new WhiteList(array_keys($providers)); }, 'OAuth Provider') + ->param('success', '', function () use ($clients) { return new Host($clients); }, 'URL to redirect back to your app after a successful login attempt.', true) + ->param('failure', '', function () use ($clients) { return new Host($clients); }, 'URL to redirect back to your app after a failed login attempt.', true) ->action( function ($provider, $success, $failure) use ($response, $request, $project) { $callback = $request->getServer('REQUEST_SCHEME', 'https').'://'.$request->getServer('HTTP_HOST').'/v1/auth/oauth/callback/'.$provider.'/'.$project->getUid(); @@ -681,23 +635,13 @@ $utopia->get('/v1/auth/oauth/callback/:provider/:projectId') ->desc('OAuth Callback') ->label('error', __DIR__.'/../views/general/error.phtml') ->label('scope', 'auth') - //->label('sdk.namespace', 'auth') - //->label('sdk.method', 'oauthCallback') ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') ->label('docs', false) - ->param('projectId', '', function () { - return new Text(1024); - }, 'Project unique ID') - ->param('provider', '', function () use ($providers) { - return new WhiteList(array_keys($providers)); - }, 'OAuth provider') - ->param('code', '', function () { - return new Text(1024); - }, 'OAuth code') - ->param('state', '', function () { - return new Text(2048); - }, 'Login state params', true) + ->param('projectId', '', function () { return new Text(1024); }, 'Project unique ID') + ->param('provider', '', function () use ($providers) { return new WhiteList(array_keys($providers)); }, 'OAuth provider') + ->param('code', '', function () { return new Text(1024); }, 'OAuth code') + ->param('state', '', function () { return new Text(2048); }, 'Login state params', true) ->action( function ($projectId, $provider, $code, $state) use ($response, $request, $domain) { $response->redirect($request->getServer('REQUEST_SCHEME', 'https').'://'.$domain.'/v1/auth/oauth/'.$provider.'/redirect?' @@ -710,20 +654,12 @@ $utopia->get('/v1/auth/oauth/:provider/redirect') ->label('error', __DIR__.'/../views/general/error.phtml') ->label('webhook', 'auth.oauth') ->label('scope', 'auth') - //->label('sdk.namespace', 'auth') - //->label('sdk.method', 'oauthRedirect') ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') ->label('docs', false) - ->param('provider', '', function () use ($providers) { - return new WhiteList(array_keys($providers)); - }, 'OAuth provider') - ->param('code', '', function () { - return new Text(1024); - }, 'OAuth code') - ->param('state', '', function () { - return new Text(2048); - }, 'OAuth state params', true) + ->param('provider', '', function () use ($providers) { return new WhiteList(array_keys($providers)); }, 'OAuth provider') + ->param('code', '', function () { return new Text(1024); }, 'OAuth code') + ->param('state', '', function () { return new Text(2048); }, 'OAuth state params', true) ->action( function ($provider, $code, $state) use ($response, $request, $user, $projectDB, $project, $audit) { $callback = $request->getServer('REQUEST_SCHEME', 'https').'://'.$request->getServer('HTTP_HOST').'/v1/auth/oauth/callback/'.$provider.'/'.$project->getUid(); diff --git a/app/controllers/avatars.php b/app/controllers/avatars.php index 77580a59b4..0f42264490 100644 --- a/app/controllers/avatars.php +++ b/app/controllers/avatars.php @@ -87,81 +87,48 @@ $avatarCallback = function ($type, $code, $width, $height, $quality) use ($types $utopia->get('/v1/avatars/credit-cards/:code') ->desc('Get Credit Card Icon') - ->param('code', '', function () use ($types) { - return new WhiteList(array_keys($types['credit-cards'])); - }, 'Credit Card Code. Possible values: '.implode(', ', array_keys($types['credit-cards'])).'.') - ->param('width', 100, function () { - return new Range(0, 2000); - }, 'Image width. Pass an integer between 0 to 2000. Defaults to 100', true) - ->param('height', 100, function () { - return new Range(0, 2000); - }, 'Image height. Pass an integer between 0 to 2000. Defaults to 100', true) - ->param('quality', 100, function () { - return new Range(0, 100); - }, 'Image quality. Pass an integer between 0 to 100. Defaults to 100', true) + ->param('code', '', function () use ($types) { return new WhiteList(array_keys($types['credit-cards'])); }, 'Credit Card Code. Possible values: '.implode(', ', array_keys($types['credit-cards'])).'.') + ->param('width', 100, function () { return new Range(0, 2000); }, 'Image width. Pass an integer between 0 to 2000. Defaults to 100', true) + ->param('height', 100, function () { return new Range(0, 2000); }, 'Image height. Pass an integer between 0 to 2000. Defaults to 100', true) + ->param('quality', 100, function () { return new Range(0, 100); }, 'Image quality. Pass an integer between 0 to 100. Defaults to 100', true) ->label('scope', 'avatars.read') ->label('sdk.namespace', 'avatars') ->label('sdk.method', 'getCreditCard') ->label('sdk.description', 'Need to display your users with your billing method or there payment methods? The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.') - ->action(function ($code, $width, $height, $quality) use ($avatarCallback) { - return $avatarCallback('credit-cards', $code, $width, $height, $quality); + ->action(function ($code, $width, $height, $quality) use ($avatarCallback) { return $avatarCallback('credit-cards', $code, $width, $height, $quality); }); $utopia->get('/v1/avatars/browsers/:code') ->desc('Get Browser Icon') - ->param('code', '', function () use ($types) { - return new WhiteList(array_keys($types['browsers'])); - }, 'Browser Code.') - ->param('width', 100, function () { - return new Range(0, 2000); - }, 'Image width. Pass an integer between 0 to 2000. Defaults to 100', true) - ->param('height', 100, function () { - return new Range(0, 2000); - }, 'Image height. Pass an integer between 0 to 2000. Defaults to 100', true) - ->param('quality', 100, function () { - return new Range(0, 100); - }, 'Image quality. Pass an integer between 0 to 100. Defaults to 100', true) + ->param('code', '', function () use ($types) { return new WhiteList(array_keys($types['browsers'])); }, 'Browser Code.') + ->param('width', 100, function () { return new Range(0, 2000); }, 'Image width. Pass an integer between 0 to 2000. Defaults to 100', true) + ->param('height', 100, function () { return new Range(0, 2000); }, 'Image height. Pass an integer between 0 to 2000. Defaults to 100', true) + ->param('quality', 100, function () { return new Range(0, 100); }, 'Image quality. Pass an integer between 0 to 100. Defaults to 100', true) ->label('scope', 'avatars.read') ->label('sdk.namespace', 'avatars') ->label('sdk.method', 'getBrowser') ->label('sdk.description', 'You can use this endpoint to show different browser icons to your users, The code argument receives the browser code as appear in your user /account/sessions endpoint. Use width, height and quality arguments to change the output settings.') - ->action(function ($code, $width, $height, $quality) use ($avatarCallback) { - return $avatarCallback('browsers', $code, $width, $height, $quality); + ->action(function ($code, $width, $height, $quality) use ($avatarCallback) { return $avatarCallback('browsers', $code, $width, $height, $quality); }); $utopia->get('/v1/avatars/flags/:code') ->desc('Get Country Flag') - ->param('code', '', function () use ($types) { - return new WhiteList(array_keys($types['flags'])); - }, 'Country Code. ISO Alpha-2 country code format.') - ->param('width', 100, function () { - return new Range(0, 2000); - }, 'Image width. Pass an integer between 0 to 2000. Defaults to 100', true) - ->param('height', 100, function () { - return new Range(0, 2000); - }, 'Image height. Pass an integer between 0 to 2000. Defaults to 100', true) - ->param('quality', 100, function () { - return new Range(0, 100); - }, 'Image quality. Pass an integer between 0 to 100. Defaults to 100', true) + ->param('code', '', function () use ($types) { return new WhiteList(array_keys($types['flags'])); }, 'Country Code. ISO Alpha-2 country code format.') + ->param('width', 100, function () { return new Range(0, 2000); }, 'Image width. Pass an integer between 0 to 2000. Defaults to 100', true) + ->param('height', 100, function () { return new Range(0, 2000); }, 'Image height. Pass an integer between 0 to 2000. Defaults to 100', true) + ->param('quality', 100, function () { return new Range(0, 100); }, 'Image quality. Pass an integer between 0 to 100. Defaults to 100', true) ->label('scope', 'avatars.read') ->label('sdk.namespace', 'avatars') ->label('sdk.method', 'getFlag') ->label('sdk.description', 'You can use this endpoint to show different country flags icons to your users, The code argument receives the a 2 letter country code. Use width, height and quality arguments to change the output settings.') - ->action(function ($code, $width, $height, $quality) use ($avatarCallback) { - return $avatarCallback('flags', $code, $width, $height, $quality); + ->action(function ($code, $width, $height, $quality) use ($avatarCallback) { return $avatarCallback('flags', $code, $width, $height, $quality); }); $utopia->get('/v1/avatars/image') ->desc('Get Image from URL') - ->param('url', '', function () { - return new URL(); - }, 'Image URL which you want to crop.') - ->param('width', 400, function () { - return new Range(0, 2000); - }, 'Resize preview image width, Pass an integer between 0 to 4000', true) - ->param('height', 400, function () { - return new Range(0, 2000); - }, 'Resize preview image height, Pass an integer between 0 to 4000', true) + ->param('url', '', function () { return new URL(); }, 'Image URL which you want to crop.') + ->param('width', 400, function () { return new Range(0, 2000); }, 'Resize preview image width, Pass an integer between 0 to 4000', true) + ->param('height', 400, function () { return new Range(0, 2000); }, 'Resize preview image height, Pass an integer between 0 to 4000', true) ->label('scope', 'avatars.read') ->label('sdk.namespace', 'avatars') ->label('sdk.method', 'getImage') @@ -226,9 +193,7 @@ $utopia->get('/v1/avatars/image') $utopia->get('/v1/avatars/favicon') ->desc('Get Favicon') - ->param('url', '', function () { - return new URL(); - }, 'Website URL which you want to fetch the favicon from.') + ->param('url', '', function () { return new URL(); }, 'Website URL which you want to fetch the favicon from.') ->label('scope', 'avatars.read') ->label('sdk.namespace', 'avatars') ->label('sdk.method', 'getFavicon') @@ -377,18 +342,10 @@ $utopia->get('/v1/avatars/favicon') $utopia->get('/v1/avatars/qr') ->desc('Text to QR Generator') - ->param('text', '', function () { - return new Text(512); - }, 'Plain text to be converted to QR code image') - ->param('size', 400, function () { - return new Range(0, 1000); - }, 'QR code size. Pass an integer between 0 to 1000. Defaults to 400.', true) - ->param('margin', 1, function () { - return new Range(0, 10); - }, 'Margin From Edge. Pass an integer between 0 to 10. Defaults to 1.', true) - ->param('download', 0, function () { - return new Range(0, 1); - }, 'Return resulting image with \'Content-Disposition: attachment \' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.', true) + ->param('text', '', function () { return new Text(512); }, 'Plain text to be converted to QR code image') + ->param('size', 400, function () { return new Range(0, 1000); }, 'QR code size. Pass an integer between 0 to 1000. Defaults to 400.', true) + ->param('margin', 1, function () { return new Range(0, 10); }, 'Margin From Edge. Pass an integer between 0 to 10. Defaults to 1.', true) + ->param('download', 0, function () { return new Range(0, 1); }, 'Return resulting image with \'Content-Disposition: attachment \' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.', true) ->label('scope', 'avatars.read') ->label('sdk.namespace', 'avatars') ->label('sdk.method', 'getQR') diff --git a/app/controllers/console.php b/app/controllers/console.php index ef36ba9e01..b213158d2a 100644 --- a/app/controllers/console.php +++ b/app/controllers/console.php @@ -174,9 +174,7 @@ $utopia->get('/console/database/collection') ->desc('Platform console project settings') ->label('permission', 'public') ->label('scope', 'console') - ->param('id', '', function () { - return new UID(); - }, 'Collection unique ID.') + ->param('id', '', function () { return new UID(); }, 'Collection unique ID.') ->action(function ($id) use ($layout, $projectDB) { $collection = $projectDB->getDocument($id, false); diff --git a/app/controllers/database.php b/app/controllers/database.php index a9de951e89..6b2a2460a3 100644 --- a/app/controllers/database.php +++ b/app/controllers/database.php @@ -27,18 +27,10 @@ $utopia->get('/v1/database') ->label('sdk.namespace', 'database') ->label('sdk.method', 'listCollections') ->label('sdk.description', 'Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](/docs/modes).') - ->param('search', '', function () { - return new Text(256); - }, 'Search term to filter your list results.', true) - ->param('limit', 25, function () { - return new Range(0, 100); - }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) - ->param('offset', 0, function () { - return new Range(0, 40000); - }, 'Results offset. The default value is 0. Use this param to manage pagination.', true) - ->param('orderType', 'ASC', function () { - return new WhiteList(['ASC', 'DESC']); - }, 'Order result by ASC or DESC order.', true) + ->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true) + ->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) + ->param('offset', 0, function () { return new Range(0, 40000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true) + ->param('orderType', 'ASC', function () { return new WhiteList(['ASC', 'DESC']); }, 'Order result by ASC or DESC order.', true) ->action( function ($search, $limit, $offset, $orderType) use ($response, $projectDB) { /*$vl = new Structure($projectDB); @@ -82,9 +74,7 @@ $utopia->get('/v1/database/:collectionId') ->label('sdk.namespace', 'database') ->label('sdk.method', 'getCollection') ->label('sdk.description', 'Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.') - ->param('collectionId', '', function () { - return new UID(); - }, 'Collection unique ID.') + ->param('collectionId', '', function () { return new UID(); }, 'Collection unique ID.') ->action( function ($collectionId) use ($response, $projectDB) { $collection = $projectDB->getDocument($collectionId, false); @@ -104,18 +94,10 @@ $utopia->post('/v1/database') ->label('sdk.namespace', 'database') ->label('sdk.method', 'createCollection') ->label('sdk.description', 'Create a new Collection.') - ->param('name', '', function () { - return new Text(256); - }, 'Collection name.') - ->param('read', [], function () { - return new ArrayList(new Text(64)); - }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true) - ->param('write', [], function () { - return new ArrayList(new Text(64)); - }, 'An array of strings with write permissions. [Learn more about permissions and roles](/docs/permissions).', true) - ->param('rules', [], function () use ($projectDB) { - return new ArrayList(new Collection($projectDB, [Database::SYSTEM_COLLECTION_RULES], ['$collection' => Database::SYSTEM_COLLECTION_RULES, '$permissions' => ['read' => [], 'write' => []]])); - }, 'Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation', true) + ->param('name', '', function () { return new Text(256); }, 'Collection name.') + ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true) + ->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. [Learn more about permissions and roles](/docs/permissions).', true) + ->param('rules', [], function () use ($projectDB) { return new ArrayList(new Collection($projectDB, [Database::SYSTEM_COLLECTION_RULES], ['$collection' => Database::SYSTEM_COLLECTION_RULES, '$permissions' => ['read' => [], 'write' => []]])); }, 'Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation', true) ->action( function ($name, $read, $write, $rules) use ($response, $projectDB, $webhook, $audit) { $parsedRules = []; @@ -179,21 +161,11 @@ $utopia->put('/v1/database/:collectionId') ->label('sdk.namespace', 'database') ->label('sdk.method', 'updateCollection') ->label('sdk.description', 'Update collection by its unique ID.') - ->param('collectionId', '', function () { - return new UID(); - }, 'Collection unique ID.') - ->param('name', null, function () { - return new Text(256); - }, 'Collection name.') - ->param('read', [], function () { - return new ArrayList(new Text(64)); - }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true) - ->param('write', [], function () { - return new ArrayList(new Text(64)); - }, 'An array of strings with write permissions. [Learn more about permissions and roles](/docs/permissions).', true) - ->param('rules', [], function () use ($projectDB) { - return new ArrayList(new Collection($projectDB, [Database::SYSTEM_COLLECTION_RULES], ['$collection' => Database::SYSTEM_COLLECTION_RULES, '$permissions' => ['read' => [], 'write' => []]])); - }, 'Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation', true) + ->param('collectionId', '', function () { return new UID(); }, 'Collection unique ID.') + ->param('name', null, function () { return new Text(256); }, 'Collection name.') + ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true) + ->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. [Learn more about permissions and roles](/docs/permissions).', true) + ->param('rules', [], function () use ($projectDB) { return new ArrayList(new Collection($projectDB, [Database::SYSTEM_COLLECTION_RULES], ['$collection' => Database::SYSTEM_COLLECTION_RULES, '$permissions' => ['read' => [], 'write' => []]])); }, 'Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation', true) ->action( function ($collectionId, $name, $read, $write, $rules) use ($response, $projectDB) { $collection = $projectDB->getDocument($collectionId, false); @@ -239,9 +211,7 @@ $utopia->delete('/v1/database/:collectionId') ->label('sdk.namespace', 'database') ->label('sdk.method', 'deleteCollection') ->label('sdk.description', 'Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.') - ->param('collectionId', '', function () { - return new UID(); - }, 'Collection unique ID.') + ->param('collectionId', '', function () { return new UID(); }, 'Collection unique ID.') ->action( function ($collectionId) use ($response, $projectDB, $audit) { $collection = $projectDB->getDocument($collectionId, false); @@ -270,36 +240,16 @@ $utopia->get('/v1/database/:collectionId/documents') ->label('sdk.namespace', 'database') ->label('sdk.method', 'listDocuments') ->label('sdk.description', 'Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](/docs/modes).') - ->param('collectionId', null, function () { - return new UID(); - }, 'Collection unique ID.') - ->param('filters', [], function () { - return new ArrayList(new Text(128)); - }, 'Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: \'name=John Doe\' or \'category.$uid>=5bed2d152c362\'', true) - ->param('offset', 0, function () { - return new Range(0, 900000000); - }, 'Offset value. Use this value to manage pagination.', true) - ->param('limit', 50, function () { - return new Range(0, 1000); - }, 'Maximum number of documents to return in response. Use this value to manage pagination.', true) - ->param('order-field', '$uid', function () { - return new Text(128); - }, 'Document field that results will be sorted by.', true) - ->param('order-type', 'ASC', function () { - return new WhiteList(array('DESC', 'ASC')); - }, 'Order direction. Possible values are DESC for descending order, or ASC for ascending order.', true) - ->param('order-cast', 'string', function () { - return new WhiteList(array('int', 'string', 'date', 'time', 'datetime')); - }, 'Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.', true) - ->param('search', '', function () { - return new Text(256); - }, 'Search query. Enter any free text search. The database will try to find a match against all document attributes and children.', true) - ->param('first', 0, function () { - return new Range(0, 1); - }, 'Return only first document. Pass 1 for true or 0 for false. The default value is 0.', true) - ->param('last', 0, function () { - return new Range(0, 1); - }, 'Return only last document. Pass 1 for true or 0 for false. The default value is 0.', true) + ->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID.') + ->param('filters', [], function () { return new ArrayList(new Text(128)); }, 'Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: \'name=John Doe\' or \'category.$uid>=5bed2d152c362\'', true) + ->param('offset', 0, function () { return new Range(0, 900000000); }, 'Offset value. Use this value to manage pagination.', true) + ->param('limit', 50, function () { return new Range(0, 1000); }, 'Maximum number of documents to return in response. Use this value to manage pagination.', true) + ->param('order-field', '$uid', function () { return new Text(128); }, 'Document field that results will be sorted by.', true) + ->param('order-type', 'ASC', function () { return new WhiteList(array('DESC', 'ASC')); }, 'Order direction. Possible values are DESC for descending order, or ASC for ascending order.', true) + ->param('order-cast', 'string', function () { return new WhiteList(array('int', 'string', 'date', 'time', 'datetime')); }, 'Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.', true) + ->param('search', '', function () { return new Text(256); }, 'Search query. Enter any free text search. The database will try to find a match against all document attributes and children.', true) + ->param('first', 0, function () { return new Range(0, 1); }, 'Return only first document. Pass 1 for true or 0 for false. The default value is 0.', true) + ->param('last', 0, function () { return new Range(0, 1); }, 'Return only last document. Pass 1 for true or 0 for false. The default value is 0.', true) ->action( function ($collectionId, $filters, $offset, $limit, $orderField, $orderType, $orderCast, $search, $first, $last) use ($response, $projectDB, $isDev) { $collection = $projectDB->getDocument($collectionId, $isDev); @@ -356,12 +306,8 @@ $utopia->get('/v1/database/:collectionId/documents/:documentId') ->label('sdk.namespace', 'database') ->label('sdk.method', 'getDocument') ->label('sdk.description', 'Get document by its unique ID. This endpoint response returns a JSON object with the document data.') - ->param('collectionId', null, function () { - return new UID(); - }, 'Collection unique ID') - ->param('documentId', null, function () { - return new UID(); - }, 'Document unique ID') + ->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID') + ->param('documentId', null, function () { return new UID(); }, 'Document unique ID') ->action( function ($collectionId, $documentId) use ($response, $request, $projectDB, $isDev) { $document = $projectDB->getDocument($documentId, $isDev); @@ -405,27 +351,13 @@ $utopia->post('/v1/database/:collectionId/documents') ->label('sdk.namespace', 'database') ->label('sdk.method', 'createDocument') ->label('sdk.description', 'Create a new Document.') - ->param('collectionId', null, function () { - return new UID(); - }, 'Collection unique ID.') - ->param('data', [], function () { - return new \Utopia\Validator\Mock(); - }, 'Document data as JSON string.') - ->param('read', [], function () { - return new ArrayList(new Text(64)); - }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true) - ->param('write', [], function () { - return new ArrayList(new Text(64)); - }, 'An array of strings with write permissions. [Learn more about permissions and roles](/docs/permissions).', true) - ->param('parentDocument', '', function () { - return new UID(); - }, 'Parent document unique ID. Use when you want your new document to be a child of a parent document.', true) - ->param('parentProperty', '', function () { - return new Key(); - }, 'Parent document property name. Use when you want your new document to be a child of a parent document.', true) - ->param('parentPropertyType', Document::SET_TYPE_ASSIGN, function () { - return new WhiteList([Document::SET_TYPE_ASSIGN, Document::SET_TYPE_APPEND, Document::SET_TYPE_PREPEND]); - }, 'Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.', true) + ->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID.') + ->param('data', [], function () { return new \Utopia\Validator\Mock(); }, 'Document data as JSON string.') + ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true) + ->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. [Learn more about permissions and roles](/docs/permissions).', true) + ->param('parentDocument', '', function () { return new UID(); }, 'Parent document unique ID. Use when you want your new document to be a child of a parent document.', true) + ->param('parentProperty', '', function () { return new Key(); }, 'Parent document property name. Use when you want your new document to be a child of a parent document.', true) + ->param('parentPropertyType', Document::SET_TYPE_ASSIGN, function () { return new WhiteList([Document::SET_TYPE_ASSIGN, Document::SET_TYPE_APPEND, Document::SET_TYPE_PREPEND]); }, 'Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.', true) ->action( function ($collectionId, $data, $read, $write, $parentDocument, $parentProperty, $parentPropertyType) use ($response, $projectDB, $webhook, $audit) { $data = (is_string($data) && $result = json_decode($data, true)) ? $result : $data; // Cast to JSON array @@ -524,21 +456,11 @@ $utopia->patch('/v1/database/:collectionId/documents/:documentId') ->label('scope', 'documents.write') ->label('sdk.namespace', 'database') ->label('sdk.method', 'updateDocument') - ->param('collectionId', null, function () { - return new UID(); - }, 'Collection unique ID') - ->param('documentId', null, function () { - return new UID(); - }, 'Document unique ID') - ->param('data', [], function () { - return new \Utopia\Validator\Mock(); - }, 'Document data as JSON string') - ->param('read', [], function () { - return new ArrayList(new Text(64)); - }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true) - ->param('write', [], function () { - return new ArrayList(new Text(64)); - }, 'An array of strings with write permissions. [Learn more about permissions and roles](/docs/permissions).', true) + ->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID') + ->param('documentId', null, function () { return new UID(); }, 'Document unique ID') + ->param('data', [], function () { return new \Utopia\Validator\Mock(); }, 'Document data as JSON string') + ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true) + ->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. [Learn more about permissions and roles](/docs/permissions).', true) ->action( function ($collectionId, $documentId, $data, $read, $write) use ($response, $projectDB, &$output, $webhook, $audit, $isDev) { $collection = $projectDB->getDocument($collectionId/*, $isDev*/); @@ -611,12 +533,8 @@ $utopia->delete('/v1/database/:collectionId/documents/:documentId') ->label('sdk.namespace', 'database') ->label('sdk.method', 'deleteDocument') ->label('sdk.description', 'Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted.') - ->param('collectionId', null, function () { - return new UID(); - }, 'Collection unique ID') - ->param('documentId', null, function () { - return new UID(); - }, 'Document unique ID') + ->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID') + ->param('documentId', null, function () { return new UID(); }, 'Document unique ID') ->action( function ($collectionId, $documentId) use ($response, $projectDB, $audit, $isDev) { $collection = $projectDB->getDocument($collectionId, $isDev); diff --git a/app/controllers/projects.php b/app/controllers/projects.php index 2633e023e9..b06e602d52 100644 --- a/app/controllers/projects.php +++ b/app/controllers/projects.php @@ -67,9 +67,7 @@ $utopia->get('/v1/projects/:projectId') ->label('scope', 'projects.read') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'getProject') - ->param('projectId', '', function () { - return new UID(); - }, 'Project unique ID.') + ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.') ->action( function ($projectId) use ($request, $response, $providers, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -96,9 +94,7 @@ $utopia->get('/v1/projects/:projectId/usage') ->label('scope', 'projects.read') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'getProjectUsage') - ->param('projectId', '', function () { - return new UID(); - }, 'Project unique ID.') + ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.') ->action( function ($projectId) use ($response, $consoleDB, $projectDB, $register) { $project = $consoleDB->getDocument($projectId); @@ -232,39 +228,17 @@ $utopia->post('/v1/projects') ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'createProject') - ->param('name', null, function () { - return new Text(100); - }, 'Project name') - ->param('teamId', '', function () { - return new UID(); - }, 'Team unique ID.') - ->param('description', '', function () { - return new Text(255); - }, 'Project description', true) - ->param('logo', '', function () { - return new Text(1024); - }, 'Project logo', true) - ->param('url', '', function () { - return new URL(); - }, 'Project URL', true) - ->param('legalName', '', function () { - return new Text(256); - }, 'Project Legal Name', true) - ->param('legalCountry', '', function () { - return new Text(256); - }, 'Project Legal Country', true) - ->param('legalState', '', function () { - return new Text(256); - }, 'Project Legal State', true) - ->param('legalCity', '', function () { - return new Text(256); - }, 'Project Legal City', true) - ->param('legalAddress', '', function () { - return new Text(256); - }, 'Project Legal Address', true) - ->param('legalTaxId', '', function () { - return new Text(256); - }, 'Project Legal Tax ID', true) + ->param('name', null, function () { return new Text(100); }, 'Project name') + ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') + ->param('description', '', function () { return new Text(255); }, 'Project description', true) + ->param('logo', '', function () { return new Text(1024); }, 'Project logo', true) + ->param('url', '', function () { return new URL(); }, 'Project URL', true) + ->param('legalName', '', function () { return new Text(256); }, 'Project Legal Name', true) + ->param('legalCountry', '', function () { return new Text(256); }, 'Project Legal Country', true) + ->param('legalState', '', function () { return new Text(256); }, 'Project Legal State', true) + ->param('legalCity', '', function () { return new Text(256); }, 'Project Legal City', true) + ->param('legalAddress', '', function () { return new Text(256); }, 'Project Legal Address', true) + ->param('legalTaxId', '', function () { return new Text(256); }, 'Project Legal Tax ID', true) ->action( function ($name, $teamId, $description, $logo, $url, $legalName, $legalCountry, $legalState, $legalCity, $legalAddress, $legalTaxId) use ($response, $user, $consoleDB, $projectDB) { $team = $projectDB->getDocument($teamId); @@ -314,39 +288,17 @@ $utopia->patch('/v1/projects/:projectId') ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'updateProject') - ->param('projectId', '', function () { - return new UID(); - }, 'Project unique ID.') - ->param('name', null, function () { - return new Text(100); - }, 'Project name') - ->param('description', '', function () { - return new Text(255); - }, 'Project description', true) - ->param('logo', '', function () { - return new Text(1024); - }, 'Project logo', true) - ->param('url', '', function () { - return new URL(); - }, 'Project URL', true) - ->param('legalName', '', function () { - return new Text(256); - }, 'Project Legal Name', true) - ->param('legalCountry', '', function () { - return new Text(256); - }, 'Project Legal Country', true) - ->param('legalState', '', function () { - return new Text(256); - }, 'Project Legal State', true) - ->param('legalCity', '', function () { - return new Text(256); - }, 'Project Legal City', true) - ->param('legalAddress', '', function () { - return new Text(256); - }, 'Project Legal Address', true) - ->param('legalTaxId', '', function () { - return new Text(256); - }, 'Project Legal Tax ID', true) + ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.') + ->param('name', null, function () { return new Text(100); }, 'Project name') + ->param('description', '', function () { return new Text(255); }, 'Project description', true) + ->param('logo', '', function () { return new Text(1024); }, 'Project logo', true) + ->param('url', '', function () { return new URL(); }, 'Project URL', true) + ->param('legalName', '', function () { return new Text(256); }, 'Project Legal Name', true) + ->param('legalCountry', '', function () { return new Text(256); }, 'Project Legal Country', true) + ->param('legalState', '', function () { return new Text(256); }, 'Project Legal State', true) + ->param('legalCity', '', function () { return new Text(256); }, 'Project Legal City', true) + ->param('legalAddress', '', function () { return new Text(256); }, 'Project Legal Address', true) + ->param('legalTaxId', '', function () { return new Text(256); }, 'Project Legal Tax ID', true) ->action( function ($projectId, $name, $description, $logo, $url, $legalName, $legalCountry, $legalState, $legalCity, $legalAddress, $legalTaxId) use ($response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -381,18 +333,10 @@ $utopia->patch('/v1/projects/:projectId/oauth') ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'updateProjectOAuth') - ->param('projectId', '', function () { - return new UID(); - }, 'Project unique ID.') - ->param('provider', '', function () use ($providers) { - return new WhiteList(array_keys($providers)); - }, 'Provider Name', false) - ->param('appId', '', function () { - return new Text(256); - }, 'Provider App ID', true) - ->param('secret', '', function () { - return new text(256); - }, 'Provider Secret Key', true) + ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.') + ->param('provider', '', function () use ($providers) { return new WhiteList(array_keys($providers)); }, 'Provider Name', false) + ->param('appId', '', function () { return new Text(256); }, 'Provider App ID', true) + ->param('secret', '', function () { return new text(256); }, 'Provider Secret Key', true) ->action( function ($projectId, $provider, $appId, $secret) use ($request, $response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -430,9 +374,7 @@ $utopia->delete('/v1/projects/:projectId') ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'deleteProject') - ->param('projectId', '', function () { - return new UID(); - }, 'Project unique ID.') + ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.') ->action( function ($projectId) use ($response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -466,9 +408,7 @@ $utopia->get('/v1/projects/:projectId/webhooks') ->label('scope', 'projects.read') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'listWebhooks') - ->param('projectId', '', function () { - return new UID(); - }, 'Project unique ID.') + ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.') ->action( function ($projectId) use ($request, $response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -500,12 +440,8 @@ $utopia->get('/v1/projects/:projectId/webhooks/:webhookId') ->label('scope', 'projects.read') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'getWebhook') - ->param('projectId', null, function () { - return new UID(); - }, 'Project unique ID.') - ->param('webhookId', null, function () { - return new UID(); - }, 'Webhook unique ID.') + ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') + ->param('webhookId', null, function () { return new UID(); }, 'Webhook unique ID.') ->action( function ($projectId, $webhookId) use ($request, $response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -536,27 +472,13 @@ $utopia->post('/v1/projects/:projectId/webhooks') ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'createWebhook') - ->param('projectId', null, function () { - return new UID(); - }, 'Project unique ID.') - ->param('name', null, function () { - return new Text(256); - }, 'Webhook name') - ->param('events', null, function () { - return new ArrayList(new Text(256)); - }, 'Webhook events list') - ->param('url', null, function () { - return new Text(2000); - }, 'Webhook URL') - ->param('security', null, function () { - return new Range(0, 1); - }, 'Certificate verification, 0 for disabled or 1 for enabled') - ->param('httpUser', '', function () { - return new Text(256); - }, 'Webhook HTTP user', true) - ->param('httpPass', '', function () { - return new Text(256); - }, 'Webhook HTTP password', true) + ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') + ->param('name', null, function () { return new Text(256); }, 'Webhook name') + ->param('events', null, function () { return new ArrayList(new Text(256)); }, 'Webhook events list') + ->param('url', null, function () { return new Text(2000); }, 'Webhook URL') + ->param('security', null, function () { return new Range(0, 1); }, 'Certificate verification, 0 for disabled or 1 for enabled') + ->param('httpUser', '', function () { return new Text(256); }, 'Webhook HTTP user', true) + ->param('httpPass', '', function () { return new Text(256); }, 'Webhook HTTP password', true) ->action( function ($projectId, $name, $events, $url, $security, $httpUser, $httpPass) use ($request, $response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -614,30 +536,14 @@ $utopia->put('/v1/projects/:projectId/webhooks/:webhookId') ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'updateWebhook') - ->param('projectId', null, function () { - return new UID(); - }, 'Project unique ID.') - ->param('webhookId', null, function () { - return new UID(); - }, 'Webhook unique ID.') - ->param('name', null, function () { - return new Text(256); - }, 'Webhook name') - ->param('events', null, function () { - return new ArrayList(new Text(256)); - }, 'Webhook events list') - ->param('url', null, function () { - return new Text(2000); - }, 'Webhook URL') - ->param('security', null, function () { - return new Range(0, 1); - }, 'Certificate verification, 0 for disabled or 1 for enabled') - ->param('httpUser', '', function () { - return new Text(256); - }, 'Webhook HTTP user', true) - ->param('httpPass', '', function () { - return new Text(256); - }, 'Webhook HTTP password', true) + ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') + ->param('webhookId', null, function () { return new UID(); }, 'Webhook unique ID.') + ->param('name', null, function () { return new Text(256); }, 'Webhook name') + ->param('events', null, function () { return new ArrayList(new Text(256)); }, 'Webhook events list') + ->param('url', null, function () { return new Text(2000); }, 'Webhook URL') + ->param('security', null, function () { return new Range(0, 1); }, 'Certificate verification, 0 for disabled or 1 for enabled') + ->param('httpUser', '', function () { return new Text(256); }, 'Webhook HTTP user', true) + ->param('httpPass', '', function () { return new Text(256); }, 'Webhook HTTP password', true) ->action( function ($projectId, $webhookId, $name, $events, $url, $security, $httpUser, $httpPass) use ($request, $response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -685,12 +591,8 @@ $utopia->delete('/v1/projects/:projectId/webhooks/:webhookId') ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'deleteWebhook') - ->param('projectId', null, function () { - return new UID(); - }, 'Project unique ID.') - ->param('webhookId', null, function () { - return new UID(); - }, 'Webhook unique ID.') + ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') + ->param('webhookId', null, function () { return new UID(); }, 'Webhook unique ID.') ->action( function ($projectId, $webhookId) use ($response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -720,9 +622,7 @@ $utopia->get('/v1/projects/:projectId/keys') ->label('scope', 'projects.read') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'listKeys') - ->param('projectId', null, function () { - return new UID(); - }, 'Project unique ID.') + ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') ->action( function ($projectId) use ($response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -740,12 +640,8 @@ $utopia->get('/v1/projects/:projectId/keys/:keyId') ->label('scope', 'projects.read') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'getKey') - ->param('projectId', null, function () { - return new UID(); - }, 'Project unique ID.') - ->param('keyId', null, function () { - return new UID(); - }, 'Key unique ID.') + ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') + ->param('keyId', null, function () { return new UID(); }, 'Key unique ID.') ->action( function ($projectId, $keyId) use ($response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -769,15 +665,9 @@ $utopia->post('/v1/projects/:projectId/keys') ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'createKey') - ->param('projectId', null, function () { - return new UID(); - }, 'Project unique ID.') - ->param('name', null, function () { - return new Text(256); - }, 'Key name') - ->param('scopes', null, function () use ($scopes) { - return new ArrayList(new WhiteList($scopes)); - }, 'Key scopes list') + ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') + ->param('name', null, function () { return new Text(256); }, 'Key name') + ->param('scopes', null, function () use ($scopes) { return new ArrayList(new WhiteList($scopes)); }, 'Key scopes list') ->action( function ($projectId, $name, $scopes) use ($response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -821,18 +711,10 @@ $utopia->put('/v1/projects/:projectId/keys/:keyId') ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'updateKey') - ->param('projectId', null, function () { - return new UID(); - }, 'Project unique ID.') - ->param('keyId', null, function () { - return new UID(); - }, 'Key unique ID.') - ->param('name', null, function () { - return new Text(256); - }, 'Key name') - ->param('scopes', null, function () use ($scopes) { - return new ArrayList(new WhiteList($scopes)); - }, 'Key scopes list') + ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') + ->param('keyId', null, function () { return new UID(); }, 'Key unique ID.') + ->param('name', null, function () { return new Text(256); }, 'Key name') + ->param('scopes', null, function () use ($scopes) { return new ArrayList(new WhiteList($scopes)); }, 'Key scopes list') ->action( function ($projectId, $keyId, $name, $scopes) use ($response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -865,12 +747,8 @@ $utopia->delete('/v1/projects/:projectId/keys/:keyId') ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'deleteKey') - ->param('projectId', null, function () { - return new UID(); - }, 'Project unique ID.') - ->param('keyId', null, function () { - return new UID(); - }, 'Key unique ID.') + ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') + ->param('keyId', null, function () { return new UID(); }, 'Key unique ID.') ->action( function ($projectId, $keyId) use ($response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -900,9 +778,7 @@ $utopia->get('/v1/projects/:projectId/tasks') ->label('scope', 'projects.read') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'listTasks') - ->param('projectId', '', function () { - return new UID(); - }, 'Project unique ID.') + ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.') ->action( function ($projectId) use ($request, $response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -934,12 +810,8 @@ $utopia->get('/v1/projects/:projectId/tasks/:taskId') ->label('scope', 'projects.read') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'getTask') - ->param('projectId', null, function () { - return new UID(); - }, 'Project unique ID.') - ->param('taskId', null, function () { - return new UID(); - }, 'Task unique ID.') + ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') + ->param('taskId', null, function () { return new UID(); }, 'Task unique ID.') ->action( function ($projectId, $taskId) use ($request, $response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -970,36 +842,16 @@ $utopia->post('/v1/projects/:projectId/tasks') ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'createTask') - ->param('projectId', null, function () { - return new UID(); - }, 'Project unique ID.') - ->param('name', null, function () { - return new Text(256); - }, 'Task name') - ->param('status', null, function () { - return new WhiteList(['play', 'pause']); - }, 'Task status') - ->param('schedule', null, function () { - return new Cron(); - }, 'Task schedule syntax') - ->param('security', null, function () { - return new Range(0, 1); - }, 'Certificate verification, 0 for disabled or 1 for enabled') - ->param('httpMethod', '', function () { - return new WhiteList(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT']); - }, 'Task HTTP method') - ->param('httpUrl', '', function () { - return new URL(); - }, 'Task HTTP URL') - ->param('httpHeaders', null, function () { - return new ArrayList(new Text(256)); - }, 'Task HTTP headers list', true) - ->param('httpUser', '', function () { - return new Text(256); - }, 'Task HTTP user', true) - ->param('httpPass', '', function () { - return new Text(256); - }, 'Task HTTP password', true) + ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') + ->param('name', null, function () { return new Text(256); }, 'Task name') + ->param('status', null, function () { return new WhiteList(['play', 'pause']); }, 'Task status') + ->param('schedule', null, function () { return new Cron(); }, 'Task schedule syntax') + ->param('security', null, function () { return new Range(0, 1); }, 'Certificate verification, 0 for disabled or 1 for enabled') + ->param('httpMethod', '', function () { return new WhiteList(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT']); }, 'Task HTTP method') + ->param('httpUrl', '', function () { return new URL(); }, 'Task HTTP URL') + ->param('httpHeaders', null, function () { return new ArrayList(new Text(256)); }, 'Task HTTP headers list', true) + ->param('httpUser', '', function () { return new Text(256); }, 'Task HTTP user', true) + ->param('httpPass', '', function () { return new Text(256); }, 'Task HTTP password', true) ->action( function ($projectId, $name, $status, $schedule, $security, $httpMethod, $httpUrl, $httpHeaders, $httpUser, $httpPass) use ($request, $response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -1072,39 +924,17 @@ $utopia->put('/v1/projects/:projectId/tasks/:taskId') ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'updateTask') - ->param('projectId', null, function () { - return new UID(); - }, 'Project unique ID.') - ->param('taskId', null, function () { - return new UID(); - }, 'Task unique ID.') - ->param('name', null, function () { - return new Text(256); - }, 'Task name') - ->param('status', null, function () { - return new WhiteList(['play', 'pause']); - }, 'Task status') - ->param('schedule', null, function () { - return new Cron(); - }, 'Task schedule syntax') - ->param('security', null, function () { - return new Range(0, 1); - }, 'Certificate verification, 0 for disabled or 1 for enabled') - ->param('httpMethod', '', function () { - return new WhiteList(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT']); - }, 'Task HTTP method') - ->param('httpUrl', '', function () { - return new URL(); - }, 'Task HTTP URL') - ->param('httpHeaders', null, function () { - return new ArrayList(new Text(256)); - }, 'Task HTTP headers list', true) - ->param('httpUser', '', function () { - return new Text(256); - }, 'Task HTTP user', true) - ->param('httpPass', '', function () { - return new Text(256); - }, 'Task HTTP password', true) + ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') + ->param('taskId', null, function () { return new UID(); }, 'Task unique ID.') + ->param('name', null, function () { return new Text(256); }, 'Task name') + ->param('status', null, function () { return new WhiteList(['play', 'pause']); }, 'Task status') + ->param('schedule', null, function () { return new Cron(); }, 'Task schedule syntax') + ->param('security', null, function () { return new Range(0, 1); }, 'Certificate verification, 0 for disabled or 1 for enabled') + ->param('httpMethod', '', function () { return new WhiteList(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT']); }, 'Task HTTP method') + ->param('httpUrl', '', function () { return new URL(); }, 'Task HTTP URL') + ->param('httpHeaders', null, function () { return new ArrayList(new Text(256)); }, 'Task HTTP headers list', true) + ->param('httpUser', '', function () { return new Text(256); }, 'Task HTTP user', true) + ->param('httpPass', '', function () { return new Text(256); }, 'Task HTTP password', true) ->action( function ($projectId, $taskId, $name, $status, $schedule, $security, $httpMethod, $httpUrl, $httpHeaders, $httpUser, $httpPass) use ($request, $response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -1164,12 +994,8 @@ $utopia->delete('/v1/projects/:projectId/tasks/:taskId') ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'deleteTask') - ->param('projectId', null, function () { - return new UID(); - }, 'Project unique ID.') - ->param('taskId', null, function () { - return new UID(); - }, 'Task unique ID.') + ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') + ->param('taskId', null, function () { return new UID(); }, 'Task unique ID.') ->action( function ($projectId, $taskId) use ($response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -1199,9 +1025,7 @@ $utopia->get('/v1/projects/:projectId/platforms') ->label('scope', 'projects.read') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'listPlatforms') - ->param('projectId', '', function () { - return new UID(); - }, 'Project unique ID.') + ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.') ->action( function ($projectId) use ($request, $response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -1221,12 +1045,8 @@ $utopia->get('/v1/projects/:projectId/platforms/:platformId') ->label('scope', 'projects.read') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'getPlatform') - ->param('projectId', null, function () { - return new UID(); - }, 'Project unique ID.') - ->param('platformId', null, function () { - return new UID(); - }, 'Platform unique ID.') + ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') + ->param('platformId', null, function () { return new UID(); }, 'Platform unique ID.') ->action( function ($projectId, $platformId) use ($request, $response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -1250,24 +1070,12 @@ $utopia->post('/v1/projects/:projectId/platforms') ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'createPlatform') - ->param('projectId', null, function () { - return new UID(); - }, 'Project unique ID.') - ->param('type', null, function () { - return new WhiteList(['web', 'ios', 'android', 'unity']); - }, 'Platform name') - ->param('name', null, function () { - return new Text(256); - }, 'Platform name') - ->param('key', '', function () { - return new Text(256); - }, 'Package name for android or bundle ID for iOS', true) - ->param('store', '', function () { - return new Text(256); - }, 'App store or Google Play store ID', true) - ->param('url', '', function () { - return new URL(); - }, 'Platform client URL', true) + ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') + ->param('type', null, function () { return new WhiteList(['web', 'ios', 'android', 'unity']); }, 'Platform name') + ->param('name', null, function () { return new Text(256); }, 'Platform name') + ->param('key', '', function () { return new Text(256); }, 'Package name for android or bundle ID for iOS', true) + ->param('store', '', function () { return new Text(256); }, 'App store or Google Play store ID', true) + ->param('url', '', function () { return new URL(); }, 'Platform client URL', true) ->action( function ($projectId, $type, $name, $key, $store, $url) use ($response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -1315,24 +1123,12 @@ $utopia->put('/v1/projects/:projectId/platforms/:platformId') ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'updatePlatform') - ->param('projectId', null, function () { - return new UID(); - }, 'Project unique ID.') - ->param('platformId', null, function () { - return new UID(); - }, 'Platform unique ID.') - ->param('name', null, function () { - return new Text(256); - }, 'Platform name') - ->param('key', '', function () { - return new Text(256); - }, 'Package name for android or bundle ID for iOS', true) - ->param('store', '', function () { - return new Text(256); - }, 'App store or Google Play store ID', true) - ->param('url', '', function () { - return new URL(); - }, 'Platform client URL', true) + ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') + ->param('platformId', null, function () { return new UID(); }, 'Platform unique ID.') + ->param('name', null, function () { return new Text(256); }, 'Platform name') + ->param('key', '', function () { return new Text(256); }, 'Package name for android or bundle ID for iOS', true) + ->param('store', '', function () { return new Text(256); }, 'App store or Google Play store ID', true) + ->param('url', '', function () { return new URL(); }, 'Platform client URL', true) ->action( function ($projectId, $platformId, $name, $key, $store, $url) use ($response, $consoleDB) { $project = $consoleDB->getDocument($projectId); @@ -1368,12 +1164,8 @@ $utopia->delete('/v1/projects/:projectId/platforms/:platformId') ->label('scope', 'projects.write') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'deletePlatform') - ->param('projectId', null, function () { - return new UID(); - }, 'Project unique ID.') - ->param('platformId', null, function () { - return new UID(); - }, 'Platform unique ID.') + ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.') + ->param('platformId', null, function () { return new UID(); }, 'Platform unique ID.') ->action( function ($projectId, $platformId) use ($response, $consoleDB) { $project = $consoleDB->getDocument($projectId); diff --git a/app/controllers/storage.php b/app/controllers/storage.php index c397d69e3f..81c1b6ceac 100644 --- a/app/controllers/storage.php +++ b/app/controllers/storage.php @@ -119,18 +119,10 @@ $utopia->get('/v1/storage/files') ->label('sdk.namespace', 'storage') ->label('sdk.method', 'listFiles') ->label('sdk.description', 'Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](/docs/modes).') - ->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) + ->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true) + ->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) + ->param('offset', 0, function () { return new Range(0, 2000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true) + ->param('orderType', 'ASC', function () { return new WhiteList(['ASC', 'DESC']); }, 'Order result by ASC or DESC order.', true) ->action( function ($search, $limit, $offset, $orderType) use ($response, $projectDB) { $results = $projectDB->getCollection([ @@ -159,9 +151,7 @@ $utopia->get('/v1/storage/files/:fileId') ->label('sdk.namespace', 'storage') ->label('sdk.method', 'getFile') ->label('sdk.description', 'Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.') - ->param('fileId', '', function () { - return new UID(); - }, 'File unique ID.') + ->param('fileId', '', function () { return new UID(); }, 'File unique ID.') ->action( function ($fileId) use ($response, $projectDB) { $file = $projectDB->getDocument($fileId); @@ -180,24 +170,12 @@ $utopia->get('/v1/storage/files/:fileId/preview') ->label('sdk.namespace', 'storage') ->label('sdk.method', 'getFilePreview') ->label('sdk.description', 'Get file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets will return file icon image. You can also pass query string arguments for cutting and resizing your preview image.') - ->param('fileId', '', function () { - return new UID(); - }, 'File unique ID') - ->param('width', 0, function () { - return new Range(0, 4000); - }, 'Resize preview image width, Pass an integer between 0 to 4000', true) - ->param('height', 0, function () { - return new Range(0, 4000); - }, 'Resize preview image height, Pass an integer between 0 to 4000', true) - ->param('quality', 100, function () { - return new Range(0, 100); - }, 'Preview image quality. Pass an integer between 0 to 100. Defaults to 100', true) - ->param('background', '', function () { - return new HexColor(); - }, 'Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.', true) - ->param('output', null, function () use ($outputs) { - return new WhiteList(array_merge(array_keys($outputs), [null])); - }, 'Output format type (jpeg, jpg, png, gif and webp)', true) + ->param('fileId', '', function () { return new UID(); }, 'File unique ID') + ->param('width', 0, function () { return new Range(0, 4000); }, 'Resize preview image width, Pass an integer between 0 to 4000', true) + ->param('height', 0, function () { return new Range(0, 4000); }, 'Resize preview image height, Pass an integer between 0 to 4000', true) + ->param('quality', 100, function () { return new Range(0, 100); }, 'Preview image quality. Pass an integer between 0 to 100. Defaults to 100', true) + ->param('background', '', function () { return new HexColor(); }, 'Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.', true) + ->param('output', null, function () use ($outputs) { return new WhiteList(array_merge(array_keys($outputs), [null])); }, 'Output format type (jpeg, jpg, png, gif and webp)', true) //->param('storage', 'local', function () {return new WhiteList(array('local'));}, 'Selected storage device. defaults to local') //->param('token', '', function () {return new Text(128);}, 'Preview token', true) ->action( @@ -304,9 +282,7 @@ $utopia->get('/v1/storage/files/:fileId/download') ->label('sdk.namespace', 'storage') ->label('sdk.method', 'getFileDownload') ->label('sdk.description', 'Get file content by its unique ID. The endpoint response return with a \'Content-Disposition: attachment\' header that tells the browser to start downloading the file to user downloads directory.') - ->param('fileId', '', function () { - return new UID(); - }, 'File unique ID.') + ->param('fileId', '', function () { return new UID(); }, 'File unique ID.') ->action( function ($fileId) use ($response, $request, $projectDB) { $file = $projectDB->getDocument($fileId); @@ -356,12 +332,8 @@ $utopia->get('/v1/storage/files/:fileId/view') ->label('sdk.namespace', 'storage') ->label('sdk.method', 'getFileView') ->label('sdk.description', 'Get file content by its unique ID. This endpoint is similar to the download method but returns with no \'Content-Disposition: attachment\' header.') - ->param('fileId', '', function () { - return new UID(); - }, 'File unique ID.') - ->param('as', '', function () { - return new WhiteList(['pdf', /*'html',*/ 'text']); - }, 'Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.', true) + ->param('fileId', '', function () { return new UID(); }, 'File unique ID.') + ->param('as', '', function () { return new WhiteList(['pdf', /*'html',*/ 'text']); }, 'Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.', true) ->action( function ($fileId, $as) use ($response, $request, $projectDB, $mimes) { $file = $projectDB->getDocument($fileId); @@ -428,18 +400,10 @@ $utopia->post('/v1/storage/files') ->label('sdk.method', 'createFile') ->label('sdk.description', 'Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.') ->label('sdk.consumes', 'multipart/form-data') - ->param('files', [], function () { - return new File(); - }, 'Binary Files.', false) - ->param('read', [], function () { - return new ArrayList(new Text(64)); - }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true) - ->param('write', [], function () { - return new ArrayList(new Text(64)); - }, 'An array of strings with write permissions. [Learn more about permissions and roles](/docs/permissions).', true) - ->param('folderId', '', function () { - return new UID(); - }, 'Folder to associate files with.', true) + ->param('files', [], function () { return new File(); }, 'Binary Files.', false) + ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true) + ->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. [Learn more about permissions and roles](/docs/permissions).', true) + ->param('folderId', '', function () { return new UID(); }, 'Folder to associate files with.', true) ->action( function ($files, $read, $write, $folderId) use ($request, $response, $user, $projectDB, $audit, $usage) { $files = $request->getFiles('files'); @@ -558,18 +522,10 @@ $utopia->put('/v1/storage/files/:fileId') ->label('sdk.namespace', 'storage') ->label('sdk.method', 'updateFile') ->label('sdk.description', 'Update file by its unique ID. Only users with write permissions have access to update this resource.') - ->param('fileId', '', function () { - return new UID(); - }, 'File unique ID.') - ->param('read', [], function () { - return new ArrayList(new Text(64)); - }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true) - ->param('write', [], function () { - return new ArrayList(new Text(64)); - }, 'An array of strings with write permissions. [Learn more about permissions and roles](/docs/permissions).', true) - ->param('folderId', '', function () { - return new UID(); - }, 'Folder to associate files with.', true) + ->param('fileId', '', function () { return new UID(); }, 'File unique ID.') + ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. [Learn more about permissions and roles](/docs/permissions).', true) + ->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. [Learn more about permissions and roles](/docs/permissions).', true) + ->param('folderId', '', function () { return new UID(); }, 'Folder to associate files with.', true) ->action( function ($fileId, $read, $write, $folderId) use ($response, $projectDB) { $file = $projectDB->getDocument($fileId); @@ -600,9 +556,7 @@ $utopia->delete('/v1/storage/files/:fileId') ->label('sdk.namespace', 'storage') ->label('sdk.method', 'deleteFile') ->label('sdk.description', 'Delete a file by its unique ID. Only users with write permissions have access to delete this resource.') - ->param('fileId', '', function () { - return new UID(); - }, 'File unique ID.') + ->param('fileId', '', function () { return new UID(); }, 'File unique ID.') ->action( function ($fileId) use ($response, $projectDB, $audit, $usage) { $file = $projectDB->getDocument($fileId); @@ -638,11 +592,8 @@ $utopia->get('/v1/storage/files/:fileId/scan') ->label('sdk.namespace', 'storage') ->label('sdk.method', 'getFileScan') ->label('sdk.hide', true) - ->param('fileId', '', function () { - return new UID(); - }, 'File unique ID.') - ->param('storage', 'local', function () { - return new WhiteList(['local']); + ->param('fileId', '', function () { return new UID(); }, 'File unique ID.') + ->param('storage', 'local', function () { return new WhiteList(['local']); }) ->action( function ($fileId, $storage) use ($response, $request, $projectDB) { diff --git a/app/controllers/teams.php b/app/controllers/teams.php index 27a5fbe31a..84da0f23ec 100644 --- a/app/controllers/teams.php +++ b/app/controllers/teams.php @@ -24,18 +24,10 @@ $utopia->get('/v1/teams') ->label('sdk.namespace', 'teams') ->label('sdk.method', 'listTeams') ->label('sdk.description', 'Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](/docs/modes).') - ->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) + ->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true) + ->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) + ->param('offset', 0, function () { return new Range(0, 2000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true) + ->param('orderType', 'ASC', function () { return new WhiteList(['ASC', 'DESC']); }, 'Order result by ASC or DESC order.', true) ->action( function ($search, $limit, $offset, $orderType) use ($response, $projectDB) { $results = $projectDB->getCollection([ @@ -60,9 +52,7 @@ $utopia->get('/v1/teams/:teamId') ->label('sdk.namespace', 'teams') ->label('sdk.method', 'getTeam') ->label('sdk.description', 'Get team by its unique ID. All team members have read access for this resource.') - ->param('teamId', '', function () { - return new UID(); - }, 'Team unique ID.') + ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') ->action( function ($teamId) use ($response, $projectDB) { $team = $projectDB->getDocument($teamId); @@ -81,9 +71,7 @@ $utopia->get('/v1/teams/:teamId/members') ->label('sdk.namespace', 'teams') ->label('sdk.method', 'getTeamMembers') ->label('sdk.description', 'Get team members by the team unique ID. All team members have read access for this list of resources.') - ->param('teamId', '', function () { - return new UID(); - }, 'Team unique ID.') + ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') ->action( function ($teamId) use ($response, $projectDB) { $team = $projectDB->getDocument($teamId); @@ -135,12 +123,8 @@ $utopia->post('/v1/teams') ->label('sdk.namespace', 'teams') ->label('sdk.method', 'createTeam') ->label('sdk.description', 'Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.') - ->param('name', null, function () { - return new Text(100); - }, 'Team name.') - ->param('roles', ['owner'], function () { - return new ArrayList(new Text(128)); - }, 'User roles array. Use this param to set the roles in the team for the user who created the team. The default role is **owner**, a role can be any string.', true) + ->param('name', null, function () { return new Text(100); }, 'Team name.') + ->param('roles', ['owner'], function () { return new ArrayList(new Text(128)); }, 'User roles array. Use this param to set the roles in the team for the user who created the team. The default role is **owner**, a role can be any string.', true) ->action( function ($name, $roles) use ($response, $projectDB, $user, $mode) { Authorization::disable(); @@ -201,12 +185,8 @@ $utopia->put('/v1/teams/:teamId') ->label('sdk.namespace', 'teams') ->label('sdk.method', 'updateTeam') ->label('sdk.description', 'Update team by its unique ID. Only team owners have write access for this resource.') - ->param('teamId', '', function () { - return new UID(); - }, 'Team unique ID.') - ->param('name', null, function () { - return new Text(100); - }, 'Team name.') + ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') + ->param('name', null, function () { return new Text(100); }, 'Team name.') ->action( function ($teamId, $name) use ($response, $projectDB) { $team = $projectDB->getDocument($teamId); @@ -233,9 +213,7 @@ $utopia->delete('/v1/teams/:teamId') ->label('sdk.namespace', 'teams') ->label('sdk.method', 'deleteTeam') ->label('sdk.description', 'Delete team by its unique ID. Only team owners have write access for this resource.') - ->param('teamId', '', function () { - return new UID(); - }, 'Team unique ID.') + ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') ->action( function ($teamId) use ($response, $projectDB) { $team = $projectDB->getDocument($teamId); @@ -275,21 +253,11 @@ $utopia->post('/v1/teams/:teamId/memberships') ->label('sdk.namespace', 'teams') ->label('sdk.method', 'createTeamMembership') ->label('sdk.description', "Use this endpoint to invite a new member to your team. An email with a link to join the team will be sent to the new member email address. If member doesn't exists in the project it will be automatically created.\n\nUse the redirect parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the /teams/{teamId}/memberships/{inviteId}/status endpoint to finally join the user to the team.\n\nPlease notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.") - ->param('teamId', '', function () { - return new UID(); - }, 'Team unique ID.') - ->param('email', '', function () { - return new Email(); - }, 'New team member email address.') - ->param('name', '', function () { - return new Text(100); - }, 'New team member name.', true) - ->param('roles', [], function () { - return new ArrayList(new Text(128)); - }, 'Invite roles array. Learn more about [roles and permissions](/docs/permissions).') - ->param('redirect', '', function () use ($clients) { - return new Host($clients); - }, 'Reset page to redirect user back to your app from the invitation email.') + ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') + ->param('email', '', function () { return new Email(); }, 'New team member email address.') + ->param('name', '', function () { return new Text(100); }, 'New team member name.', true) + ->param('roles', [], function () { return new ArrayList(new Text(128)); }, 'Invite roles array. Learn more about [roles and permissions](/docs/permissions).') + ->param('redirect', '', function () use ($clients) { return new Host($clients); }, 'Reset page to redirect user back to your app from the invitation email.') ->action( function ($teamId, $email, $name, $roles, $redirect) use ($request, $response, $register, $project, $user, $audit, $projectDB) { $name = (empty($name)) ? $email : $name; @@ -428,15 +396,9 @@ $utopia->post('/v1/teams/:teamId/memberships/:inviteId/resend') ->label('sdk.namespace', 'teams') ->label('sdk.method', 'createTeamMembershipResend') ->label('sdk.description', 'Use this endpoint to resend your invitation email for a user to join a team.') - ->param('teamId', '', function () { - return new UID(); - }, 'Team unique ID.') - ->param('inviteId', '', function () { - return new UID(); - }, 'Invite unique ID.') - ->param('redirect', '', function () use ($clients) { - return new Host($clients); - }, 'Reset page to redirect user back to your app from the invitation email.') + ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') + ->param('inviteId', '', function () { return new UID(); }, 'Invite unique ID.') + ->param('redirect', '', function () use ($clients) { return new Host($clients); }, 'Reset page to redirect user back to your app from the invitation email.') ->action( function ($teamId, $inviteId, $redirect) use ($response, $register, $project, $user, $audit, $projectDB) { $membership = $projectDB->getDocument($inviteId); @@ -515,24 +477,12 @@ $utopia->patch('/v1/teams/:teamId/memberships/:inviteId/status') ->label('sdk.method', 'updateTeamMembershipStatus') ->label('sdk.description', "Use this endpoint to let user accept an invitation to join a team after he is being redirect back to your app from the invitation email. Use the success and failure URL's to redirect users back to your application after the request completes.\n\nPlease notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.\n\nWhen not using the success or failure redirect arguments this endpoint will result with a 200 status code on success and with 401 status error on failure. This behavior was applied to help the web clients deal with browsers who don't allow to set 3rd party HTTP cookies needed for saving the account session token.") ->label('sdk.cookies', true) - ->param('teamId', '', function () { - return new UID(); - }, 'Team unique ID.') - ->param('inviteId', '', function () { - return new UID(); - }, 'Invite unique ID') - ->param('userId', '', function () { - return new UID(); - }, 'User unique ID') - ->param('secret', '', function () { - return new Text(256); - }, 'Secret Key') - ->param('success', null, function () use ($clients) { - return new Host($clients); - }, 'Redirect when registration succeed', true) - ->param('failure', null, function () use ($clients) { - return new Host($clients); - }, 'Redirect when registration failed', true) + ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') + ->param('inviteId', '', function () { return new UID(); }, 'Invite unique ID') + ->param('userId', '', function () { return new UID(); }, 'User unique ID') + ->param('secret', '', function () { return new Text(256); }, 'Secret Key') + ->param('success', null, function () use ($clients) { return new Host($clients); }, 'Redirect when registration succeed', true) + ->param('failure', null, function () use ($clients) { return new Host($clients); }, 'Redirect when registration failed', true) ->action( function ($teamId, $inviteId, $userId, $secret, $success, $failure) use ($response, $request, $user, $audit, $projectDB) { $invite = $projectDB->getDocument($inviteId); @@ -658,12 +608,8 @@ $utopia->delete('/v1/teams/:teamId/memberships/:inviteId') ->label('sdk.namespace', 'teams') ->label('sdk.method', 'deleteTeamMembership') ->label('sdk.description', 'This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member.') - ->param('teamId', '', function () { - return new UID(); - }, 'Team unique ID.') - ->param('inviteId', '', function () { - return new UID(); - }, 'Invite unique ID') + ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.') + ->param('inviteId', '', function () { return new UID(); }, 'Invite unique ID') ->action( function ($teamId, $inviteId) use ($response, $projectDB, $audit) { $invite = $projectDB->getDocument($inviteId); diff --git a/app/controllers/users.php b/app/controllers/users.php index a77436b0c0..7cc4b4ed31 100644 --- a/app/controllers/users.php +++ b/app/controllers/users.php @@ -23,18 +23,10 @@ $utopia->get('/v1/users') ->label('sdk.namespace', 'users') ->label('sdk.method', 'listUsers') ->label('sdk.description', 'Get a list of all the project users. You can use the query params to filter your results.') - ->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) + ->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true) + ->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) + ->param('offset', 0, function () { return new Range(0, 2000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true) + ->param('orderType', 'ASC', function () { return new WhiteList(['ASC', 'DESC']); }, 'Order result by ASC or DESC order.', true) ->action( function ($search, $limit, $offset, $orderType) use ($response, $projectDB, $providers) { $results = $projectDB->getCollection([ @@ -83,9 +75,7 @@ $utopia->get('/v1/users/:userId') ->label('sdk.namespace', 'users') ->label('sdk.method', 'getUser') ->label('sdk.description', 'Get user by its unique ID.') - ->param('userId', '', function () { - return new UID(); - }, 'User unique ID.') + ->param('userId', '', function () { return new UID(); }, 'User unique ID.') ->action( function ($userId) use ($response, $projectDB, $providers) { $user = $projectDB->getDocument($userId); @@ -124,9 +114,7 @@ $utopia->get('/v1/users/:userId/prefs') ->label('sdk.namespace', 'users') ->label('sdk.method', 'getUserPrefs') ->label('sdk.description', 'Get user preferences by its unique ID.') - ->param('userId', '', function () { - return new UID(); - }, 'User unique ID.') + ->param('userId', '', function () { return new UID(); }, 'User unique ID.') ->action( function ($userId) use ($response, $projectDB) { $user = $projectDB->getDocument($userId); @@ -157,9 +145,7 @@ $utopia->get('/v1/users/:userId/sessions') ->label('sdk.namespace', 'users') ->label('sdk.method', 'getUserSessions') ->label('sdk.description', 'Get user sessions list by its unique ID.') - ->param('userId', '', function () { - return new UID(); - }, 'User unique ID.') + ->param('userId', '', function () { return new UID(); }, 'User unique ID.') ->action( function ($userId) use ($response, $projectDB) { $user = $projectDB->getDocument($userId); @@ -221,9 +207,7 @@ $utopia->get('/v1/users/:userId/logs') ->label('sdk.namespace', 'users') ->label('sdk.method', 'getUserLogs') ->label('sdk.description', 'Get user activity logs list by its unique ID.') - ->param('userId', '', function () { - return new UID(); - }, 'User unique ID.') + ->param('userId', '', function () { return new UID(); }, 'User unique ID.') ->action( function ($userId) use ($response, $register, $projectDB, $project) { $user = $projectDB->getDocument($userId); @@ -284,15 +268,9 @@ $utopia->post('/v1/users') ->label('sdk.namespace', 'users') ->label('sdk.method', 'createUser') ->label('sdk.description', 'Create a new user.') - ->param('email', '', function () { - return new Email(); - }, 'User account email.') - ->param('password', '', function () { - return new Password(); - }, 'User account password.') - ->param('name', '', function () { - return new Text(100); - }, 'User account name.', true) + ->param('email', '', function () { return new Email(); }, 'User account email.') + ->param('password', '', function () { return new Password(); }, 'User account password.') + ->param('name', '', function () { return new Text(100); }, 'User account name.', true) ->action( function ($email, $password, $name) use ($response, $register, $projectDB, $providers) { $profile = $projectDB->getCollection([ // Get user by email address @@ -354,12 +332,8 @@ $utopia->patch('/v1/users/:userId/status') ->label('sdk.namespace', 'users') ->label('sdk.method', 'updateUserStatus') ->label('sdk.description', 'Update user status by its unique ID.') - ->param('userId', '', function () { - return new UID(); - }, 'User unique ID.') - ->param('status', '', function () { - return new WhiteList([Auth::USER_STATUS_ACTIVATED, Auth::USER_STATUS_BLOCKED, Auth::USER_STATUS_UNACTIVATED]); - }, 'User Status code. To activate the user pass '.Auth::USER_STATUS_ACTIVATED.', to blocking the user pass '.Auth::USER_STATUS_BLOCKED.' and for disabling the user pass '.Auth::USER_STATUS_UNACTIVATED) + ->param('userId', '', function () { return new UID(); }, 'User unique ID.') + ->param('status', '', function () { return new WhiteList([Auth::USER_STATUS_ACTIVATED, Auth::USER_STATUS_BLOCKED, Auth::USER_STATUS_UNACTIVATED]); }, 'User Status code. To activate the user pass '.Auth::USER_STATUS_ACTIVATED.', to blocking the user pass '.Auth::USER_STATUS_BLOCKED.' and for disabling the user pass '.Auth::USER_STATUS_UNACTIVATED) ->action( function ($userId, $status) use ($response, $projectDB) { $user = $projectDB->getDocument($userId); @@ -386,12 +360,8 @@ $utopia->patch('/v1/users/:userId/prefs') ->label('scope', 'users.write') ->label('sdk.namespace', 'users') ->label('sdk.method', 'updateUserPrefs') - ->param('userId', '', function () { - return new UID(); - }, 'User unique ID.') - ->param('prefs', '', function () { - return new \Utopia\Validator\Mock(); - }, 'Prefs key-value JSON object string.') + ->param('userId', '', function () { return new UID(); }, 'User unique ID.') + ->param('prefs', '', function () { return new \Utopia\Validator\Mock(); }, 'Prefs key-value JSON object string.') ->label('sdk.description', 'Update user preferences by its unique ID. You can pass only the specific settings you wish to update.') ->action( function ($userId, $prefs) use ($response, $projectDB) { @@ -420,12 +390,8 @@ $utopia->delete('/v1/users/:userId/sessions/:session') ->label('sdk.method', 'deleteUsersSession') ->label('sdk.description', 'Delete user sessions by its unique ID.') ->label('abuse-limit', 100) - ->param('userId', '', function () { - return new UID(); - }, 'User unique ID.') - ->param('sessionId', null, function () { - return new UID(); - }, 'User unique session ID.') + ->param('userId', '', function () { return new UID(); }, 'User unique ID.') + ->param('sessionId', null, function () { return new UID(); }, 'User unique session ID.') ->action( function ($userId, $sessionId) use ($response, $request, $projectDB) { $user = $projectDB->getDocument($userId); @@ -455,9 +421,7 @@ $utopia->delete('/v1/users/:userId/sessions') ->label('sdk.method', 'deleteUserSessions') ->label('sdk.description', 'Delete all user sessions by its unique ID.') ->label('abuse-limit', 100) - ->param('userId', '', function () { - return new UID(); - }, 'User unique ID.') + ->param('userId', '', function () { return new UID(); }, 'User unique ID.') ->action( function ($userId) use ($response, $request, $projectDB) { $user = $projectDB->getDocument($userId); diff --git a/docs/references/auth/confirm-resend.md b/docs/references/auth/confirm-resend.md new file mode 100644 index 0000000000..420f9bc113 --- /dev/null +++ b/docs/references/auth/confirm-resend.md @@ -0,0 +1,3 @@ +This endpoint allows the user to request your app to resend him his email confirmation message. The redirect arguments acts the same way as in /auth/register endpoint. + +Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface. \ No newline at end of file diff --git a/docs/references/auth/confirm.md b/docs/references/auth/confirm.md new file mode 100644 index 0000000000..1826e605aa --- /dev/null +++ b/docs/references/auth/confirm.md @@ -0,0 +1 @@ +Use this endpoint to complete the confirmation of the user account email address. Both the **userId** and **token** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the /auth/register endpoint. \ No newline at end of file diff --git a/docs/references/auth/login.md b/docs/references/auth/login.md new file mode 100644 index 0000000000..1bbd0fbdb7 --- /dev/null +++ b/docs/references/auth/login.md @@ -0,0 +1,5 @@ +Allow the user to login into his account by providing a valid email and password combination. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. + +Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface. + +When accessing this route using JavaScript from the browser, success and failure parameter URLs are required. Appwrite server will respond with a 301 redirect status code and will set the user session cookie. This behavior is enforced because modern browsers are limiting 3rd party cookies in XHR of fetch requests to protect user privacy. \ No newline at end of file diff --git a/docs/references/auth/logout-by-session.md b/docs/references/auth/logout-by-session.md new file mode 100644 index 0000000000..4184532fd9 --- /dev/null +++ b/docs/references/auth/logout-by-session.md @@ -0,0 +1 @@ +Use this endpoint to log out the currently logged in user from all his account sessions across all his different devices. When using the option id argument, only the session unique ID provider will be deleted. \ No newline at end of file diff --git a/docs/references/auth/logout.md b/docs/references/auth/logout.md new file mode 100644 index 0000000000..534b191187 --- /dev/null +++ b/docs/references/auth/logout.md @@ -0,0 +1 @@ +Use this endpoint to log out the currently logged in user from his account. When succeed this endpoint will delete the user session and remove the session secret cookie from the user client. \ No newline at end of file diff --git a/docs/references/auth/recovery-reset.md b/docs/references/auth/recovery-reset.md new file mode 100644 index 0000000000..8d1336450a --- /dev/null +++ b/docs/references/auth/recovery-reset.md @@ -0,0 +1,3 @@ +Use this endpoint to complete the user account password reset. Both the **userId** and **token** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the /auth/recovery endpoint. + +Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface. \ No newline at end of file diff --git a/docs/references/auth/recovery.md b/docs/references/auth/recovery.md new file mode 100644 index 0000000000..e15db5ac6b --- /dev/null +++ b/docs/references/auth/recovery.md @@ -0,0 +1 @@ +Sends the user an email with a temporary secret token for password reset. When the user clicks the confirmation link he is redirected back to your app password reset redirect URL with a secret token and email address values attached to the URL query string. Use the query string params to submit a request to the /auth/password/reset endpoint to complete the process. \ No newline at end of file diff --git a/docs/references/auth/register.md b/docs/references/auth/register.md new file mode 100644 index 0000000000..a5195eef10 --- /dev/null +++ b/docs/references/auth/register.md @@ -0,0 +1,7 @@ +Use this endpoint to allow a new user to register an account in your project. Use the success and failure URL's to redirect users back to your application after signup completes. + +If registration completes successfully user will be sent with a confirmation email in order to confirm he is the owner of the account email address. Use the confirmation parameter to redirect the user from the confirmation email back to your app. When the user is redirected, use the /auth/confirm endpoint to complete the account confirmation. + +Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface. + +When accessing this route using JavaScript from the browser, success and failure parameter URLs are required. Appwrite server will respond with a 301 redirect status code and will set the user session cookie. This behavior is enforced because modern browsers are limiting 3rd party cookies in XHR of fetch requests to protect user privacy. \ No newline at end of file From 511455b3f6f008d15ced318e62340a4fa2b40e06 Mon Sep 17 00:00:00 2001 From: Esteban Campos Date: Mon, 7 Oct 2019 09:40:34 +1100 Subject: [PATCH 21/24] Fixed typo errors --- app/config/locale/es.php | 2 +- app/config/locale/templates/es.email.auth.confirm.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/config/locale/es.php b/app/config/locale/es.php index 0a56743689..cc8e82b7bd 100644 --- a/app/config/locale/es.php +++ b/app/config/locale/es.php @@ -6,7 +6,7 @@ return [ 'settings.direction' => 'ltr', // Service - Users - 'auth.emails.team' => '%s Equipo', + 'auth.emails.team' => 'Equipo %s', 'auth.emails.confirm.title' => 'Confirmación de la cuenta', 'auth.emails.confirm.body' => 'es.email.auth.confirm.tpl', 'auth.emails.recovery.title' => 'Reestablecer contraseña', diff --git a/app/config/locale/templates/es.email.auth.confirm.tpl b/app/config/locale/templates/es.email.auth.confirm.tpl index 3bb7e97b62..e8ab39bf86 100644 --- a/app/config/locale/templates/es.email.auth.confirm.tpl +++ b/app/config/locale/templates/es.email.auth.confirm.tpl @@ -10,7 +10,7 @@ Hola {{name}},

- Sigue este enlace para verificar tu dirección de correo: + Sigue este enlace para verificar tu dirección de correo.
{{redirect}}
From 0960b0043dd35bc34b2ae1771252e3ef18b0c9fc Mon Sep 17 00:00:00 2001 From: alvesgabriel Date: Sun, 6 Oct 2019 22:48:42 -0300 Subject: [PATCH 22/24] fix link to enviroment variables file in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 76f8bc1f7f..4afc72376d 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ docker-compose up -d --remove-orphans Once the Docker installation completes, go to http://localhost to access the Appwrite console from your browser. Please notice that on non-linux native hosts, the server might take a few minutes to start after installation completes. -For advanced, production and custom installation, check out our Docker [environment variables](/docs/EnviornementVariables.md) docs. +For advanced, production and custom installation, check out our Docker [environment variables](docs/tutorials/environment-variables.md) docs. ### Changing Port Number From 7f5ea0a5f6c4207ff65e391af8b940f857251277 Mon Sep 17 00:00:00 2001 From: eldadfux Date: Mon, 7 Oct 2019 19:53:56 +0300 Subject: [PATCH 23/24] Moved services docs to md files --- app/config/services.php | 18 ++++++++---------- docs/services/account.md | 1 + docs/services/auth.md | 3 +++ docs/services/avatars.md | 1 + docs/services/database.md | 7 +++++++ docs/services/locale.md | 1 + docs/services/storage.md | 5 +++++ docs/services/teams.md | 3 +++ docs/services/users.md | 1 + 9 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 docs/services/account.md create mode 100644 docs/services/auth.md create mode 100644 docs/services/avatars.md create mode 100644 docs/services/database.md create mode 100644 docs/services/locale.md create mode 100644 docs/services/storage.md create mode 100644 docs/services/teams.md create mode 100644 docs/services/users.md diff --git a/app/config/services.php b/app/config/services.php index 85c313cfbb..9b83eb1c56 100644 --- a/app/config/services.php +++ b/app/config/services.php @@ -13,33 +13,31 @@ return [ ], 'v1/account' => [ 'name' => 'Account', - 'description' => 'The account service allow you to fetch and update information related to the currently logged in user. You can also retrieve a list of all the user sessions across different devices and a security log with the account recent activity.', + 'description' => '/docs/service/account.md', 'controller' => 'controllers/account.php', 'sdk' => true, ], 'v1/auth' => [ // Add to docs later: You can also learn how to [configure support for our supported OAuth providers](/docs/oauth) 'name' => 'Auth', - 'description' => "The authentication service allows you to verify users accounts using basic email and password login or with a supported OAuth provider. The auth service also exposes methods to confirm users email account and recover users forgotten passwords.\n\nYou can review our currently available OAuth providers from your project console under the **'users'** menu.", + 'description' => '/docs/service/auth.md', 'controller' => 'controllers/auth.php', 'sdk' => true, ], 'v1/avatars' => [ 'name' => 'Avatars', - 'description' => 'The avatars service aims to help you complete common and recitative tasks related to your app images, icons and avatars. Using this service we hope to save you some precious time and help you focus on solving your app real challenges.', + 'description' => '/docs/service/avatars.md', 'controller' => 'controllers/avatars.php', 'sdk' => true, ], 'v1/database' => [ 'name' => 'Database', - 'description' => "The database service allows you to create structured document collections, query and filter lists of documents and manage an advanced set of read and write access. - \n\nAll the data in the database service is stored in JSON format. The service also allows you to nest child documents and use advanced filters to search and query the database just like you would with a classic graph database. - \n\nBy leveraging the database permission management you can assign read or write access to the database documents for a specific user, team, user role or even grant public access to all visitors of your project. You can learn more about [how ".APP_NAME.' handles permissions and role access control](/docs/permissions).', + 'description' => '/docs/service/database.md', 'controller' => 'controllers/database.php', 'sdk' => true, ], 'v1/locale' => [ 'name' => 'Locale', - 'description' => 'The locale service allow you customize your app based on your user location. Get your user location, IP address, list of countries names, phone codes, currencies and more. This product includes GeoLite2 data created by MaxMind, available from [https://www.maxmind.com](https://www.maxmind.com).', + 'description' => '/docs/service/locale.md', 'controller' => 'controllers/locale.php', 'sdk' => true, ], @@ -55,19 +53,19 @@ return [ ], 'v1/storage' => [ 'name' => 'Storage', - 'description' => "The storage service allows you to manage your project files. You can upload, view, download, and query your files and media.\n\nEach file is granted read and write permissions to manage who has access to view or manage it. You can also learn more about how to manage your [resources permissions](/docs/permissions).\n\n You can also use the storage file preview endpoint to show the app users preview images of your files. The preview endpoint also allows you to manipulate the resulting image, so it will fit perfectly inside your app.", + 'description' => '/docs/service/storage.md', 'controller' => 'controllers/storage.php', 'sdk' => true, ], 'v1/teams' => [ 'name' => 'Teams', - 'description' => "The teams' service allows you to group together users of your project and allow them to share read and write access to your project resources, such as, database documents or storage files.\n\nEach user who creates a team becomes the team owner and can delegate the ownership role by inviting a new team member. Only team owners can invite new users to the team.", + 'description' => '/docs/service/teams.md', 'controller' => 'controllers/teams.php', 'sdk' => true, ], 'v1/users' => [ 'name' => 'Users', - 'description' => "The users' service allows you to to manage your users in admin mode, you can search, block and view your users' current sessions and latest activity.", + 'description' => '/docs/service/users.md', 'controller' => 'controllers/users.php', 'sdk' => true, ], diff --git a/docs/services/account.md b/docs/services/account.md new file mode 100644 index 0000000000..cecc3e2393 --- /dev/null +++ b/docs/services/account.md @@ -0,0 +1 @@ +The account service allow you to fetch and update information related to the currently logged in user. You can also retrieve a list of all the user sessions across different devices and a security log with the account recent activity. \ No newline at end of file diff --git a/docs/services/auth.md b/docs/services/auth.md new file mode 100644 index 0000000000..ea2f2bcb9a --- /dev/null +++ b/docs/services/auth.md @@ -0,0 +1,3 @@ +The authentication service allows you to verify users accounts using basic email and password login or with a supported OAuth provider. The auth service also exposes methods to confirm users email account and recover users forgotten passwords. + +You can review our currently available OAuth providers from your project console under the **'users'** menu. \ No newline at end of file diff --git a/docs/services/avatars.md b/docs/services/avatars.md new file mode 100644 index 0000000000..a0475bce9a --- /dev/null +++ b/docs/services/avatars.md @@ -0,0 +1 @@ +The avatars service aims to help you complete common and recitative tasks related to your app images, icons and avatars. Using this service we hope to save you some precious time and help you focus on solving your app real challenges. \ No newline at end of file diff --git a/docs/services/database.md b/docs/services/database.md new file mode 100644 index 0000000000..84a0aa1b01 --- /dev/null +++ b/docs/services/database.md @@ -0,0 +1,7 @@ +The database service allows you to create structured document collections, query and filter lists of documents and manage an advanced set of read and write access. + + +All the data in the database service is stored in JSON format. The service also allows you to nest child documents and use advanced filters to search and query the database just like you would with a classic graph database. + + +By leveraging the database permission management you can assign read or write access to the database documents for a specific user, team, user role or even grant public access to all visitors of your project. You can learn more about [how Appwrite handles permissions and role access control](/docs/permissions). \ No newline at end of file diff --git a/docs/services/locale.md b/docs/services/locale.md new file mode 100644 index 0000000000..060d45bf2f --- /dev/null +++ b/docs/services/locale.md @@ -0,0 +1 @@ +The locale service allow you customize your app based on your user location. Get your user location, IP address, list of countries names, phone codes, currencies and more. This product includes GeoLite2 data created by MaxMind, available from [https://www.maxmind.com](https://www.maxmind.com). \ No newline at end of file diff --git a/docs/services/storage.md b/docs/services/storage.md new file mode 100644 index 0000000000..77253b4ee6 --- /dev/null +++ b/docs/services/storage.md @@ -0,0 +1,5 @@ +The storage service allows you to manage your project files. You can upload, view, download, and query your files and media. + +Each file is granted read and write permissions to manage who has access to view or manage it. You can also learn more about how to manage your [resources permissions](/docs/permissions). + + You can also use the storage file preview endpoint to show the app users preview images of your files. The preview endpoint also allows you to manipulate the resulting image, so it will fit perfectly inside your app. \ No newline at end of file diff --git a/docs/services/teams.md b/docs/services/teams.md new file mode 100644 index 0000000000..a074be96e8 --- /dev/null +++ b/docs/services/teams.md @@ -0,0 +1,3 @@ +The teams' service allows you to group together users of your project and allow them to share read and write access to your project resources, such as, database documents or storage files. + +Each user who creates a team becomes the team owner and can delegate the ownership role by inviting a new team member. Only team owners can invite new users to the team. \ No newline at end of file diff --git a/docs/services/users.md b/docs/services/users.md new file mode 100644 index 0000000000..b1d24362cd --- /dev/null +++ b/docs/services/users.md @@ -0,0 +1 @@ +The users' service allows you to to manage your users in admin mode, you can search, block and view your users' current sessions and latest activity. \ No newline at end of file From 28b81c7382020cefddea561a66bd56dc1e5add56 Mon Sep 17 00:00:00 2001 From: eldadfux Date: Mon, 7 Oct 2019 20:06:55 +0300 Subject: [PATCH 24/24] Moved docs to md files --- docs/references/account/delete.md | 1 + docs/references/account/get-prefs.md | 1 + docs/references/account/get-security.md | 1 + docs/references/account/get-sessions.md | 1 + docs/references/account/get.md | 1 + docs/references/account/update-email.md | 1 + docs/references/account/update-name.md | 1 + docs/references/account/update-password.md | 1 + docs/references/account/update-prefs.md | 1 + docs/references/auth/login.md | 4 ++-- docs/references/auth/oauth.md | 0 docs/references/auth/register.md | 2 +- docs/references/avatars/get-browser.md | 1 + docs/references/avatars/get-credit-card.md | 1 + docs/references/avatars/get-favicon.md | 1 + docs/references/avatars/get-flag.md | 1 + docs/references/avatars/get-image.md | 1 + docs/references/avatars/get-qr.md | 1 + docs/references/database/create-collection.md | 1 + docs/references/database/create-document.md | 1 + docs/references/database/delete-collection.md | 1 + docs/references/database/delete-document.md | 1 + docs/references/database/get-collection.md | 1 + docs/references/database/get-document.md | 1 + docs/references/database/list-collections.md | 1 + docs/references/database/list-documents.md | 1 + docs/references/database/update-collection.md | 1 + docs/references/database/update-document.md | 0 docs/references/locale/get-countries-eu.md | 1 + docs/references/locale/get-countries-phones.md | 1 + docs/references/locale/get-countries.md | 1 + docs/references/locale/get-currencies.md | 1 + docs/references/locale/get-locale.md | 1 + docs/references/storage/create-file.md | 1 + docs/references/storage/delete-file.md | 1 + docs/references/storage/get-file-download.md | 1 + docs/references/storage/get-file-preview.md | 1 + docs/references/storage/get-file-view.md | 1 + docs/references/storage/get-file.md | 1 + docs/references/storage/list-files.md | 1 + docs/references/storage/update-file.md | 1 + docs/references/teams/create-team-membership-resend.md | 1 + docs/references/teams/create-team-membership.md | 5 +++++ docs/references/teams/create-team.md | 1 + docs/references/teams/delete-team-membership.md | 1 + docs/references/teams/delete-team.md | 1 + docs/references/teams/get-team-members.md | 1 + docs/references/teams/get-team.md | 1 + docs/references/teams/list-teams.md | 1 + docs/references/teams/update-team-membership-status.md | 5 +++++ docs/references/teams/update-team.md | 1 + docs/references/users/create-user.md | 1 + docs/references/users/delete-user-sessions.md | 1 + docs/references/users/delete-users-session.md | 1 + docs/references/users/get-user-logs.md | 1 + docs/references/users/get-user-prefs.md | 1 + docs/references/users/get-user-sessions.md | 1 + docs/references/users/get-user.md | 1 + docs/references/users/list-users.md | 1 + docs/references/users/update-user-status.md | 1 + 60 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 docs/references/account/delete.md create mode 100644 docs/references/account/get-prefs.md create mode 100644 docs/references/account/get-security.md create mode 100644 docs/references/account/get-sessions.md create mode 100644 docs/references/account/get.md create mode 100644 docs/references/account/update-email.md create mode 100644 docs/references/account/update-name.md create mode 100644 docs/references/account/update-password.md create mode 100644 docs/references/account/update-prefs.md create mode 100644 docs/references/auth/oauth.md create mode 100644 docs/references/avatars/get-browser.md create mode 100644 docs/references/avatars/get-credit-card.md create mode 100644 docs/references/avatars/get-favicon.md create mode 100644 docs/references/avatars/get-flag.md create mode 100644 docs/references/avatars/get-image.md create mode 100644 docs/references/avatars/get-qr.md create mode 100644 docs/references/database/create-collection.md create mode 100644 docs/references/database/create-document.md create mode 100644 docs/references/database/delete-collection.md create mode 100644 docs/references/database/delete-document.md create mode 100644 docs/references/database/get-collection.md create mode 100644 docs/references/database/get-document.md create mode 100644 docs/references/database/list-collections.md create mode 100644 docs/references/database/list-documents.md create mode 100644 docs/references/database/update-collection.md create mode 100644 docs/references/database/update-document.md create mode 100644 docs/references/locale/get-countries-eu.md create mode 100644 docs/references/locale/get-countries-phones.md create mode 100644 docs/references/locale/get-countries.md create mode 100644 docs/references/locale/get-currencies.md create mode 100644 docs/references/locale/get-locale.md create mode 100644 docs/references/storage/create-file.md create mode 100644 docs/references/storage/delete-file.md create mode 100644 docs/references/storage/get-file-download.md create mode 100644 docs/references/storage/get-file-preview.md create mode 100644 docs/references/storage/get-file-view.md create mode 100644 docs/references/storage/get-file.md create mode 100644 docs/references/storage/list-files.md create mode 100644 docs/references/storage/update-file.md create mode 100644 docs/references/teams/create-team-membership-resend.md create mode 100644 docs/references/teams/create-team-membership.md create mode 100644 docs/references/teams/create-team.md create mode 100644 docs/references/teams/delete-team-membership.md create mode 100644 docs/references/teams/delete-team.md create mode 100644 docs/references/teams/get-team-members.md create mode 100644 docs/references/teams/get-team.md create mode 100644 docs/references/teams/list-teams.md create mode 100644 docs/references/teams/update-team-membership-status.md create mode 100644 docs/references/teams/update-team.md create mode 100644 docs/references/users/create-user.md create mode 100644 docs/references/users/delete-user-sessions.md create mode 100644 docs/references/users/delete-users-session.md create mode 100644 docs/references/users/get-user-logs.md create mode 100644 docs/references/users/get-user-prefs.md create mode 100644 docs/references/users/get-user-sessions.md create mode 100644 docs/references/users/get-user.md create mode 100644 docs/references/users/list-users.md create mode 100644 docs/references/users/update-user-status.md diff --git a/docs/references/account/delete.md b/docs/references/account/delete.md new file mode 100644 index 0000000000..9fbad88cb5 --- /dev/null +++ b/docs/references/account/delete.md @@ -0,0 +1 @@ +Delete currently logged in user account. \ No newline at end of file diff --git a/docs/references/account/get-prefs.md b/docs/references/account/get-prefs.md new file mode 100644 index 0000000000..5cea863e31 --- /dev/null +++ b/docs/references/account/get-prefs.md @@ -0,0 +1 @@ +Get currently logged in user preferences key-value object. \ No newline at end of file diff --git a/docs/references/account/get-security.md b/docs/references/account/get-security.md new file mode 100644 index 0000000000..5cd2a4b87e --- /dev/null +++ b/docs/references/account/get-security.md @@ -0,0 +1 @@ +Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log. \ No newline at end of file diff --git a/docs/references/account/get-sessions.md b/docs/references/account/get-sessions.md new file mode 100644 index 0000000000..e944fd3675 --- /dev/null +++ b/docs/references/account/get-sessions.md @@ -0,0 +1 @@ +Get currently logged in user list of active sessions across different devices. \ No newline at end of file diff --git a/docs/references/account/get.md b/docs/references/account/get.md new file mode 100644 index 0000000000..f62b1f52bf --- /dev/null +++ b/docs/references/account/get.md @@ -0,0 +1 @@ +Get currently logged in user data as JSON object. \ No newline at end of file diff --git a/docs/references/account/update-email.md b/docs/references/account/update-email.md new file mode 100644 index 0000000000..d99b9b4a1d --- /dev/null +++ b/docs/references/account/update-email.md @@ -0,0 +1 @@ +Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request. \ No newline at end of file diff --git a/docs/references/account/update-name.md b/docs/references/account/update-name.md new file mode 100644 index 0000000000..1d62171959 --- /dev/null +++ b/docs/references/account/update-name.md @@ -0,0 +1 @@ +Update currently logged in user account name. \ No newline at end of file diff --git a/docs/references/account/update-password.md b/docs/references/account/update-password.md new file mode 100644 index 0000000000..207fedab1f --- /dev/null +++ b/docs/references/account/update-password.md @@ -0,0 +1 @@ +Update currently logged in user password. For validation, user is required to pass the password twice. \ No newline at end of file diff --git a/docs/references/account/update-prefs.md b/docs/references/account/update-prefs.md new file mode 100644 index 0000000000..cdfbdf9f04 --- /dev/null +++ b/docs/references/account/update-prefs.md @@ -0,0 +1 @@ +Update currently logged in user account preferences. You can pass only the specific settings you wish to update. \ No newline at end of file diff --git a/docs/references/auth/login.md b/docs/references/auth/login.md index 1bbd0fbdb7..5c8f1e7a4a 100644 --- a/docs/references/auth/login.md +++ b/docs/references/auth/login.md @@ -1,5 +1,5 @@ -Allow the user to login into his account by providing a valid email and password combination. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. +Allow the user to login into his account by providing a valid email and password combination. Use the success and failure arguments to provide a redirect URL\'s back to your app when login is completed. Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface. -When accessing this route using JavaScript from the browser, success and failure parameter URLs are required. Appwrite server will respond with a 301 redirect status code and will set the user session cookie. This behavior is enforced because modern browsers are limiting 3rd party cookies in XHR of fetch requests to protect user privacy. \ No newline at end of file +When accessing this route using Javascript from the browser, success and failure parameter URLs are required. Appwrite server will respond with a 301 redirect status code and will set the user session cookie. This behavior is enforced because modern browsers are limiting 3rd party cookies in XHR of fetch requests to protect user privacy. \ No newline at end of file diff --git a/docs/references/auth/oauth.md b/docs/references/auth/oauth.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/references/auth/register.md b/docs/references/auth/register.md index a5195eef10..4c6768f1a4 100644 --- a/docs/references/auth/register.md +++ b/docs/references/auth/register.md @@ -4,4 +4,4 @@ If registration completes successfully user will be sent with a confirmation ema Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface. -When accessing this route using JavaScript from the browser, success and failure parameter URLs are required. Appwrite server will respond with a 301 redirect status code and will set the user session cookie. This behavior is enforced because modern browsers are limiting 3rd party cookies in XHR of fetch requests to protect user privacy. \ No newline at end of file +When accessing this route using Javascript from the browser, success and failure parameter URLs are required. Appwrite server will respond with a 301 redirect status code and will set the user session cookie. This behavior is enforced because modern browsers are limiting 3rd party cookies in XHR of fetch requests to protect user privacy. \ No newline at end of file diff --git a/docs/references/avatars/get-browser.md b/docs/references/avatars/get-browser.md new file mode 100644 index 0000000000..8b1032d59a --- /dev/null +++ b/docs/references/avatars/get-browser.md @@ -0,0 +1 @@ +You can use this endpoint to show different browser icons to your users, The code argument receives the browser code as appear in your user /account/sessions endpoint. Use width, height and quality arguments to change the output settings. \ No newline at end of file diff --git a/docs/references/avatars/get-credit-card.md b/docs/references/avatars/get-credit-card.md new file mode 100644 index 0000000000..c94b1cabbe --- /dev/null +++ b/docs/references/avatars/get-credit-card.md @@ -0,0 +1 @@ +Need to display your users with your billing method or there payment methods? The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings. \ No newline at end of file diff --git a/docs/references/avatars/get-favicon.md b/docs/references/avatars/get-favicon.md new file mode 100644 index 0000000000..889b046e2e --- /dev/null +++ b/docs/references/avatars/get-favicon.md @@ -0,0 +1 @@ +Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL. \ No newline at end of file diff --git a/docs/references/avatars/get-flag.md b/docs/references/avatars/get-flag.md new file mode 100644 index 0000000000..81cdb1bbac --- /dev/null +++ b/docs/references/avatars/get-flag.md @@ -0,0 +1 @@ +You can use this endpoint to show different country flags icons to your users, The code argument receives the a 2 letter country code. Use width, height and quality arguments to change the output settings. \ No newline at end of file diff --git a/docs/references/avatars/get-image.md b/docs/references/avatars/get-image.md new file mode 100644 index 0000000000..981d10675c --- /dev/null +++ b/docs/references/avatars/get-image.md @@ -0,0 +1 @@ +Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in cases, you want to make sure a 3rd party image is properly served using a TLS protocol. \ No newline at end of file diff --git a/docs/references/avatars/get-qr.md b/docs/references/avatars/get-qr.md new file mode 100644 index 0000000000..54c6c3588a --- /dev/null +++ b/docs/references/avatars/get-qr.md @@ -0,0 +1 @@ +Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. \ No newline at end of file diff --git a/docs/references/database/create-collection.md b/docs/references/database/create-collection.md new file mode 100644 index 0000000000..5896acd681 --- /dev/null +++ b/docs/references/database/create-collection.md @@ -0,0 +1 @@ +Create a new Collection. \ No newline at end of file diff --git a/docs/references/database/create-document.md b/docs/references/database/create-document.md new file mode 100644 index 0000000000..d2ab330bc5 --- /dev/null +++ b/docs/references/database/create-document.md @@ -0,0 +1 @@ +Create a new Document. \ No newline at end of file diff --git a/docs/references/database/delete-collection.md b/docs/references/database/delete-collection.md new file mode 100644 index 0000000000..90f7aa6aa5 --- /dev/null +++ b/docs/references/database/delete-collection.md @@ -0,0 +1 @@ +Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. \ No newline at end of file diff --git a/docs/references/database/delete-document.md b/docs/references/database/delete-document.md new file mode 100644 index 0000000000..2545821205 --- /dev/null +++ b/docs/references/database/delete-document.md @@ -0,0 +1 @@ +Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted. \ No newline at end of file diff --git a/docs/references/database/get-collection.md b/docs/references/database/get-collection.md new file mode 100644 index 0000000000..db0823beb9 --- /dev/null +++ b/docs/references/database/get-collection.md @@ -0,0 +1 @@ +Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. \ No newline at end of file diff --git a/docs/references/database/get-document.md b/docs/references/database/get-document.md new file mode 100644 index 0000000000..1aa54e6d28 --- /dev/null +++ b/docs/references/database/get-document.md @@ -0,0 +1 @@ +Get document by its unique ID. This endpoint response returns a JSON object with the document data. \ No newline at end of file diff --git a/docs/references/database/list-collections.md b/docs/references/database/list-collections.md new file mode 100644 index 0000000000..d1bf657dae --- /dev/null +++ b/docs/references/database/list-collections.md @@ -0,0 +1 @@ +Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](/docs/modes). \ No newline at end of file diff --git a/docs/references/database/list-documents.md b/docs/references/database/list-documents.md new file mode 100644 index 0000000000..c6e210e8c8 --- /dev/null +++ b/docs/references/database/list-documents.md @@ -0,0 +1 @@ +Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](/docs/modes). \ No newline at end of file diff --git a/docs/references/database/update-collection.md b/docs/references/database/update-collection.md new file mode 100644 index 0000000000..d9ee36a305 --- /dev/null +++ b/docs/references/database/update-collection.md @@ -0,0 +1 @@ +Update collection by its unique ID. \ No newline at end of file diff --git a/docs/references/database/update-document.md b/docs/references/database/update-document.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/references/locale/get-countries-eu.md b/docs/references/locale/get-countries-eu.md new file mode 100644 index 0000000000..b42d5bbc32 --- /dev/null +++ b/docs/references/locale/get-countries-eu.md @@ -0,0 +1 @@ +List of all countries that are currently members of the EU. You can use the locale header to get the data in supported language. UK brexit date is currently set to 2019-10-31 and will be updated if and when needed. \ No newline at end of file diff --git a/docs/references/locale/get-countries-phones.md b/docs/references/locale/get-countries-phones.md new file mode 100644 index 0000000000..6aeecfcaa0 --- /dev/null +++ b/docs/references/locale/get-countries-phones.md @@ -0,0 +1 @@ +List of all countries phone codes. You can use the locale header to get the data in supported language. \ No newline at end of file diff --git a/docs/references/locale/get-countries.md b/docs/references/locale/get-countries.md new file mode 100644 index 0000000000..c708dce6dc --- /dev/null +++ b/docs/references/locale/get-countries.md @@ -0,0 +1 @@ +List of all countries. You can use the locale header to get the data in supported language. \ No newline at end of file diff --git a/docs/references/locale/get-currencies.md b/docs/references/locale/get-currencies.md new file mode 100644 index 0000000000..4214d9c555 --- /dev/null +++ b/docs/references/locale/get-currencies.md @@ -0,0 +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 supported language. \ No newline at end of file diff --git a/docs/references/locale/get-locale.md b/docs/references/locale/get-locale.md new file mode 100644 index 0000000000..d7a1e22849 --- /dev/null +++ b/docs/references/locale/get-locale.md @@ -0,0 +1 @@ +Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in supported language. \ No newline at end of file diff --git a/docs/references/storage/create-file.md b/docs/references/storage/create-file.md new file mode 100644 index 0000000000..7fd6c5a492 --- /dev/null +++ b/docs/references/storage/create-file.md @@ -0,0 +1 @@ +Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments. \ No newline at end of file diff --git a/docs/references/storage/delete-file.md b/docs/references/storage/delete-file.md new file mode 100644 index 0000000000..1464665812 --- /dev/null +++ b/docs/references/storage/delete-file.md @@ -0,0 +1 @@ +Delete a file by its unique ID. Only users with write permissions have access to delete this resource. \ No newline at end of file diff --git a/docs/references/storage/get-file-download.md b/docs/references/storage/get-file-download.md new file mode 100644 index 0000000000..11cb96a9f5 --- /dev/null +++ b/docs/references/storage/get-file-download.md @@ -0,0 +1 @@ +Get file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. \ No newline at end of file diff --git a/docs/references/storage/get-file-preview.md b/docs/references/storage/get-file-preview.md new file mode 100644 index 0000000000..fd818d92cf --- /dev/null +++ b/docs/references/storage/get-file-preview.md @@ -0,0 +1 @@ +Get file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets will return file icon image. You can also pass query string arguments for cutting and resizing your preview image. \ No newline at end of file diff --git a/docs/references/storage/get-file-view.md b/docs/references/storage/get-file-view.md new file mode 100644 index 0000000000..4bb5abb3c7 --- /dev/null +++ b/docs/references/storage/get-file-view.md @@ -0,0 +1 @@ +Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. \ No newline at end of file diff --git a/docs/references/storage/get-file.md b/docs/references/storage/get-file.md new file mode 100644 index 0000000000..56db5c8457 --- /dev/null +++ b/docs/references/storage/get-file.md @@ -0,0 +1 @@ +Get file by its unique ID. This endpoint response returns a JSON object with the file metadata. \ No newline at end of file diff --git a/docs/references/storage/list-files.md b/docs/references/storage/list-files.md new file mode 100644 index 0000000000..a53d6baf79 --- /dev/null +++ b/docs/references/storage/list-files.md @@ -0,0 +1 @@ +Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](/docs/modes). \ No newline at end of file diff --git a/docs/references/storage/update-file.md b/docs/references/storage/update-file.md new file mode 100644 index 0000000000..abc44a782c --- /dev/null +++ b/docs/references/storage/update-file.md @@ -0,0 +1 @@ +Update file by its unique ID. Only users with write permissions have access to update this resource. \ No newline at end of file diff --git a/docs/references/teams/create-team-membership-resend.md b/docs/references/teams/create-team-membership-resend.md new file mode 100644 index 0000000000..8ba2a913d3 --- /dev/null +++ b/docs/references/teams/create-team-membership-resend.md @@ -0,0 +1 @@ +Use this endpoint to resend your invitation email for a user to join a team. \ No newline at end of file diff --git a/docs/references/teams/create-team-membership.md b/docs/references/teams/create-team-membership.md new file mode 100644 index 0000000000..2edba8cd68 --- /dev/null +++ b/docs/references/teams/create-team-membership.md @@ -0,0 +1,5 @@ +Use this endpoint to invite a new member to your team. An email with a link to join the team will be sent to the new member email address. If member doesn't exists in the project it will be automatically created. + +Use the redirect parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the /teams/{teamId}/memberships/{inviteId}/status endpoint to finally join the user to the team. + +Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface. \ No newline at end of file diff --git a/docs/references/teams/create-team.md b/docs/references/teams/create-team.md new file mode 100644 index 0000000000..91bd09e8f9 --- /dev/null +++ b/docs/references/teams/create-team.md @@ -0,0 +1 @@ +Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project. \ No newline at end of file diff --git a/docs/references/teams/delete-team-membership.md b/docs/references/teams/delete-team-membership.md new file mode 100644 index 0000000000..e8c97e63ee --- /dev/null +++ b/docs/references/teams/delete-team-membership.md @@ -0,0 +1 @@ +This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. \ No newline at end of file diff --git a/docs/references/teams/delete-team.md b/docs/references/teams/delete-team.md new file mode 100644 index 0000000000..a9e48c5a43 --- /dev/null +++ b/docs/references/teams/delete-team.md @@ -0,0 +1 @@ +Delete team by its unique ID. Only team owners have write access for this resource. \ No newline at end of file diff --git a/docs/references/teams/get-team-members.md b/docs/references/teams/get-team-members.md new file mode 100644 index 0000000000..b5a33667d9 --- /dev/null +++ b/docs/references/teams/get-team-members.md @@ -0,0 +1 @@ +Get team members by the team unique ID. All team members have read access for this list of resources. \ No newline at end of file diff --git a/docs/references/teams/get-team.md b/docs/references/teams/get-team.md new file mode 100644 index 0000000000..eda8865e78 --- /dev/null +++ b/docs/references/teams/get-team.md @@ -0,0 +1 @@ +Get team by its unique ID. All team members have read access for this resource. \ No newline at end of file diff --git a/docs/references/teams/list-teams.md b/docs/references/teams/list-teams.md new file mode 100644 index 0000000000..ff8b90dd99 --- /dev/null +++ b/docs/references/teams/list-teams.md @@ -0,0 +1 @@ +Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](/docs/modes). \ No newline at end of file diff --git a/docs/references/teams/update-team-membership-status.md b/docs/references/teams/update-team-membership-status.md new file mode 100644 index 0000000000..11eaf8ef88 --- /dev/null +++ b/docs/references/teams/update-team-membership-status.md @@ -0,0 +1,5 @@ +Use this endpoint to let user accept an invitation to join a team after he is being redirect back to your app from the invitation email. Use the success and failure URL's to redirect users back to your application after the request completes. + +Please notice that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface. + +When not using the success or failure redirect arguments this endpoint will result with a 200 status code on success and with 401 status error on failure. This behavior was applied to help the web clients deal with browsers who don't allow to set 3rd party HTTP cookies needed for saving the account session token. \ No newline at end of file diff --git a/docs/references/teams/update-team.md b/docs/references/teams/update-team.md new file mode 100644 index 0000000000..219989f0cd --- /dev/null +++ b/docs/references/teams/update-team.md @@ -0,0 +1 @@ +Update team by its unique ID. Only team owners have write access for this resource. \ No newline at end of file diff --git a/docs/references/users/create-user.md b/docs/references/users/create-user.md new file mode 100644 index 0000000000..d7267ae8bf --- /dev/null +++ b/docs/references/users/create-user.md @@ -0,0 +1 @@ +Create a new user. \ No newline at end of file diff --git a/docs/references/users/delete-user-sessions.md b/docs/references/users/delete-user-sessions.md new file mode 100644 index 0000000000..7c78dcd637 --- /dev/null +++ b/docs/references/users/delete-user-sessions.md @@ -0,0 +1 @@ +Delete all user sessions by its unique ID. \ No newline at end of file diff --git a/docs/references/users/delete-users-session.md b/docs/references/users/delete-users-session.md new file mode 100644 index 0000000000..7ce030a4a3 --- /dev/null +++ b/docs/references/users/delete-users-session.md @@ -0,0 +1 @@ +Delete user sessions by its unique ID. \ No newline at end of file diff --git a/docs/references/users/get-user-logs.md b/docs/references/users/get-user-logs.md new file mode 100644 index 0000000000..e188651e80 --- /dev/null +++ b/docs/references/users/get-user-logs.md @@ -0,0 +1 @@ +Get user activity logs list by its unique ID. \ No newline at end of file diff --git a/docs/references/users/get-user-prefs.md b/docs/references/users/get-user-prefs.md new file mode 100644 index 0000000000..0a704cfa34 --- /dev/null +++ b/docs/references/users/get-user-prefs.md @@ -0,0 +1 @@ +Get user preferences by its unique ID. \ No newline at end of file diff --git a/docs/references/users/get-user-sessions.md b/docs/references/users/get-user-sessions.md new file mode 100644 index 0000000000..acb9005302 --- /dev/null +++ b/docs/references/users/get-user-sessions.md @@ -0,0 +1 @@ +Get user sessions list by its unique ID. \ No newline at end of file diff --git a/docs/references/users/get-user.md b/docs/references/users/get-user.md new file mode 100644 index 0000000000..60cdf21cac --- /dev/null +++ b/docs/references/users/get-user.md @@ -0,0 +1 @@ +Get user by its unique ID. \ No newline at end of file diff --git a/docs/references/users/list-users.md b/docs/references/users/list-users.md new file mode 100644 index 0000000000..fa7855bc22 --- /dev/null +++ b/docs/references/users/list-users.md @@ -0,0 +1 @@ +Get a list of all the project users. You can use the query params to filter your results. \ No newline at end of file diff --git a/docs/references/users/update-user-status.md b/docs/references/users/update-user-status.md new file mode 100644 index 0000000000..fc334c322b --- /dev/null +++ b/docs/references/users/update-user-status.md @@ -0,0 +1 @@ +Update user status by its unique ID. \ No newline at end of file