1
0
Fork 0
mirror of synced 2024-06-22 04:30:29 +12:00

Merge branch '0.7.x' of github.com:appwrite/appwrite into feat-add-cli-packaging-to-function-ui

This commit is contained in:
Eldad Fux 2021-02-05 08:20:56 +02:00
commit 51775208aa
36 changed files with 438 additions and 151 deletions

View file

@ -35,6 +35,7 @@ install:
script:
- docker ps
- docker-compose logs appwrite
- docker-compose logs appwrite-worker-functions
- docker-compose exec appwrite doctor
- docker-compose exec appwrite vars
- docker-compose exec appwrite test

View file

@ -364,5 +364,5 @@ Submitting documentation updates, enhancements, designs, or bug fixes. Spelling
### Helping Someone
Searching for Appwrite on Discord, GitHub, or StackOverflow and helping someone else who needs help. You can also help by reaching others how to contribute to Appwrite's repo!
Searching for Appwrite on Discord, GitHub, or StackOverflow and helping someone else who needs help. You can also help by teaching others how to contribute to Appwrite's repo!

View file

@ -102,7 +102,7 @@ Getting started with Appwrite is as easy as creating a new project, choosing you
* [**Account**](https://appwrite.io/docs/client/account) - Manage current user authentication and account. Track and manage the user sessions, devices, sign-in methods, and security logs.
* [**Users**](https://appwrite.io/docs/server/users) - Manage and list all project users when in admin mode.
* [**Teams**](https://appwrite.io/docs/client/teams) - Manage and group users in teams. Manage memberships, invites, and user roles within a team.
* [**Database**](https://appwrite.io/docs/client/database) - Manage database collections and documents. Read, create, update, and delete documents and filter lists of documents collections using an advanced filter with graph-like capabilities.
* [**Database**](https://appwrite.io/docs/client/database) - Manage database collections and documents. Read, create, update, and delete documents and filter lists of document collections using advanced filters.
* [**Storage**](https://appwrite.io/docs/client/storage) - Manage storage files. Read, create, delete, and preview files. Manipulate the preview of your files to fit your app perfectly. All files are scanned by ClamAV and stored in a secure and encrypted way.
* [**Functions**](https://appwrite.io/docs/server/functions) - Customize your Appwrite server by executing your custom code in a secure, isolated environment. You can trigger your code on any Appwrite system event, manually or using a CRON schedule.
* [**Locale**](https://appwrite.io/docs/client/locale) - Track your user's location, and manage your app locale-based data.

View file

@ -139,6 +139,22 @@ return [
'enabled' => true,
'beta' => false,
'languages' => [ // TODO change key to 'sdks'
[
'key' => 'cli',
'name' => 'Command Line',
'version' => '0.1.0',
'url' => 'https://github.com/appwrite/sdk-for-cli',
'package' => 'https://github.com/appwrite/sdk-for-cli',
'enabled' => true,
'beta' => true,
'dev' => true,
'family' => APP_PLATFORM_SERVER,
'prism' => 'bash',
'source' => \realpath(__DIR__ . '/../sdks/server-cli'),
'gitUrl' => 'git@github.com:appwrite/sdk-for-cli.git',
'gitRepoName' => 'sdk-for-cli',
'gitUserName' => 'appwrite',
],
[
'key' => 'nodejs',
'name' => 'Node.js',

View file

@ -163,6 +163,24 @@ return [ // Ordered by ABC.
'beta' => false,
'mock' => false,
],
'tradeshift' => [
'name' => 'Tradeshift',
'developers' => 'https://developers.tradeshift.com/docs/api',
'icon' => 'icon-tradeshift',
'enabled' => true,
'form' => false,
'beta' => false,
'mock' => false,
],
'tradeshiftBox' => [
'name' => 'Tradeshift Sandbox',
'developers' => 'https://developers.tradeshift.com/docs/api',
'icon' => 'icon-tradeshiftbox',
'enabled' => true,
'form' => false,
'beta' => false,
'mock' => false,
],
'twitch' => [
'name' => 'Twitch',
'developers' => 'https://dev.twitch.tv/docs/authentication',
@ -215,6 +233,15 @@ return [ // Ordered by ABC.
// 'beta' => false,
// 'mock' => false,
// ],
'wordpress' => [
'name' => 'WordPress',
'developers' => 'https://developer.wordpress.com/docs/oauth2/',
'icon' => 'icon-wordpress',
'enabled' => true,
'form' => false,
'beta' => false,
'mock' => false
],
// Keep Last
'mock' => [
'name' => 'Mock',
@ -225,13 +252,4 @@ return [ // Ordered by ABC.
'beta' => false,
'mock' => true,
],
'wordpress' => [
'name' => 'WordPress',
'developers' => 'https://developer.wordpress.com/docs/oauth2/',
'icon' => 'icon-wordpress',
'enabled' => true,
'form' => false,
'beta' => false,
'mock' => false
]
];

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -642,6 +642,7 @@ App::post('/v1/account/jwt')
->desc('Create Account JWT')
->groups(['api', 'account'])
->label('scope', 'account')
->label('docs', false) // Hidden for now - private beta
->label('sdk.platform', [APP_PLATFORM_CLIENT])
->label('sdk.namespace', 'account')
->label('sdk.method', 'createJWT')
@ -1066,7 +1067,6 @@ App::delete('/v1/account')
->label('sdk.method', 'delete')
->label('sdk.description', '/docs/references/account/delete.md')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_NONE)
->inject('request')
->inject('response')
@ -1133,7 +1133,6 @@ App::delete('/v1/account/sessions/:sessionId')
->label('sdk.method', 'deleteSession')
->label('sdk.description', '/docs/references/account/delete-session.md')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_NONE)
->label('abuse-limit', 100)
->param('sessionId', null, new UID(), 'Session unique ID. Use the string \'current\' to delete the current device session.')
@ -1208,7 +1207,6 @@ App::delete('/v1/account/sessions')
->label('sdk.method', 'deleteSessions')
->label('sdk.description', '/docs/references/account/delete-sessions.md')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_NONE)
->label('abuse-limit', 100)
->inject('request')

View file

@ -240,7 +240,6 @@ App::delete('/v1/database/collections/:collectionId')
->label('sdk.method', 'deleteCollection')
->label('sdk.description', '/docs/references/database/delete-collection.md')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_NONE)
->param('collectionId', '', new UID(), 'Collection unique ID.')
->inject('response')
@ -584,7 +583,6 @@ App::delete('/v1/database/collections/:collectionId/documents/:documentId')
->label('sdk.method', 'deleteDocument')
->label('sdk.description', '/docs/references/database/delete-document.md')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_NONE)
->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
->param('documentId', null, new UID(), 'Document unique ID.')

View file

@ -392,7 +392,6 @@ App::delete('/v1/functions/:functionId')
->label('sdk.method', 'delete')
->label('sdk.description', '/docs/references/functions/delete-function.md')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_NONE)
->param('functionId', '', new UID(), 'Function unique ID.')
->inject('response')
@ -607,7 +606,6 @@ App::delete('/v1/functions/:functionId/tags/:tagId')
->label('sdk.method', 'deleteTag')
->label('sdk.description', '/docs/references/functions/delete-tag.md')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_NONE)
->param('functionId', '', new UID(), 'Function unique ID.')
->param('tagId', '', new UID(), 'Tag unique ID.')

View file

@ -448,7 +448,6 @@ App::delete('/v1/projects/:projectId')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'delete')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_NONE)
->param('projectId', '', new UID(), 'Project unique ID.')
->param('password', '', new UID(), 'Your user password for confirmation. Must be between 6 to 32 chars.')
@ -684,7 +683,6 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'deleteWebhook')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_NONE)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('webhookId', null, new UID(), 'Webhook unique ID.')
@ -877,7 +875,6 @@ App::delete('/v1/projects/:projectId/keys/:keyId')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'deleteKey')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_NONE)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('keyId', null, new UID(), 'Key unique ID.')
@ -1126,7 +1123,6 @@ App::delete('/v1/projects/:projectId/tasks/:taskId')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'deleteTask')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_NONE)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('taskId', null, new UID(), 'Task unique ID.')
@ -1334,7 +1330,6 @@ App::delete('/v1/projects/:projectId/platforms/:platformId')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'deletePlatform')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_NONE)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('platformId', null, new UID(), 'Platform unique ID.')
@ -1566,7 +1561,6 @@ App::delete('/v1/projects/:projectId/domains/:domainId')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'deleteDomain')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_NONE)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('domainId', null, new UID(), 'Domain unique ID.')

