mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Merge branch '1.8.x' into feat-update-preview-url-in-vcs-controller
This commit is contained in:
@@ -435,6 +435,11 @@ return [
|
||||
'description' => 'The requested favicon could not be found.',
|
||||
'code' => 404,
|
||||
],
|
||||
Exception::AVATAR_SVG_SANITIZATION_FAILED => [
|
||||
'name' => Exception::AVATAR_SVG_SANITIZATION_FAILED,
|
||||
'description' => 'SVG sanitization failed.',
|
||||
'code' => 400,
|
||||
],
|
||||
|
||||
/** Storage */
|
||||
Exception::STORAGE_FILE_ALREADY_EXISTS => [
|
||||
|
||||
@@ -9948,17 +9948,20 @@
|
||||
"type": "integer",
|
||||
"description": "Row automatically incrementing ID.",
|
||||
"x-example": 1,
|
||||
"format": "int32"
|
||||
"format": "int32",
|
||||
"readOnly": true
|
||||
},
|
||||
"$tableId": {
|
||||
"type": "string",
|
||||
"description": "Table ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$databaseId": {
|
||||
"type": "string",
|
||||
"description": "Database ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$createdAt": {
|
||||
"type": "string",
|
||||
|
||||
@@ -47120,17 +47120,20 @@
|
||||
"type": "integer",
|
||||
"description": "Row automatically incrementing ID.",
|
||||
"x-example": 1,
|
||||
"format": "int32"
|
||||
"format": "int32",
|
||||
"readOnly": true
|
||||
},
|
||||
"$tableId": {
|
||||
"type": "string",
|
||||
"description": "Table ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$databaseId": {
|
||||
"type": "string",
|
||||
"description": "Database ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$createdAt": {
|
||||
"type": "string",
|
||||
|
||||
@@ -35978,17 +35978,20 @@
|
||||
"type": "integer",
|
||||
"description": "Row automatically incrementing ID.",
|
||||
"x-example": 1,
|
||||
"format": "int32"
|
||||
"format": "int32",
|
||||
"readOnly": true
|
||||
},
|
||||
"$tableId": {
|
||||
"type": "string",
|
||||
"description": "Table ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$databaseId": {
|
||||
"type": "string",
|
||||
"description": "Database ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$createdAt": {
|
||||
"type": "string",
|
||||
|
||||
@@ -9948,17 +9948,20 @@
|
||||
"type": "integer",
|
||||
"description": "Row automatically incrementing ID.",
|
||||
"x-example": 1,
|
||||
"format": "int32"
|
||||
"format": "int32",
|
||||
"readOnly": true
|
||||
},
|
||||
"$tableId": {
|
||||
"type": "string",
|
||||
"description": "Table ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$databaseId": {
|
||||
"type": "string",
|
||||
"description": "Database ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$createdAt": {
|
||||
"type": "string",
|
||||
|
||||
@@ -47120,17 +47120,20 @@
|
||||
"type": "integer",
|
||||
"description": "Row automatically incrementing ID.",
|
||||
"x-example": 1,
|
||||
"format": "int32"
|
||||
"format": "int32",
|
||||
"readOnly": true
|
||||
},
|
||||
"$tableId": {
|
||||
"type": "string",
|
||||
"description": "Table ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$databaseId": {
|
||||
"type": "string",
|
||||
"description": "Database ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$createdAt": {
|
||||
"type": "string",
|
||||
|
||||
@@ -35978,17 +35978,20 @@
|
||||
"type": "integer",
|
||||
"description": "Row automatically incrementing ID.",
|
||||
"x-example": 1,
|
||||
"format": "int32"
|
||||
"format": "int32",
|
||||
"readOnly": true
|
||||
},
|
||||
"$tableId": {
|
||||
"type": "string",
|
||||
"description": "Table ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$databaseId": {
|
||||
"type": "string",
|
||||
"description": "Database ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$createdAt": {
|
||||
"type": "string",
|
||||
|
||||
@@ -9944,17 +9944,20 @@
|
||||
"type": "integer",
|
||||
"description": "Row automatically incrementing ID.",
|
||||
"x-example": 1,
|
||||
"format": "int32"
|
||||
"format": "int32",
|
||||
"readOnly": true
|
||||
},
|
||||
"$tableId": {
|
||||
"type": "string",
|
||||
"description": "Table ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$databaseId": {
|
||||
"type": "string",
|
||||
"description": "Database ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$createdAt": {
|
||||
"type": "string",
|
||||
|
||||
@@ -47166,17 +47166,20 @@
|
||||
"type": "integer",
|
||||
"description": "Row automatically incrementing ID.",
|
||||
"x-example": 1,
|
||||
"format": "int32"
|
||||
"format": "int32",
|
||||
"readOnly": true
|
||||
},
|
||||
"$tableId": {
|
||||
"type": "string",
|
||||
"description": "Table ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$databaseId": {
|
||||
"type": "string",
|
||||
"description": "Database ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$createdAt": {
|
||||
"type": "string",
|
||||
|
||||
@@ -36115,17 +36115,20 @@
|
||||
"type": "integer",
|
||||
"description": "Row automatically incrementing ID.",
|
||||
"x-example": 1,
|
||||
"format": "int32"
|
||||
"format": "int32",
|
||||
"readOnly": true
|
||||
},
|
||||
"$tableId": {
|
||||
"type": "string",
|
||||
"description": "Table ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$databaseId": {
|
||||
"type": "string",
|
||||
"description": "Database ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$createdAt": {
|
||||
"type": "string",
|
||||
|
||||
@@ -9944,17 +9944,20 @@
|
||||
"type": "integer",
|
||||
"description": "Row automatically incrementing ID.",
|
||||
"x-example": 1,
|
||||
"format": "int32"
|
||||
"format": "int32",
|
||||
"readOnly": true
|
||||
},
|
||||
"$tableId": {
|
||||
"type": "string",
|
||||
"description": "Table ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$databaseId": {
|
||||
"type": "string",
|
||||
"description": "Database ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$createdAt": {
|
||||
"type": "string",
|
||||
|
||||
@@ -47166,17 +47166,20 @@
|
||||
"type": "integer",
|
||||
"description": "Row automatically incrementing ID.",
|
||||
"x-example": 1,
|
||||
"format": "int32"
|
||||
"format": "int32",
|
||||
"readOnly": true
|
||||
},
|
||||
"$tableId": {
|
||||
"type": "string",
|
||||
"description": "Table ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$databaseId": {
|
||||
"type": "string",
|
||||
"description": "Database ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$createdAt": {
|
||||
"type": "string",
|
||||
|
||||
@@ -36115,17 +36115,20 @@
|
||||
"type": "integer",
|
||||
"description": "Row automatically incrementing ID.",
|
||||
"x-example": 1,
|
||||
"format": "int32"
|
||||
"format": "int32",
|
||||
"readOnly": true
|
||||
},
|
||||
"$tableId": {
|
||||
"type": "string",
|
||||
"description": "Table ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$databaseId": {
|
||||
"type": "string",
|
||||
"description": "Database ID.",
|
||||
"x-example": "5e5ea5c15117e"
|
||||
"x-example": "5e5ea5c15117e",
|
||||
"readOnly": true
|
||||
},
|
||||
"$createdAt": {
|
||||
"type": "string",
|
||||
|
||||
@@ -474,7 +474,7 @@ App::get('/v1/avatars/favicon')
|
||||
$sanitizer->minify(true);
|
||||
$cleanSvg = $sanitizer->sanitize($data);
|
||||
if ($cleanSvg === false) {
|
||||
throw new \Exception('SVG sanitization failed');
|
||||
throw new Exception(Exception::AVATAR_SVG_SANITIZATION_FAILED);
|
||||
}
|
||||
$response
|
||||
->addHeader('Cache-Control', 'private, max-age=2592000') // 30 days
|
||||
|
||||
@@ -3011,7 +3011,7 @@ App::post('/v1/messaging/messages/email')
|
||||
->inject('project')
|
||||
->inject('queueForMessaging')
|
||||
->inject('response')
|
||||
->action(function (string $messageId, string $subject, string $content, array $topics, array $users, array $targets, array $cc, array $bcc, array $attachments, bool $draft, bool $html, ?string $scheduledAt, Event $queueForEvents, Database $dbForProject, Database $dbForPlatform, Document $project, Messaging $queueForMessaging, Response $response) {
|
||||
->action(function (string $messageId, string $subject, string $content, ?array $topics, ?array $users, ?array $targets, ?array $cc, ?array $bcc, ?array $attachments, bool $draft, bool $html, ?string $scheduledAt, Event $queueForEvents, Database $dbForProject, Database $dbForPlatform, Document $project, Messaging $queueForMessaging, Response $response) {
|
||||
$messageId = $messageId == 'unique()'
|
||||
? ID::unique()
|
||||
: $messageId;
|
||||
@@ -3184,7 +3184,7 @@ App::post('/v1/messaging/messages/sms')
|
||||
->inject('project')
|
||||
->inject('queueForMessaging')
|
||||
->inject('response')
|
||||
->action(function (string $messageId, string $content, array $topics, array $users, array $targets, bool $draft, ?string $scheduledAt, Event $queueForEvents, Database $dbForProject, Database $dbForPlatform, Document $project, Messaging $queueForMessaging, Response $response) {
|
||||
->action(function (string $messageId, string $content, ?array $topics, ?array $users, ?array $targets, bool $draft, ?string $scheduledAt, Event $queueForEvents, Database $dbForProject, Database $dbForPlatform, Document $project, Messaging $queueForMessaging, Response $response) {
|
||||
$messageId = $messageId == 'unique()'
|
||||
? ID::unique()
|
||||
: $messageId;
|
||||
@@ -3319,7 +3319,7 @@ App::post('/v1/messaging/messages/push')
|
||||
->inject('project')
|
||||
->inject('queueForMessaging')
|
||||
->inject('response')
|
||||
->action(function (string $messageId, string $title, string $body, array $topics, array $users, array $targets, ?array $data, string $action, string $image, string $icon, string $sound, string $color, string $tag, int $badge, bool $draft, ?string $scheduledAt, bool $contentAvailable, bool $critical, string $priority, Event $queueForEvents, Database $dbForProject, Database $dbForPlatform, Document $project, Messaging $queueForMessaging, Response $response) {
|
||||
->action(function (string $messageId, string $title, string $body, ?array $topics, ?array $users, ?array $targets, ?array $data, string $action, string $image, string $icon, string $sound, string $color, string $tag, int $badge, bool $draft, ?string $scheduledAt, bool $contentAvailable, bool $critical, string $priority, Event $queueForEvents, Database $dbForProject, Database $dbForPlatform, Document $project, Messaging $queueForMessaging, Response $response) {
|
||||
$messageId = $messageId == 'unique()'
|
||||
? ID::unique()
|
||||
: $messageId;
|
||||
|
||||
@@ -1060,26 +1060,6 @@ App::init()
|
||||
$response->addHeader('Access-Control-Allow-Origin', '*');
|
||||
}
|
||||
|
||||
/**
|
||||
* Deprecation Warning
|
||||
*/
|
||||
/** @var \Appwrite\SDK\Method $sdk */
|
||||
$sdk = $route->getLabel('sdk', false);
|
||||
$deprecationWarning = 'This route is deprecated. See the updated documentation for improved compatibility and migration details.';
|
||||
$sdkItems = is_array($sdk) ? $sdk : (!empty($sdk) ? [$sdk] : []);
|
||||
if (!empty($sdkItems) && count($sdkItems) > 0) {
|
||||
$allDeprecated = true;
|
||||
foreach ($sdkItems as $sdkItem) {
|
||||
if (!$sdkItem->isDeprecated()) {
|
||||
$allDeprecated = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($allDeprecated) {
|
||||
$warnings[] = $deprecationWarning;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($warnings)) {
|
||||
$response->addHeader('X-Appwrite-Warning', implode(';', $warnings));
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ use Utopia\Database\DateTime;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Helpers\Role;
|
||||
use Utopia\Database\Validator\Authorization;
|
||||
use Utopia\Queue\Broker\Pool as BrokerPool;
|
||||
use Utopia\Queue\Publisher;
|
||||
use Utopia\System\System;
|
||||
use Utopia\Telemetry\Adapter as Telemetry;
|
||||
@@ -416,6 +415,7 @@ App::init()
|
||||
->inject('user')
|
||||
->inject('publisher')
|
||||
->inject('publisherFunctions')
|
||||
->inject('publisherWebhooks')
|
||||
->inject('queueForEvents')
|
||||
->inject('queueForMessaging')
|
||||
->inject('queueForAudits')
|
||||
@@ -431,7 +431,7 @@ App::init()
|
||||
->inject('plan')
|
||||
->inject('devKey')
|
||||
->inject('telemetry')
|
||||
->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, BrokerPool $publisherFunctions, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode, ?Key $apiKey, array $plan, Document $devKey, Telemetry $telemetry) use ($usageDatabaseListener, $eventDatabaseListener) {
|
||||
->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Publisher $publisherFunctions, Publisher $publisherWebhooks, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode, ?Key $apiKey, array $plan, Document $devKey, Telemetry $telemetry) use ($usageDatabaseListener, $eventDatabaseListener) {
|
||||
|
||||
$route = $utopia->getRoute();
|
||||
|
||||
@@ -544,7 +544,7 @@ App::init()
|
||||
// from overwriting the events that are supposed to be triggered in the shutdown hook.
|
||||
$queueForEventsClone = new Event($publisher);
|
||||
$queueForFunctions = new Func($publisherFunctions);
|
||||
$queueForWebhooks = new Webhook($publisher);
|
||||
$queueForWebhooks = new Webhook($publisherWebhooks);
|
||||
$queueForRealtime = new Realtime();
|
||||
|
||||
$dbForProject
|
||||
|
||||
+10
-7
@@ -84,25 +84,28 @@ App::setResource('localeCodes', function () {
|
||||
App::setResource('publisher', function (Group $pools) {
|
||||
return new BrokerPool(publisher: $pools->get('publisher'));
|
||||
}, ['pools']);
|
||||
App::setResource('publisherDatabases', function (BrokerPool $publisher) {
|
||||
App::setResource('publisherDatabases', function (Publisher $publisher) {
|
||||
return $publisher;
|
||||
}, ['publisher']);
|
||||
App::setResource('publisherFunctions', function (BrokerPool $publisher) {
|
||||
App::setResource('publisherFunctions', function (Publisher $publisher) {
|
||||
return $publisher;
|
||||
}, ['publisher']);
|
||||
App::setResource('publisherMigrations', function (BrokerPool $publisher) {
|
||||
App::setResource('publisherMigrations', function (Publisher $publisher) {
|
||||
return $publisher;
|
||||
}, ['publisher']);
|
||||
App::setResource('publisherStatsUsage', function (BrokerPool $publisher) {
|
||||
App::setResource('publisherStatsUsage', function (Publisher $publisher) {
|
||||
return $publisher;
|
||||
}, ['publisher']);
|
||||
App::setResource('publisherMails', function (BrokerPool $publisher) {
|
||||
App::setResource('publisherMails', function (Publisher $publisher) {
|
||||
return $publisher;
|
||||
}, ['publisher']);
|
||||
App::setResource('publisherDeletes', function (BrokerPool $publisher) {
|
||||
App::setResource('publisherDeletes', function (Publisher $publisher) {
|
||||
return $publisher;
|
||||
}, ['publisher']);
|
||||
App::setResource('publisherMessaging', function (BrokerPool $publisher) {
|
||||
App::setResource('publisherMessaging', function (Publisher $publisher) {
|
||||
return $publisher;
|
||||
}, ['publisher']);
|
||||
App::setResource('publisherWebhooks', function (Publisher $publisher) {
|
||||
return $publisher;
|
||||
}, ['publisher']);
|
||||
App::setResource('queueForMessaging', function (Publisher $publisher) {
|
||||
|
||||
Reference in New Issue
Block a user