Merge branch 'master' of https://github.com/appwrite/appwrite into feat-database-indexing
This commit is contained in:
commit
721363a240
|
@ -61,6 +61,7 @@ return [
|
|||
'si', // Sinhala
|
||||
'sk', // Slovakia
|
||||
'sl', // Slovenian
|
||||
'sn', // Shona
|
||||
'sq', // Albanian
|
||||
'sv', // Swedish
|
||||
'ta', // Tamil
|
||||
|
|
232
app/config/locale/translations/sn.json
Normal file
232
app/config/locale/translations/sn.json
Normal 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"
|
||||
}
|
|
@ -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,
|
||||
|
|
|
@ -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/',
|
||||
|
|
|
@ -518,6 +518,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');
|
||||
|
|
|
@ -259,7 +259,7 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled', true);
|
|||
<div class="box margin-bottom-small">
|
||||
<div class="margin-start-negative-small margin-end-negative-small margin-top-negative-small margin-bottom-negative-small">
|
||||
<div class="chart background-image-no border-no margin-bottom-no">
|
||||
<input type="hidden" data-ls-bind="{{usage}}" data-forms-chart="CPU Time (seconds)=functionsCompute" data-colors="orange" data-height="140" data-show-y-axis="true" />
|
||||
<input type="hidden" data-ls-bind="{{usage}}" data-forms-chart="CPU Time (milliseconds)=functionsCompute" data-colors="orange" data-height="140" data-show-y-axis="true" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
},
|
||||
"repositories": [],
|
||||
"require-dev": {
|
||||
"appwrite/sdk-generator": "0.16.2",
|
||||
"appwrite/sdk-generator": "0.16.3",
|
||||
"phpunit/phpunit": "9.5.10",
|
||||
"swoole/ide-helper": "4.8.3",
|
||||
"textalk/websocket": "1.5.5",
|
||||
|
|
14
composer.lock
generated
14
composer.lock
generated
|
@ -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": "d4017e5555cb2462f367b6881d5b6a5c",
|
||||
"content-hash": "c755b0ae991777da3e44b0442690fa46",
|
||||
"packages": [
|
||||
{
|
||||
"name": "adhocore/jwt",
|
||||
|
@ -3014,16 +3014,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": {
|
||||
|
@ -3057,9 +3057,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/pcre",
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
BIN
public/images/users/yammer.png
Normal file
BIN
public/images/users/yammer.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.7 KiB |
137
src/Appwrite/Auth/OAuth2/Yammer.php
Normal file
137
src/Appwrite/Auth/OAuth2/Yammer.php
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue