mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Merge branch '1.6.x' into fix-headers
This commit is contained in:
@@ -16,6 +16,9 @@
|
||||
}
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"url": "https:\/\/cloud.appwrite.io\/v1"
|
||||
},
|
||||
{
|
||||
"url": "https:\/\/<REGION>.cloud.appwrite.io\/v1"
|
||||
}
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
}
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"url": "https:\/\/cloud.appwrite.io\/v1"
|
||||
},
|
||||
{
|
||||
"url": "https:\/\/<REGION>.cloud.appwrite.io\/v1"
|
||||
}
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
}
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"url": "https:\/\/cloud.appwrite.io\/v1"
|
||||
},
|
||||
{
|
||||
"url": "https:\/\/<REGION>.cloud.appwrite.io\/v1"
|
||||
}
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
}
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"url": "https:\/\/cloud.appwrite.io\/v1"
|
||||
},
|
||||
{
|
||||
"url": "https:\/\/<REGION>.cloud.appwrite.io\/v1"
|
||||
}
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
}
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"url": "https:\/\/cloud.appwrite.io\/v1"
|
||||
},
|
||||
{
|
||||
"url": "https:\/\/<REGION>.cloud.appwrite.io\/v1"
|
||||
}
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
}
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"url": "https:\/\/cloud.appwrite.io\/v1"
|
||||
},
|
||||
{
|
||||
"url": "https:\/\/<REGION>.cloud.appwrite.io\/v1"
|
||||
}
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
"url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"
|
||||
}
|
||||
},
|
||||
"host": "<REGION>.cloud.appwrite.io",
|
||||
"host": "cloud.appwrite.io",
|
||||
"x-host-docs": "<REGION>.cloud.appwrite.io",
|
||||
"basePath": "\/v1",
|
||||
"schemes": [
|
||||
"https"
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
"url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"
|
||||
}
|
||||
},
|
||||
"host": "<REGION>.cloud.appwrite.io",
|
||||
"host": "cloud.appwrite.io",
|
||||
"x-host-docs": "<REGION>.cloud.appwrite.io",
|
||||
"basePath": "\/v1",
|
||||
"schemes": [
|
||||
"https"
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
"url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"
|
||||
}
|
||||
},
|
||||
"host": "<REGION>.cloud.appwrite.io",
|
||||
"host": "cloud.appwrite.io",
|
||||
"x-host-docs": "<REGION>.cloud.appwrite.io",
|
||||
"basePath": "\/v1",
|
||||
"schemes": [
|
||||
"https"
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
"url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"
|
||||
}
|
||||
},
|
||||
"host": "<REGION>.cloud.appwrite.io",
|
||||
"host": "cloud.appwrite.io",
|
||||
"x-host-docs": "<REGION>.cloud.appwrite.io",
|
||||
"basePath": "\/v1",
|
||||
"schemes": [
|
||||
"https"
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
"url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"
|
||||
}
|
||||
},
|
||||
"host": "<REGION>.cloud.appwrite.io",
|
||||
"host": "cloud.appwrite.io",
|
||||
"x-host-docs": "<REGION>.cloud.appwrite.io",
|
||||
"basePath": "\/v1",
|
||||
"schemes": [
|
||||
"https"
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
"url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"
|
||||
}
|
||||
},
|
||||
"host": "<REGION>.cloud.appwrite.io",
|
||||
"host": "cloud.appwrite.io",
|
||||
"x-host-docs": "<REGION>.cloud.appwrite.io",
|
||||
"basePath": "\/v1",
|
||||
"schemes": [
|
||||
"https"
|
||||
|
||||
@@ -1445,7 +1445,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
|
||||
Query::notEqual('userInternalId', $user->getInternalId()),
|
||||
]);
|
||||
if (!$identityWithMatchingEmail->isEmpty()) {
|
||||
throw new Exception(Exception::USER_ALREADY_EXISTS);
|
||||
$failureRedirect(Exception::USER_ALREADY_EXISTS);
|
||||
}
|
||||
|
||||
$userWithMatchingEmail = $dbForProject->find('users', [
|
||||
@@ -1453,7 +1453,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
|
||||
Query::notEqual('$id', $userId),
|
||||
]);
|
||||
if (!empty($userWithMatchingEmail)) {
|
||||
throw new Exception(Exception::USER_ALREADY_EXISTS);
|
||||
$failureRedirect(Exception::USER_ALREADY_EXISTS);
|
||||
}
|
||||
|
||||
$sessionUpgrade = true;
|
||||
@@ -1482,7 +1482,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
|
||||
|
||||
if ($user === false || $user->isEmpty()) { // No user logged in or with OAuth2 provider ID, create new one or connect with account with same email
|
||||
if (empty($email)) {
|
||||
throw new Exception(Exception::USER_UNAUTHORIZED, 'OAuth provider failed to return email.');
|
||||
$failureRedirect(Exception::USER_UNAUTHORIZED, 'OAuth provider failed to return email.');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1525,7 +1525,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
|
||||
Query::equal('providerEmail', [$email]),
|
||||
]);
|
||||
if (!$identityWithMatchingEmail->isEmpty()) {
|
||||
throw new Exception(Exception::GENERAL_BAD_REQUEST); /** Return a generic bad request to prevent exposing existing accounts */
|
||||
$failureRedirect(Exception::GENERAL_BAD_REQUEST); /** Return a generic bad request to prevent exposing existing accounts */
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -1597,7 +1597,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
|
||||
Query::notEqual('userInternalId', $user->getInternalId()),
|
||||
]);
|
||||
if (!empty($identitiesWithMatchingEmail)) {
|
||||
throw new Exception(Exception::GENERAL_BAD_REQUEST); /** Return a generic bad request to prevent exposing existing accounts */
|
||||
$failureRedirect(Exception::GENERAL_BAD_REQUEST); /** Return a generic bad request to prevent exposing existing accounts */
|
||||
}
|
||||
|
||||
$dbForProject->createDocument('identities', new Document([
|
||||
|
||||
@@ -1296,8 +1296,7 @@ App::post('/v1/functions/:functionId/deployments')
|
||||
->inject('deviceForFunctions')
|
||||
->inject('deviceForLocal')
|
||||
->inject('queueForBuilds')
|
||||
->inject('plan')
|
||||
->action(function (string $functionId, ?string $entrypoint, ?string $commands, mixed $code, mixed $activate, Request $request, Response $response, Database $dbForProject, Event $queueForEvents, Document $project, Device $deviceForFunctions, Device $deviceForLocal, Build $queueForBuilds, array $plan) {
|
||||
->action(function (string $functionId, ?string $entrypoint, ?string $commands, mixed $code, mixed $activate, Request $request, Response $response, Database $dbForProject, Event $queueForEvents, Document $project, Device $deviceForFunctions, Device $deviceForLocal, Build $queueForBuilds) {
|
||||
|
||||
$activate = \strval($activate) === 'true' || \strval($activate) === '1';
|
||||
|
||||
@@ -1330,14 +1329,8 @@ App::post('/v1/functions/:functionId/deployments')
|
||||
throw new Exception(Exception::STORAGE_FILE_EMPTY, 'No file sent');
|
||||
}
|
||||
|
||||
$functionSizeLimit = (int) System::getEnv('_APP_FUNCTIONS_SIZE_LIMIT', '30000000');
|
||||
|
||||
if (isset($plan['functionSize'])) {
|
||||
$functionSizeLimit = $plan['functionSize'] * 1000 * 1000;
|
||||
}
|
||||
|
||||
$fileExt = new FileExt([FileExt::TYPE_GZIP]);
|
||||
$fileSizeValidator = new FileSize($functionSizeLimit);
|
||||
$fileSizeValidator = new FileSize(System::getEnv('_APP_FUNCTIONS_SIZE_LIMIT', '30000000'));
|
||||
$upload = new Upload();
|
||||
|
||||
// Make sure we handle a single file and multiple files the same way
|
||||
|
||||
@@ -266,10 +266,6 @@ Server::setResource('timelimit', function (\Redis $redis) {
|
||||
|
||||
Server::setResource('log', fn () => new Log());
|
||||
|
||||
Server::setResource('plan', function (array $plan = []) {
|
||||
return [];
|
||||
});
|
||||
|
||||
Server::setResource('publisher', function (Group $pools) {
|
||||
return $pools->get('publisher')->pop()->getResource();
|
||||
}, ['pools']);
|
||||
|
||||
@@ -12,6 +12,8 @@ class Audit extends Event
|
||||
protected string $ip = '';
|
||||
protected string $hostname = '';
|
||||
|
||||
protected bool $critical = false;
|
||||
|
||||
public function __construct(protected Publisher $publisher)
|
||||
{
|
||||
parent::__construct($publisher);
|
||||
|
||||
@@ -57,6 +57,9 @@ class Event
|
||||
protected ?string $userId = null;
|
||||
protected bool $paused = false;
|
||||
|
||||
/** @var bool Non-critical events will not throw an exception when enqueuing of the event fails. */
|
||||
protected bool $critical = true;
|
||||
|
||||
/**
|
||||
* @param Publisher $publisher
|
||||
* @return void
|
||||
@@ -351,7 +354,14 @@ class Event
|
||||
// Merge the base payload with any trimmed values
|
||||
$payload = array_merge($this->preparePayload(), $this->trimPayload());
|
||||
|
||||
return $this->publisher->enqueue($queue, $payload);
|
||||
try {
|
||||
return $this->publisher->enqueue($queue, $payload);
|
||||
} catch (\Throwable $th) {
|
||||
if ($this->critical) {
|
||||
throw $th;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,15 +2,22 @@
|
||||
|
||||
namespace Appwrite\Event;
|
||||
|
||||
use Appwrite\Messaging\Adapter;
|
||||
use Appwrite\Messaging\Adapter\Realtime as RealtimeAdapter;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Exception;
|
||||
|
||||
class Realtime extends Event
|
||||
{
|
||||
protected array $subscribers = [];
|
||||
|
||||
private Adapter $realtime;
|
||||
|
||||
protected bool $critical = false;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->realtime = new Adapter\Realtime();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,7 +64,7 @@ class Realtime extends Event
|
||||
* Execute Event.
|
||||
*
|
||||
* @return string|bool
|
||||
* @throws InvalidArgumentException
|
||||
* @throws Exception
|
||||
*/
|
||||
public function trigger(): string|bool
|
||||
{
|
||||
@@ -87,7 +94,7 @@ class Realtime extends Event
|
||||
: [$target['projectId'] ?? $this->getProject()->getId()];
|
||||
|
||||
foreach ($projectIds as $projectId) {
|
||||
RealtimeAdapter::send(
|
||||
$this->realtime->send(
|
||||
projectId: $projectId,
|
||||
payload: $this->getRealtimePayload(),
|
||||
events: $allEvents,
|
||||
|
||||
@@ -6,6 +6,8 @@ use Utopia\Queue\Publisher;
|
||||
|
||||
class StatsResources extends Event
|
||||
{
|
||||
protected bool $critical = false;
|
||||
|
||||
public function __construct(protected Publisher $publisher)
|
||||
{
|
||||
parent::__construct($publisher);
|
||||
|
||||
@@ -11,6 +11,8 @@ class StatsUsage extends Event
|
||||
protected array $reduce = [];
|
||||
protected array $disabled = [];
|
||||
|
||||
protected bool $critical = false;
|
||||
|
||||
public function __construct(protected Publisher $publisher)
|
||||
{
|
||||
parent::__construct($publisher);
|
||||
|
||||
@@ -6,5 +6,5 @@ abstract class Adapter
|
||||
{
|
||||
abstract public function subscribe(string $projectId, mixed $identifier, array $roles, array $channels): void;
|
||||
abstract public function unsubscribe(mixed $identifier): void;
|
||||
abstract public static function send(string $projectId, array $payload, array $events, array $channels, array $roles, array $options): void;
|
||||
abstract public function send(string $projectId, array $payload, array $events, array $channels, array $roles, array $options): void;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ use Utopia\Database\DateTime;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Helpers\Role;
|
||||
use Utopia\Pools\Pool;
|
||||
|
||||
class Realtime extends Adapter
|
||||
{
|
||||
@@ -35,6 +36,14 @@ class Realtime extends Adapter
|
||||
*/
|
||||
public array $subscriptions = [];
|
||||
|
||||
private Pool $pubsubPool;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
global $register;
|
||||
$this->pubsubPool = $register->get('pools')->get('pubsub');
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a subscription.
|
||||
*
|
||||
@@ -129,7 +138,7 @@ class Realtime extends Adapter
|
||||
* @param array $options
|
||||
* @return void
|
||||
*/
|
||||
public static function send(string $projectId, array $payload, array $events, array $channels, array $roles, array $options = []): void
|
||||
public function send(string $projectId, array $payload, array $events, array $channels, array $roles, array $options = []): void
|
||||
{
|
||||
if (empty($channels) || empty($roles) || empty($projectId)) {
|
||||
return;
|
||||
@@ -138,26 +147,20 @@ class Realtime extends Adapter
|
||||
$permissionsChanged = array_key_exists('permissionsChanged', $options) && $options['permissionsChanged'];
|
||||
$userId = array_key_exists('userId', $options) ? $options['userId'] : null;
|
||||
|
||||
global $register;
|
||||
$pubsub = $register->get('pools')->get('pubsub')->pop();
|
||||
try {
|
||||
/** @var \Appwrite\PubSub\Adapter $redis */
|
||||
$redis = $pubsub->getResource();
|
||||
$redis->publish('realtime', json_encode([
|
||||
'project' => $projectId,
|
||||
'roles' => $roles,
|
||||
'permissionsChanged' => $permissionsChanged,
|
||||
'userId' => $userId,
|
||||
'data' => [
|
||||
'events' => $events,
|
||||
'channels' => $channels,
|
||||
'timestamp' => DateTime::formatTz(DateTime::now()),
|
||||
'payload' => $payload
|
||||
]
|
||||
]));
|
||||
} finally {
|
||||
$pubsub->reclaim();
|
||||
}
|
||||
$message = [
|
||||
'project' => $projectId,
|
||||
'roles' => $roles,
|
||||
'permissionsChanged' => $permissionsChanged,
|
||||
'userId' => $userId,
|
||||
'data' => [
|
||||
'events' => $events,
|
||||
'channels' => $channels,
|
||||
'timestamp' => DateTime::formatTz(DateTime::now()),
|
||||
'payload' => $payload
|
||||
]
|
||||
];
|
||||
|
||||
$this->pubsubPool->use(fn (\Appwrite\PubSub\Adapter $pubsub) => $pubsub->publish('realtime', json_encode($message)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -289,7 +289,8 @@ class Specs extends Action
|
||||
$formatInstance
|
||||
->setParam('name', APP_NAME)
|
||||
->setParam('description', 'Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)')
|
||||
->setParam('endpoint', 'https://<REGION>.cloud.appwrite.io/v1')
|
||||
->setParam('endpoint', 'https://cloud.appwrite.io/v1')
|
||||
->setParam('endpoint.docs', 'https://<REGION>.cloud.appwrite.io/v1')
|
||||
->setParam('version', APP_VERSION_STABLE)
|
||||
->setParam('terms', $endpoint . '/policy/terms')
|
||||
->setParam('support.email', $email)
|
||||
|
||||
@@ -60,9 +60,8 @@ class Builds extends Action
|
||||
->inject('isResourceBlocked')
|
||||
->inject('log')
|
||||
->inject('executor')
|
||||
->inject('plan')
|
||||
->callback(fn ($message, Document $project, Database $dbForPlatform, Event $queueForEvents, Webhook $queueForWebhooks, Func $queueForFunctions, Realtime $queueForRealtime, StatsUsage $usage, Cache $cache, Database $dbForProject, Device $deviceForFunctions, callable $isResourceBlocked, Log $log, Executor $executor, array $plan) =>
|
||||
$this->action($message, $project, $dbForPlatform, $queueForEvents, $queueForWebhooks, $queueForFunctions, $queueForRealtime, $usage, $cache, $dbForProject, $deviceForFunctions, $isResourceBlocked, $log, $executor, $plan));
|
||||
->callback(fn ($message, Document $project, Database $dbForPlatform, Event $queueForEvents, Webhook $queueForWebhooks, Func $queueForFunctions, Realtime $queueForRealtime, StatsUsage $usage, Cache $cache, Database $dbForProject, Device $deviceForFunctions, callable $isResourceBlocked, Log $log, Executor $executor) =>
|
||||
$this->action($message, $project, $dbForPlatform, $queueForEvents, $queueForWebhooks, $queueForFunctions, $queueForRealtime, $usage, $cache, $dbForProject, $deviceForFunctions, $isResourceBlocked, $log, $executor));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,11 +78,10 @@ class Builds extends Action
|
||||
* @param Device $deviceForFunctions
|
||||
* @param Log $log
|
||||
* @param Executor $executor
|
||||
* @param array $plan
|
||||
* @return void
|
||||
* @throws \Utopia\Database\Exception
|
||||
*/
|
||||
public function action(Message $message, Document $project, Database $dbForPlatform, Event $queueForEvents, Webhook $queueForWebhooks, Func $queueForFunctions, Realtime $queueForRealtime, StatsUsage $queueForStatsUsage, Cache $cache, Database $dbForProject, Device $deviceForFunctions, callable $isResourceBlocked, Log $log, Executor $executor, array $plan): void
|
||||
public function action(Message $message, Document $project, Database $dbForPlatform, Event $queueForEvents, Webhook $queueForWebhooks, Func $queueForFunctions, Realtime $queueForRealtime, StatsUsage $queueForStatsUsage, Cache $cache, Database $dbForProject, Device $deviceForFunctions, callable $isResourceBlocked, Log $log, Executor $executor): void
|
||||
{
|
||||
$payload = $message->getPayload() ?? [];
|
||||
|
||||
@@ -104,7 +102,7 @@ class Builds extends Action
|
||||
case BUILD_TYPE_RETRY:
|
||||
Console::info('Creating build for deployment: ' . $deployment->getId());
|
||||
$github = new GitHub($cache);
|
||||
$this->buildDeployment($deviceForFunctions, $queueForWebhooks, $queueForFunctions, $queueForRealtime, $queueForEvents, $queueForStatsUsage, $dbForPlatform, $dbForProject, $github, $project, $resource, $deployment, $template, $isResourceBlocked, $log, $executor, $plan);
|
||||
$this->buildDeployment($deviceForFunctions, $queueForWebhooks, $queueForFunctions, $queueForRealtime, $queueForEvents, $queueForStatsUsage, $dbForPlatform, $dbForProject, $github, $project, $resource, $deployment, $template, $isResourceBlocked, $log, $executor);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -128,12 +126,11 @@ class Builds extends Action
|
||||
* @param Document $template
|
||||
* @param Log $log
|
||||
* @param Executor $executor
|
||||
* @param array $plan
|
||||
* @return void
|
||||
* @throws \Utopia\Database\Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function buildDeployment(Device $deviceForFunctions, Webhook $queueForWebhooks, Func $queueForFunctions, Realtime $queueForRealtime, Event $queueForEvents, StatsUsage $queueForStatsUsage, Database $dbForPlatform, Database $dbForProject, GitHub $github, Document $project, Document $function, Document $deployment, Document $template, callable $isResourceBlocked, Log $log, Executor $executor, array $plan): void
|
||||
protected function buildDeployment(Device $deviceForFunctions, Webhook $queueForWebhooks, Func $queueForFunctions, Realtime $queueForRealtime, Event $queueForEvents, StatsUsage $queueForStatsUsage, Database $dbForPlatform, Database $dbForProject, GitHub $github, Document $project, Document $function, Document $deployment, Document $template, callable $isResourceBlocked, Log $log, Executor $executor): void
|
||||
{
|
||||
$functionId = $function->getId();
|
||||
$log->addTag('functionId', $function->getId());
|
||||
@@ -404,15 +401,9 @@ class Builds extends Action
|
||||
}
|
||||
|
||||
$directorySize = $localDevice->getDirectorySize($tmpDirectory);
|
||||
|
||||
$functionsSizeLimit = (int)System::getEnv('_APP_FUNCTIONS_SIZE_LIMIT', '30000000');
|
||||
|
||||
if (isset($plan['functionSize'])) {
|
||||
$functionsSizeLimit = (int) $plan['functionSize'] * 1000 * 1000;
|
||||
}
|
||||
|
||||
if ($directorySize > $functionsSizeLimit) {
|
||||
throw new \Exception('Repository directory size should be less than ' . number_format($functionsSizeLimit / (1000 * 1000), 2) . ' MBs.');
|
||||
throw new \Exception('Repository directory size should be less than ' . number_format($functionsSizeLimit / 1048576, 2) . ' MBs.');
|
||||
}
|
||||
|
||||
Console::execute('find ' . \escapeshellarg($tmpDirectory) . ' -type d -name ".git" -exec rm -rf {} +', '', $stdout, $stderr);
|
||||
@@ -629,11 +620,8 @@ class Builds extends Action
|
||||
$durationEnd = \microtime(true);
|
||||
|
||||
$buildSizeLimit = (int)System::getEnv('_APP_FUNCTIONS_BUILD_SIZE_LIMIT', '2000000000');
|
||||
if (isset($plan['buildSize'])) {
|
||||
$buildSizeLimit = $plan['buildSize'] * 1000 * 1000;
|
||||
}
|
||||
if ($response['size'] > $buildSizeLimit) {
|
||||
throw new \Exception('Build size should be less than ' . number_format($buildSizeLimit / (1000 * 1000), 2) . ' MBs.');
|
||||
throw new \Exception('Build size should be less than ' . number_format($buildSizeLimit / 1048576, 2) . ' MBs.');
|
||||
}
|
||||
|
||||
/** Update the build document */
|
||||
|
||||
@@ -16,7 +16,7 @@ class Method
|
||||
* Initialise a new SDK method
|
||||
*
|
||||
* @param string $namespace
|
||||
* @param string|null $group
|
||||
* @param ?string $group
|
||||
* @param string $name
|
||||
* @param string $description
|
||||
* @param array<AuthType> $auth
|
||||
@@ -34,7 +34,7 @@ class Method
|
||||
*/
|
||||
public function __construct(
|
||||
protected string $namespace,
|
||||
protected string|null $group,
|
||||
protected ?string $group,
|
||||
protected string $name,
|
||||
protected string $description,
|
||||
protected array $auth,
|
||||
@@ -128,7 +128,7 @@ class Method
|
||||
return $this->namespace;
|
||||
}
|
||||
|
||||
public function getGroup(): string|null
|
||||
public function getGroup(): ?string
|
||||
{
|
||||
return $this->group;
|
||||
}
|
||||
|
||||
@@ -84,6 +84,9 @@ class OpenAPI3 extends Format
|
||||
[
|
||||
'url' => $this->getParam('endpoint', ''),
|
||||
],
|
||||
[
|
||||
'url' => $this->getParam('endpoint.docs', ''),
|
||||
],
|
||||
],
|
||||
'paths' => [],
|
||||
'tags' => $this->services,
|
||||
|
||||
@@ -80,6 +80,7 @@ class Swagger2 extends Format
|
||||
],
|
||||
],
|
||||
'host' => \parse_url($this->getParam('endpoint', ''), PHP_URL_HOST),
|
||||
'x-host-docs' => \parse_url($this->getParam('endpoint.docs', ''), PHP_URL_HOST),
|
||||
'basePath' => \parse_url($this->getParam('endpoint', ''), PHP_URL_PATH),
|
||||
'schemes' => [\parse_url($this->getParam('endpoint', ''), PHP_URL_SCHEME)],
|
||||
'consumes' => ['application/json', 'multipart/form-data'],
|
||||
|
||||
Reference in New Issue
Block a user