View file

@ -541,7 +541,6 @@ App::delete('/v1/storage/files/:fileId')
->label('sdk.method', 'deleteFile')
->label('sdk.description', '/docs/references/storage/delete-file.md')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_NONE)
->param('fileId', '', new UID(), 'File unique ID.')
->inject('response')

View file

@ -207,7 +207,6 @@ App::delete('/v1/teams/:teamId')
->label('sdk.method', 'delete')
->label('sdk.description', '/docs/references/teams/delete-team.md')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_NONE)
->param('teamId', '', new UID(), 'Team unique ID.')
->inject('response')
@ -701,7 +700,6 @@ App::delete('/v1/teams/:teamId/memberships/:inviteId')
->label('sdk.method', 'deleteMembership')
->label('sdk.description', '/docs/references/teams/delete-team-membership.md')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_NONE)
->param('teamId', '', new UID(), 'Team unique ID.')
->param('inviteId', '', new UID(), 'Invite unique ID.')

View file

@ -416,7 +416,6 @@ App::delete('/v1/users/:userId/sessions/:sessionId')
->label('sdk.method', 'deleteSession')
->label('sdk.description', '/docs/references/users/delete-user-session.md')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_NONE)
->param('userId', '', new UID(), 'User unique ID.')
->param('sessionId', null, new UID(), 'User unique session ID.')
@ -462,7 +461,6 @@ App::delete('/v1/users/:userId/sessions')
->label('sdk.method', 'deleteSessions')
->label('sdk.description', '/docs/references/users/delete-user-sessions.md')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_NONE)
->param('userId', '', new UID(), 'User unique ID.')
->inject('response')
@ -505,7 +503,6 @@ App::delete('/v1/users/:userId')
->label('sdk.method', 'deleteUser')
->label('sdk.description', '/docs/references/users/delete-user.md')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_NONE)
->param('userId', '', function () {return new UID();}, 'User unique ID.')
->inject('response')

View file

