1
0
Fork 0
mirror of synced 2024-06-26 10:10:57 +12:00

Merge branch 'master' into feat-improve-error-logging

This commit is contained in:
Matej Baco 2021-12-20 16:24:50 +01:00
commit 0cb2b736f0
32 changed files with 737 additions and 193 deletions

View file

@ -4,7 +4,7 @@ We would ❤️ for you to contribute to Appwrite and help make it better! We wa
## How to Start?
If you are worried or dont know where to start, check out our next section explaining what kind of help we could use and where can you get involved. You can reach out with questions to [Eldad Fux (@eldadfux)](https://twitter.com/eldadfux) or [@appwrite_io](https://twitter.com/appwrite_io) on Twitter, and anyone from the [Appwrite team on Discord](https://discord.gg/GSeTUeA). You can also submit an issue, and a maintainer can guide you!
If you are worried or dont know where to start, check out our next section explaining what kind of help we could use and where can you get involved. You can reach out with questions to [Eldad Fux (@eldadfux)](https://twitter.com/eldadfux) or [@appwrite](https://twitter.com/appwrite) on Twitter, and anyone from the [Appwrite team on Discord](https://discord.gg/GSeTUeA). You can also submit an issue, and a maintainer can guide you!
## Code of Conduct
@ -395,7 +395,7 @@ Pull requests are great, but there are many other areas where you can help Appwr
### Blogging & Speaking
Blogging, speaking about, or creating tutorials about one of Appwrites many features. Mention [@appwrite_io](https://twitter.com/appwrite_io) on Twitter and/or [email team@appwrite.io](mailto:team@appwrite.io) so we can give pointers and tips and help you spread the word by promoting your content on the different Appwrite communication channels. Please add your blog posts and videos of talks to our [Awesome Appwrite](https://github.com/appwrite/awesome-appwrite) repo on GitHub.
Blogging, speaking about, or creating tutorials about one of Appwrites many features. Mention [@appwrite](https://twitter.com/appwrite) on Twitter and/or [email team@appwrite.io](mailto:team@appwrite.io) so we can give pointers and tips and help you spread the word by promoting your content on the different Appwrite communication channels. Please add your blog posts and videos of talks to our [Awesome Appwrite](https://github.com/appwrite/awesome-appwrite) repo on GitHub.
### Presenting at Meetups

View file

@ -8,13 +8,13 @@
<br />
</p>
[![Hacktoberfest](https://img.shields.io/static/v1?label=hacktoberfest&message=friendly&color=90a88b&style=flat-square)](https://hacktoberfest.appwrite.io)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
<!-- [![Hacktoberfest](https://img.shields.io/static/v1?label=hacktoberfest&message=friendly&color=90a88b&style=flat-square)](https://hacktoberfest.appwrite.io) -->
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord?r=Github)
[![Docker Pulls](https://img.shields.io/docker/pulls/appwrite/appwrite?color=f02e65&style=flat-square)](https://hub.docker.com/r/appwrite/appwrite)
[![Build Status](https://img.shields.io/travis/com/appwrite/appwrite?style=flat-square)](https://travis-ci.com/appwrite/appwrite)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite_io?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite_io)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Translate](https://img.shields.io/badge/translate-f02e65?style=flat-square)](docs/tutorials/add-translations.md)
<!-- [![Swag Store](https://img.shields.io/badge/swag%20store-f02e65?style=flat-square)](https://store.appwrite.io) -->
[![Swag Store](https://img.shields.io/badge/swag%20store-f02e65?style=flat-square)](https://store.appwrite.io)
[**Appwrite 0.11 has been released! Learn what's new!**](https://dev.to/appwrite/building-apps-just-got-swifter-announcing-appwrite-v011-4g62)
@ -155,7 +155,7 @@ For security issues, kindly email us at [security@appwrite.io](mailto:security@a
## Follow Us
Join our growing community around the world! See our official [Blog](https://medium.com/appwrite-io). Follow us on [Twitter](https://twitter.com/appwrite_io), [Facebook Page](https://www.facebook.com/appwrite.io), [Facebook Group](https://www.facebook.com/groups/appwrite.developers/) , [Dev Community](https://dev.to/appwrite) or join our live [Discord server](https://discord.gg/GSeTUeA) for more help, ideas, and discussions.
Join our growing community around the world! See our official [Blog](https://medium.com/appwrite-io). Follow us on [Twitter](https://twitter.com/appwrite), [Facebook Page](https://www.facebook.com/appwrite.io), [Facebook Group](https://www.facebook.com/groups/appwrite.developers/) , [Dev Community](https://dev.to/appwrite) or join our live [Discord server](https://discord.gg/GSeTUeA) for more help, ideas, and discussions.
## License

View file

@ -61,6 +61,7 @@ return [
'si', // Sinhala
'sk', // Slovakia
'sl', // Slovenian
'sn', // Shona
'sq', // Albanian
'sv', // Swedish
'ta', // Tamil

View file

@ -0,0 +1,232 @@
{
"settings.inspire": "\"Unyanzvi hwekuchenjera kuziva zvekufuratira.\"",
"settings.locale": "sn",
"settings.direction": "ltr",
"emails.sender": "Chikwata che%s",
"emails.verification.subject": "Kuratidzi kuti ndiwe muridzi weakaundi",
"emails.verification.hello": "Hesi {{name}}",
"emails.verification.body": "Tevedza chinongedzo ichi kuti uratidze kuti kero iyi ndeyako.",
"emails.verification.footer": "Kana usina kukumbira kuti uratidze kuti kero iyi ndeyako, unogona kufuratira meseji iyi.",
"emails.verification.thanks": "Ndatenda",
"emails.verification.signature": "Chikwata che{{project}}",
"emails.magicSession.subject": "Pinda",
"emails.magicSession.hello": "Hesi,",
"emails.magicSession.body": "Baya chinongedzo ichi kuti upinde muakaundi yako.",
"emails.magicSession.footer": "Kana usina kukumbira kupinda muakaundi yako uchishandisa email iyi, unogona kufuratira meseji iyi.",
"emails.magicSession.thanks": "Ndatenda",
"emails.magicSession.signature": "Chikwata che{{project}}",
"emails.recovery.subject": "Kuchinja pasiwedhi",
"emails.recovery.hello": "Mhoro {{name}}",
"emails.recovery.body": "Baya chinongedzo ichi kuti uchinje pasiwedhi yako ye{{project}}.",
"emails.recovery.footer": "Kana usina kukumbira kuchinja pasiwedhi yako, unogona kufuratira meseji iyi.",
"emails.recovery.thanks": "Ndatenda",
"emails.recovery.signature": "Chikwata che{{project}}",
"emails.invitation.subject": "Kukokwa kuchikwata che%s ku%s",
"emails.invitation.hello": "Mhoro",
"emails.invitation.body": "Tsamba iyi yatumirwa kwauri nekuti {{owner}} anga achida kuti uve nhengo yechikwata che{{team}} pachirongwa che{{project}}.",
"emails.invitation.footer": "Kana usiri kufarira kuve nhengo yechikwata ichi, unogona kufuratira meseji iyi.",
"emails.invitation.thanks": "Ndatenda",
"emails.invitation.signature": "Chikwata che{{project}}",
"locale.country.unknown": "Haizivikanwe",
"countries.af": "Afuganisitani",
"countries.ao": "Angola",
"countries.al": "Albania",
"countries.ad": "Andorra",
"countries.ae": "Mubatanidzwa wenyika dzeArab Emirates",
"countries.ar": "Argentina",
"countries.am": "Armenia",
"countries.ag": "Antigua and Barbuda",
"countries.au": "Australia",
"countries.at": "Austria",
"countries.az": "Azerbaijan",
"countries.bi": "Burundi",
"countries.be": "Belgium",
"countries.bj": "Benin",
"countries.bf": "Burkina Faso",
"countries.bd": "Bangladesh",
"countries.bg": "Bulgaria",
"countries.bh": "Bahrain",
"countries.bs": "Bahamas",
"countries.ba": "Bosnia and Herzegovina",
"countries.by": "Belarus",
"countries.bz": "Belize",
"countries.bo": "Bolivia",
"countries.br": "Brazil",
"countries.bb": "Barbados",
"countries.bn": "Brunei",
"countries.bt": "Bhutan",
"countries.bw": "Botswana",
"countries.cf": "Central African Republic",
"countries.ca": "Canada",
"countries.ch": "Switzerland",
"countries.cl": "Chile",
"countries.cn": "China",
"countries.ci": "Ivory Coast",
"countries.cm": "Cameroon",
"countries.cd": "DR Congo",
"countries.cg": "Republic of the Congo",
"countries.co": "Colombia",
"countries.km": "Comoros",
"countries.cv": "Cape Verde",
"countries.cr": "Costa Rica",
"countries.cu": "Cuba",
"countries.cy": "Cyprus",
"countries.cz": "Czechia",
"countries.de": "Germany",
"countries.dj": "Djibouti",
"countries.dm": "Dominica",
"countries.dk": "Denmark",
"countries.do": "Dominican Republic",
"countries.dz": "Algeria",
"countries.ec": "Ecuador",
"countries.eg": "Egypt",
"countries.er": "Eritrea",
"countries.es": "Spain",
"countries.ee": "Estonia",
"countries.et": "Ethiopia",
"countries.fi": "Finland",
"countries.fj": "Fiji",
"countries.fr": "France",
"countries.fm": "Micronesia",
"countries.ga": "Gabon",
"countries.gb": "United Kingdom",
"countries.ge": "Georgia",
"countries.gh": "Ghana",
"countries.gn": "Guinea",
"countries.gm": "Gambia",
"countries.gw": "Guinea-Bissau",
"countries.gq": "Equatorial Guinea",
"countries.gr": "Girisi",
"countries.gd": "Grenada",
"countries.gt": "Guatemala",
"countries.gy": "Guyana",
"countries.hn": "Honduras",
"countries.hr": "Croatia",
"countries.ht": "Haiti",
"countries.hu": "Hungary",
"countries.id": "Indonesia",
"countries.in": "India",
"countries.ie": "Ireland",
"countries.ir": "Iran",
"countries.iq": "Iraki",
"countries.is": "Aisirendi",
"countries.il": "Izirayeri",
"countries.it": "Itari",
"countries.jm": "Jamaika",
"countries.jo": "Jodhani",
"countries.jp": "Japani",
"countries.kz": "Khazakisitani",
"countries.ke": "Kenya",
"countries.kg": "Kyrgyzstan",
"countries.kh": "Kambodhiya",
"countries.ki": "Kiribati",
"countries.kn": "Saint Kitts and Nevis",
"countries.kr": "Koria yekuChamhembe",
"countries.kw": "Kuweiti",
"countries.la": "Laos",
"countries.lb": "Lebanon",
"countries.lr": "Liberia",
"countries.ly": "Libya",
"countries.lc": "Saint Lucia",
"countries.li": "Liechtenstein",
"countries.lk": "Sri Lanka",
"countries.ls": "Lesotho",
"countries.lt": "Lithuania",
"countries.lu": "Luxembourg",
"countries.lv": "Latvia",
"countries.ma": "Morocco",
"countries.mc": "Monaco",
"countries.md": "Moldova",
"countries.mg": "Madagascar",
"countries.mv": "Maldives",
"countries.mx": "Mexico",
"countries.mh": "Marshall Islands",
"countries.mk": "Macedonia",
"countries.ml": "Mali",
"countries.mt": "Malta",
"countries.mm": "Myanmar",
"countries.me": "Montenegro",
"countries.mn": "Mongolia",
"countries.mz": "Mozambiki",
"countries.mr": "Moritaniya",
"countries.mu": "Morishiyasi",
"countries.mw": "Malawi",
"countries.my": "Malaysia",
"countries.na": "Namibia",
"countries.ne": "Naija",
"countries.ng": "Naijeriya",
"countries.ni": "Nicaragua",
"countries.nl": "Netherlands",
"countries.no": "Noweyi",
"countries.np": "Nepal",
"countries.nr": "Nauru",
"countries.nz": "New Zealand",
"countries.om": "Oman",
"countries.pk": "Pakisitani",
"countries.pa": "Panama",
"countries.pe": "Peru",
"countries.ph": "Philippines",
"countries.pw": "Palau",
"countries.pg": "Papua New Guinea",
"countries.pl": "Poland",
"countries.kp": "North Korea",
"countries.pt": "Portugal",
"countries.py": "Paraguay",
"countries.qa": "Qatar",
"countries.ro": "Romania",
"countries.ru": "Russia",
"countries.rw": "Rwanda",
"countries.sa": "Saudi Arabia",
"countries.sd": "Sudan",
"countries.sn": "Senegal",
"countries.sg": "Singapore",
"countries.sb": "Solomon Islands",
"countries.sl": "Sierra Leone",
"countries.sv": "El Salvador",
"countries.sm": "San Marino",
"countries.so": "Somalia",
"countries.rs": "Serbia",
"countries.ss": "South Sudan",
"countries.st": "São Tomé and Príncipe",
"countries.sr": "Suriname",
"countries.sk": "Slovakia",
"countries.si": "Slovenia",
"countries.se": "Sweden",
"countries.sz": "Swaziland",
"countries.sc": "Seychelles",
"countries.sy": "Syria",
"countries.td": "Chad",
"countries.tg": "Togo",
"countries.th": "Thailand",
"countries.tj": "Tajikistan",
"countries.tm": "Turkmenistan",
"countries.tl": "Timor-Leste",
"countries.to": "Tonga",
"countries.tt": "Trinidad and Tobago",
"countries.tn": "Tunisia",
"countries.tr": "Turkey",
"countries.tv": "Tuvalu",
"countries.tz": "Tanzania",
"countries.ug": "Uganda",
"countries.ua": "Ukraine",
"countries.uy": "Uruguay",
"countries.us": "United States",
"countries.uz": "Uzbekistan",
"countries.va": "Vatican City",
"countries.vc": "Saint Vincent and the Grenadines",
"countries.ve": "Venezuela",
"countries.vn": "Vietnam",
"countries.vu": "Vanuatu",
"countries.ws": "Samoa",
"countries.ye": "Yemen",
"countries.za": "South Africa",
"countries.zm": "Zambia",
"countries.zw": "Zimbabwe",
"continents.af": "Africa",
"continents.an": "Antarctica",
"continents.as": "Asia",
"continents.eu": "Europe",
"continents.na": "North America",
"continents.oc": "Oceania",
"continents.sa": "South America"
}

View file

@ -63,7 +63,7 @@ return [
[
'key' => 'flutter',
'name' => 'Flutter',
'version' => '2.0.3',
'version' => '2.1.0',
'url' => 'https://github.com/appwrite/sdk-for-flutter',
'package' => 'https://pub.dev/packages/appwrite',
'enabled' => true,
@ -334,7 +334,7 @@ return [
[
'key' => 'dart',
'name' => 'Dart',
'version' => '1.0.2',
'version' => '2.0.0',
'url' => 'https://github.com/appwrite/sdk-for-dart',
'package' => 'https://pub.dev/packages/dart_appwrite',
'enabled' => true,

View file

@ -231,6 +231,16 @@ return [ // Ordered by ABC.
'beta' => false,
'mock' => false,
],
'yammer' => [
'name' => 'Yammer',
'developers' => 'https://developer.yammer.com/docs/oauth-2',
'icon' => 'icon-yammer',
'enabled' => true,
'sandbox' => false,
'form' => false,
'beta' => false,
'mock' => false,
],
'yandex' => [
'name' => 'Yandex',
'developers' => 'https://tech.yandex.com/oauth/',

View file

@ -113,9 +113,9 @@ App::get('/v1/teams')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_TEAM_LIST)
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true)
->param('search', '', new Text(256), 'Search term to filter results. Max length: 256 chars.', true)
->param('limit', 25, new Range(0, 100), 'Limit how many results will be returned. Returns up to 25 results by default. Maximum of 100 results allowed per request.', true)
->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this value to manage pagination.', true)
->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true)
->inject('response')
->inject('projectDB')
@ -150,7 +150,7 @@ App::get('/v1/teams/:teamId')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_TEAM)
->param('teamId', '', new UID(), 'Team unique ID.')
->param('teamId', '', new UID(), 'Team ID.')
->inject('response')
->inject('projectDB')
->action(function ($teamId, $response, $projectDB) {
@ -178,8 +178,8 @@ App::put('/v1/teams/:teamId')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_TEAM)
->param('teamId', '', new UID(), 'Team unique ID.')
->param('name', null, new Text(128), 'Team name. Max length: 128 chars.')
->param('teamId', '', new UID(), 'Team ID.')
->param('name', null, new Text(128), 'New team name. Max length: 128 chars.')
->inject('response')
->inject('projectDB')
->action(function ($teamId, $name, $response, $projectDB) {
@ -214,7 +214,7 @@ App::delete('/v1/teams/:teamId')
->label('sdk.description', '/docs/references/teams/delete-team.md')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.model', Response::MODEL_NONE)
->param('teamId', '', new UID(), 'Team unique ID.')
->param('teamId', '', new UID(), 'Team ID.')
->inject('response')
->inject('projectDB')
->inject('events')
@ -260,11 +260,11 @@ App::post('/v1/teams/:teamId/memberships')
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_MEMBERSHIP)
->label('abuse-limit', 10)
->param('teamId', '', new UID(), 'Team unique ID.')
->param('email', '', new Email(), 'New team member email.')
->param('roles', [], new ArrayList(new Key()), 'Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Max length for each role is 32 chars.')
->param('teamId', '', new UID(), 'Team ID.')
->param('email', '', new Email(), 'Email address of the new team member.')
->param('roles', [], new ArrayList(new Key()), 'An array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Max length for each role is 32 chars.')
->param('url', '', function ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['clients']) // TODO add our own built-in confirm page
->param('name', '', new Text(128), 'New team member name. Max length: 128 chars.', true)
->param('name', '', new Text(128), 'Name of the new team member. Max length: 128 chars.', true)
->inject('response')
->inject('project')
->inject('user')
@ -472,9 +472,9 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_MEMBERSHIP)
->param('teamId', '', new UID(), 'Team unique ID.')
->param('teamId', '', new UID(), 'Team ID.')
->param('membershipId', '', new UID(), 'Membership ID.')
->param('roles', [], new ArrayList(new Key()), 'Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Max length for each role is 32 chars.')
->param('roles', [], new ArrayList(new Key()), 'An array of strings. Use this param to set the user\'s roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Max length for each role is 32 chars.')
->inject('request')
->inject('response')
->inject('user')
@ -534,11 +534,11 @@ App::get('/v1/teams/:teamId/memberships')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_MEMBERSHIP_LIST)
->param('teamId', '', new UID(), 'Team unique ID.')
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true)
->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true)
->param('teamId', '', new UID(), 'Team ID.')
->param('search', '', new Text(256), 'Search term to filter your results. Max length: 256 chars.', true)
->param('limit', 25, new Range(0, 100), 'Limit how many results will be returned. By default will return a maximum of 25 results. Maximum of 100 results allowed per request.', true)
->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this value to manage pagination.', true)
->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order results by ASC or DESC order.', true)
->inject('response')
->inject('projectDB')
->action(function ($teamId, $search, $limit, $offset, $orderType, $response, $projectDB) {
@ -588,9 +588,9 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_MEMBERSHIP)
->param('teamId', '', new UID(), 'Team unique ID.')
->param('teamId', '', new UID(), 'Team ID.')
->param('membershipId', '', new UID(), 'Membership ID.')
->param('userId', '', new UID(), 'User unique ID.')
->param('userId', '', new UID(), 'User ID.')
->param('secret', '', new Text(256), 'Secret key.')
->inject('request')
->inject('response')
@ -734,7 +734,7 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId')
->label('sdk.description', '/docs/references/teams/delete-team-membership.md')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.model', Response::MODEL_NONE)
->param('teamId', '', new UID(), 'Team unique ID.')
->param('teamId', '', new UID(), 'Team ID.')
->param('membershipId', '', new UID(), 'Membership ID.')
->inject('response')
->inject('projectDB')

View file

@ -48,15 +48,15 @@ const APP_USERAGENT = APP_NAME.'-Server v%s. Please report abuse at %s';
const APP_MODE_DEFAULT = 'default';
const APP_MODE_ADMIN = 'admin';
const APP_PAGING_LIMIT = 12;
const APP_CACHE_BUSTER = 170;
const APP_CACHE_BUSTER = 171;
const APP_VERSION_STABLE = '0.11.0';
const APP_STORAGE_UPLOADS = '/storage/uploads';
const APP_STORAGE_FUNCTIONS = '/storage/functions';
const APP_STORAGE_CACHE = '/storage/cache';
const APP_STORAGE_CERTIFICATES = '/storage/certificates';
const APP_STORAGE_CONFIG = '/storage/config';
const APP_SOCIAL_TWITTER = 'https://twitter.com/appwrite_io';
const APP_SOCIAL_TWITTER_HANDLE = 'appwrite_io';
const APP_SOCIAL_TWITTER = 'https://twitter.com/appwrite';
const APP_SOCIAL_TWITTER_HANDLE = 'appwrite';
const APP_SOCIAL_FACEBOOK = 'https://www.facebook.com/appwrite.io';
const APP_SOCIAL_LINKEDIN = 'https://www.linkedin.com/company/appwrite';
const APP_SOCIAL_INSTAGRAM = 'https://www.instagram.com/appwrite.io';
@ -65,7 +65,7 @@ const APP_SOCIAL_DISCORD = 'https://appwrite.io/discord';
const APP_SOCIAL_DISCORD_CHANNEL = '564160730845151244';
const APP_SOCIAL_DEV = 'https://dev.to/appwrite';
const APP_SOCIAL_STACKSHARE = 'https://stackshare.io/appwrite';
const APP_SOCIAL_YOUTUBE = 'https://www.youtube.com/c/appwrite';
const APP_SOCIAL_YOUTUBE = 'https://www.youtube.com/c/appwrite?sub_confirmation=1';
// Deletion Types
const DELETE_TYPE_DOCUMENT = 'document';
@ -338,6 +338,7 @@ Locale::setLanguageFromJSON('sd', __DIR__ . '/config/locale/translations/sd.json
Locale::setLanguageFromJSON('si', __DIR__ . '/config/locale/translations/si.json');
Locale::setLanguageFromJSON('sk', __DIR__ . '/config/locale/translations/sk.json');
Locale::setLanguageFromJSON('sl', __DIR__ . '/config/locale/translations/sl.json');
Locale::setLanguageFromJSON('sn', __DIR__ . '/config/locale/translations/sn.json');
Locale::setLanguageFromJSON('sq', __DIR__ . '/config/locale/translations/sq.json');
Locale::setLanguageFromJSON('sv', __DIR__ . '/config/locale/translations/sv.json');
Locale::setLanguageFromJSON('ta', __DIR__ . '/config/locale/translations/ta.json');

View file

@ -180,7 +180,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
->setShareText('Appwrite is a backend as a service for building web or mobile apps')
->setShareURL('http://appwrite.io')
->setShareTags('JS,javascript,reactjs,angular,ios,android,serverless')
->setShareVia('appwrite_io')
->setShareVia('appwrite')
->setWarning($warning)
->setReadme($readme)
->setGettingStarted($gettingStarted)

View file

@ -10,7 +10,7 @@ $litespeed = $this->getParam('litespeed', true);
$analytics = $this->getParam('analytics', 'UA-26264668-9');
$mode = $this->getParam('mode', '');
$canonical = $this->getParam('canonical', '');
$image = $this->getParam('image', '/images/logo.png');
$image = $this->getParam('image', '/images/logo.png');
$locale = $this->getParam('locale', null);
$runtimes = $this->getParam('runtimes', null);
@ -53,12 +53,17 @@ if(!empty($platforms)) {
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5" />
<meta name="theme-color" content="#f02e65">
<meta property="og:type" content="website" />
<meta property="og:site_name" content="<?php echo APP_NAME; ?>">
<meta property="og:title" content="<?php echo $this->escape($this->getParam('title', '')); ?>" />
<meta property="og:description" content="<?php echo $this->escape($this->getParam('description', '')); ?>" />
<?php if (!empty($canonical)): ?>
<meta property="og:url" content="<?php echo $this->escape($canonical); ?>" />
<?php endif; ?>
<meta property="og:image" content="<?php echo $this->escape($endpoint); ?><?php echo $this->escape($image); ?>?v=<?php echo APP_CACHE_BUSTER; ?>" />
<meta name="twitter:site" content="@<?php echo APP_SOCIAL_TWITTER_HANDLE; ?>">
<meta name="twitter:title" content="<?php echo $this->escape($this->getParam('title', '')); ?>">
<meta name="twitter:image:src" content="<?php echo $this->escape($endpoint); ?><?php echo $this->escape($image); ?>?v=<?php echo APP_CACHE_BUSTER; ?>">
<meta name="twitter:card" content="summary_large_image">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){

View file

@ -71,7 +71,7 @@
"slickdeals/statsd": "3.1.0"
},
"require-dev": {
"appwrite/sdk-generator": "0.16.2",
"appwrite/sdk-generator": "0.16.3",
"phpunit/phpunit": "9.5.6",
"swoole/ide-helper": "4.6.7",
"textalk/websocket": "1.5.2",

255
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "d16e7eb6e8b85d414f22270af7cfb314",
"content-hash": "c118448e0047bca33e037cb54fa4b3a0",
"packages": [
{
"name": "adhocore/jwt",
@ -416,16 +416,16 @@
},
{
"name": "guzzlehttp/guzzle",
"version": "7.4.0",
"version": "7.4.1",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "868b3571a039f0ebc11ac8f344f4080babe2cb94"
"reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/868b3571a039f0ebc11ac8f344f4080babe2cb94",
"reference": "868b3571a039f0ebc11ac8f344f4080babe2cb94",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee0a041b1760e6a53d2a39c8c34115adc2af2c79",
"reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79",
"shasum": ""
},
"require": {
@ -434,7 +434,7 @@
"guzzlehttp/psr7": "^1.8.3 || ^2.1",
"php": "^7.2.5 || ^8.0",
"psr/http-client": "^1.0",
"symfony/deprecation-contracts": "^2.2"
"symfony/deprecation-contracts": "^2.2 || ^3.0"
},
"provide": {
"psr/http-client-implementation": "1.0"
@ -520,7 +520,7 @@
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
"source": "https://github.com/guzzle/guzzle/tree/7.4.0"
"source": "https://github.com/guzzle/guzzle/tree/7.4.1"
},
"funding": [
{
@ -536,7 +536,7 @@
"type": "tidelift"
}
],
"time": "2021-10-18T09:52:00+00:00"
"time": "2021-12-06T18:43:05+00:00"
},
{
"name": "guzzlehttp/promises",
@ -1395,25 +1395,25 @@
},
{
"name": "symfony/deprecation-contracts",
"version": "v2.5.0",
"version": "v3.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
"reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8"
"reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8",
"reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/c726b64c1ccfe2896cb7df2e1331c357ad1c8ced",
"reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced",
"shasum": ""
},
"require": {
"php": ">=7.1"
"php": ">=8.0.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "2.5-dev"
"dev-main": "3.0-dev"
},
"thanks": {
"name": "symfony/contracts",
@ -1442,7 +1442,7 @@
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0"
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.0"
},
"funding": [
{
@ -1458,7 +1458,7 @@
"type": "tidelift"
}
],
"time": "2021-07-12T14:48:14+00:00"
"time": "2021-11-01T23:48:49+00:00"
},
{
"name": "symfony/polyfill-ctype",
@ -2060,61 +2060,6 @@
},
"time": "2021-07-24T11:35:55+00:00"
},
{
"name": "utopia-php/logger",
"version": "dev-dev",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/logger",
"reference": "e67eafc1edb8729c463275b81ff4e870eb30c314"
},
"require": {
"php": ">=8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.3",
"vimeo/psalm": "4.0.1"
},
"type": "library",
"autoload": {
"psr-4": {
"Utopia\\Logger\\": "src/Logger"
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Eldad Fux",
"email": "eldad@appwrite.io"
},
{
"name": "Matej Bačo",
"email": "matej@appwrite.io"
},
{
"name": "Christy Jacob",
"email": "christy@appwrite.io"
}
],
"description": "Utopia Logger library is simple and lite library for logging information, such as errors or warnings. This library is aiming to be as simple and easy to learn and use.",
"keywords": [
"appsignal",
"errors",
"framework",
"logger",
"logging",
"logs",
"php",
"raygun",
"sentry",
"upf",
"utopia",
"warnings"
],
"time": "2021-12-06T11:18:07+00:00"
},
{
"name": "utopia-php/orchestration",
"version": "0.2.1",
@ -2277,16 +2222,16 @@
},
{
"name": "utopia-php/storage",
"version": "0.5.0",
"version": "0.5.1",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/storage.git",
"reference": "92ae20c7a2ac329f573a58a82dc245134cc63408"
"reference": "e672aa3fc2a8ba689aff65f68ff29f1d608223b8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/storage/zipball/92ae20c7a2ac329f573a58a82dc245134cc63408",
"reference": "92ae20c7a2ac329f573a58a82dc245134cc63408",
"url": "https://api.github.com/repos/utopia-php/storage/zipball/e672aa3fc2a8ba689aff65f68ff29f1d608223b8",
"reference": "e672aa3fc2a8ba689aff65f68ff29f1d608223b8",
"shasum": ""
},
"require": {
@ -2323,9 +2268,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/storage/issues",
"source": "https://github.com/utopia-php/storage/tree/0.5.0"
"source": "https://github.com/utopia-php/storage/tree/0.5.1"
},
"time": "2021-04-15T16:43:12+00:00"
"time": "2021-12-13T15:17:14+00:00"
},
{
"name": "utopia-php/swoole",
@ -2440,16 +2385,16 @@
},
{
"name": "utopia-php/websocket",
"version": "dev-feat-onerror-callback",
"version": "0.0.1",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/websocket.git",
"reference": "237eed7e9c54a514cfabac3e5726d24661254f2e"
"reference": "808317ef4ea0683c2c82dee5d543b1c8378e2e1b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/websocket/zipball/237eed7e9c54a514cfabac3e5726d24661254f2e",
"reference": "237eed7e9c54a514cfabac3e5726d24661254f2e",
"url": "https://api.github.com/repos/utopia-php/websocket/zipball/808317ef4ea0683c2c82dee5d543b1c8378e2e1b",
"reference": "808317ef4ea0683c2c82dee5d543b1c8378e2e1b",
"shasum": ""
},
"require": {
@ -2492,9 +2437,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/websocket/issues",
"source": "https://github.com/utopia-php/websocket/tree/feat-onerror-callback"
"source": "https://github.com/utopia-php/websocket/tree/0.0.1"
},
"time": "2021-11-29T08:43:24+00:00"
"time": "2021-07-11T13:09:44+00:00"
},
{
"name": "webmozart/assert",
@ -2724,16 +2669,16 @@
},
{
"name": "appwrite/sdk-generator",
"version": "0.16.2",
"version": "0.16.3",
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator.git",
"reference": "e3a20c96a745a9c4aa048fd344650fcfbf41cf6f"
"reference": "6185cdfe4c4261287240639f3a7fdc05e7ae2337"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/e3a20c96a745a9c4aa048fd344650fcfbf41cf6f",
"reference": "e3a20c96a745a9c4aa048fd344650fcfbf41cf6f",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/6185cdfe4c4261287240639f3a7fdc05e7ae2337",
"reference": "6185cdfe4c4261287240639f3a7fdc05e7ae2337",
"shasum": ""
},
"require": {
@ -2767,9 +2712,9 @@
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
"support": {
"issues": "https://github.com/appwrite/sdk-generator/issues",
"source": "https://github.com/appwrite/sdk-generator/tree/0.16.2"
"source": "https://github.com/appwrite/sdk-generator/tree/0.16.3"
},
"time": "2021-11-12T11:09:38+00:00"
"time": "2021-12-16T23:56:47+00:00"
},
{
"name": "composer/package-versions-deprecated",
@ -2844,6 +2789,77 @@
],
"time": "2021-09-13T08:41:34+00:00"
},
{
"name": "composer/pcre",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/composer/pcre.git",
"reference": "3d322d715c43a1ac36c7fe215fa59336265500f2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/pcre/zipball/3d322d715c43a1ac36c7fe215fa59336265500f2",
"reference": "3d322d715c43a1ac36c7fe215fa59336265500f2",
"shasum": ""
},
"require": {
"php": "^5.3.2 || ^7.0 || ^8.0"
},
"require-dev": {
"phpstan/phpstan": "^1",
"phpstan/phpstan-strict-rules": "^1.1",
"symfony/phpunit-bridge": "^4.2 || ^5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"Composer\\Pcre\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
"homepage": "http://seld.be"
}
],
"description": "PCRE wrapping library that offers type-safe preg_* replacements.",
"keywords": [
"PCRE",
"preg",
"regex",
"regular expression"
],
"support": {
"issues": "https://github.com/composer/pcre/issues",
"source": "https://github.com/composer/pcre/tree/1.0.0"
},
"funding": [
{
"url": "https://packagist.com",
"type": "custom"
},
{
"url": "https://github.com/composer",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/composer/composer",
"type": "tidelift"
}
],
"time": "2021-12-06T15:17:27+00:00"
},
{
"name": "composer/semver",
"version": "3.2.6",
@ -2927,25 +2943,27 @@
},
{
"name": "composer/xdebug-handler",
"version": "2.0.2",
"version": "2.0.3",
"source": {
"type": "git",
"url": "https://github.com/composer/xdebug-handler.git",
"reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339"
"reference": "6555461e76962fd0379c444c46fd558a0fcfb65e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339",
"reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339",
"url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6555461e76962fd0379c444c46fd558a0fcfb65e",
"reference": "6555461e76962fd0379c444c46fd558a0fcfb65e",
"shasum": ""
},
"require": {
"composer/pcre": "^1",
"php": "^5.3.2 || ^7.0 || ^8.0",
"psr/log": "^1 || ^2 || ^3"
},
"require-dev": {
"phpstan/phpstan": "^0.12.55",
"symfony/phpunit-bridge": "^4.2 || ^5"
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-strict-rules": "^1.1",
"symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0"
},
"type": "library",
"autoload": {
@ -2971,7 +2989,7 @@
"support": {
"irc": "irc://irc.freenode.org/composer",
"issues": "https://github.com/composer/xdebug-handler/issues",
"source": "https://github.com/composer/xdebug-handler/tree/2.0.2"
"source": "https://github.com/composer/xdebug-handler/tree/2.0.3"
},
"funding": [
{
@ -2987,7 +3005,7 @@
"type": "tidelift"
}
],
"time": "2021-07-31T17:03:58+00:00"
"time": "2021-12-08T13:07:32+00:00"
},
{
"name": "dnoegel/php-xdg-base-dir",
@ -3818,16 +3836,16 @@
},
{
"name": "phpspec/prophecy",
"version": "1.14.0",
"version": "v1.15.0",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e"
"reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e",
"reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13",
"reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13",
"shasum": ""
},
"require": {
@ -3879,9 +3897,9 @@
],
"support": {
"issues": "https://github.com/phpspec/prophecy/issues",
"source": "https://github.com/phpspec/prophecy/tree/1.14.0"
"source": "https://github.com/phpspec/prophecy/tree/v1.15.0"
},
"time": "2021-09-10T09:02:12+00:00"
"time": "2021-12-08T12:19:24+00:00"
},
{
"name": "phpunit/php-code-coverage",
@ -5375,23 +5393,23 @@
},
{
"name": "symfony/console",
"version": "v5.4.0",
"version": "v5.4.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "ec3661faca1d110d6c307e124b44f99ac54179e3"
"reference": "9130e1a0fc93cb0faadca4ee917171bd2ca9e5f4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/ec3661faca1d110d6c307e124b44f99ac54179e3",
"reference": "ec3661faca1d110d6c307e124b44f99ac54179e3",
"url": "https://api.github.com/repos/symfony/console/zipball/9130e1a0fc93cb0faadca4ee917171bd2ca9e5f4",
"reference": "9130e1a0fc93cb0faadca4ee917171bd2ca9e5f4",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1|^3",
"symfony/polyfill-mbstring": "~1.0",
"symfony/polyfill-php73": "^1.8",
"symfony/polyfill-php73": "^1.9",
"symfony/polyfill-php80": "^1.16",
"symfony/service-contracts": "^1.1|^2|^3",
"symfony/string": "^5.1|^6.0"
@ -5454,7 +5472,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v5.4.0"
"source": "https://github.com/symfony/console/tree/v5.4.1"
},
"funding": [
{
@ -5470,7 +5488,7 @@
"type": "tidelift"
}
],
"time": "2021-11-29T15:30:56+00:00"
"time": "2021-12-09T11:22:43+00:00"
},
{
"name": "symfony/polyfill-intl-grapheme",
@ -5963,16 +5981,16 @@
},
{
"name": "symfony/string",
"version": "v6.0.0",
"version": "v6.0.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
"reference": "ba727797426af0f587f4800566300bdc0cda0777"
"reference": "0cfed595758ec6e0a25591bdc8ca733c1896af32"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/ba727797426af0f587f4800566300bdc0cda0777",
"reference": "ba727797426af0f587f4800566300bdc0cda0777",
"url": "https://api.github.com/repos/symfony/string/zipball/0cfed595758ec6e0a25591bdc8ca733c1896af32",
"reference": "0cfed595758ec6e0a25591bdc8ca733c1896af32",
"shasum": ""
},
"require": {
@ -6028,7 +6046,7 @@
"utf8"
],
"support": {
"source": "https://github.com/symfony/string/tree/v6.0.0"
"source": "https://github.com/symfony/string/tree/v6.0.1"
},
"funding": [
{
@ -6044,7 +6062,7 @@
"type": "tidelift"
}
],
"time": "2021-10-29T07:35:21+00:00"
"time": "2021-12-08T15:13:44+00:00"
},
{
"name": "textalk/websocket",
@ -6383,10 +6401,7 @@
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"utopia-php/logger": 20,
"utopia-php/websocket": 20
},
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {

View file

@ -1,5 +1,5 @@
Use this endpoint to invite a new member to join your team. If initiated from Client SDK, an email with a link to join the team will be sent to the new member's email address if the member doesn't exist in the project it will be created automatically. If initiated from server side SDKs, new member will automatically be added to the team.
Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.
Use the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow the user to accept the invitation to the team. While calling from side SDKs the redirect url can be empty string.
Use the 'url' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
Please note that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.
Please note that to avoid a [Redirect Attack](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 adding your platforms in the console interface.

View file

@ -1 +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.
Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.

View file

@ -1 +1 @@
Delete a team by its unique ID. Only team owners have write access for this resource.
Delete a team using its ID. Only team members with the owner role can delete the team.

View file

@ -1 +1 @@
Get a team members by the team unique ID. All team members have read access for this list of resources.
Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.

View file

@ -1 +1 @@
Get a team by its unique ID. All team members have read access for this resource.
Get a team by its ID. All team members have read access for this resource.

View file

@ -1 +1,3 @@
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's teams. [Learn more about different API modes](/docs/admin).
Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.
In admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](/docs/admin).

View file

@ -0,0 +1 @@
Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](/docs/permissions).

View file

@ -1 +1 @@
Update a team by its unique ID. Only team owners have write access for this resource.
Update a team using its ID. Only members with the owner role can update the team.

View file

@ -1,3 +1,6 @@
## 2.0.0
- BREAKING All services and methods now return structured response objects instead of `Response` object
## 1.0.2
- Support for Appwrite 0.11

View file

@ -1,3 +1,7 @@
## 2.1.0
- Updated `flutter_we_auth` plugin now supports Flutter web for OAuth2 sessions [read more](https://github.com/appwrite/sdk-for-flutter/blob/master/README.md#web)
- Added linters and updated codebase to match the rules
## 2.0.3
- Support for Appwrite 0.11
- Fix comments on `sum` attributes

View file

@ -46,6 +46,23 @@ For **Mac OS** add your app name and Bundle ID, You can find your Bundle Identif
### Web
Appwrite 0.7, and the Appwrite Flutter SDK 0.3.0 have added support for Flutter Web. To build web apps that integrate with Appwrite successfully, all you have to do is add a web platform on your Appwrite project's dashboard and list the domain your website will use to allow communication to the Appwrite API.
For web in order to capture the OAuth2 callback URL and send it to the application using JavaScript `postMessage()`, you need to create an html file inside `./web` folder of your Flutter project. For example `auth.html` with the following content.
```html
<!DOCTYPE html>
<title>Authentication complete</title>
<p>Authentication is complete. If this does not happen automatically, please
close the window.
<script>
window.opener.postMessage({
flutter-web-auth: window.location.href
}, window.location.origin);
window.close();
</script>
```
Redirection URL passed to the authentication service must be the same as the URL on which the application is running (schema, host, port if necessary) and the path must point to created HTML file, /auth.html in this case. The callbackUrlScheme parameter of the authenticate() method does not take into account, so it is possible to use a schema for native platforms in the code.
#### Flutter Web Cross-Domain Communication & Cookies
While running Flutter Web, make sure your Appwrite server and your Flutter client are using the same top-level domain and the same protocol (HTTP or HTTPS) to communicate. When trying to communicate between different domains or protocols, you may receive HTTP status error 401 because some modern browsers block cross-site or insecure cookies for enhanced privacy. In production, Appwrite allows you set multiple [custom-domains](https://appwrite.io/docs/custom-domains) for each project.

14
package-lock.json generated
View file

@ -9,7 +9,7 @@
"version": "0.1.0",
"license": "BSD-3-Clause",
"dependencies": {
"chart.js": "^3.5.1",
"chart.js": "^3.6.0",
"markdown-it": "^12.2.0",
"pell": "^1.0.6",
"prismjs": "^1.25.0",
@ -549,9 +549,9 @@
}
},
"node_modules/chart.js": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.5.1.tgz",
"integrity": "sha512-m5kzt72I1WQ9LILwQC4syla/LD/N413RYv2Dx2nnTkRS9iv/ey1xLTt0DnPc/eWV4zI+BgEgDYBIzbQhZHc/PQ=="
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.6.0.tgz",
"integrity": "sha512-iOzzDKePL+bj+ccIsVAgWQehCXv8xOKGbaU2fO/myivH736zcx535PGJzQGanvcSGVOqX6yuLZsN3ygcQ35UgQ=="
},
"node_modules/chokidar": {
"version": "2.1.8",
@ -5484,9 +5484,9 @@
"dev": true
},
"chart.js": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.5.1.tgz",
"integrity": "sha512-m5kzt72I1WQ9LILwQC4syla/LD/N413RYv2Dx2nnTkRS9iv/ey1xLTt0DnPc/eWV4zI+BgEgDYBIzbQhZHc/PQ=="
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.6.0.tgz",
"integrity": "sha512-iOzzDKePL+bj+ccIsVAgWQehCXv8xOKGbaU2fO/myivH736zcx535PGJzQGanvcSGVOqX6yuLZsN3ygcQ35UgQ=="
},
"chokidar": {
"version": "2.1.8",

View file

@ -17,7 +17,7 @@
"gulp-less": "^5.0.0"
},
"dependencies": {
"chart.js": "^3.5.1",
"chart.js": "^3.6.0",
"markdown-it": "^12.2.0",
"pell": "^1.0.6",
"prismjs": "^1.25.0",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 495 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View file

@ -612,20 +612,6 @@
"code": 61751,
"src": "fontawesome"
},
{
"uid": "00d86f3e46c3c3d768e7246eb0eadd7f",
"css": "discord",
"code": 59463,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M435 432.9C411.3 432.9 392.5 453.8 392.5 479.2S411.7 525.4 435 525.4C458.8 525.4 477.5 504.6 477.5 479.2 477.9 453.8 458.8 432.9 435 432.9ZM587.1 432.9C563.3 432.9 544.6 453.8 544.6 479.2S563.8 525.4 587.1 525.4C610.8 525.4 629.6 504.6 629.6 479.2S610.8 432.9 587.1 432.9ZM789.6 83.3H231.3C184.2 83.3 145.8 121.7 145.8 169.2V732.5C145.8 780 184.2 818.3 231.3 818.3H703.8L681.7 741.3 735 790.8 785.4 837.5 875 916.7V169.2C875 121.7 836.7 83.3 789.6 83.3ZM628.8 627.5S613.8 609.6 601.3 593.8C655.8 578.3 676.7 544.2 676.7 544.2 659.6 555.4 643.3 563.3 628.8 568.8 607.9 577.5 587.9 583.3 568.3 586.7 528.3 594.2 491.7 592.1 460.4 586.3 436.7 581.7 416.3 575 399.2 568.3 389.6 564.6 379.2 560 368.8 554.2 367.5 553.3 366.3 552.9 365 552.1 364.2 551.7 363.8 551.3 363.3 550.8 355.8 546.7 351.7 543.8 351.7 543.8S371.7 577.1 424.6 592.9C412.1 608.8 396.7 627.5 396.7 627.5 304.6 624.6 269.6 564.2 269.6 564.2 269.6 430 329.6 321.3 329.6 321.3 389.6 276.3 446.7 277.5 446.7 277.5L450.8 282.5C375.8 304.2 341.3 337.1 341.3 337.1S350.4 332.1 365.8 325C410.4 305.4 445.8 300 460.4 298.8 462.9 298.3 465 297.9 467.5 297.9 492.9 294.6 521.7 293.8 551.7 297.1 591.3 301.7 633.8 313.3 677.1 337.1 677.1 337.1 644.2 305.8 573.3 284.2L579.2 277.5S636.3 276.3 696.3 321.3C696.3 321.3 756.3 430 756.3 564.2 756.3 564.2 720.8 624.6 628.8 627.5Z",
"width": 1021
},
"search": [
"discord-logo-black"
]
},
{
"uid": "c2152732d525871cf35345955854f711",
"css": "moon-inv",
@ -707,6 +693,136 @@
"css": "reddit",
"code": 59473,
"src": "elusive"
},
{
"uid": "5b43525a8080befb3493998ea77195e0",
"css": "integer",
"code": 59475,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M381.7 825.7L279.7 825.7 313.1 625 202.7 625 202.7 533.6 327.9 533.6 347.8 409.3 240.4 409.3 240.4 316.8 363.3 316.8 397.6 113.3 498.5 113.3 465.2 316.8 541.3 316.8 574.6 113.3 676.5 113.3 642.2 316.8 757.6 316.8 757.6 409.3 626.3 409.3 605.9 533.6 720.3 533.6 720.3 625 591.5 625 558.2 825.7 457.3 825.7 490.6 625 415 625 381.7 825.7ZM449.8 409.3L429.4 533.6 505 533.6 525.3 409.3 449.8 409.3Z",
"width": 1000
},
"search": [
"integer"
]
},
{
"uid": "23359bf9000e958419520fc09f111a22",
"css": "float",
"code": 59476,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M381.7 825.7L279.7 825.7 313.1 625 202.7 625 202.7 533.6 327.9 533.6 347.8 409.3 240.4 409.3 240.4 316.8 363.3 316.8 397.6 113.3 498.5 113.3 465.2 316.8 541.3 316.8 574.6 113.3 676.5 113.3 642.2 316.8 757.6 316.8 757.6 409.3 626.3 409.3 605.9 533.6 720.3 533.6 720.3 625 591.5 625 558.2 825.7 457.3 825.7 490.6 625 415 625 381.7 825.7ZM449.8 409.3L429.4 533.6 505 533.6 525.3 409.3 449.8 409.3Z",
"width": 1000
},
"search": [
"float"
]
},
{
"uid": "bbbebc5835cb7e7dd8cecdc59a4dad47",
"css": "ip",
"code": 59477,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M378.7 683.7L147.5 683.7 147.5 606.5 196.1 594.4 196.1 365.8 138.3 353.7 138.3 276.2 330.4 276.2 330.4 594.4 378.7 606.5 378.7 683.7ZM330.4 198.9L192.3 198.9 192.3 96.1 330.4 96.1 330.4 198.9ZM640.9 840.3L409.3 840.3 409.3 762.8 460.6 750.7 460.6 365.8 402.4 353.7 402.4 276.2 586.5 276.2 591.1 322.1C602.3 305.1 615.9 291.9 631.7 282.6 647.5 273.3 666.9 268.6 689.9 268.6 722.5 268.6 750.6 277.5 774.1 295.2 797.6 312.9 815.6 337.7 828.3 369.6 840.9 401.4 847.2 438.5 847.2 480.7L847.2 488.6C847.2 529.3 840.9 564.8 828.3 595.4 815.6 625.9 797.4 649.5 773.7 666.3 750 683.2 721.4 691.6 688 691.6 667.6 691.6 649.6 687.8 634.2 680.3 618.7 672.7 605.4 661.7 594.2 647.1L594.2 750.7 640.9 762.8 640.9 840.3ZM648.2 591C672.4 591 689.3 582 698.7 564.1 708.1 546.1 712.9 521 712.9 488.6L712.9 480.7C712.9 458.3 710.7 438.9 706.4 422.3 702 405.7 695.1 392.9 685.5 383.7 675.9 374.5 663.2 369.9 647.4 369.9 635.9 369.9 625.5 372.5 616.2 377.5 606.9 382.5 599.6 390 594.2 400.1L594.2 566.2C599.6 574.4 607 580.7 616.4 584.8 625.8 589 636.4 591 648.2 591Z",
"width": 1000
},
"search": [
"ip"
]
},
{
"uid": "ffd1698833bf4ed2d4c04041051f336b",
"css": "string",
"code": 59474,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M659.6 835.5L339.5 835.5 339.5 736.9 413.8 721.5 413.8 266.2 303.8 266.2 299.4 341.6 169.9 341.6 169.9 135.4 831.2 135.4 831.2 341.6 700.2 341.6 696.2 266.2 585.3 266.2 585.3 721.5 659.6 736.9 659.6 835.5Z",
"width": 1000
},
"search": [
"string"
]
},
{
"uid": "d91a2d9df5ed8188f0eb0eaeeebd675d",
"css": "more",
"code": 59478,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M970 500C970 759.6 759.6 970 500 970 240.4 970 30 759.6 30 500 30 240.4 240.4 30 500 30 759.6 30 970 240.4 970 500ZM680.1 623.6C641.2 623.6 609.6 655.1 609.6 694 609.6 732.9 641.2 764.5 680.1 764.5 719 764.5 750.5 732.9 750.5 694 750.5 655.1 719 623.6 680.1 623.6ZM308.5 621.5C269.6 621.5 238.1 653 238.1 692 238.1 730.9 269.6 762.4 308.5 762.4 347.4 762.4 378.9 730.9 378.9 692 378.9 653 347.4 621.5 308.5 621.5ZM493.6 621.9C454.7 621.9 423.1 653.4 423.1 692.3 423.1 731.2 454.7 762.7 493.6 762.7 532.5 762.7 564 731.2 564 692.3 564 653.4 532.5 621.9 493.6 621.9ZM751.5 694C751.5 713.7 743.4 731.7 730.6 744.5 717.7 757.4 699.7 765.5 680.1 765.5 660.4 765.5 642.4 757.4 629.5 744.5 616.7 731.7 608.6 713.7 608.6 694 608.6 674.4 616.7 656.4 629.5 643.5 642.4 630.6 660.4 622.6 680.1 622.6 699.7 622.6 717.7 630.6 730.6 643.5 743.4 656.4 751.5 674.4 751.5 694ZM729.2 644.9C716.5 632.3 699.3 624.6 680.1 624.6 660.8 624.6 643.6 632.3 631 644.9 618.3 657.5 610.6 674.8 610.6 694 610.6 713.3 618.3 730.5 631 743.1 643.6 755.7 660.8 763.5 680.1 763.5 699.3 763.5 716.5 755.7 729.2 743.1 741.8 730.5 749.5 713.3 749.5 694 749.5 674.8 741.8 657.5 729.2 644.9ZM379.9 692C379.9 711.6 371.9 729.6 359 742.5 346.1 755.3 328.1 763.4 308.5 763.4 288.8 763.4 270.9 755.3 258 742.5 245.1 729.6 237.1 711.6 237.1 692 237.1 672.3 245.1 654.3 258 641.4 270.9 628.6 288.8 620.5 308.5 620.5 328.1 620.5 346.1 628.6 359 641.4 371.9 654.3 379.9 672.3 379.9 692ZM357.6 642.9C345 630.2 327.7 622.5 308.5 622.5 289.2 622.5 272 630.2 259.4 642.9 246.8 655.5 239.1 672.7 239.1 692 239.1 711.2 246.8 728.4 259.4 741.1 272 753.7 289.2 761.4 308.5 761.4 327.7 761.4 345 753.7 357.6 741.1 370.2 728.4 377.9 711.2 377.9 692 377.9 672.7 370.2 655.5 357.6 642.9ZM565 692.3C565 712 557 729.9 544.1 742.8 531.2 755.7 513.2 763.7 493.6 763.7 473.9 763.7 455.9 755.7 443.1 742.8 430.2 729.9 422.1 712 422.1 692.3 422.1 672.6 430.2 654.7 443.1 641.8 455.9 628.9 473.9 620.9 493.6 620.9 513.2 620.9 531.2 628.9 544.1 641.8 557 654.7 565 672.6 565 692.3ZM542.7 643.2C530.1 630.6 512.8 622.9 493.6 622.9 474.3 622.9 457.1 630.6 444.5 643.2 431.9 655.8 424.1 673.1 424.1 692.3 424.1 711.6 431.9 728.8 444.5 741.4 457.1 754 474.3 761.7 493.6 761.7 512.8 761.7 530.1 754 542.7 741.4 555.3 728.8 563 711.6 563 692.3 563 673.1 555.3 655.8 542.7 643.2Z",
"width": 1000
},
"search": [
"more"
]
},
{
"uid": "272e08e0e16226aadf94dcbf33aab2b2",
"css": "key",
"code": 59479,
"src": "elusive"
},
{
"uid": "3256ef03b16e7ab51235bc7378b53bb5",
"css": "boolean",
"code": 61957,
"src": "fontawesome"
},
{
"uid": "47a1f80457068fbeab69fdb83d7d0817",
"css": "youtube-play",
"code": 61802,
"src": "fontawesome"
},
{
"uid": "b6941a012434c6246e2ad74248b6453e",
"css": "discord",
"code": 59463,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M1006.7 168.6C940.3 138.1 869 115.6 794.5 102.8 793.2 102.5 791.8 103.2 791.1 104.4 781.9 120.7 771.8 142 764.7 158.7 684.6 146.7 604.9 146.7 526.4 158.7 519.3 141.6 508.7 120.7 499.5 104.4 498.8 103.2 497.5 102.6 496.1 102.8 421.7 115.6 350.4 138.1 284 168.6 283.4 168.8 282.9 169.3 282.6 169.8 147.4 371.7 110.4 568.6 128.6 763.1 128.6 764.1 129.2 765 129.9 765.5 219.1 831 305.4 870.8 390.2 897.1 391.6 897.5 393 897 393.9 895.9 413.9 868.5 431.8 839.7 447.1 809.3 448 807.5 447.2 805.4 445.3 804.7 417 794 390 780.9 364 766 361.9 764.8 361.8 761.8 363.7 760.4 369.1 756.3 374.6 752.1 379.8 747.8 380.8 747 382.1 746.8 383.2 747.3 553.8 825.2 738.5 825.2 907.1 747.3 908.2 746.8 909.5 746.9 910.5 747.7 915.7 752 921.1 756.3 926.7 760.4 928.5 761.8 928.4 764.8 926.4 766 900.4 781.1 873.4 794 845 804.7 843.2 805.4 842.3 807.5 843.2 809.3 858.9 839.6 876.8 868.5 896.5 895.9 897.3 897 898.8 897.5 900.1 897.1 985.3 870.8 1071.7 831 1160.8 765.5 1161.6 765 1162.1 764.1 1162.2 763.2 1183.9 538.3 1125.8 343 1008 169.8 1007.8 169.3 1007.3 168.8 1006.7 168.6ZM472.6 644.7C421.2 644.7 378.9 597.5 378.9 539.6 378.9 481.7 420.4 434.6 472.6 434.6 525.2 434.6 567.1 482.1 566.3 539.6 566.3 597.5 524.8 644.7 472.6 644.7ZM819 644.7C767.6 644.7 725.3 597.5 725.3 539.6 725.3 481.7 766.8 434.6 819 434.6 871.6 434.6 913.5 482.1 912.6 539.6 912.6 597.5 871.6 644.7 819 644.7Z",
"width": 1291
},
"search": [
"discord-logo-color"
]
},
{
"uid": "00d86f3e46c3c3d768e7246eb0eadd7f",
"css": "discord",
"code": 59463,
"src": "custom_icons",
"selected": false,
"svg": {
"path": "M435 432.9C411.3 432.9 392.5 453.8 392.5 479.2S411.7 525.4 435 525.4C458.8 525.4 477.5 504.6 477.5 479.2 477.9 453.8 458.8 432.9 435 432.9ZM587.1 432.9C563.3 432.9 544.6 453.8 544.6 479.2S563.8 525.4 587.1 525.4C610.8 525.4 629.6 504.6 629.6 479.2S610.8 432.9 587.1 432.9ZM789.6 83.3H231.3C184.2 83.3 145.8 121.7 145.8 169.2V732.5C145.8 780 184.2 818.3 231.3 818.3H703.8L681.7 741.3 735 790.8 785.4 837.5 875 916.7V169.2C875 121.7 836.7 83.3 789.6 83.3ZM628.8 627.5S613.8 609.6 601.3 593.8C655.8 578.3 676.7 544.2 676.7 544.2 659.6 555.4 643.3 563.3 628.8 568.8 607.9 577.5 587.9 583.3 568.3 586.7 528.3 594.2 491.7 592.1 460.4 586.3 436.7 581.7 416.3 575 399.2 568.3 389.6 564.6 379.2 560 368.8 554.2 367.5 553.3 366.3 552.9 365 552.1 364.2 551.7 363.8 551.3 363.3 550.8 355.8 546.7 351.7 543.8 351.7 543.8S371.7 577.1 424.6 592.9C412.1 608.8 396.7 627.5 396.7 627.5 304.6 624.6 269.6 564.2 269.6 564.2 269.6 430 329.6 321.3 329.6 321.3 389.6 276.3 446.7 277.5 446.7 277.5L450.8 282.5C375.8 304.2 341.3 337.1 341.3 337.1S350.4 332.1 365.8 325C410.4 305.4 445.8 300 460.4 298.8 462.9 298.3 465 297.9 467.5 297.9 492.9 294.6 521.7 293.8 551.7 297.1 591.3 301.7 633.8 313.3 677.1 337.1 677.1 337.1 644.2 305.8 573.3 284.2L579.2 277.5S636.3 276.3 696.3 321.3C696.3 321.3 756.3 430 756.3 564.2 756.3 564.2 720.8 624.6 628.8 627.5Z",
"width": 1021
},
"search": [
"discord-logo-black"
]
},
{
"uid": "097a1d40f8e785fbd260946461a6ea9c",
"css": "discord",
"code": 59463,
"src": "custom_icons",
"selected": false,
"svg": {
"path": "M1092.8 89.1C1010.5 51.3 922.3 23.5 830 7.6 828.4 7.2 826.7 8 825.8 9.6 814.5 29.7 801.9 56.1 793.1 76.8 693.9 61.9 595.2 61.9 498 76.8 489.2 55.6 476.2 29.7 464.8 9.6 463.9 8.1 462.2 7.3 460.5 7.6 368.3 23.4 280.1 51.2 197.8 89.1 197.1 89.4 196.5 89.9 196 90.5 28.7 340.6-17.2 584.4 5.3 825.3 5.4 826.5 6.1 827.6 7 828.3 117.4 909.4 224.4 958.6 329.4 991.3 331 991.8 332.8 991.2 333.9 989.8 358.7 955.9 380.9 920.1 399.8 882.5 401 880.3 399.9 877.7 397.6 876.8 362.5 863.5 329.1 847.3 296.9 828.8 294.4 827.3 294.1 823.7 296.5 822 303.3 816.9 310 811.6 316.5 806.3 317.7 805.3 319.3 805.1 320.7 805.7 531.9 902.2 760.6 902.2 969.4 805.7 970.8 805.1 972.4 805.3 973.6 806.2 980.1 811.6 986.9 816.9 993.7 822 996 823.7 995.9 827.3 993.3 828.8 961.2 847.6 927.7 863.5 892.6 876.8 890.3 877.6 889.3 880.3 890.4 882.5 909.8 920.1 931.9 955.8 956.3 989.7 957.3 991.2 959.1 991.8 960.8 991.3 1066.3 958.6 1173.3 909.4 1283.7 828.3 1284.6 827.6 1285.2 826.5 1285.4 825.3 1312.3 546.9 1240.3 305 1094.5 90.6 1094.1 89.9 1093.5 89.4 1092.8 89.1ZM431.4 678.6C367.8 678.6 315.4 620.2 315.4 548.5 315.4 476.8 366.8 418.4 431.4 418.4 496.5 418.4 548.4 477.3 547.4 548.5 547.4 620.2 496 678.6 431.4 678.6ZM860.3 678.6C796.7 678.6 744.3 620.2 744.3 548.5 744.3 476.8 795.7 418.4 860.3 418.4 925.5 418.4 977.4 477.3 976.3 548.5 976.3 620.2 925.5 678.6 860.3 678.6Z",
"width": 1291
},
"search": [
"discord-logo-color"
]
}
]
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,137 @@
<?php
namespace Appwrite\Auth\OAuth2;
use Appwrite\Auth\OAuth2;
// Reference Material
// https://developer.yammer.com/docs/oauth-2
class Yammer extends OAuth2
{
/**
* @var string
*/
private $endpoint = 'https://www.yammer.com/oauth2/';
/**
* @var array
*/
protected $user = [];
/**
* @return string
*/
public function getName(): string
{
return 'yammer';
}
/**
* @return string
*/
public function getLoginURL(): string
{
return $this->endpoint . 'oauth2/authorize?'.
\http_build_query([
'client_id' => $this->appID,
'response_type' => 'code',
'redirect_uri' => $this->callback,
'state' => \json_encode($this->state)
]);
}
/**
* @param string $code
*
* @return string
*/
public function getAccessToken(string $code): string
{
$headers = ['Content-Type: application/x-www-form-urlencoded'];
$accessToken = $this->request(
'POST',
$this->endpoint . 'access_token?',
$headers,
\http_build_query([
'client_id' => $this->appID,
'client_secret' => $this->appSecret,
'code' => $code,
'grant_type' => 'authorization_code'
])
);
$accessToken = \json_decode($accessToken, true);
if (isset($accessToken['access_token']['token'])) {
return $accessToken['access_token']['token'];
}
return '';
}
/**
* @param string $accessToken
*
* @return string
*/
public function getUserID(string $accessToken): string
{
$user = $this->getUser($accessToken);
if (isset($user['id'])) {
return $user['id'];
}
return '';
}
/**
* @param string $accessToken
*
* @return string
*/
public function getUserEmail(string $accessToken): string
{
$user = $this->getUser($accessToken);
if (isset($user['email'])) {
return $user['email'];
}
return '';
}
/**
* @param string $accessToken
*
* @return string
*/
public function getUserName(string $accessToken): string
{
$user = $this->getUser($accessToken);
if (isset($user['full_name'])) {
return $user['full_name'];
}
return '';
}
/**
* @param string $accessToken
*
* @return array
*/
protected function getUser(string $accessToken): array
{
if (empty($this->user)) {
$headers = ['Authorization: Bearer '. \urlencode($accessToken)];
$user = $this->request('GET', 'https://www.yammer.com/api/v1/users/current.json', $headers);
$this->user = \json_decode($user, true);
}
return $this->user;
}
}