mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Updated SDKs list
This commit is contained in:
@@ -124,29 +124,35 @@ Below is a list of currently supported platforms and languages. If you wish to h
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>*</td>
|
||||
<td>[ANY]</td>
|
||||
<td><a href="https://github.com/appwrite/sdk-for-php">PHP</a></td>
|
||||
<td>Appwrite Team</td>
|
||||
<td>✅</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>*</td>
|
||||
<td>[ANY]</td>
|
||||
<td><a href="https://github.com/appwrite/sdk-for-js">Javascript</a></td>
|
||||
<td>Appwrite Team</td>
|
||||
<td>✅</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>*</td>
|
||||
<td>[ANY]</td>
|
||||
<td><a href="https://github.com/appwrite/sdk-for-ruby">Ruby</a></td>
|
||||
<td>Appwrite Team</td>
|
||||
<td>✅</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>*</td>
|
||||
<td>[ANY]</td>
|
||||
<td><a href="https://github.com/appwrite/sdk-for-python">Python</a></td>
|
||||
<td>Appwrite Team</td>
|
||||
<td>✅</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>[ANY]</td>
|
||||
<td><a href="https://github.com/appwrite/sdk-for-node">Node JS</a></td>
|
||||
<td>Appwrite Team</td>
|
||||
<td>✅</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ $cli
|
||||
'gitUserName' => 'appwrite',
|
||||
],
|
||||
'node' => [
|
||||
'version' => 'v1.0.9',
|
||||
'version' => 'v1.0.10',
|
||||
'result' => __DIR__ . '/../sdks/node/',
|
||||
'gitURL' => 'https://github.com/appwrite/sdk-for-node.git',
|
||||
'gitRepo' => 'git@github.com:appwrite/sdk-for-node.git',
|
||||
|
||||
Generated
+8
-8
@@ -57,12 +57,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/appwrite/sdk-generator.git",
|
||||
"reference": "a345962813f3e5d64f18e7f733a2d77b8fd85603"
|
||||
"reference": "541dae92637c36668b7e0a78e248f6aec4630bd3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/a345962813f3e5d64f18e7f733a2d77b8fd85603",
|
||||
"reference": "a345962813f3e5d64f18e7f733a2d77b8fd85603",
|
||||
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/541dae92637c36668b7e0a78e248f6aec4630bd3",
|
||||
"reference": "541dae92637c36668b7e0a78e248f6aec4630bd3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -94,7 +94,7 @@
|
||||
}
|
||||
],
|
||||
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
|
||||
"time": "2019-06-05 06:46:55"
|
||||
"time": "2019-06-06 06:22:01"
|
||||
},
|
||||
{
|
||||
"name": "bacon/bacon-qr-code",
|
||||
@@ -741,12 +741,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/psr7.git",
|
||||
"reference": "dd1ba1de1234e5e8939809bbd9e103e7aeebf0d5"
|
||||
"reference": "c5aea30ff82a3565e6d3decd18d74257c033daf6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/dd1ba1de1234e5e8939809bbd9e103e7aeebf0d5",
|
||||
"reference": "dd1ba1de1234e5e8939809bbd9e103e7aeebf0d5",
|
||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/c5aea30ff82a3565e6d3decd18d74257c033daf6",
|
||||
"reference": "c5aea30ff82a3565e6d3decd18d74257c033daf6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -804,7 +804,7 @@
|
||||
"uri",
|
||||
"url"
|
||||
],
|
||||
"time": "2019-05-26 12:43:51"
|
||||
"time": "2019-06-05 23:31:57"
|
||||
},
|
||||
{
|
||||
"name": "influxdb/influxdb-php",
|
||||
|
||||
+73
-15
@@ -8,55 +8,113 @@ class Apple extends OAuth
|
||||
{
|
||||
//READ THE DOCS HERE: https://developer.apple.com/documentation/signinwithapplerestapi
|
||||
|
||||
//https://appleid.apple.com/auth/token
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $version = 'v2.8';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $user = [];
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): string
|
||||
public function getName():string
|
||||
{
|
||||
// TODO: Implement getName() method.
|
||||
return 'facebook';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLoginURL(): string
|
||||
public function getLoginURL():string
|
||||
{
|
||||
// TODO: Implement getLoginURL() method.
|
||||
return '?client_id=' . urlencode($this->appID) . '&redirect_uri=' . urlencode($this->callback) . '&scope=email&state=' . urlencode(json_encode($this->state));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $code
|
||||
* @return string
|
||||
*/
|
||||
public function getAccessToken(string $code): string
|
||||
public function getAccessToken(string $code):string
|
||||
{
|
||||
// TODO: Implement getAccessToken() method.
|
||||
$accessToken = $this->request('GET', 'https://appleid.apple.com/auth/token' .
|
||||
'client_id=' . urlencode($this->appID) .
|
||||
'&client_secret=' . urlencode($this->appSecret) .
|
||||
'&redirect_uri=' . urlencode($this->callback) .
|
||||
'&code=' . urlencode($code) .
|
||||
'&grant_type=authorization_token'
|
||||
);
|
||||
|
||||
$accessToken = json_decode($accessToken, true); //
|
||||
|
||||
if(isset($accessToken['access_token'])) {
|
||||
return $accessToken['access_token'];
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $accessToken
|
||||
* @param string $accessToken
|
||||
* @return string
|
||||
*/
|
||||
public function getUserID(string $accessToken): string
|
||||
public function getUserID(string $accessToken):string
|
||||
{
|
||||
// TODO: Implement getUserID() method.
|
||||
$user = $this->getUser($accessToken);
|
||||
|
||||
if(isset($user['id'])) {
|
||||
return $user['id'];
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $accessToken
|
||||
* @param string $accessToken
|
||||
* @return string
|
||||
*/
|
||||
public function getUserEmail(string $accessToken): string
|
||||
public function getUserEmail(string $accessToken):string
|
||||
{
|
||||
// TODO: Implement getUserEmail() method.
|
||||
$user = $this->getUser($accessToken);
|
||||
|
||||
if(isset($user['email'])) {
|
||||
return $user['email'];
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $accessToken
|
||||
* @param string $accessToken
|
||||
* @return string
|
||||
*/
|
||||
public function getUserName(string $accessToken): string
|
||||
public function getUserName(string $accessToken):string
|
||||
{
|
||||
// TODO: Implement getUserName() method.
|
||||
$user = $this->getUser($accessToken);
|
||||
|
||||
if(isset($user['name'])) {
|
||||
return $user['name'];
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $accessToken
|
||||
* @return array
|
||||
*/
|
||||
protected function getUser(string $accessToken):array
|
||||
{
|
||||
if(empty($this->user)) {
|
||||
$user = $this->request('GET', 'https://graph.facebook.com/' . $this->version . '/me?fields=email,name&access_token=' . urlencode($accessToken));
|
||||
|
||||
$this->user = json_decode($user, true);
|
||||
}
|
||||
|
||||
return $this->user;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user