@ -241,7 +241,7 @@ App::options(function ($request, $response) {
->addHeader('Access-Control-Expose-Headers', 'X-Fallback-Cookies')
->addHeader('Access-Control-Allow-Origin', $origin)
->addHeader('Access-Control-Allow-Credentials', 'true')
->send();
->noContent();
}, ['request', 'response']);
App::error(function ($error, $utopia, $request, $response, $layout, $project) {

View file

@ -4,6 +4,7 @@ global $cli;
use Appwrite\Docker\Compose;
use Appwrite\Docker\Env;
use Utopia\Analytics\GoogleAnalytics;
use Utopia\CLI\Console;
use Utopia\Config\Config;
use Utopia\View;
@ -34,6 +35,12 @@ $cli
$defaultHTTPSPort = '443';
$vars = [];
/**
* We are using a random value every execution for identification.
* This allows us to collect information without invading the privacy of our users.
*/
$analytics = new GoogleAnalytics('UA-26264668-9', uniqid('server.', true));
foreach($config as $category) {
foreach($category['variables'] ?? [] as $var) {
$vars[] = $var;
@ -136,12 +143,16 @@ $cli
;
if(!file_put_contents($path.'/docker-compose.yml', $templateForCompose->render(false))) {
Console::error('Failed to save Docker Compose file');
$message = 'Failed to save Docker Compose file';
$analytics->createEvent('install/server', 'install', APP_VERSION_STABLE.' - '.$message);
Console::error($message);
Console::exit(1);
}
if(!file_put_contents($path.'/.env', $templateForEnv->render(false))) {
Console::error('Failed to save environment variables file');
$message = 'Failed to save environment variables file';
$analytics->createEvent('install/server', 'install', APP_VERSION_STABLE.' - '.$message);
Console::error($message);
Console::exit(1);
}
@ -160,10 +171,14 @@ $cli
$exit = Console::execute("${env} docker-compose -f {$path}/docker-compose.yml up -d --remove-orphans --renew-anon-volumes", '', $stdout, $stderr);
if ($exit !== 0) {
Console::error("Failed to install Appwrite dockers");
$message = 'Failed to install Appwrite dockers';
$analytics->createEvent('install/server', 'install', APP_VERSION_STABLE.' - '.$message);
Console::error($message);
Console::error($stderr);
Console::exit($exit);
} else {
Console::success("Appwrite installed successfully");
$message = 'Appwrite installed successfully';
$analytics->createEvent('install/server', 'install', APP_VERSION_STABLE.' - '.$message);
Console::success($message);
}
});

View file

@ -164,7 +164,7 @@ $scopes = $this->getParam('scopes', []);
<div class="col span-6 text-one-liner margin-bottom text-height-large text-size-small" title="<?php echo $scope; ?>">
<input type="checkbox" name="scopes" id="<?php echo $scope; ?>" value="<?php echo $scope; ?>" />
&nbsp;
<label for="<?php echo $scope; ?>"><?php echo $scope; ?></label>
<label class="inline" for="<?php echo $scope; ?>"><?php echo $scope; ?></label>
</div>
<?php if (($i + 1) % 2 === 0) : ?>
</div>

View file

@ -29,7 +29,18 @@ $warmupStart = \microtime(true);
Co\run(function() use ($environments) { // Warmup: make sure images are ready to run fast 🚀
Runtime::enableCoroutine(SWOOLE_HOOK_ALL);
$dockerUser = App::getEnv('DOCKERHUB_PULL_USERNAME', null);
$dockerPass = App::getEnv('DOCKERHUB_PULL_PASSWORD', null);
if($dockerUser) {
$stdout = '';
$stderr = '';
Console::execute('docker login --username '.$dockerUser.' --password-stdin', $dockerPass, $stdout, $stderr);
Console::log('Docker Login'. $stdout.$stderr);
}
foreach($environments as $environment) {
go(function() use ($environment) {
$stdout = '';

View file

@ -36,6 +36,7 @@
"utopia-php/framework": "0.10.0",
"utopia-php/abuse": "0.3.*",
"utopia-php/analytics": "0.1.*",
"utopia-php/audit": "0.5.*",
"utopia-php/cache": "0.2.*",
"utopia-php/cli": "0.9.0",
@ -45,7 +46,7 @@
"utopia-php/preloader": "0.2.*",
"utopia-php/domains": "0.2.*",
"utopia-php/swoole": "0.2.*",
"utopia-php/system": "0.3.*",
"utopia-php/system": "0.4.*",
"utopia-php/storage": "0.2.*",
"resque/php-resque": "1.3.6",
@ -58,9 +59,9 @@
"adhocore/jwt": "1.1.0"
},
"require-dev": {
"swoole/ide-helper": "4.5.5",
"appwrite/sdk-generator": "0.4.5",
"phpunit/phpunit": "9.4.2",
"swoole/ide-helper": "4.5.5",
"vimeo/psalm": "4.1.1"
},
"repositories": [

231
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": "be6adbd12397d629ee420d11eed43b1f",
"content-hash": "9392457b87e42defd544ca840fee0bab",
"packages": [
{
"name": "adhocore/jwt",
@ -1227,6 +1227,61 @@
},
"time": "2020-12-21T17:28:03+00:00"
},
{
"name": "utopia-php/analytics",
"version": "0.1.0",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/analytics.git",
"reference": "a1f2a1672a927bef8cd4d9b47e5cfbc856a3c72f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/analytics/zipball/a1f2a1672a927bef8cd4d9b47e5cfbc856a3c72f",
"reference": "a1f2a1672a927bef8cd4d9b47e5cfbc856a3c72f",
"shasum": ""
},
"require": {
"php": ">=7.4"
},
"require-dev": {
"phpunit/phpunit": "^9.3",
"vimeo/psalm": "4.0.1"
},
"type": "library",
"autoload": {
"psr-4": {
"Utopia\\Analytics\\": "src/Analytics"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Eldad Fux",
"email": "eldad@appwrite.io"
},
{
"name": "Torsten Dittmann",
"email": "torsten@appwrite.io"
}
],
"description": "A simple library to track events & users.",
"keywords": [
"analytics",
"framework",
"php",
"upf",
"utopia"
],
"support": {
"issues": "https://github.com/utopia-php/analytics/issues",
"source": "https://github.com/utopia-php/analytics/tree/0.1.0"
},
"time": "2021-02-03T17:07:09+00:00"
},
{
"name": "utopia-php/audit",
"version": "0.5.1",
@ -1805,16 +1860,16 @@
},
{
"name": "utopia-php/system",
"version": "0.3.0",
"version": "0.4.0",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/system.git",
"reference": "63a4f2ea06a60ed82b8904e24b4754df0f77fef2"
"reference": "67c92c66ce8f0cc925a00bca89f7a188bf9183c0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/system/zipball/63a4f2ea06a60ed82b8904e24b4754df0f77fef2",
"reference": "63a4f2ea06a60ed82b8904e24b4754df0f77fef2",
"url": "https://api.github.com/repos/utopia-php/system/zipball/67c92c66ce8f0cc925a00bca89f7a188bf9183c0",
"reference": "67c92c66ce8f0cc925a00bca89f7a188bf9183c0",
"shasum": ""
},
"require": {
@ -1854,9 +1909,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/system/issues",
"source": "https://github.com/utopia-php/system/tree/0.3.0"
"source": "https://github.com/utopia-php/system/tree/0.4.0"
},
"time": "2021-01-24T11:28:55+00:00"
"time": "2021-02-04T14:14:49+00:00"
}
],
"packages-dev": [
@ -3072,12 +3127,12 @@
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0"
"reference": "6759f2268deb9f329812679e9dcb2d0083b2a30b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
"reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6759f2268deb9f329812679e9dcb2d0083b2a30b",
"reference": "6759f2268deb9f329812679e9dcb2d0083b2a30b",
"shasum": ""
},
"require": {
@ -3112,9 +3167,9 @@
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"support": {
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0"
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.x"
},
"time": "2020-09-17T18:55:26+00:00"
"time": "2021-02-02T21:09:27+00:00"
},
{
"name": "phpspec/prophecy",
@ -3266,12 +3321,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
"reference": "42c07f0e3553df5bf56a079957a52e9353625058"
"reference": "7643948b9b254d2c1406437070c53489ca858632"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/42c07f0e3553df5bf56a079957a52e9353625058",
"reference": "42c07f0e3553df5bf56a079957a52e9353625058",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/7643948b9b254d2c1406437070c53489ca858632",
"reference": "7643948b9b254d2c1406437070c53489ca858632",
"shasum": ""
},
"require": {
@ -3319,7 +3374,7 @@
"type": "github"
}
],
"time": "2021-01-27T12:51:34+00:00"
"time": "2021-01-31T06:06:23+00:00"
},
{
"name": "phpunit/php-invoker",
@ -3327,12 +3382,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-invoker.git",
"reference": "3a913dc74b32a7646a5fb3cfb72f6ace01fabd01"
"reference": "8ddb05c30eb42ee9342a711ff490436db0f42aad"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/3a913dc74b32a7646a5fb3cfb72f6ace01fabd01",
"reference": "3a913dc74b32a7646a5fb3cfb72f6ace01fabd01",
"url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/8ddb05c30eb42ee9342a711ff490436db0f42aad",
"reference": "8ddb05c30eb42ee9342a711ff490436db0f42aad",
"shasum": ""
},
"require": {
@ -3383,7 +3438,7 @@
"type": "github"
}
],
"time": "2021-01-27T12:51:43+00:00"
"time": "2021-01-31T06:06:31+00:00"
},
{
"name": "phpunit/php-text-template",
@ -3391,12 +3446,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git",
"reference": "f2e1a43551a53861fd0d000518f8db3818b82655"
"reference": "eace5f89cab382a6908f404ca2ea757e644047ab"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/f2e1a43551a53861fd0d000518f8db3818b82655",
"reference": "f2e1a43551a53861fd0d000518f8db3818b82655",
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/eace5f89cab382a6908f404ca2ea757e644047ab",
"reference": "eace5f89cab382a6908f404ca2ea757e644047ab",
"shasum": ""
},
"require": {
@ -3443,7 +3498,7 @@
"type": "github"
}
],
"time": "2021-01-27T12:52:18+00:00"
"time": "2021-01-31T06:07:05+00:00"
},
{
"name": "phpunit/php-timer",
@ -3451,12 +3506,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
"reference": "ca89d7aa771d3c7a095ec2bac5b70489a6d15638"
"reference": "c2c32bcece727700ce67b2c4fa5b5231c03d1232"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/ca89d7aa771d3c7a095ec2bac5b70489a6d15638",
"reference": "ca89d7aa771d3c7a095ec2bac5b70489a6d15638",
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/c2c32bcece727700ce67b2c4fa5b5231c03d1232",
"reference": "c2c32bcece727700ce67b2c4fa5b5231c03d1232",
"shasum": ""
},
"require": {
@ -3503,7 +3558,7 @@
"type": "github"
}
],
"time": "2021-01-27T12:51:51+00:00"
"time": "2021-01-31T06:06:40+00:00"
},
{
"name": "phpunit/phpunit",
@ -3668,12 +3723,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/cli-parser.git",
"reference": "66398c0b5074897805514249878d592f9ada37c5"
"reference": "852907f9ef27ea08ad4135614a9fbd2f70c91ed1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/66398c0b5074897805514249878d592f9ada37c5",
"reference": "66398c0b5074897805514249878d592f9ada37c5",
"url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/852907f9ef27ea08ad4135614a9fbd2f70c91ed1",
"reference": "852907f9ef27ea08ad4135614a9fbd2f70c91ed1",
"shasum": ""
},
"require": {
@ -3717,7 +3772,7 @@
"type": "github"
}
],
"time": "2021-01-27T12:52:48+00:00"
"time": "2021-01-31T06:07:32+00:00"
},
{
"name": "sebastian/code-unit",
@ -3781,12 +3836,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
"reference": "8be6fadd1eb9f4bcee0e823a0f392d641e00e3d9"
"reference": "bae9e6f9fc00aa95c1971a52f819b08494a394f0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/8be6fadd1eb9f4bcee0e823a0f392d641e00e3d9",
"reference": "8be6fadd1eb9f4bcee0e823a0f392d641e00e3d9",
"url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/bae9e6f9fc00aa95c1971a52f819b08494a394f0",
"reference": "bae9e6f9fc00aa95c1971a52f819b08494a394f0",
"shasum": ""
},
"require": {
@ -3829,7 +3884,7 @@
"type": "github"
}
],
"time": "2021-01-27T12:50:24+00:00"
"time": "2021-01-31T06:05:15+00:00"
},
{
"name": "sebastian/comparator",
@ -3837,12 +3892,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "5a39e6c8994048403e326298f0b1bda7eb1ea127"
"reference": "d529bf5bc5746f6c59a1defc17c3725b5374c750"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5a39e6c8994048403e326298f0b1bda7eb1ea127",
"reference": "5a39e6c8994048403e326298f0b1bda7eb1ea127",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/d529bf5bc5746f6c59a1defc17c3725b5374c750",
"reference": "d529bf5bc5746f6c59a1defc17c3725b5374c750",
"shasum": ""
},
"require": {
@ -3904,7 +3959,7 @@
"type": "github"
}
],
"time": "2021-01-27T14:14:42+00:00"
"time": "2021-01-31T06:05:24+00:00"
},
{
"name": "sebastian/complexity",
@ -3912,12 +3967,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/complexity.git",
"reference": "653277be0c4044b0a32ee3e799b3b0c6945aa7f8"
"reference": "1e51f588b0bf9783d80e952339a1f057f530f3ac"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/653277be0c4044b0a32ee3e799b3b0c6945aa7f8",
"reference": "653277be0c4044b0a32ee3e799b3b0c6945aa7f8",
"url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/1e51f588b0bf9783d80e952339a1f057f530f3ac",
"reference": "1e51f588b0bf9783d80e952339a1f057f530f3ac",
"shasum": ""
},
"require": {
@ -3962,7 +4017,7 @@
"type": "github"
}
],
"time": "2021-01-27T12:52:27+00:00"
"time": "2021-01-31T06:07:14+00:00"
},
{
"name": "sebastian/diff",
@ -3970,12 +4025,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
"reference": "9d7fb8ba123928945b9727a3e02501645955f61f"
"reference": "492912a4b41de6a0127ebcd2f766b7d7f10f574c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/9d7fb8ba123928945b9727a3e02501645955f61f",
"reference": "9d7fb8ba123928945b9727a3e02501645955f61f",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/492912a4b41de6a0127ebcd2f766b7d7f10f574c",
"reference": "492912a4b41de6a0127ebcd2f766b7d7f10f574c",
"shasum": ""
},
"require": {
@ -4029,7 +4084,7 @@
"type": "github"
}
],
"time": "2021-01-27T12:50:42+00:00"
"time": "2021-01-31T06:05:32+00:00"
},
{
"name": "sebastian/environment",
@ -4037,12 +4092,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
"reference": "27e27e02ab122412b7ff9c847445e21ecfcc5c68"
"reference": "36ffd0fc651961e864d955e6fd71ef03c367abae"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/27e27e02ab122412b7ff9c847445e21ecfcc5c68",
"reference": "27e27e02ab122412b7ff9c847445e21ecfcc5c68",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/36ffd0fc651961e864d955e6fd71ef03c367abae",
"reference": "36ffd0fc651961e864d955e6fd71ef03c367abae",
"shasum": ""
},
"require": {
@ -4093,7 +4148,7 @@
"type": "github"
}
],
"time": "2021-01-27T12:50:50+00:00"
"time": "2021-01-31T06:05:40+00:00"
},
{
"name": "sebastian/exporter",
@ -4101,12 +4156,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
"reference": "4b97f87ebe0e759d27a96e5cfcb15193fdcc1000"
"reference": "61024af3555edd28c0e2df7ae6a72bb24b1c3f88"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/4b97f87ebe0e759d27a96e5cfcb15193fdcc1000",
"reference": "4b97f87ebe0e759d27a96e5cfcb15193fdcc1000",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/61024af3555edd28c0e2df7ae6a72bb24b1c3f88",
"reference": "61024af3555edd28c0e2df7ae6a72bb24b1c3f88",
"shasum": ""
},
"require": {
@ -4171,7 +4226,7 @@
"type": "github"
}
],
"time": "2021-01-27T12:50:59+00:00"
"time": "2021-01-31T06:05:49+00:00"
},
{
"name": "sebastian/global-state",
@ -4179,12 +4234,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
"reference": "ae53ac14d8df978ebc06a0382997257a2268dc2c"
"reference": "ebe2eda599117719755417db6552cf3e6cea68a3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/ae53ac14d8df978ebc06a0382997257a2268dc2c",
"reference": "ae53ac14d8df978ebc06a0382997257a2268dc2c",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/ebe2eda599117719755417db6552cf3e6cea68a3",
"reference": "ebe2eda599117719755417db6552cf3e6cea68a3",
"shasum": ""
},
"require": {
@ -4236,7 +4291,7 @@
"type": "github"
}
],
"time": "2021-01-27T12:51:08+00:00"
"time": "2021-01-31T06:05:57+00:00"
},
{
"name": "sebastian/lines-of-code",
@ -4244,12 +4299,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/lines-of-code.git",
"reference": "3b537e8cf7d5d40c5937cb238dd86e9849058978"
"reference": "a58591ee219008ebc039a6ef1a1ad5ebd7aa5094"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/3b537e8cf7d5d40c5937cb238dd86e9849058978",
"reference": "3b537e8cf7d5d40c5937cb238dd86e9849058978",
"url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/a58591ee219008ebc039a6ef1a1ad5ebd7aa5094",
"reference": "a58591ee219008ebc039a6ef1a1ad5ebd7aa5094",
"shasum": ""
},
"require": {
@ -4294,7 +4349,7 @@
"type": "github"
}
],
"time": "2021-01-27T12:52:38+00:00"
"time": "2021-01-31T06:07:23+00:00"
},
{
"name": "sebastian/object-enumerator",
@ -4302,12 +4357,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-enumerator.git",
"reference": "f8f7c1ff5e66b5c9145df7329b3bc54844138e21"
"reference": "c3392f76c657681a2fde9073a47d26190580acee"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f8f7c1ff5e66b5c9145df7329b3bc54844138e21",
"reference": "f8f7c1ff5e66b5c9145df7329b3bc54844138e21",
"url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/c3392f76c657681a2fde9073a47d26190580acee",
"reference": "c3392f76c657681a2fde9073a47d26190580acee",
"shasum": ""
},
"require": {
@ -4352,7 +4407,7 @@
"type": "github"
}
],
"time": "2021-01-27T12:51:16+00:00"
"time": "2021-01-31T06:06:06+00:00"
},
{
"name": "sebastian/object-reflector",
@ -4360,12 +4415,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-reflector.git",
"reference": "dbea5f76fb03ccf212b0fc88fb8f2ad256f4f000"
"reference": "0b1e3b35407041b8f28c2d8b9f3d792720c81c23"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/dbea5f76fb03ccf212b0fc88fb8f2ad256f4f000",
"reference": "dbea5f76fb03ccf212b0fc88fb8f2ad256f4f000",
"url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/0b1e3b35407041b8f28c2d8b9f3d792720c81c23",
"reference": "0b1e3b35407041b8f28c2d8b9f3d792720c81c23",
"shasum": ""
},
"require": {
@ -4408,7 +4463,7 @@
"type": "github"
}
],
"time": "2021-01-27T12:51:25+00:00"
"time": "2021-01-31T06:06:15+00:00"
},
{
"name": "sebastian/recursion-context",
@ -4416,12 +4471,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
"reference": "4181599c8f7b66401bf827a3e7e6da85a2303524"
"reference": "5df92f91b2cc5f733bb1d2df3eb81013a2bf69c6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/4181599c8f7b66401bf827a3e7e6da85a2303524",
"reference": "4181599c8f7b66401bf827a3e7e6da85a2303524",
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5df92f91b2cc5f733bb1d2df3eb81013a2bf69c6",
"reference": "5df92f91b2cc5f733bb1d2df3eb81013a2bf69c6",
"shasum": ""
},
"require": {
@ -4472,7 +4527,7 @@
"type": "github"
}
],
"time": "2021-01-27T12:52:00+00:00"
"time": "2021-01-31T06:06:48+00:00"
},
{
"name": "sebastian/resource-operations",
@ -4536,12 +4591,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/type.git",
"reference": "1c469702730295ddaf484d6fddb3b42a1354cd5c"
"reference": "6751662dde805fb5e46e05d3133a89e056796404"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/type/zipball/1c469702730295ddaf484d6fddb3b42a1354cd5c",
"reference": "1c469702730295ddaf484d6fddb3b42a1354cd5c",
"url": "https://api.github.com/repos/sebastianbergmann/type/zipball/6751662dde805fb5e46e05d3133a89e056796404",
"reference": "6751662dde805fb5e46e05d3133a89e056796404",
"shasum": ""
},
"require": {
@ -4585,7 +4640,7 @@
"type": "github"
}
],
"time": "2021-01-27T12:52:09+00:00"
"time": "2021-01-31T06:06:56+00:00"
},
{
"name": "sebastian/version",
@ -4685,12 +4740,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "a056a527ed72d089185d505882b66f3676e22439"
"reference": "56d4c04ca6069c93857c7335a626dbe747fa82d4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/a056a527ed72d089185d505882b66f3676e22439",
"reference": "a056a527ed72d089185d505882b66f3676e22439",
"url": "https://api.github.com/repos/symfony/console/zipball/56d4c04ca6069c93857c7335a626dbe747fa82d4",
"reference": "56d4c04ca6069c93857c7335a626dbe747fa82d4",
"shasum": ""
},
"require": {
@ -4775,7 +4830,7 @@
"type": "tidelift"
}
],
"time": "2021-01-27T09:05:46+00:00"
"time": "2021-01-28T22:09:26+00:00"
},
{
"name": "symfony/polyfill-ctype",
@ -5489,12 +5544,12 @@
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "1a0162a612658790cb1f7b468c7698a7ee58001a"
"reference": "5a60e72afa8511b63217d27bef3f4b7f074e20e1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/1a0162a612658790cb1f7b468c7698a7ee58001a",
"reference": "1a0162a612658790cb1f7b468c7698a7ee58001a",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/5a60e72afa8511b63217d27bef3f4b7f074e20e1",
"reference": "5a60e72afa8511b63217d27bef3f4b7f074e20e1",
"shasum": ""
},
"require": {
@ -5560,7 +5615,7 @@
"type": "tidelift"
}
],
"time": "2021-01-14T07:57:35+00:00"
"time": "2021-02-02T15:25:09+00:00"
},
{
"name": "vimeo/psalm",

View file

@ -286,6 +286,8 @@ services:
- _APP_FUNCTIONS_MEMORY
- _APP_FUNCTIONS_MEMORY_SWAP
- _APP_USAGE_STATS
- DOCKERHUB_PULL_USERNAME
- DOCKERHUB_PULL_PASSWORD
appwrite-worker-mails:
entrypoint: worker-mails

View file

@ -1,3 +1,5 @@
The Functions service allows you to create custom behaviour that can be triggered by any supported Appwrite system events or by a predefined schedule.
Appwrite Cloud Functions lets you automatically run backend code in response to events triggered by Appwrite or by setting it to be executed in a predefined schedule. Your code is stored in a secure and encrypted way on your Appwrite instance and is executed in an isolated enviornment.
Appwrite Cloud Functions lets you automatically run backend code in response to events triggered by Appwrite or by setting it to be executed in a predefined schedule. Your code is stored in a secure way on your Appwrite instance and is executed in an isolated enviornment.
You can learn more by following our [Cloud Functions tutorial](https://appwrite.io/docs/functions).

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.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

View file

@ -144,11 +144,17 @@
border-bottom: solid 1px var(--config-modal-note-border);
}
.ide.strech {
box-shadow: none;
border-radius: 0;
margin: 0 -30px;
}
.ide {
&.strech {
box-shadow: none;
border-radius: 0;
margin: 0 -30px;
}
pre {
overflow: auto;
}
}
button.close {
width: 30px;

View file

@ -0,0 +1,155 @@
<?php
namespace Appwrite\Auth\OAuth2;
use Appwrite\Auth\OAuth2;
// Reference Material
// https://developers.tradeshift.com/docs/api
class Tradeshift extends OAuth2
{
const TRADESHIFT_SANDBOX_API_DOMAIN = 'api-sandbox.tradeshift.com';
const TRADESHIFT_API_DOMAIN = 'api.tradeshift.com';
private $apiDomain = [
'sandbox' => self::TRADESHIFT_SANDBOX_API_DOMAIN,
'live' => self::TRADESHIFT_API_DOMAIN,
];
private $endpoint = [
'sandbox' => 'https://' . self::TRADESHIFT_SANDBOX_API_DOMAIN . '/tradeshift/',
'live' => 'https://' . self::TRADESHIFT_API_DOMAIN . '/tradeshift/',
];
private $resourceEndpoint = [
'sandbox' => 'https://' . self::TRADESHIFT_SANDBOX_API_DOMAIN . '/tradeshift/rest/external/',
'live' => 'https://' . self::TRADESHIFT_API_DOMAIN . '/tradeshift/rest/external/',
];
protected $environment = 'live';
/**
* @var array
*/
protected $user = [];
protected $scopes = [
'openid',
'offline',
];
/**
* @return string
*/
public function getName(): string
{
return 'tradeshift';
}
/**
* @return string
*/
public function getLoginURL(): string
{
$httpQuery = \http_build_query([
'response_type' => 'code',
'client_id' => $this->appID,
'scope' => \implode(' ', $this->getScopes()),
'redirect_uri' => \str_replace("localhost", "127.0.0.1", $this->callback),
'state' => \json_encode($this->state),
]);
$url = $this->endpoint[$this->environment] . 'auth/login?' . $httpQuery;
return $url;
}
/**
* @param string $code
*
* @return string
*/
public function getAccessToken(string $code): string
{
$response = $this->request(
'POST',
$this->endpoint[$this->environment] . 'auth/token',
['Authorization: Basic ' . \base64_encode($this->appID . ':' . $this->appSecret)],
\http_build_query([
'grant_type' => 'authorization_code',
'code' => $code,
])
);
$accessToken = \json_decode($response, true);
return $accessToken['access_token'] ?? '';
}
/**
* @param string $accessToken
*
* @return string
*/
public function getUserID(string $accessToken): string
{
$user = $this->getUser($accessToken);
return $user['Id'] ?? '';
}
/**
* @param string $accessToken
*
* @return string
*/
public function getUserEmail(string $accessToken): string
{
$user = $this->getUser($accessToken);
return $user['Username'] ?? '';
}
/**
* @param string $accessToken
*
* @return string
*/
public function getUserName(string $accessToken): string
{
$user = $this->getUser($accessToken);
$firstName = $user['FirstName'] ?? '';
$lastName = $user['LastName'] ?? '';
return $firstName . ' ' . $lastName;
}
/**
* @param string $accessToken
*
* @return array
*/
protected function getUser(string $accessToken): array
{
$header = [
'Content-Type: application/json',
'Accept: application/json',
'Host: ' . urlencode($this->apiDomain[$this->environment]),
'Authorization: Bearer ' . $accessToken,
];
if (empty($this->user)) {
$response = $this->request(
'GET',
$this->resourceEndpoint[$this->environment] . 'account/info/user',
$header
);
$this->user = \json_decode($response, true);
}
return $this->user;
}
}

View file

@ -0,0 +1,18 @@
<?php
namespace Appwrite\Auth\OAuth2;
use Appwrite\Auth\OAuth2\Tradeshift;
class TradeshiftBox extends Tradeshift
{
protected $environment = 'sandbox';
/**
* @return string
*/
public function getName(): string
{
return 'tradeshiftBox';
}
}

View file

@ -95,7 +95,7 @@ class OpenAPI3 extends Format
$id = $route->getLabel('sdk.method', \uniqid());
$desc = (!empty($route->getLabel('sdk.description', ''))) ? \realpath(__DIR__.'/../../../../'.$route->getLabel('sdk.description', '')) : null;
$produces = $route->getLabel('sdk.response.type', 'application/json');
$produces = $route->getLabel('sdk.response.type', null);
$model = $route->getLabel('sdk.response.model', 'none');
$temp = [

View file

@ -93,14 +93,14 @@ class Swagger2 extends Format
$id = $route->getLabel('sdk.method', \uniqid());
$desc = (!empty($route->getLabel('sdk.description', ''))) ? \realpath(__DIR__.'/../../../../'.$route->getLabel('sdk.description', '')) : null;
$produces = $route->getLabel('sdk.response.type', 'application/json');
$produces = $route->getLabel('sdk.response.type', null);
$model = $route->getLabel('sdk.response.model', 'none');
$temp = [
'summary' => $route->getDesc(),
'operationId' => $route->getLabel('sdk.namespace', 'default').ucfirst($id),
'consumes' => [],
'produces' => [$produces],
'produces' => [],
'tags' => [$route->getLabel('sdk.namespace', 'default')],
'description' => ($desc) ? \file_get_contents($desc) : '',
'responses' => [],
@ -120,6 +120,10 @@ class Swagger2 extends Format
],
];
if($produces) {
$temp['produces'][] = $produces;
}
foreach ($this->models as $key => $value) {
if($value->getType() === $model) {
$model = $value;

View file

@ -83,8 +83,8 @@ class Response extends SwooleResponse
const MODEL_CONTINENT_LIST = 'continentList';
const MODEL_CURRENCY = 'currency';
const MODEL_CURRENCY_LIST = 'currencyList';
const MODEL_LANGUAGE = 'langauge';
const MODEL_LANGUAGE_LIST = 'langaugeList';
const MODEL_LANGUAGE = 'language';
const MODEL_LANGUAGE_LIST = 'languageList';
const MODEL_PHONE = 'phone';
const MODEL_PHONE_LIST = 'phoneList';
@ -104,7 +104,7 @@ class Response extends SwooleResponse
// Project
const MODEL_PROJECT = 'project';
const MODEL_PROJECT_LIST = 'projectsList';
const MODEL_PROJECT_LIST = 'projectList';
const MODEL_WEBHOOK = 'webhook';
const MODEL_WEBHOOK_LIST = 'webhookList';
const MODEL_KEY = 'key';

View file

@ -103,6 +103,10 @@ class V06 extends Filter {
$parsedResponse = $this->parseCurrencyList($content);
break;
case Response::MODEL_LANGUAGE_LIST:
$parsedResponse = $content;
break;
case Response::MODEL_ANY :
$parsedResponse = $content;
break;

View file

@ -23,7 +23,7 @@ class HTTPTest extends Scope
'content-type' => 'application/json',
]), []);
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertEquals(204, $response['headers']['status-code']);
$this->assertEquals('Appwrite', $response['headers']['server']);
$this->assertEquals('GET, POST, PUT, PATCH, DELETE', $response['headers']['access-control-allow-methods']);
$this->assertEquals('Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-Appwrite-JWT, X-SDK-Version, Cache-Control, Expires, Pragma, X-Fallback-Cookies', $response['headers']['access-control-allow-headers']);

View file

@ -308,8 +308,6 @@ class FunctionsCustomServerTest extends Scope
$this->assertEquals('', $execution['body']['stderr']);
$this->assertEquals(0, $execution['body']['time']);
// sleep(75);
// $execution = $this->client->call(Client::METHOD_GET, '/functions/'.$data['functionId'].'/executions/'.$executionId, array_merge([
// 'content-type' => 'application/json',
// 'x-appwrite-project' => $this->getProject()['$id'],
@ -561,7 +559,7 @@ class FunctionsCustomServerTest extends Scope
],
];
sleep(count($envs) * 20);
sleep(count($envs) * 15);
fwrite(STDERR, ".");
/**
@ -643,7 +641,7 @@ class FunctionsCustomServerTest extends Scope
$executionId = $execution['body']['$id'] ?? '';
$this->assertEquals(201, $execution['headers']['status-code']);
sleep(30);
sleep(10);
$executions = $this->client->call(Client::METHOD_GET, '/functions/'.$functionId.'/executions', array_merge([
'content-type' => 'application/json',
@ -742,7 +740,7 @@ class FunctionsCustomServerTest extends Scope
$this->assertEquals(201, $execution['headers']['status-code']);
sleep(15);
sleep(10);
$executions = $this->client->call(Client::METHOD_GET, '/functions/'.$functionId.'/executions', array_merge([
'content-type' => 'application/json',