1
0
Fork 0
mirror of synced 2024-05-29 17:09:48 +12:00

Merge branch '0.7.x' of github.com:appwrite/appwrite into feat-execute-functions-from-client

This commit is contained in:
Eldad Fux 2020-12-30 07:50:54 +02:00
commit 6d94c12409
4 changed files with 6 additions and 9 deletions

View file

@ -115,6 +115,7 @@ App::get('/v1/database/collections')
$results = $projectDB->getCollection([
'limit' => $limit,
'offset' => $offset,
'orderType' => $orderType,
'search' => $search,
'filters' => [
'$collection='.Database::SYSTEM_COLLECTION_COLLECTIONS,

View file

@ -96,6 +96,7 @@ App::get('/v1/functions')
$results = $projectDB->getCollection([
'limit' => $limit,
'offset' => $offset,
'orderType' => $orderType,
'search' => $search,
'filters' => [
'$collection='.Database::SYSTEM_COLLECTION_FUNCTIONS,
@ -507,6 +508,7 @@ App::get('/v1/functions/:functionId/tags')
$results = $projectDB->getCollection([
'limit' => $limit,
'offset' => $offset,
'orderType' => $orderType,
'search' => $search,
'filters' => [
'$collection='.Database::SYSTEM_COLLECTION_TAGS,
@ -721,6 +723,7 @@ App::get('/v1/functions/:functionId/executions')
$results = $projectDB->getCollection([
'limit' => $limit,
'offset' => $offset,
'orderType' => $orderType,
'search' => $search,
'filters' => [
'$collection='.Database::SYSTEM_COLLECTION_EXECUTIONS,

View file

@ -114,6 +114,7 @@ App::get('/v1/projects')
$results = $consoleDB->getCollection([
'limit' => $limit,
'offset' => $offset,
'orderType' => $orderType,
'search' => $search,
'filters' => [
'$collection='.Database::SYSTEM_COLLECTION_PROJECTS,

View file

@ -425,10 +425,9 @@ App::get('/v1/storage/files/:fileId/view')
->label('sdk.response.type', '*/*')
->label('sdk.methodType', 'location')
->param('fileId', '', new UID(), 'File unique ID.')
->param('as', '', new WhiteList(['pdf', /*'html',*/ 'text'], true), 'Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.', true)
->inject('response')
->inject('projectDB')
->action(function ($fileId, $as, $response, $projectDB) {
->action(function ($fileId, $response, $projectDB) {
/** @var Appwrite\Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@ -470,13 +469,6 @@ App::get('/v1/storage/files/:fileId/view')
$output = $compressor->decompress($source);
$fileName = $file->getAttribute('name', '');
$contentTypes = [
'pdf' => 'application/pdf',
'text' => 'text/plain',
];
$contentType = (\array_key_exists($as, $contentTypes)) ? $contentTypes[$as] : $contentType;
// Response
$response
->setContentType($contentType)