From 36e3d9c6034273eeb889de7542f5eb2ba106ee14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 27 Nov 2024 16:27:40 +0100 Subject: [PATCH 1/8] WIP: Server-side rendering for sites --- .env | 2 +- app/config/frameworks.php | 11 ++++++-- app/config/site-templates.php | 12 ++++---- app/controllers/general.php | 28 +++++++++++++++++-- docker-compose.yml | 1 + .../Modules/Functions/Workers/Builds.php | 21 +++++++------- 6 files changed, 53 insertions(+), 22 deletions(-) diff --git a/.env b/.env index 4b82bda47a..dc66155208 100644 --- a/.env +++ b/.env @@ -77,7 +77,7 @@ _APP_COMPUTE_INACTIVE_THRESHOLD=600 _APP_COMPUTE_MAINTENANCE_INTERVAL=600 _APP_COMPUTE_RUNTIMES_NETWORK=runtimes _APP_EXECUTOR_SECRET=your-secret-key -_APP_EXECUTOR_HOST=http://proxy/v1 +_APP_EXECUTOR_HOST=http://exc1/v1 _APP_FUNCTIONS_RUNTIMES=php-8.0,node-18.0,python-3.9,ruby-3.1 _APP_SITES_RUNTIMES=static-1,node-22,flutter-3.24 _APP_SITES_FRAMEWORKS=sveltekit,nextjs,nuxt,astro,angular,remix,static diff --git a/app/config/frameworks.php b/app/config/frameworks.php index 13c6b69825..742b00aae0 100644 --- a/app/config/frameworks.php +++ b/app/config/frameworks.php @@ -28,6 +28,8 @@ return [ 'defaultBuildCommand' => 'npm run build', 'defaultInstallCommand' => 'npm install', 'defaultOutputDirectory' => './build', + 'startCommand' => 'cd src/function && node index.js', + 'bundleCommand' => 'cp package*.json build/ && cp -R node_modules/ build/node_modules/', ], 'nextjs' => [ 'key' => 'nextjs', @@ -73,15 +75,20 @@ return [ 'astro' => [ 'key' => 'astro', 'name' => 'Astro', - 'defaultServeRuntime' => 'static-1', + 'defaultServeRuntime' => 'node-22', 'serveRuntimes' => [ - 'static-1' + ...getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'static-1', ], 'defaultBuildRuntime' => 'node-22', 'buildRuntimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), 'defaultBuildCommand' => 'npm run build', 'defaultInstallCommand' => 'npm install', 'defaultOutputDirectory' => './dist', + // 'startCommand' => 'sh helpers/server-astro.sh', + // 'bundleCommand' => 'sh helpers/bundle-astro.sh', + 'startCommand' => 'cd src/function && HOST=0.0.0.0 PORT=3000 node server/entry.mjs', + 'bundleCommand' => 'cp package*.json dist/server/ && cp -R node_modules/ dist/server/node_modules/', ], 'remix' => [ 'key' => 'remix', diff --git a/app/config/site-templates.php b/app/config/site-templates.php index 8a71fa556a..7e943437ab 100644 --- a/app/config/site-templates.php +++ b/app/config/site-templates.php @@ -8,7 +8,7 @@ const TEMPLATE_FRAMEWORKS = [ 'buildCommand' => 'npm run build', 'outputDirectory' => './build', 'buildRuntime' => 'node-22', - 'serveRuntime' => 'static-1', + 'serveRuntime' => 'node-22', 'fallbackFile' => null, ], 'NEXTJS' => [ @@ -48,7 +48,7 @@ const TEMPLATE_FRAMEWORKS = [ 'buildCommand' => 'npm run build', 'outputDirectory' => './dist', 'buildRuntime' => 'node-22', - 'serveRuntime' => 'static-1', + 'serveRuntime' => 'node-22', 'fallbackFile' => null, ], /* @@ -130,7 +130,7 @@ return [ 'vcsProvider' => 'github', 'providerRepositoryId' => 'templates-for-sites', 'providerOwner' => 'appwrite', - 'providerVersion' => '0.1.*', + 'providerVersion' => '0.2.*', 'variables' => [], ], [ @@ -141,12 +141,12 @@ return [ 'demoImage' => 'https://qa17.appwrite.org/console/images/sites/templates/astro-starter.png', 'frameworks' => [ getFramework('ASTRO', [ - 'providerRootDirectory' => './astro/starter', + 'providerRootDirectory' => './', ]), ], 'vcsProvider' => 'github', - 'providerRepositoryId' => 'templates-for-sites', - 'providerOwner' => 'appwrite', + 'providerRepositoryId' => 'astro-ssr-test-template', + 'providerOwner' => 'Meldiron', 'providerVersion' => '0.1.*', 'variables' => [], ], diff --git a/app/controllers/general.php b/app/controllers/general.php index 0d42357b95..71782414e7 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -336,9 +336,28 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo 'site' => '', 'deployment' => '' }; - $runtimeEntrypoint = match ($version) { - 'v2' => '', - default => 'cp /tmp/code.tar.gz /mnt/code/code.tar.gz && nohup helpers/start.sh "' . $runtime['startCommand'] . '"' + + if($type === 'function') { + $runtimeEntrypoint = match ($version) { + 'v2' => '', + default => 'cp /tmp/code.tar.gz /mnt/code/code.tar.gz && nohup helpers/start.sh "' . $runtime['startCommand'] . '"' + }; + } else if($type === 'site' || $type === 'deployment') { + $frameworks = Config::getParam('frameworks', []); + $framework = $frameworks[$resource->getAttribute('framework', '')] ?? null; + + $startCommand = $runtime['startCommand']; + if(!is_null($framework) && !empty($framework['startCommand'])) { + $startCommand = $framework['startCommand']; + } + + $runtimeEntrypoint = 'cp /tmp/code.tar.gz /mnt/code/code.tar.gz && nohup helpers/start.sh "' . $startCommand . '"'; + } + + $entrypoint = match($type) { + 'function' => $deployment->getAttribute('entrypoint', ''), + 'site' => '', + 'deployment' => '' }; $executionResponse = $executor->createExecution( @@ -446,6 +465,9 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo $response->setHeader($header['name'], $header['value']); } + // TODO: Figoure out situation with transfer-encoding + // TODO: Dont double-compress + $response ->setContentType($contentType) ->setStatusCode($execution['responseStatusCode'] ?? 200) diff --git a/docker-compose.yml b/docker-compose.yml index 227c07fb2a..9c8c133ee6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -84,6 +84,7 @@ services: - ./public:/usr/src/code/public - ./src:/usr/src/code/src - ./dev:/usr/src/code/dev + - ./vendor/utopia-php/framework:/usr/src/code/vendor/utopia-php/framework depends_on: - mariadb - redis diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index 2fcbf4bb36..3d2937f80b 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -870,20 +870,21 @@ class Builds extends Action if ($resource->getCollection() === 'functions') { return $deployment->getAttribute('commands', ''); } elseif ($resource->getCollection() === 'sites') { - $command = ''; + $commands = []; + + $commands[] = $deployment->getAttribute('installCommand', ''); + $commands[] = $deployment->getAttribute('buildCommand', ''); - $installCommand = $deployment->getAttribute('installCommand', ''); - $buildCommand = $deployment->getAttribute('buildCommand', ''); - - $command .= $installCommand; - - if (!empty($installCommand) && !empty($buildCommand)) { - $command .= ' && '; + $frameworks = Config::getParam('frameworks', []); + $framework = $frameworks[$resource->getAttribute('framework', '')] ?? null; + + if(!is_null($framework) && !empty($framework['bundleCommand'])) { + $commands[] = $framework['bundleCommand']; } - $command .= $buildCommand; + $commands = array_filter($commands, fn($command) => !empty($command)); - return $command; + return implode(' && ', $commands); } return ''; From 4a117adb2860f7ddc37fd692d307448c999600cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 2 Dec 2024 13:20:54 +0100 Subject: [PATCH 2/8] Support SSR --- .env | 2 +- app/config/collections.php | 10 +- app/config/frameworks.php | 217 ++++++++------- app/config/site-templates.php | 57 ++-- .../specs/open-api3-latest-console.json | 248 +++++------------ app/config/specs/open-api3-latest-server.json | 236 +++++----------- app/config/specs/swagger2-latest-console.json | 251 +++++------------- app/config/specs/swagger2-latest-server.json | 239 +++++------------ app/controllers/general.php | 23 +- composer.lock | 189 ++++++------- docker-compose.yml | 3 +- .../Modules/Functions/Workers/Builds.php | 7 +- .../Modules/Sites/Http/Sites/CreateSite.php | 13 +- .../Modules/Sites/Http/Sites/UpdateSite.php | 12 +- src/Appwrite/Utopia/Response.php | 3 + .../Utopia/Response/Model/Framework.php | 50 +--- .../Response/Model/FrameworkAdapter.php | 65 +++++ src/Appwrite/Utopia/Response/Model/Site.php | 8 +- .../Response/Model/TemplateFramework.php | 12 +- 19 files changed, 625 insertions(+), 1020 deletions(-) create mode 100644 src/Appwrite/Utopia/Response/Model/FrameworkAdapter.php diff --git a/.env b/.env index dc66155208..2d2e335186 100644 --- a/.env +++ b/.env @@ -80,7 +80,7 @@ _APP_EXECUTOR_SECRET=your-secret-key _APP_EXECUTOR_HOST=http://exc1/v1 _APP_FUNCTIONS_RUNTIMES=php-8.0,node-18.0,python-3.9,ruby-3.1 _APP_SITES_RUNTIMES=static-1,node-22,flutter-3.24 -_APP_SITES_FRAMEWORKS=sveltekit,nextjs,nuxt,astro,angular,remix,static +_APP_SITES_FRAMEWORKS=sveltekit,nextjs,nuxt,astro,remix,static,flutter # TODO: Angular _APP_MAINTENANCE_INTERVAL=86400 _APP_MAINTENANCE_DELAY= _APP_MAINTENANCE_RETENTION_CACHE=2592000 diff --git a/app/config/collections.php b/app/config/collections.php index e5a3d8ac7b..8fad49fada 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -3425,7 +3425,7 @@ $projectCollections = array_merge([ 'filters' => [], ], [ - '$id' => ID::custom('serveRuntime'), + '$id' => ID::custom('buildRuntime'), 'type' => Database::VAR_STRING, 'format' => '', 'size' => 2048, @@ -3436,13 +3436,13 @@ $projectCollections = array_merge([ 'filters' => [], ], [ - '$id' => ID::custom('buildRuntime'), + '$id' => ID::custom('adapter'), // ssr or static 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 2048, + 'size' => 128, 'signed' => true, - 'required' => true, - 'default' => '', + 'required' => false, + 'default' => null, 'array' => false, 'filters' => [], ], diff --git a/app/config/frameworks.php b/app/config/frameworks.php index 742b00aae0..02df80793f 100644 --- a/app/config/frameworks.php +++ b/app/config/frameworks.php @@ -4,6 +4,8 @@ * List of Appwrite Sites supported frameworks */ +// TODO: @Meldiron Angular + use Utopia\Config\Config; $templateRuntimes = Config::getParam('template-runtimes'); @@ -19,114 +21,137 @@ return [ 'sveltekit' => [ 'key' => 'sveltekit', 'name' => 'SvelteKit', - 'defaultServeRuntime' => 'static-1', - 'serveRuntimes' => [ - 'static-1' - ], - 'defaultBuildRuntime' => 'node-22', - 'buildRuntimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), - 'defaultBuildCommand' => 'npm run build', - 'defaultInstallCommand' => 'npm install', - 'defaultOutputDirectory' => './build', - 'startCommand' => 'cd src/function && node index.js', - 'bundleCommand' => 'cp package*.json build/ && cp -R node_modules/ build/node_modules/', + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'adapters' => [ + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './build', + 'startCommand' => 'sh helpers/server.sh', + 'bundleCommand' => '', + ], + 'ssr' => [ + 'key' => 'ssr', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './build', + 'startCommand' => 'sh helpers/sveltekit/server.sh', + 'bundleCommand' => 'sh /usr/local/server/helpers/sveltekit/bundle.sh', + ] + ] ], - 'nextjs' => [ - 'key' => 'nextjs', - 'name' => 'Next.js', - 'defaultServeRuntime' => 'static-1', - 'serveRuntimes' => [ - 'static-1' - ], - 'defaultBuildRuntime' => 'node-22', - 'buildRuntimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), - 'defaultBuildCommand' => 'npm run build', - 'defaultInstallCommand' => 'npm install', - 'defaultOutputDirectory' => './out', - ], - 'nuxt' => [ - 'key' => 'nuxt', - 'name' => 'Nuxt', - 'defaultServeRuntime' => 'static-1', - 'serveRuntimes' => [ - 'static-1' - ], - 'defaultBuildRuntime' => 'node-22', - 'buildRuntimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), - 'defaultBuildCommand' => 'npm run generate', - 'defaultInstallCommand' => 'npm install', - 'defaultOutputDirectory' => './dist', - ], - /* - 'angular' => [ - 'key' => 'angular', - 'name' => 'Angular', - 'defaultServeRuntime' => 'static-1', - 'serveRuntimes' => [ - 'static-1' - ], - 'defaultBuildRuntime' => 'node-22', - 'buildRuntimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), - 'defaultBuildCommand' => 'npm run build', - 'defaultInstallCommand' => 'npm install', - 'defaultOutputDirectory' => './dist/starter/browser', - ], - */ 'astro' => [ 'key' => 'astro', 'name' => 'Astro', - 'defaultServeRuntime' => 'node-22', - 'serveRuntimes' => [ - ...getVersions($templateRuntimes['NODE']['versions'], 'node'), - 'static-1', - ], - 'defaultBuildRuntime' => 'node-22', - 'buildRuntimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), - 'defaultBuildCommand' => 'npm run build', - 'defaultInstallCommand' => 'npm install', - 'defaultOutputDirectory' => './dist', - // 'startCommand' => 'sh helpers/server-astro.sh', - // 'bundleCommand' => 'sh helpers/bundle-astro.sh', - 'startCommand' => 'cd src/function && HOST=0.0.0.0 PORT=3000 node server/entry.mjs', - 'bundleCommand' => 'cp package*.json dist/server/ && cp -R node_modules/ dist/server/node_modules/', + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'adapters' => [ + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist', + 'startCommand' => 'sh helpers/server.sh', + 'bundleCommand' => '', + ], + 'ssr' => [ + 'key' => 'ssr', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist', + 'startCommand' => 'sh helpers/astro/server.sh', + 'bundleCommand' => 'sh /usr/local/server/helpers/astro/bundle.sh', + ] + ] ], 'remix' => [ 'key' => 'remix', 'name' => 'Remix', - 'defaultServeRuntime' => 'static-1', - 'serveRuntimes' => [ - 'static-1' - ], - 'defaultBuildRuntime' => 'node-22', - 'buildRuntimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), - 'defaultBuildCommand' => 'npm run build', - 'defaultInstallCommand' => 'npm install', - 'defaultOutputDirectory' => './build/client', + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'adapters' => [ + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './build/client', + 'startCommand' => 'sh helpers/server.sh', + 'bundleCommand' => '', + ], + 'ssr' => [ + 'key' => 'ssr', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './build', + 'startCommand' => 'sh helpers/remix/server.sh', + 'bundleCommand' => 'sh /usr/local/server/helpers/remix/bundle.sh', + ] + ] + ], + 'nuxt' => [ + 'key' => 'nuxt', + 'name' => 'Nuxt', + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'adapters' => [ + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run generate', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist', + 'startCommand' => 'sh helpers/server.sh', + 'bundleCommand' => '', + ], + 'ssr' => [ + 'key' => 'ssr', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './.output', + 'startCommand' => 'sh helpers/nuxt/server.sh', + 'bundleCommand' => 'sh /usr/local/server/helpers/nuxt/bundle.sh', + ] + ] + ], + 'nextjs' => [ + 'key' => 'nextjs', + 'name' => 'Next.js', + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'adapters' => [ + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './out', + 'startCommand' => 'sh helpers/server.sh', + 'bundleCommand' => '', + ], + 'ssr' => [ + 'key' => 'ssr', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './.next', + 'startCommand' => 'sh helpers/next-js/server.sh', + 'bundleCommand' => 'sh /usr/local/server/helpers/next-js/bundle.sh', + ] + ] ], 'flutter' => [ 'key' => 'flutter', 'name' => 'Flutter', - 'defaultServeRuntime' => 'static-1', - 'serveRuntimes' => [ - 'static-1' + 'buildRuntime' => 'flutter-3.24', + 'runtimes' => getVersions($templateRuntimes['FLUTTER']['versions'], 'flutter'), + 'adapters' => [ + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'flutter build web', + 'installCommand' => '', + 'outputDirectory' => './build/web', + 'startCommand' => 'sh helpers/server.sh', + 'bundleCommand' => '', + ], ], - 'defaultBuildRuntime' => 'flutter-3.24', - 'buildRuntimes' => getVersions($templateRuntimes['FLUTTER']['versions'], 'flutter'), - 'defaultBuildCommand' => 'flutter build web', - 'defaultInstallCommand' => '', - 'defaultOutputDirectory' => './build/web', - ], - 'static' => [ - 'key' => 'static', - 'name' => 'Static', - 'defaultServeRuntime' => 'static-1', - 'serveRuntimes' => [ - 'static-1' - ], - 'defaultBuildRuntime' => 'node-22', - 'buildRuntimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), - 'defaultBuildCommand' => 'npm run build', - 'defaultInstallCommand' => 'npm install', - 'defaultOutputDirectory' => './build', ] ]; diff --git a/app/config/site-templates.php b/app/config/site-templates.php index 7e943437ab..88b882765f 100644 --- a/app/config/site-templates.php +++ b/app/config/site-templates.php @@ -1,5 +1,11 @@ [ 'key' => 'sveltekit', @@ -8,7 +14,7 @@ const TEMPLATE_FRAMEWORKS = [ 'buildCommand' => 'npm run build', 'outputDirectory' => './build', 'buildRuntime' => 'node-22', - 'serveRuntime' => 'node-22', + 'adapter' => 'ssr', 'fallbackFile' => null, ], 'NEXTJS' => [ @@ -16,19 +22,19 @@ const TEMPLATE_FRAMEWORKS = [ 'name' => 'Next.js', 'installCommand' => 'npm install', 'buildCommand' => 'npm run build', - 'outputDirectory' => './out', + 'outputDirectory' => './.next', 'buildRuntime' => 'node-22', - 'serveRuntime' => 'static-1', + 'adapter' => 'ssr', 'fallbackFile' => null, ], 'NUXT' => [ 'key' => 'nuxt', 'name' => 'Nuxt', 'installCommand' => 'npm install', - 'buildCommand' => 'npm run generate', - 'outputDirectory' => './dist', + 'buildCommand' => 'npm run build', + 'outputDirectory' => './.output', 'buildRuntime' => 'node-22', - 'serveRuntime' => 'static-1', + 'adapter' => 'ssr', 'fallbackFile' => null, ], 'REMIX' => [ @@ -36,9 +42,9 @@ const TEMPLATE_FRAMEWORKS = [ 'name' => 'Remix', 'installCommand' => 'npm install', 'buildCommand' => 'npm run build', - 'outputDirectory' => './build/client', + 'outputDirectory' => './build', 'buildRuntime' => 'node-22', - 'serveRuntime' => 'static-1', + 'adapter' => 'ssr', 'fallbackFile' => null, ], 'ASTRO' => [ @@ -48,21 +54,9 @@ const TEMPLATE_FRAMEWORKS = [ 'buildCommand' => 'npm run build', 'outputDirectory' => './dist', 'buildRuntime' => 'node-22', - 'serveRuntime' => 'node-22', + 'adapter' => 'ssr', 'fallbackFile' => null, ], - /* - 'ANGULAR' => [ - 'key' => 'angular', - 'name' => 'Angular', - 'installCommand' => 'npm install', - 'buildCommand' => 'npm run build', - 'outputDirectory' => './dist/starter/browser', - 'buildRuntime' => 'node-22', - 'serveRuntime' => 'static-1', - 'fallbackFile' => null, - ], - */ 'FLUTTER' => [ 'key' => 'flutter', 'name' => 'Flutter', @@ -70,7 +64,7 @@ const TEMPLATE_FRAMEWORKS = [ 'buildCommand' => 'flutter build web', 'outputDirectory' => './build/web', 'buildRuntime' => 'flutter-3.24', - 'serveRuntime' => 'static-1', + 'adapter' => 'static', 'fallbackFile' => null, ], ]; @@ -167,25 +161,6 @@ return [ 'providerVersion' => '0.1.*', 'variables' => [], ], - /* - [ - 'key' => 'angular-starter', - 'name' => 'Angular starter website', - 'useCases' => ['starter'], - 'demoUrl' => 'https://angular-starter.sites.qa17.appwrite.org/', - 'demoImage' => 'https://qa17.appwrite.org/console/images/sites/templates/angular-starter.png', - 'frameworks' => [ - getFramework('ANGULAR', [ - 'providerRootDirectory' => './angular/starter', - ]), - ], - 'vcsProvider' => 'github', - 'providerRepositoryId' => 'templates-for-sites', - 'providerOwner' => 'appwrite', - 'providerVersion' => '0.1.*', - 'variables' => [], - ], - */ [ 'key' => 'flutter-starter', 'name' => 'Flutter starter website', diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index d549badef6..3ed57047ff 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -25314,12 +25314,11 @@ "x-example": "sveltekit", "enum": [ "sveltekit", - "nextjs", - "nuxt", "astro", "remix", - "flutter", - "static" + "nuxt", + "nextjs", + "flutter" ], "x-enum-name": null, "x-enum-keys": [] @@ -25422,73 +25421,10 @@ "x-enum-name": null, "x-enum-keys": [] }, - "serveRuntime": { + "adapter": { "type": "string", - "description": "Runtime to use when serving site.", - "x-example": "node-14.5", - "enum": [ - "node-14.5", - "node-16.0", - "node-18.0", - "node-19.0", - "node-20.0", - "node-21.0", - "node-22", - "php-8.0", - "php-8.1", - "php-8.2", - "php-8.3", - "ruby-3.0", - "ruby-3.1", - "ruby-3.2", - "ruby-3.3", - "python-3.8", - "python-3.9", - "python-3.10", - "python-3.11", - "python-3.12", - "python-ml-3.11", - "deno-1.21", - "deno-1.24", - "deno-1.35", - "deno-1.40", - "deno-1.46", - "deno-2.0", - "dart-2.15", - "dart-2.16", - "dart-2.17", - "dart-2.18", - "dart-3.0", - "dart-3.1", - "dart-3.3", - "dart-3.5", - "dotnet-6.0", - "dotnet-7.0", - "dotnet-8.0", - "java-8.0", - "java-11.0", - "java-17.0", - "java-18.0", - "java-21.0", - "java-22", - "swift-5.5", - "swift-5.8", - "swift-5.9", - "swift-5.10", - "kotlin-1.6", - "kotlin-1.8", - "kotlin-1.9", - "kotlin-2.0", - "cpp-17", - "cpp-20", - "bun-1.0", - "bun-1.1", - "go-1.23", - "static-1", - "flutter-3.24" - ], - "x-enum-name": null, - "x-enum-keys": [] + "description": "Framework adapter. Usuallly allows: static, ssr", + "x-example": "" }, "installationId": { "type": "string", @@ -25551,7 +25487,7 @@ "name", "framework", "buildRuntime", - "serveRuntime" + "adapter" ] } } @@ -25987,12 +25923,11 @@ "x-example": "sveltekit", "enum": [ "sveltekit", - "nextjs", - "nuxt", "astro", "remix", - "flutter", - "static" + "nuxt", + "nextjs", + "flutter" ], "x-enum-name": null, "x-enum-keys": [] @@ -26090,73 +26025,10 @@ "x-enum-name": null, "x-enum-keys": [] }, - "serveRuntime": { + "adapter": { "type": "string", - "description": "Runtime to use when serving site.", - "x-example": "node-14.5", - "enum": [ - "node-14.5", - "node-16.0", - "node-18.0", - "node-19.0", - "node-20.0", - "node-21.0", - "node-22", - "php-8.0", - "php-8.1", - "php-8.2", - "php-8.3", - "ruby-3.0", - "ruby-3.1", - "ruby-3.2", - "ruby-3.3", - "python-3.8", - "python-3.9", - "python-3.10", - "python-3.11", - "python-3.12", - "python-ml-3.11", - "deno-1.21", - "deno-1.24", - "deno-1.35", - "deno-1.40", - "deno-1.46", - "deno-2.0", - "dart-2.15", - "dart-2.16", - "dart-2.17", - "dart-2.18", - "dart-3.0", - "dart-3.1", - "dart-3.3", - "dart-3.5", - "dotnet-6.0", - "dotnet-7.0", - "dotnet-8.0", - "java-8.0", - "java-11.0", - "java-17.0", - "java-18.0", - "java-21.0", - "java-22", - "swift-5.5", - "swift-5.8", - "swift-5.9", - "swift-5.10", - "kotlin-1.6", - "kotlin-1.8", - "kotlin-1.9", - "kotlin-2.0", - "cpp-17", - "cpp-20", - "bun-1.0", - "bun-1.1", - "go-1.23", - "static-1", - "flutter-3.24" - ], - "x-enum-name": null, - "x-enum-keys": [] + "description": "Framework adapter. Usuallly allows: static, ssr", + "x-example": "" }, "fallbackFile": { "type": "string", @@ -26196,7 +26068,8 @@ }, "required": [ "name", - "framework" + "framework", + "adapter" ] } } @@ -37516,10 +37389,10 @@ "description": "Site build runtime.", "x-example": "node-22" }, - "serveRuntime": { + "adapter": { "type": "string", - "description": "Site serve runtime.", - "x-example": "static-1" + "description": "Site framework adapter.", + "x-example": "static" }, "fallbackFile": { "type": "string", @@ -37548,7 +37421,7 @@ "providerSilentMode", "specification", "buildRuntime", - "serveRuntime", + "adapter", "fallbackFile" ] }, @@ -37669,16 +37542,16 @@ "description": "Path to site in VCS (Version Control System) repository", "x-example": ".\/svelte-kit\/starter" }, - "serveRuntime": { - "type": "string", - "description": "Runtime used during serve of template deployment.", - "x-example": "static-1" - }, "buildRuntime": { "type": "string", "description": "Runtime used during build step of template.", "x-example": "node-22" }, + "adapter": { + "type": "string", + "description": "Site framework runtime", + "x-example": "ssr" + }, "fallbackFile": { "type": "string", "description": "Fallback file for SPA. Only relevant for static serve runtime.", @@ -37692,8 +37565,8 @@ "buildCommand", "outputDirectory", "providerRootDirectory", - "serveRuntime", "buildRuntime", + "adapter", "fallbackFile" ] }, @@ -38287,7 +38160,7 @@ "properties": { "key": { "type": "string", - "description": "Parent framework key.", + "description": "Framework key.", "x-example": "sveltekit" }, "name": { @@ -38295,48 +38168,66 @@ "description": "Framework Name.", "x-example": "SvelteKit" }, - "logo": { - "type": "string", - "description": "Name of the logo image.", - "x-example": "sveltekit.png" - }, - "serveRuntimes": { + "runtimes": { "type": "array", "description": "List of supported runtime versions.", "items": { "type": "string" }, - "x-example": "static-1" + "x-example": [ + "static-1", + "node-22" + ] }, - "buildRuntimes": { + "adapters": { "type": "array", - "description": "List of supported runtime versions.", + "description": "List of supported adapters.", "items": { - "type": "string" + "$ref": "#\/components\/schemas\/frameworkAdapter" }, - "x-example": "node-21.0" - }, - "defaultServeRuntime": { + "x-example": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } + }, + "required": [ + "key", + "name", + "runtimes", + "adapters" + ] + }, + "frameworkAdapter": { + "description": "Framework Adapter", + "type": "object", + "properties": { + "key": { "type": "string", - "description": "Default runtime version.", - "x-example": "static-1" + "description": "Adapter key.", + "x-example": "static" }, - "defaultBuildRuntime": { + "buildRuntime": { "type": "string", "description": "Default runtime version.", "x-example": "node-22" }, - "defaultInstallCommand": { + "installCommand": { "type": "string", "description": "Default command to download dependencies.", "x-example": "npm install" }, - "defaultBuildCommand": { + "buildCommand": { "type": "string", "description": "Default command to build site into output directory.", "x-example": "npm run build" }, - "defaultOutputDirectory": { + "outputDirectory": { "type": "string", "description": "Default output directory of build.", "x-example": ".\/dist" @@ -38344,15 +38235,10 @@ }, "required": [ "key", - "name", - "logo", - "serveRuntimes", - "buildRuntimes", - "defaultServeRuntime", - "defaultBuildRuntime", - "defaultInstallCommand", - "defaultBuildCommand", - "defaultOutputDirectory" + "buildRuntime", + "installCommand", + "buildCommand", + "outputDirectory" ] }, "deployment": { diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 316071d12b..ce226e8655 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -17130,12 +17130,11 @@ "x-example": "sveltekit", "enum": [ "sveltekit", - "nextjs", - "nuxt", "astro", "remix", - "flutter", - "static" + "nuxt", + "nextjs", + "flutter" ], "x-enum-name": null, "x-enum-keys": [] @@ -17238,73 +17237,10 @@ "x-enum-name": null, "x-enum-keys": [] }, - "serveRuntime": { + "adapter": { "type": "string", - "description": "Runtime to use when serving site.", - "x-example": "node-14.5", - "enum": [ - "node-14.5", - "node-16.0", - "node-18.0", - "node-19.0", - "node-20.0", - "node-21.0", - "node-22", - "php-8.0", - "php-8.1", - "php-8.2", - "php-8.3", - "ruby-3.0", - "ruby-3.1", - "ruby-3.2", - "ruby-3.3", - "python-3.8", - "python-3.9", - "python-3.10", - "python-3.11", - "python-3.12", - "python-ml-3.11", - "deno-1.21", - "deno-1.24", - "deno-1.35", - "deno-1.40", - "deno-1.46", - "deno-2.0", - "dart-2.15", - "dart-2.16", - "dart-2.17", - "dart-2.18", - "dart-3.0", - "dart-3.1", - "dart-3.3", - "dart-3.5", - "dotnet-6.0", - "dotnet-7.0", - "dotnet-8.0", - "java-8.0", - "java-11.0", - "java-17.0", - "java-18.0", - "java-21.0", - "java-22", - "swift-5.5", - "swift-5.8", - "swift-5.9", - "swift-5.10", - "kotlin-1.6", - "kotlin-1.8", - "kotlin-1.9", - "kotlin-2.0", - "cpp-17", - "cpp-20", - "bun-1.0", - "bun-1.1", - "go-1.23", - "static-1", - "flutter-3.24" - ], - "x-enum-name": null, - "x-enum-keys": [] + "description": "Framework adapter. Usuallly allows: static, ssr", + "x-example": "" }, "installationId": { "type": "string", @@ -17367,7 +17303,7 @@ "name", "framework", "buildRuntime", - "serveRuntime" + "adapter" ] } } @@ -17568,12 +17504,11 @@ "x-example": "sveltekit", "enum": [ "sveltekit", - "nextjs", - "nuxt", "astro", "remix", - "flutter", - "static" + "nuxt", + "nextjs", + "flutter" ], "x-enum-name": null, "x-enum-keys": [] @@ -17671,73 +17606,10 @@ "x-enum-name": null, "x-enum-keys": [] }, - "serveRuntime": { + "adapter": { "type": "string", - "description": "Runtime to use when serving site.", - "x-example": "node-14.5", - "enum": [ - "node-14.5", - "node-16.0", - "node-18.0", - "node-19.0", - "node-20.0", - "node-21.0", - "node-22", - "php-8.0", - "php-8.1", - "php-8.2", - "php-8.3", - "ruby-3.0", - "ruby-3.1", - "ruby-3.2", - "ruby-3.3", - "python-3.8", - "python-3.9", - "python-3.10", - "python-3.11", - "python-3.12", - "python-ml-3.11", - "deno-1.21", - "deno-1.24", - "deno-1.35", - "deno-1.40", - "deno-1.46", - "deno-2.0", - "dart-2.15", - "dart-2.16", - "dart-2.17", - "dart-2.18", - "dart-3.0", - "dart-3.1", - "dart-3.3", - "dart-3.5", - "dotnet-6.0", - "dotnet-7.0", - "dotnet-8.0", - "java-8.0", - "java-11.0", - "java-17.0", - "java-18.0", - "java-21.0", - "java-22", - "swift-5.5", - "swift-5.8", - "swift-5.9", - "swift-5.10", - "kotlin-1.6", - "kotlin-1.8", - "kotlin-1.9", - "kotlin-2.0", - "cpp-17", - "cpp-20", - "bun-1.0", - "bun-1.1", - "go-1.23", - "static-1", - "flutter-3.24" - ], - "x-enum-name": null, - "x-enum-keys": [] + "description": "Framework adapter. Usuallly allows: static, ssr", + "x-example": "" }, "fallbackFile": { "type": "string", @@ -17777,7 +17649,8 @@ }, "required": [ "name", - "framework" + "framework", + "adapter" ] } } @@ -27750,10 +27623,10 @@ "description": "Site build runtime.", "x-example": "node-22" }, - "serveRuntime": { + "adapter": { "type": "string", - "description": "Site serve runtime.", - "x-example": "static-1" + "description": "Site framework adapter.", + "x-example": "static" }, "fallbackFile": { "type": "string", @@ -27782,7 +27655,7 @@ "providerSilentMode", "specification", "buildRuntime", - "serveRuntime", + "adapter", "fallbackFile" ] }, @@ -28016,7 +27889,7 @@ "properties": { "key": { "type": "string", - "description": "Parent framework key.", + "description": "Framework key.", "x-example": "sveltekit" }, "name": { @@ -28024,48 +27897,66 @@ "description": "Framework Name.", "x-example": "SvelteKit" }, - "logo": { - "type": "string", - "description": "Name of the logo image.", - "x-example": "sveltekit.png" - }, - "serveRuntimes": { + "runtimes": { "type": "array", "description": "List of supported runtime versions.", "items": { "type": "string" }, - "x-example": "static-1" + "x-example": [ + "static-1", + "node-22" + ] }, - "buildRuntimes": { + "adapters": { "type": "array", - "description": "List of supported runtime versions.", + "description": "List of supported adapters.", "items": { - "type": "string" + "$ref": "#\/components\/schemas\/frameworkAdapter" }, - "x-example": "node-21.0" - }, - "defaultServeRuntime": { + "x-example": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } + }, + "required": [ + "key", + "name", + "runtimes", + "adapters" + ] + }, + "frameworkAdapter": { + "description": "Framework Adapter", + "type": "object", + "properties": { + "key": { "type": "string", - "description": "Default runtime version.", - "x-example": "static-1" + "description": "Adapter key.", + "x-example": "static" }, - "defaultBuildRuntime": { + "buildRuntime": { "type": "string", "description": "Default runtime version.", "x-example": "node-22" }, - "defaultInstallCommand": { + "installCommand": { "type": "string", "description": "Default command to download dependencies.", "x-example": "npm install" }, - "defaultBuildCommand": { + "buildCommand": { "type": "string", "description": "Default command to build site into output directory.", "x-example": "npm run build" }, - "defaultOutputDirectory": { + "outputDirectory": { "type": "string", "description": "Default output directory of build.", "x-example": ".\/dist" @@ -28073,15 +27964,10 @@ }, "required": [ "key", - "name", - "logo", - "serveRuntimes", - "buildRuntimes", - "defaultServeRuntime", - "defaultBuildRuntime", - "defaultInstallCommand", - "defaultBuildCommand", - "defaultOutputDirectory" + "buildRuntime", + "installCommand", + "buildCommand", + "outputDirectory" ] }, "deployment": { diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 13d3f0c59f..abb2a389c0 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -25791,12 +25791,11 @@ "x-example": "sveltekit", "enum": [ "sveltekit", - "nextjs", - "nuxt", "astro", "remix", - "flutter", - "static" + "nuxt", + "nextjs", + "flutter" ], "x-enum-name": null, "x-enum-keys": [] @@ -25906,74 +25905,11 @@ "x-enum-name": null, "x-enum-keys": [] }, - "serveRuntime": { + "adapter": { "type": "string", - "description": "Runtime to use when serving site.", + "description": "Framework adapter. Usuallly allows: static, ssr", "default": null, - "x-example": "node-14.5", - "enum": [ - "node-14.5", - "node-16.0", - "node-18.0", - "node-19.0", - "node-20.0", - "node-21.0", - "node-22", - "php-8.0", - "php-8.1", - "php-8.2", - "php-8.3", - "ruby-3.0", - "ruby-3.1", - "ruby-3.2", - "ruby-3.3", - "python-3.8", - "python-3.9", - "python-3.10", - "python-3.11", - "python-3.12", - "python-ml-3.11", - "deno-1.21", - "deno-1.24", - "deno-1.35", - "deno-1.40", - "deno-1.46", - "deno-2.0", - "dart-2.15", - "dart-2.16", - "dart-2.17", - "dart-2.18", - "dart-3.0", - "dart-3.1", - "dart-3.3", - "dart-3.5", - "dotnet-6.0", - "dotnet-7.0", - "dotnet-8.0", - "java-8.0", - "java-11.0", - "java-17.0", - "java-18.0", - "java-21.0", - "java-22", - "swift-5.5", - "swift-5.8", - "swift-5.9", - "swift-5.10", - "kotlin-1.6", - "kotlin-1.8", - "kotlin-1.9", - "kotlin-2.0", - "cpp-17", - "cpp-20", - "bun-1.0", - "bun-1.1", - "go-1.23", - "static-1", - "flutter-3.24" - ], - "x-enum-name": null, - "x-enum-keys": [] + "x-example": "" }, "installationId": { "type": "string", @@ -26047,7 +25983,7 @@ "name", "framework", "buildRuntime", - "serveRuntime" + "adapter" ] } } @@ -26481,12 +26417,11 @@ "x-example": "sveltekit", "enum": [ "sveltekit", - "nextjs", - "nuxt", "astro", "remix", - "flutter", - "static" + "nuxt", + "nextjs", + "flutter" ], "x-enum-name": null, "x-enum-keys": [] @@ -26590,74 +26525,11 @@ "x-enum-name": null, "x-enum-keys": [] }, - "serveRuntime": { + "adapter": { "type": "string", - "description": "Runtime to use when serving site.", - "default": "", - "x-example": "node-14.5", - "enum": [ - "node-14.5", - "node-16.0", - "node-18.0", - "node-19.0", - "node-20.0", - "node-21.0", - "node-22", - "php-8.0", - "php-8.1", - "php-8.2", - "php-8.3", - "ruby-3.0", - "ruby-3.1", - "ruby-3.2", - "ruby-3.3", - "python-3.8", - "python-3.9", - "python-3.10", - "python-3.11", - "python-3.12", - "python-ml-3.11", - "deno-1.21", - "deno-1.24", - "deno-1.35", - "deno-1.40", - "deno-1.46", - "deno-2.0", - "dart-2.15", - "dart-2.16", - "dart-2.17", - "dart-2.18", - "dart-3.0", - "dart-3.1", - "dart-3.3", - "dart-3.5", - "dotnet-6.0", - "dotnet-7.0", - "dotnet-8.0", - "java-8.0", - "java-11.0", - "java-17.0", - "java-18.0", - "java-21.0", - "java-22", - "swift-5.5", - "swift-5.8", - "swift-5.9", - "swift-5.10", - "kotlin-1.6", - "kotlin-1.8", - "kotlin-1.9", - "kotlin-2.0", - "cpp-17", - "cpp-20", - "bun-1.0", - "bun-1.1", - "go-1.23", - "static-1", - "flutter-3.24" - ], - "x-enum-name": null, - "x-enum-keys": [] + "description": "Framework adapter. Usuallly allows: static, ssr", + "default": null, + "x-example": "" }, "fallbackFile": { "type": "string", @@ -26704,7 +26576,8 @@ }, "required": [ "name", - "framework" + "framework", + "adapter" ] } } @@ -38070,10 +37943,10 @@ "description": "Site build runtime.", "x-example": "node-22" }, - "serveRuntime": { + "adapter": { "type": "string", - "description": "Site serve runtime.", - "x-example": "static-1" + "description": "Site framework adapter.", + "x-example": "static" }, "fallbackFile": { "type": "string", @@ -38102,7 +37975,7 @@ "providerSilentMode", "specification", "buildRuntime", - "serveRuntime", + "adapter", "fallbackFile" ] }, @@ -38225,16 +38098,16 @@ "description": "Path to site in VCS (Version Control System) repository", "x-example": ".\/svelte-kit\/starter" }, - "serveRuntime": { - "type": "string", - "description": "Runtime used during serve of template deployment.", - "x-example": "static-1" - }, "buildRuntime": { "type": "string", "description": "Runtime used during build step of template.", "x-example": "node-22" }, + "adapter": { + "type": "string", + "description": "Site framework runtime", + "x-example": "ssr" + }, "fallbackFile": { "type": "string", "description": "Fallback file for SPA. Only relevant for static serve runtime.", @@ -38248,8 +38121,8 @@ "buildCommand", "outputDirectory", "providerRootDirectory", - "serveRuntime", "buildRuntime", + "adapter", "fallbackFile" ] }, @@ -38846,7 +38719,7 @@ "properties": { "key": { "type": "string", - "description": "Parent framework key.", + "description": "Framework key.", "x-example": "sveltekit" }, "name": { @@ -38854,48 +38727,67 @@ "description": "Framework Name.", "x-example": "SvelteKit" }, - "logo": { - "type": "string", - "description": "Name of the logo image.", - "x-example": "sveltekit.png" - }, - "serveRuntimes": { + "runtimes": { "type": "array", "description": "List of supported runtime versions.", "items": { "type": "string" }, - "x-example": "static-1" + "x-example": [ + "static-1", + "node-22" + ] }, - "buildRuntimes": { + "adapters": { "type": "array", - "description": "List of supported runtime versions.", + "description": "List of supported adapters.", "items": { - "type": "string" + "type": "object", + "$ref": "#\/definitions\/frameworkAdapter" }, - "x-example": "node-21.0" - }, - "defaultServeRuntime": { + "x-example": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } + }, + "required": [ + "key", + "name", + "runtimes", + "adapters" + ] + }, + "frameworkAdapter": { + "description": "Framework Adapter", + "type": "object", + "properties": { + "key": { "type": "string", - "description": "Default runtime version.", - "x-example": "static-1" + "description": "Adapter key.", + "x-example": "static" }, - "defaultBuildRuntime": { + "buildRuntime": { "type": "string", "description": "Default runtime version.", "x-example": "node-22" }, - "defaultInstallCommand": { + "installCommand": { "type": "string", "description": "Default command to download dependencies.", "x-example": "npm install" }, - "defaultBuildCommand": { + "buildCommand": { "type": "string", "description": "Default command to build site into output directory.", "x-example": "npm run build" }, - "defaultOutputDirectory": { + "outputDirectory": { "type": "string", "description": "Default output directory of build.", "x-example": ".\/dist" @@ -38903,15 +38795,10 @@ }, "required": [ "key", - "name", - "logo", - "serveRuntimes", - "buildRuntimes", - "defaultServeRuntime", - "defaultBuildRuntime", - "defaultInstallCommand", - "defaultBuildCommand", - "defaultOutputDirectory" + "buildRuntime", + "installCommand", + "buildCommand", + "outputDirectory" ] }, "deployment": { diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 841597577d..be3138e93b 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -17575,12 +17575,11 @@ "x-example": "sveltekit", "enum": [ "sveltekit", - "nextjs", - "nuxt", "astro", "remix", - "flutter", - "static" + "nuxt", + "nextjs", + "flutter" ], "x-enum-name": null, "x-enum-keys": [] @@ -17690,74 +17689,11 @@ "x-enum-name": null, "x-enum-keys": [] }, - "serveRuntime": { + "adapter": { "type": "string", - "description": "Runtime to use when serving site.", + "description": "Framework adapter. Usuallly allows: static, ssr", "default": null, - "x-example": "node-14.5", - "enum": [ - "node-14.5", - "node-16.0", - "node-18.0", - "node-19.0", - "node-20.0", - "node-21.0", - "node-22", - "php-8.0", - "php-8.1", - "php-8.2", - "php-8.3", - "ruby-3.0", - "ruby-3.1", - "ruby-3.2", - "ruby-3.3", - "python-3.8", - "python-3.9", - "python-3.10", - "python-3.11", - "python-3.12", - "python-ml-3.11", - "deno-1.21", - "deno-1.24", - "deno-1.35", - "deno-1.40", - "deno-1.46", - "deno-2.0", - "dart-2.15", - "dart-2.16", - "dart-2.17", - "dart-2.18", - "dart-3.0", - "dart-3.1", - "dart-3.3", - "dart-3.5", - "dotnet-6.0", - "dotnet-7.0", - "dotnet-8.0", - "java-8.0", - "java-11.0", - "java-17.0", - "java-18.0", - "java-21.0", - "java-22", - "swift-5.5", - "swift-5.8", - "swift-5.9", - "swift-5.10", - "kotlin-1.6", - "kotlin-1.8", - "kotlin-1.9", - "kotlin-2.0", - "cpp-17", - "cpp-20", - "bun-1.0", - "bun-1.1", - "go-1.23", - "static-1", - "flutter-3.24" - ], - "x-enum-name": null, - "x-enum-keys": [] + "x-example": "" }, "installationId": { "type": "string", @@ -17831,7 +17767,7 @@ "name", "framework", "buildRuntime", - "serveRuntime" + "adapter" ] } } @@ -18034,12 +17970,11 @@ "x-example": "sveltekit", "enum": [ "sveltekit", - "nextjs", - "nuxt", "astro", "remix", - "flutter", - "static" + "nuxt", + "nextjs", + "flutter" ], "x-enum-name": null, "x-enum-keys": [] @@ -18143,74 +18078,11 @@ "x-enum-name": null, "x-enum-keys": [] }, - "serveRuntime": { + "adapter": { "type": "string", - "description": "Runtime to use when serving site.", - "default": "", - "x-example": "node-14.5", - "enum": [ - "node-14.5", - "node-16.0", - "node-18.0", - "node-19.0", - "node-20.0", - "node-21.0", - "node-22", - "php-8.0", - "php-8.1", - "php-8.2", - "php-8.3", - "ruby-3.0", - "ruby-3.1", - "ruby-3.2", - "ruby-3.3", - "python-3.8", - "python-3.9", - "python-3.10", - "python-3.11", - "python-3.12", - "python-ml-3.11", - "deno-1.21", - "deno-1.24", - "deno-1.35", - "deno-1.40", - "deno-1.46", - "deno-2.0", - "dart-2.15", - "dart-2.16", - "dart-2.17", - "dart-2.18", - "dart-3.0", - "dart-3.1", - "dart-3.3", - "dart-3.5", - "dotnet-6.0", - "dotnet-7.0", - "dotnet-8.0", - "java-8.0", - "java-11.0", - "java-17.0", - "java-18.0", - "java-21.0", - "java-22", - "swift-5.5", - "swift-5.8", - "swift-5.9", - "swift-5.10", - "kotlin-1.6", - "kotlin-1.8", - "kotlin-1.9", - "kotlin-2.0", - "cpp-17", - "cpp-20", - "bun-1.0", - "bun-1.1", - "go-1.23", - "static-1", - "flutter-3.24" - ], - "x-enum-name": null, - "x-enum-keys": [] + "description": "Framework adapter. Usuallly allows: static, ssr", + "default": null, + "x-example": "" }, "fallbackFile": { "type": "string", @@ -18257,7 +18129,8 @@ }, "required": [ "name", - "framework" + "framework", + "adapter" ] } } @@ -28281,10 +28154,10 @@ "description": "Site build runtime.", "x-example": "node-22" }, - "serveRuntime": { + "adapter": { "type": "string", - "description": "Site serve runtime.", - "x-example": "static-1" + "description": "Site framework adapter.", + "x-example": "static" }, "fallbackFile": { "type": "string", @@ -28313,7 +28186,7 @@ "providerSilentMode", "specification", "buildRuntime", - "serveRuntime", + "adapter", "fallbackFile" ] }, @@ -28548,7 +28421,7 @@ "properties": { "key": { "type": "string", - "description": "Parent framework key.", + "description": "Framework key.", "x-example": "sveltekit" }, "name": { @@ -28556,48 +28429,67 @@ "description": "Framework Name.", "x-example": "SvelteKit" }, - "logo": { - "type": "string", - "description": "Name of the logo image.", - "x-example": "sveltekit.png" - }, - "serveRuntimes": { + "runtimes": { "type": "array", "description": "List of supported runtime versions.", "items": { "type": "string" }, - "x-example": "static-1" + "x-example": [ + "static-1", + "node-22" + ] }, - "buildRuntimes": { + "adapters": { "type": "array", - "description": "List of supported runtime versions.", + "description": "List of supported adapters.", "items": { - "type": "string" + "type": "object", + "$ref": "#\/definitions\/frameworkAdapter" }, - "x-example": "node-21.0" - }, - "defaultServeRuntime": { + "x-example": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } + }, + "required": [ + "key", + "name", + "runtimes", + "adapters" + ] + }, + "frameworkAdapter": { + "description": "Framework Adapter", + "type": "object", + "properties": { + "key": { "type": "string", - "description": "Default runtime version.", - "x-example": "static-1" + "description": "Adapter key.", + "x-example": "static" }, - "defaultBuildRuntime": { + "buildRuntime": { "type": "string", "description": "Default runtime version.", "x-example": "node-22" }, - "defaultInstallCommand": { + "installCommand": { "type": "string", "description": "Default command to download dependencies.", "x-example": "npm install" }, - "defaultBuildCommand": { + "buildCommand": { "type": "string", "description": "Default command to build site into output directory.", "x-example": "npm run build" }, - "defaultOutputDirectory": { + "outputDirectory": { "type": "string", "description": "Default output directory of build.", "x-example": ".\/dist" @@ -28605,15 +28497,10 @@ }, "required": [ "key", - "name", - "logo", - "serveRuntimes", - "buildRuntimes", - "defaultServeRuntime", - "defaultBuildRuntime", - "defaultInstallCommand", - "defaultBuildCommand", - "defaultOutputDirectory" + "buildRuntime", + "installCommand", + "buildCommand", + "outputDirectory" ] }, "deployment": { diff --git a/app/controllers/general.php b/app/controllers/general.php index 71782414e7..183d0ff1b1 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -157,11 +157,15 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo $runtime = match($type) { 'function' => $runtimes[$resource->getAttribute('runtime')] ?? null, - 'site' => $runtimes[$resource->getAttribute('serveRuntime')] ?? null, - 'deployment' => $runtimes[$resource->getAttribute('serveRuntime')] ?? null, + 'site' => $runtimes[$resource->getAttribute('buildRuntime')] ?? null, + 'deployment' => $runtimes[$resource->getAttribute('buildRuntime')] ?? null, default => null }; + if($resource->getAttribute('adapter', '') === 'static') { + $runtime = $runtimes['static'] ?? null; + } + if (\is_null($runtime)) { throw new AppwriteException(AppwriteException::FUNCTION_RUNTIME_UNSUPPORTED, 'Runtime "' . $resource->getAttribute('runtime', '') . '" is not supported'); } @@ -347,8 +351,12 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo $framework = $frameworks[$resource->getAttribute('framework', '')] ?? null; $startCommand = $runtime['startCommand']; - if(!is_null($framework) && !empty($framework['startCommand'])) { - $startCommand = $framework['startCommand']; + + if(!is_null($framework)) { + $adapter = ($framework['adapters'] ?? [])[$resource->getAttribute('adapter', '')] ?? null; + if(!is_null($adapter) && isset($adapter['startCommand'])) { + $startCommand = $adapter['startCommand']; + } } $runtimeEntrypoint = 'cp /tmp/code.tar.gz /mnt/code/code.tar.gz && nohup helpers/start.sh "' . $startCommand . '"'; @@ -462,12 +470,13 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo $contentType = $header['value']; } + if (\strtolower($header['name']) === 'transfer-encoding') { + continue; + } + $response->setHeader($header['name'], $header['value']); } - // TODO: Figoure out situation with transfer-encoding - // TODO: Dont double-compress - $response ->setContentType($contentType) ->setStatusCode($execution['responseStatusCode'] ?? 200) diff --git a/composer.lock b/composer.lock index ac52ec7baf..7b9cd2106f 100644 --- a/composer.lock +++ b/composer.lock @@ -709,16 +709,16 @@ }, { "name": "google/protobuf", - "version": "v4.28.3", + "version": "v4.29.0", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "c5c311e0f3d89928251ac5a2f0e3db283612c100" + "reference": "0ef6b2eb74b782f3f9023276c324d22e440f7587" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/c5c311e0f3d89928251ac5a2f0e3db283612c100", - "reference": "c5c311e0f3d89928251ac5a2f0e3db283612c100", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/0ef6b2eb74b782f3f9023276c324d22e440f7587", + "reference": "0ef6b2eb74b782f3f9023276c324d22e440f7587", "shasum": "" }, "require": { @@ -747,9 +747,9 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.28.3" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.0" }, - "time": "2024-10-22T22:27:17+00:00" + "time": "2024-11-27T18:37:40+00:00" }, { "name": "jean85/pretty-package-versions", @@ -2343,9 +2343,9 @@ "type": "library", "extra": { "branch-alias": { - "v10.0": "10.0.x-dev", + "v8.3": "8.3.x-dev", "v9.0": "9.0.x-dev", - "v8.3": "8.3.x-dev" + "v10.0": "10.0.x-dev" } }, "autoload": { @@ -2386,16 +2386,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { @@ -2433,7 +2433,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -2449,30 +2449,31 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/http-client", - "version": "v7.1.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a" + "reference": "955e43336aff03df1e8a8e17daefabb0127a313b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a", - "reference": "c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a", + "url": "https://api.github.com/repos/symfony/http-client/zipball/955e43336aff03df1e8a8e17daefabb0127a313b", + "reference": "955e43336aff03df1e8a8e17daefabb0127a313b", "shasum": "" }, "require": { "php": ">=8.2", "psr/log": "^1|^2|^3", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/http-client-contracts": "^3.4.1", + "symfony/http-client-contracts": "~3.4.3|^3.5.1", "symfony/service-contracts": "^2.5|^3" }, "conflict": { + "amphp/amp": "<2.5", "php-http/discovery": "<1.15", "symfony/http-foundation": "<6.4" }, @@ -2483,14 +2484,14 @@ "symfony/http-client-implementation": "3.0" }, "require-dev": { - "amphp/amp": "^2.5", - "amphp/http-client": "^4.2.1", - "amphp/http-tunnel": "^1.0", + "amphp/http-client": "^4.2.1|^5.0", + "amphp/http-tunnel": "^1.0|^2.0", "amphp/socket": "^1.1", "guzzlehttp/promises": "^1.4|^2.0", "nyholm/psr7": "^1.0", "php-http/httplug": "^1.0|^2.0", "psr/http-client": "^1.0", + "symfony/amphp-http-client-meta": "^1.0|^2.0", "symfony/dependency-injection": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", "symfony/messenger": "^6.4|^7.0", @@ -2527,7 +2528,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.1.8" + "source": "https://github.com/symfony/http-client/tree/v7.2.0" }, "funding": [ { @@ -2543,20 +2544,20 @@ "type": "tidelift" } ], - "time": "2024-11-13T13:40:27+00:00" + "time": "2024-11-29T08:22:02+00:00" }, { "name": "symfony/http-client-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "20414d96f391677bf80078aa55baece78b82647d" + "reference": "c2f3ad828596624ca39ea40f83617ef51ca8bbf9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/20414d96f391677bf80078aa55baece78b82647d", - "reference": "20414d96f391677bf80078aa55baece78b82647d", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/c2f3ad828596624ca39ea40f83617ef51ca8bbf9", + "reference": "c2f3ad828596624ca39ea40f83617ef51ca8bbf9", "shasum": "" }, "require": { @@ -2605,7 +2606,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.1" }, "funding": [ { @@ -2621,7 +2622,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-11-25T12:02:18+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -2861,16 +2862,16 @@ }, { "name": "symfony/service-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", "shasum": "" }, "require": { @@ -2924,7 +2925,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" }, "funding": [ { @@ -2940,7 +2941,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "tbachert/spi", @@ -3928,16 +3929,16 @@ }, { "name": "utopia-php/migration", - "version": "0.6.12", + "version": "0.6.13", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "9a8c905af4cece5c5ec9542a5b534befce067260" + "reference": "68d9b0a9477755afcda607e7e8109785cae17a13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/9a8c905af4cece5c5ec9542a5b534befce067260", - "reference": "9a8c905af4cece5c5ec9542a5b534befce067260", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/68d9b0a9477755afcda607e7e8109785cae17a13", + "reference": "68d9b0a9477755afcda607e7e8109785cae17a13", "shasum": "" }, "require": { @@ -3978,9 +3979,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/0.6.12" + "source": "https://github.com/utopia-php/migration/tree/0.6.13" }, - "time": "2024-11-12T00:31:53+00:00" + "time": "2024-11-26T13:57:53+00:00" }, { "name": "utopia-php/mongo", @@ -4362,16 +4363,16 @@ }, { "name": "utopia-php/storage", - "version": "0.18.6", + "version": "0.18.7", "source": { "type": "git", "url": "https://github.com/utopia-php/storage.git", - "reference": "893ccf06e183f8ece2aed8dbf14d64d6ba036071" + "reference": "0d9228faa1c202f9e01483e45a8950485f01a288" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/storage/zipball/893ccf06e183f8ece2aed8dbf14d64d6ba036071", - "reference": "893ccf06e183f8ece2aed8dbf14d64d6ba036071", + "url": "https://api.github.com/repos/utopia-php/storage/zipball/0d9228faa1c202f9e01483e45a8950485f01a288", + "reference": "0d9228faa1c202f9e01483e45a8950485f01a288", "shasum": "" }, "require": { @@ -4411,9 +4412,9 @@ ], "support": { "issues": "https://github.com/utopia-php/storage/issues", - "source": "https://github.com/utopia-php/storage/tree/0.18.6" + "source": "https://github.com/utopia-php/storage/tree/0.18.7" }, - "time": "2024-11-06T09:58:50+00:00" + "time": "2024-11-28T11:10:53+00:00" }, { "name": "utopia-php/swoole", @@ -5127,16 +5128,16 @@ }, { "name": "laravel/pint", - "version": "v1.18.2", + "version": "v1.18.3", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64" + "reference": "cef51821608239040ab841ad6e1c6ae502ae3026" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", - "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", + "url": "https://api.github.com/repos/laravel/pint/zipball/cef51821608239040ab841ad6e1c6ae502ae3026", + "reference": "cef51821608239040ab841ad6e1c6ae502ae3026", "shasum": "" }, "require": { @@ -5147,13 +5148,13 @@ "php": "^8.1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.64.0", - "illuminate/view": "^10.48.20", - "larastan/larastan": "^2.9.8", + "friendsofphp/php-cs-fixer": "^3.65.0", + "illuminate/view": "^10.48.24", + "larastan/larastan": "^2.9.11", "laravel-zero/framework": "^10.4.0", "mockery/mockery": "^1.6.12", - "nunomaduro/termwind": "^1.15.1", - "pestphp/pest": "^2.35.1" + "nunomaduro/termwind": "^1.17.0", + "pestphp/pest": "^2.36.0" }, "bin": [ "builds/pint" @@ -5189,7 +5190,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-11-20T09:33:46+00:00" + "time": "2024-11-26T15:34:00+00:00" }, { "name": "matthiasmullie/minify", @@ -7577,16 +7578,16 @@ }, { "name": "symfony/console", - "version": "v7.1.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5" + "reference": "23c8aae6d764e2bae02d2a99f7532a7f6ed619cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/ff04e5b5ba043d2badfb308197b9e6b42883fcd5", - "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5", + "url": "https://api.github.com/repos/symfony/console/zipball/23c8aae6d764e2bae02d2a99f7532a7f6ed619cf", + "reference": "23c8aae6d764e2bae02d2a99f7532a7f6ed619cf", "shasum": "" }, "require": { @@ -7650,7 +7651,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.1.8" + "source": "https://github.com/symfony/console/tree/v7.2.0" }, "funding": [ { @@ -7666,20 +7667,20 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:23:19+00:00" + "time": "2024-11-06T14:24:19+00:00" }, { "name": "symfony/filesystem", - "version": "v7.1.6", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "c835867b3c62bb05c7fe3d637c871c7ae52024d4" + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/c835867b3c62bb05c7fe3d637c871c7ae52024d4", - "reference": "c835867b3c62bb05c7fe3d637c871c7ae52024d4", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", "shasum": "" }, "require": { @@ -7716,7 +7717,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.1.6" + "source": "https://github.com/symfony/filesystem/tree/v7.2.0" }, "funding": [ { @@ -7732,20 +7733,20 @@ "type": "tidelift" } ], - "time": "2024-10-25T15:11:02+00:00" + "time": "2024-10-25T15:15:23+00:00" }, { "name": "symfony/finder", - "version": "v7.1.6", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "2cb89664897be33f78c65d3d2845954c8d7a43b8" + "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/2cb89664897be33f78c65d3d2845954c8d7a43b8", - "reference": "2cb89664897be33f78c65d3d2845954c8d7a43b8", + "url": "https://api.github.com/repos/symfony/finder/zipball/6de263e5868b9a137602dd1e33e4d48bfae99c49", + "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49", "shasum": "" }, "require": { @@ -7780,7 +7781,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.1.6" + "source": "https://github.com/symfony/finder/tree/v7.2.0" }, "funding": [ { @@ -7796,20 +7797,20 @@ "type": "tidelift" } ], - "time": "2024-10-01T08:31:23+00:00" + "time": "2024-10-23T06:56:12+00:00" }, { "name": "symfony/options-resolver", - "version": "v7.1.6", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "85e95eeede2d41cd146146e98c9c81d9214cae85" + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/85e95eeede2d41cd146146e98c9c81d9214cae85", - "reference": "85e95eeede2d41cd146146e98c9c81d9214cae85", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", "shasum": "" }, "require": { @@ -7847,7 +7848,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.1.6" + "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" }, "funding": [ { @@ -7863,7 +7864,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:20:29+00:00" + "time": "2024-11-20T11:17:29+00:00" }, { "name": "symfony/polyfill-ctype", @@ -8181,16 +8182,16 @@ }, { "name": "symfony/process", - "version": "v7.1.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892" + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/42783370fda6e538771f7c7a36e9fa2ee3a84892", - "reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892", + "url": "https://api.github.com/repos/symfony/process/zipball/d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", "shasum": "" }, "require": { @@ -8222,7 +8223,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.1.8" + "source": "https://github.com/symfony/process/tree/v7.2.0" }, "funding": [ { @@ -8238,20 +8239,20 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:23:19+00:00" + "time": "2024-11-06T14:24:19+00:00" }, { "name": "symfony/string", - "version": "v7.1.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281" + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/591ebd41565f356fcd8b090fe64dbb5878f50281", - "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281", + "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", "shasum": "" }, "require": { @@ -8309,7 +8310,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.1.8" + "source": "https://github.com/symfony/string/tree/v7.2.0" }, "funding": [ { @@ -8325,7 +8326,7 @@ "type": "tidelift" } ], - "time": "2024-11-13T13:31:21+00:00" + "time": "2024-11-13T13:31:26+00:00" }, { "name": "textalk/websocket", diff --git a/docker-compose.yml b/docker-compose.yml index 9c8c133ee6..af5b5e1246 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -881,7 +881,7 @@ services: hostname: exc1 <<: *x-logging stop_signal: SIGINT - image: openruntimes/executor:0.7.1 + image: openruntimes/executor:0.7.2 restart: unless-stopped networks: - appwrite @@ -894,6 +894,7 @@ services: # It's not possible to share mount file between 2 containers without host mount (copying is too slow) - /tmp:/tmp:rw environment: + - OPR_EXECUTOR_IMAGE_PULL=disabled - OPR_EXECUTOR_INACTIVE_TRESHOLD=$_APP_COMPUTE_INACTIVE_THRESHOLD - OPR_EXECUTOR_MAINTENANCE_INTERVAL=$_APP_COMPUTE_MAINTENANCE_INTERVAL - OPR_EXECUTOR_NETWORK=$_APP_COMPUTE_RUNTIMES_NETWORK diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index 3d2937f80b..b4eff604c0 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -878,8 +878,11 @@ class Builds extends Action $frameworks = Config::getParam('frameworks', []); $framework = $frameworks[$resource->getAttribute('framework', '')] ?? null; - if(!is_null($framework) && !empty($framework['bundleCommand'])) { - $commands[] = $framework['bundleCommand']; + if(!is_null($framework)) { + $adapter = ($framework['adapters'] ?? [])[$resource->getAttribute('adapter', '')] ?? null; + if(!is_null($adapter) && isset($adapter['bundleCommand'])) { + $commands[] = $adapter['bundleCommand']; + } } $commands = array_filter($commands, fn($command) => !empty($command)); diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/CreateSite.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/CreateSite.php index 0d0a0f0d2b..74f8f8ab23 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/CreateSite.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/CreateSite.php @@ -66,7 +66,7 @@ class CreateSite extends Base ->param('outputDirectory', '', new Text(8192, 0), 'Output Directory for site.', true) ->param('subdomain', '', new CustomId(), 'Unique custom sub-domain. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true) ->param('buildRuntime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Runtime to use during build step.') - ->param('serveRuntime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Runtime to use when serving site.') + ->param('adapter', '', new Text(8192, 0), 'Framework adapter. Usuallly allows: static, ssr') ->param('installationId', '', new Text(128, 0), 'Appwrite Installation ID for VCS (Version Control System) deployment.', true) ->param('fallbackFile', '', new Text(255, 0), 'Fallback file for single page application sites.', true) ->param('providerRepositoryId', '', new Text(128, 0), 'Repository ID of the repo linked to the site.', true) @@ -95,8 +95,15 @@ class CreateSite extends Base ->callback([$this, 'action']); } - public function action(string $siteId, string $name, string $framework, bool $enabled, int $timeout, string $installCommand, string $buildCommand, string $outputDirectory, string $subdomain, string $buildRuntime, string $serveRuntime, string $installationId, ?string $fallbackFile, string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $templateRepository, string $templateOwner, string $templateRootDirectory, string $templateVersion, string $specification, Request $request, Response $response, Database $dbForProject, Document $project, Document $user, Event $queueForEvents, Build $queueForBuilds, Database $dbForConsole, GitHub $github) + public function action(string $siteId, string $name, string $framework, bool $enabled, int $timeout, string $installCommand, string $buildCommand, string $outputDirectory, string $subdomain, string $buildRuntime, string $adapter, string $installationId, ?string $fallbackFile, string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $templateRepository, string $templateOwner, string $templateRootDirectory, string $templateVersion, string $specification, Request $request, Response $response, Database $dbForProject, Document $project, Document $user, Event $queueForEvents, Build $queueForBuilds, Database $dbForConsole, GitHub $github) { + $configFramework = Config::getParam('frameworks')[$framework] ?? []; + $adapters = \array_keys($configFramework['adapters'] ?? []); + $validator = new WhiteList($adapters, true); + if (!$validator->isValid($adapter)) { + throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'Adapter not supported for the selected framework.'); + } + $sitesDomain = System::getEnv('_APP_DOMAIN_SITES', ''); $routeSubdomain = ''; $domain = ''; @@ -168,7 +175,7 @@ class CreateSite extends Base 'providerSilentMode' => $providerSilentMode, 'specification' => $specification, 'buildRuntime' => $buildRuntime, - 'serveRuntime' => $serveRuntime, + 'adapter' => $adapter, ])); // Git connect logic diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/UpdateSite.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/UpdateSite.php index 90d50f49d2..e3403f579b 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/UpdateSite.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/UpdateSite.php @@ -63,7 +63,7 @@ class UpdateSite extends Base ->param('buildCommand', '', new Text(8192, 0), 'Build Command.', true) ->param('outputDirectory', '', new Text(8192, 0), 'Output Directory for site.', true) ->param('buildRuntime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Runtime to use during build step.', true) - ->param('serveRuntime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Runtime to use when serving site.', true) + ->param('adapter', '', new Text(8192, 0), 'Framework adapter. Usuallly allows: static, ssr') ->param('fallbackFile', '', new Text(255, 0), 'Fallback file for single page application sites.', true) ->param('installationId', '', new Text(128, 0), 'Appwrite Installation ID for VCS (Version Control System) deployment.', true) ->param('providerRepositoryId', '', new Text(128, 0), 'Repository ID of the repo linked to the site.', true) @@ -87,8 +87,14 @@ class UpdateSite extends Base ->callback([$this, 'action']); } - public function action(string $siteId, string $name, string $framework, bool $enabled, int $timeout, string $installCommand, string $buildCommand, string $outputDirectory, string $buildRuntime, string $serveRuntime, ?string $fallbackFile, string $installationId, ?string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $specification, Request $request, Response $response, Database $dbForProject, Document $project, Event $queueForEvents, Build $queueForBuilds, Database $dbForConsole, GitHub $github) + public function action(string $siteId, string $name, string $framework, bool $enabled, int $timeout, string $installCommand, string $buildCommand, string $outputDirectory, string $buildRuntime, string $adapter, ?string $fallbackFile, string $installationId, ?string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $specification, Request $request, Response $response, Database $dbForProject, Document $project, Event $queueForEvents, Build $queueForBuilds, Database $dbForConsole, GitHub $github) { + $adapters = \array_keys($framework['adapters'] ?? []); + $validator = new WhiteList($adapters, true); + if (!$validator->isValid($adapter)) { + throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'Adapter not supported for the selected framework.'); + } + // TODO: If only branch changes, re-deploy $site = $dbForProject->getDocument('sites', $siteId); @@ -219,7 +225,7 @@ class UpdateSite extends Base 'specification' => $specification, 'search' => implode(' ', [$siteId, $name, $framework]), 'buildRuntime' => $buildRuntime, - 'serveRuntime' => $serveRuntime, + 'adapter' => $adapter, 'fallbackFile' => $fallbackFile, ]))); diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 05b6ada061..da222822e0 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -45,6 +45,7 @@ use Appwrite\Utopia\Response\Model\ErrorDev; use Appwrite\Utopia\Response\Model\Execution; use Appwrite\Utopia\Response\Model\File; use Appwrite\Utopia\Response\Model\Framework; +use Appwrite\Utopia\Response\Model\FrameworkAdapter; use Appwrite\Utopia\Response\Model\Func; use Appwrite\Utopia\Response\Model\Headers; use Appwrite\Utopia\Response\Model\HealthAntivirus; @@ -257,6 +258,7 @@ class Response extends SwooleResponse public const MODEL_SITE_LIST = 'siteList'; public const MODEL_FRAMEWORK = 'framework'; public const MODEL_FRAMEWORK_LIST = 'frameworkList'; + public const MODEL_FRAMEWORK_ADAPTER = 'frameworkAdapter'; public const MODEL_TEMPLATE_SITE = 'templateSite'; public const MODEL_TEMPLATE_SITE_LIST = 'templateSiteList'; public const MODEL_TEMPLATE_FRAMEWORK = 'templateFramework'; @@ -456,6 +458,7 @@ class Response extends SwooleResponse ->setModel(new Branch()) ->setModel(new Runtime()) ->setModel(new Framework()) + ->setModel(new FrameworkAdapter()) ->setModel(new Deployment()) ->setModel(new Execution()) ->setModel(new Build()) diff --git a/src/Appwrite/Utopia/Response/Model/Framework.php b/src/Appwrite/Utopia/Response/Model/Framework.php index 162ab08cca..40ce126ea0 100644 --- a/src/Appwrite/Utopia/Response/Model/Framework.php +++ b/src/Appwrite/Utopia/Response/Model/Framework.php @@ -12,7 +12,7 @@ class Framework extends Model $this ->addRule('key', [ 'type' => self::TYPE_STRING, - 'description' => 'Parent framework key.', + 'description' => 'Framework key.', 'default' => '', 'example' => 'sveltekit', ]) @@ -22,56 +22,20 @@ class Framework extends Model 'default' => '', 'example' => 'SvelteKit' ]) - ->addRule('logo', [ - 'type' => self::TYPE_STRING, - 'description' => 'Name of the logo image.', - 'default' => '', - 'example' => 'sveltekit.png', - ]) - ->addRule('serveRuntimes', [ + ->addRule('runtimes', [ 'type' => self::TYPE_STRING, 'description' => 'List of supported runtime versions.', 'default' => '', - 'example' => 'static-1', + 'example' => ['static-1', 'node-22'], 'array' => true, ]) - ->addRule('buildRuntimes', [ - 'type' => self::TYPE_STRING, - 'description' => 'List of supported runtime versions.', + ->addRule('adapters', [ + 'type' => Response::MODEL_FRAMEWORK_ADAPTER, + 'description' => 'List of supported adapters.', 'default' => '', - 'example' => 'node-21.0', + 'example' => [[ 'key' => 'static', 'buildRuntime' => 'node-22', 'buildCommand' => 'npm run build', 'installCommand' => 'npm install', 'outputDirectory' => './dist' ]], 'array' => true, ]) - ->addRule('defaultServeRuntime', [ - 'type' => self::TYPE_STRING, - 'description' => 'Default runtime version.', - 'default' => '', - 'example' => 'static-1', - ]) - ->addRule('defaultBuildRuntime', [ - 'type' => self::TYPE_STRING, - 'description' => 'Default runtime version.', - 'default' => '', - 'example' => 'node-22', - ]) - ->addRule('defaultInstallCommand', [ - 'type' => self::TYPE_STRING, - 'description' => 'Default command to download dependencies.', - 'default' => '', - 'example' => 'npm install', - ]) - ->addRule('defaultBuildCommand', [ - 'type' => self::TYPE_STRING, - 'description' => 'Default command to build site into output directory.', - 'default' => '', - 'example' => 'npm run build', - ]) - ->addRule('defaultOutputDirectory', [ - 'type' => self::TYPE_STRING, - 'description' => 'Default output directory of build.', - 'default' => '', - 'example' => './dist', - ]) ; } diff --git a/src/Appwrite/Utopia/Response/Model/FrameworkAdapter.php b/src/Appwrite/Utopia/Response/Model/FrameworkAdapter.php new file mode 100644 index 0000000000..08ee79063e --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/FrameworkAdapter.php @@ -0,0 +1,65 @@ +addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Adapter key.', + 'default' => '', + 'example' => 'static', + ]) + ->addRule('buildRuntime', [ + 'type' => self::TYPE_STRING, + 'description' => 'Default runtime version.', + 'default' => '', + 'example' => 'node-22', + ]) + ->addRule('installCommand', [ + 'type' => self::TYPE_STRING, + 'description' => 'Default command to download dependencies.', + 'default' => '', + 'example' => 'npm install', + ]) + ->addRule('buildCommand', [ + 'type' => self::TYPE_STRING, + 'description' => 'Default command to build site into output directory.', + 'default' => '', + 'example' => 'npm run build', + ]) + ->addRule('outputDirectory', [ + 'type' => self::TYPE_STRING, + 'description' => 'Default output directory of build.', + 'default' => '', + 'example' => './dist', + ]) + ; + } + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'Framework Adapter'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_FRAMEWORK_ADAPTER; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/Site.php b/src/Appwrite/Utopia/Response/Model/Site.php index 1897a502ac..9a760a3e2a 100644 --- a/src/Appwrite/Utopia/Response/Model/Site.php +++ b/src/Appwrite/Utopia/Response/Model/Site.php @@ -131,11 +131,11 @@ class Site extends Model 'default' => '', 'example' => 'node-22', ]) - ->addRule('serveRuntime', [ + ->addRule('adapter', [ 'type' => self::TYPE_STRING, - 'description' => 'Site serve runtime.', - 'default' => '', - 'example' => 'static-1', + 'description' => 'Site framework adapter.', + 'default' => null, + 'example' => 'static', ]) ->addRule('fallbackFile', [ 'type' => self::TYPE_STRING, diff --git a/src/Appwrite/Utopia/Response/Model/TemplateFramework.php b/src/Appwrite/Utopia/Response/Model/TemplateFramework.php index 67b7e21152..ae94ca4425 100644 --- a/src/Appwrite/Utopia/Response/Model/TemplateFramework.php +++ b/src/Appwrite/Utopia/Response/Model/TemplateFramework.php @@ -46,18 +46,18 @@ class TemplateFramework extends Model 'default' => '', 'example' => './svelte-kit/starter', ]) - ->addRule('serveRuntime', [ - 'type' => self::TYPE_STRING, - 'description' => 'Runtime used during serve of template deployment.', - 'default' => '', - 'example' => 'static-1', - ]) ->addRule('buildRuntime', [ 'type' => self::TYPE_STRING, 'description' => 'Runtime used during build step of template.', 'default' => '', 'example' => 'node-22', ]) + ->addRule('adapter', [ + 'type' => self::TYPE_STRING, + 'description' => 'Site framework runtime', + 'default' => '', + 'example' => 'ssr', + ]) ->addRule('fallbackFile', [ 'type' => self::TYPE_STRING, 'description' => 'Fallback file for SPA. Only relevant for static serve runtime.', From 2ef1cf5da0fdc44ee2ba3dce70fa99ea6de43edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 2 Dec 2024 13:45:03 +0100 Subject: [PATCH 3/8] bug fixes --- app/controllers/general.php | 16 ++++++++-------- .../Modules/Functions/Workers/Builds.php | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index 183d0ff1b1..aca899bb23 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -162,8 +162,8 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo default => null }; - if($resource->getAttribute('adapter', '') === 'static') { - $runtime = $runtimes['static'] ?? null; + if ($resource->getAttribute('adapter', '') === 'static') { + $runtime = $runtimes['static-1'] ?? null; } if (\is_null($runtime)) { @@ -341,24 +341,24 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo 'deployment' => '' }; - if($type === 'function') { + if ($type === 'function') { $runtimeEntrypoint = match ($version) { 'v2' => '', default => 'cp /tmp/code.tar.gz /mnt/code/code.tar.gz && nohup helpers/start.sh "' . $runtime['startCommand'] . '"' }; - } else if($type === 'site' || $type === 'deployment') { + } elseif ($type === 'site' || $type === 'deployment') { $frameworks = Config::getParam('frameworks', []); $framework = $frameworks[$resource->getAttribute('framework', '')] ?? null; - + $startCommand = $runtime['startCommand']; - if(!is_null($framework)) { + if (!is_null($framework)) { $adapter = ($framework['adapters'] ?? [])[$resource->getAttribute('adapter', '')] ?? null; - if(!is_null($adapter) && isset($adapter['startCommand'])) { + if (!is_null($adapter) && isset($adapter['startCommand'])) { $startCommand = $adapter['startCommand']; } } - + $runtimeEntrypoint = 'cp /tmp/code.tar.gz /mnt/code/code.tar.gz && nohup helpers/start.sh "' . $startCommand . '"'; } diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index b4eff604c0..37e5356ec5 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -871,21 +871,21 @@ class Builds extends Action return $deployment->getAttribute('commands', ''); } elseif ($resource->getCollection() === 'sites') { $commands = []; - + $commands[] = $deployment->getAttribute('installCommand', ''); $commands[] = $deployment->getAttribute('buildCommand', ''); $frameworks = Config::getParam('frameworks', []); $framework = $frameworks[$resource->getAttribute('framework', '')] ?? null; - - if(!is_null($framework)) { + + if (!is_null($framework)) { $adapter = ($framework['adapters'] ?? [])[$resource->getAttribute('adapter', '')] ?? null; - if(!is_null($adapter) && isset($adapter['bundleCommand'])) { + if (!is_null($adapter) && isset($adapter['bundleCommand'])) { $commands[] = $adapter['bundleCommand']; } } - $commands = array_filter($commands, fn($command) => !empty($command)); + $commands = array_filter($commands, fn ($command) => !empty($command)); return implode(' && ', $commands); } From 1b95790de39299c2c5bb789e86c3ddefe446c7d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 2 Dec 2024 13:56:03 +0100 Subject: [PATCH 4/8] Add CI/CD logs --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f149e1d4e9..63c132cd03 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -66,6 +66,9 @@ jobs: docker compose up -d sleep 10 + - name: Logs + run: docker compose logs appwrite + - name: Doctor run: docker compose exec -T appwrite doctor From 563031f2141a5fc2a50a5b685a307c90fc940137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 2 Dec 2024 14:12:46 +0100 Subject: [PATCH 5/8] Remove local mount --- docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index af5b5e1246..bb7af40946 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -84,7 +84,6 @@ services: - ./public:/usr/src/code/public - ./src:/usr/src/code/src - ./dev:/usr/src/code/dev - - ./vendor/utopia-php/framework:/usr/src/code/vendor/utopia-php/framework depends_on: - mariadb - redis From fdff1664eada8d92351eb66f0a0636d3d6b17d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 2 Dec 2024 15:05:26 +0100 Subject: [PATCH 6/8] Add other framework --- app/config/collections.php | 2 +- app/config/frameworks.php | 18 +++++++++++++++++- app/config/specs/open-api3-latest-console.json | 12 ++++++------ app/config/specs/open-api3-latest-server.json | 12 ++++++------ app/config/specs/swagger2-latest-console.json | 16 ++++++++-------- app/config/specs/swagger2-latest-server.json | 16 ++++++++-------- .../Modules/Sites/Http/Sites/CreateSite.php | 2 +- .../Modules/Sites/Http/Sites/UpdateSite.php | 2 +- 8 files changed, 48 insertions(+), 32 deletions(-) diff --git a/app/config/collections.php b/app/config/collections.php index 8fad49fada..dca9f1d166 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -3442,7 +3442,7 @@ $projectCollections = array_merge([ 'size' => 128, 'signed' => true, 'required' => false, - 'default' => null, + 'default' => '', 'array' => false, 'filters' => [], ], diff --git a/app/config/frameworks.php b/app/config/frameworks.php index 02df80793f..a44780137c 100644 --- a/app/config/frameworks.php +++ b/app/config/frameworks.php @@ -153,5 +153,21 @@ return [ 'bundleCommand' => '', ], ], - ] + ], + 'other' => [ + 'key' => 'other', + 'name' => 'Other', + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'adapters' => [ + 'static' => [ + 'key' => 'static', + 'buildCommand' => '', + 'installCommand' => '', + 'outputDirectory' => './', + 'startCommand' => 'sh helpers/server.sh', + 'bundleCommand' => '', + ], + ] + ], ]; diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 3ed57047ff..b087c70ef0 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -25318,7 +25318,8 @@ "remix", "nuxt", "nextjs", - "flutter" + "flutter", + "other" ], "x-enum-name": null, "x-enum-keys": [] @@ -25486,8 +25487,7 @@ "siteId", "name", "framework", - "buildRuntime", - "adapter" + "buildRuntime" ] } } @@ -25927,7 +25927,8 @@ "remix", "nuxt", "nextjs", - "flutter" + "flutter", + "other" ], "x-enum-name": null, "x-enum-keys": [] @@ -26068,8 +26069,7 @@ }, "required": [ "name", - "framework", - "adapter" + "framework" ] } } diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index ce226e8655..cbacaff82b 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -17134,7 +17134,8 @@ "remix", "nuxt", "nextjs", - "flutter" + "flutter", + "other" ], "x-enum-name": null, "x-enum-keys": [] @@ -17302,8 +17303,7 @@ "siteId", "name", "framework", - "buildRuntime", - "adapter" + "buildRuntime" ] } } @@ -17508,7 +17508,8 @@ "remix", "nuxt", "nextjs", - "flutter" + "flutter", + "other" ], "x-enum-name": null, "x-enum-keys": [] @@ -17649,8 +17650,7 @@ }, "required": [ "name", - "framework", - "adapter" + "framework" ] } } diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index abb2a389c0..da533d2ef0 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -25795,7 +25795,8 @@ "remix", "nuxt", "nextjs", - "flutter" + "flutter", + "other" ], "x-enum-name": null, "x-enum-keys": [] @@ -25908,7 +25909,7 @@ "adapter": { "type": "string", "description": "Framework adapter. Usuallly allows: static, ssr", - "default": null, + "default": "", "x-example": "" }, "installationId": { @@ -25982,8 +25983,7 @@ "siteId", "name", "framework", - "buildRuntime", - "adapter" + "buildRuntime" ] } } @@ -26421,7 +26421,8 @@ "remix", "nuxt", "nextjs", - "flutter" + "flutter", + "other" ], "x-enum-name": null, "x-enum-keys": [] @@ -26528,7 +26529,7 @@ "adapter": { "type": "string", "description": "Framework adapter. Usuallly allows: static, ssr", - "default": null, + "default": "", "x-example": "" }, "fallbackFile": { @@ -26576,8 +26577,7 @@ }, "required": [ "name", - "framework", - "adapter" + "framework" ] } } diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index be3138e93b..9f8fd86146 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -17579,7 +17579,8 @@ "remix", "nuxt", "nextjs", - "flutter" + "flutter", + "other" ], "x-enum-name": null, "x-enum-keys": [] @@ -17692,7 +17693,7 @@ "adapter": { "type": "string", "description": "Framework adapter. Usuallly allows: static, ssr", - "default": null, + "default": "", "x-example": "" }, "installationId": { @@ -17766,8 +17767,7 @@ "siteId", "name", "framework", - "buildRuntime", - "adapter" + "buildRuntime" ] } } @@ -17974,7 +17974,8 @@ "remix", "nuxt", "nextjs", - "flutter" + "flutter", + "other" ], "x-enum-name": null, "x-enum-keys": [] @@ -18081,7 +18082,7 @@ "adapter": { "type": "string", "description": "Framework adapter. Usuallly allows: static, ssr", - "default": null, + "default": "", "x-example": "" }, "fallbackFile": { @@ -18129,8 +18130,7 @@ }, "required": [ "name", - "framework", - "adapter" + "framework" ] } } diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/CreateSite.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/CreateSite.php index 74f8f8ab23..dcdb9920b4 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/CreateSite.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/CreateSite.php @@ -66,7 +66,7 @@ class CreateSite extends Base ->param('outputDirectory', '', new Text(8192, 0), 'Output Directory for site.', true) ->param('subdomain', '', new CustomId(), 'Unique custom sub-domain. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true) ->param('buildRuntime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Runtime to use during build step.') - ->param('adapter', '', new Text(8192, 0), 'Framework adapter. Usuallly allows: static, ssr') + ->param('adapter', '', new Text(8192, 0), 'Framework adapter. Usuallly allows: static, ssr', true) ->param('installationId', '', new Text(128, 0), 'Appwrite Installation ID for VCS (Version Control System) deployment.', true) ->param('fallbackFile', '', new Text(255, 0), 'Fallback file for single page application sites.', true) ->param('providerRepositoryId', '', new Text(128, 0), 'Repository ID of the repo linked to the site.', true) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/UpdateSite.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/UpdateSite.php index e3403f579b..f17fd6379d 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/UpdateSite.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/UpdateSite.php @@ -63,7 +63,7 @@ class UpdateSite extends Base ->param('buildCommand', '', new Text(8192, 0), 'Build Command.', true) ->param('outputDirectory', '', new Text(8192, 0), 'Output Directory for site.', true) ->param('buildRuntime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Runtime to use during build step.', true) - ->param('adapter', '', new Text(8192, 0), 'Framework adapter. Usuallly allows: static, ssr') + ->param('adapter', '', new Text(8192, 0), 'Framework adapter. Usuallly allows: static, ssr', true) ->param('fallbackFile', '', new Text(255, 0), 'Fallback file for single page application sites.', true) ->param('installationId', '', new Text(128, 0), 'Appwrite Installation ID for VCS (Version Control System) deployment.', true) ->param('providerRepositoryId', '', new Text(128, 0), 'Repository ID of the repo linked to the site.', true) From e15fdc493c29ba2e5a7e4b5535b83268bb3a41bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 2 Dec 2024 15:28:00 +0100 Subject: [PATCH 7/8] Fix missing key in specs --- app/config/frameworks.php | 156 +++++++++--------- .../specs/open-api3-latest-console.json | 24 +-- app/config/specs/open-api3-latest-server.json | 24 +-- app/config/specs/swagger2-latest-console.json | 24 +-- app/config/specs/swagger2-latest-server.json | 24 +-- .../Utopia/Response/Model/Framework.php | 6 + .../Response/Model/FrameworkAdapter.php | 6 - 7 files changed, 132 insertions(+), 132 deletions(-) diff --git a/app/config/frameworks.php b/app/config/frameworks.php index a44780137c..35c9c9909c 100644 --- a/app/config/frameworks.php +++ b/app/config/frameworks.php @@ -18,75 +18,27 @@ function getVersions(array $versions, string $prefix) } return [ - 'sveltekit' => [ - 'key' => 'sveltekit', - 'name' => 'SvelteKit', + 'nextjs' => [ + 'key' => 'nextjs', + 'name' => 'Next.js', 'buildRuntime' => 'node-22', 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), 'adapters' => [ - 'static' => [ - 'key' => 'static', - 'buildCommand' => 'npm run build', - 'installCommand' => 'npm install', - 'outputDirectory' => './build', - 'startCommand' => 'sh helpers/server.sh', - 'bundleCommand' => '', - ], 'ssr' => [ 'key' => 'ssr', 'buildCommand' => 'npm run build', 'installCommand' => 'npm install', - 'outputDirectory' => './build', - 'startCommand' => 'sh helpers/sveltekit/server.sh', - 'bundleCommand' => 'sh /usr/local/server/helpers/sveltekit/bundle.sh', - ] - ] - ], - 'astro' => [ - 'key' => 'astro', - 'name' => 'Astro', - 'buildRuntime' => 'node-22', - 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), - 'adapters' => [ + 'outputDirectory' => './.next', + 'startCommand' => 'sh helpers/next-js/server.sh', + 'bundleCommand' => 'sh /usr/local/server/helpers/next-js/bundle.sh', + ], 'static' => [ 'key' => 'static', 'buildCommand' => 'npm run build', 'installCommand' => 'npm install', - 'outputDirectory' => './dist', + 'outputDirectory' => './out', 'startCommand' => 'sh helpers/server.sh', 'bundleCommand' => '', - ], - 'ssr' => [ - 'key' => 'ssr', - 'buildCommand' => 'npm run build', - 'installCommand' => 'npm install', - 'outputDirectory' => './dist', - 'startCommand' => 'sh helpers/astro/server.sh', - 'bundleCommand' => 'sh /usr/local/server/helpers/astro/bundle.sh', - ] - ] - ], - 'remix' => [ - 'key' => 'remix', - 'name' => 'Remix', - 'buildRuntime' => 'node-22', - 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), - 'adapters' => [ - 'static' => [ - 'key' => 'static', - 'buildCommand' => 'npm run build', - 'installCommand' => 'npm install', - 'outputDirectory' => './build/client', - 'startCommand' => 'sh helpers/server.sh', - 'bundleCommand' => '', - ], - 'ssr' => [ - 'key' => 'ssr', - 'buildCommand' => 'npm run build', - 'installCommand' => 'npm install', - 'outputDirectory' => './build', - 'startCommand' => 'sh helpers/remix/server.sh', - 'bundleCommand' => 'sh /usr/local/server/helpers/remix/bundle.sh', ] ] ], @@ -96,14 +48,6 @@ return [ 'buildRuntime' => 'node-22', 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), 'adapters' => [ - 'static' => [ - 'key' => 'static', - 'buildCommand' => 'npm run generate', - 'installCommand' => 'npm install', - 'outputDirectory' => './dist', - 'startCommand' => 'sh helpers/server.sh', - 'bundleCommand' => '', - ], 'ssr' => [ 'key' => 'ssr', 'buildCommand' => 'npm run build', @@ -111,30 +55,86 @@ return [ 'outputDirectory' => './.output', 'startCommand' => 'sh helpers/nuxt/server.sh', 'bundleCommand' => 'sh /usr/local/server/helpers/nuxt/bundle.sh', + ], + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run generate', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist', + 'startCommand' => 'sh helpers/server.sh', + 'bundleCommand' => '', ] ] ], - 'nextjs' => [ - 'key' => 'nextjs', - 'name' => 'Next.js', + 'sveltekit' => [ + 'key' => 'sveltekit', + 'name' => 'SvelteKit', 'buildRuntime' => 'node-22', 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), 'adapters' => [ - 'static' => [ - 'key' => 'static', - 'buildCommand' => 'npm run build', - 'installCommand' => 'npm install', - 'outputDirectory' => './out', - 'startCommand' => 'sh helpers/server.sh', - 'bundleCommand' => '', - ], 'ssr' => [ 'key' => 'ssr', 'buildCommand' => 'npm run build', 'installCommand' => 'npm install', - 'outputDirectory' => './.next', - 'startCommand' => 'sh helpers/next-js/server.sh', - 'bundleCommand' => 'sh /usr/local/server/helpers/next-js/bundle.sh', + 'outputDirectory' => './build', + 'startCommand' => 'sh helpers/sveltekit/server.sh', + 'bundleCommand' => 'sh /usr/local/server/helpers/sveltekit/bundle.sh', + ], + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './build', + 'startCommand' => 'sh helpers/server.sh', + 'bundleCommand' => '', + ] + ] + ], + 'astro' => [ + 'key' => 'astro', + 'name' => 'Astro', + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'adapters' => [ + 'ssr' => [ + 'key' => 'ssr', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist', + 'startCommand' => 'sh helpers/astro/server.sh', + 'bundleCommand' => 'sh /usr/local/server/helpers/astro/bundle.sh', + ], + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist', + 'startCommand' => 'sh helpers/server.sh', + 'bundleCommand' => '', + ] + ] + ], + 'remix' => [ + 'key' => 'remix', + 'name' => 'Remix', + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'adapters' => [ + 'ssr' => [ + 'key' => 'ssr', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './build', + 'startCommand' => 'sh helpers/remix/server.sh', + 'bundleCommand' => 'sh /usr/local/server/helpers/remix/bundle.sh', + ], + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './build/client', + 'startCommand' => 'sh helpers/server.sh', + 'bundleCommand' => '', ] ] ], diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index b087c70ef0..413b3d8dfe 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -25311,13 +25311,13 @@ "framework": { "type": "string", "description": "Sites framework.", - "x-example": "sveltekit", + "x-example": "nextjs", "enum": [ + "nextjs", + "nuxt", "sveltekit", "astro", "remix", - "nuxt", - "nextjs", "flutter", "other" ], @@ -25920,13 +25920,13 @@ "framework": { "type": "string", "description": "Sites framework.", - "x-example": "sveltekit", + "x-example": "nextjs", "enum": [ + "nextjs", + "nuxt", "sveltekit", "astro", "remix", - "nuxt", - "nextjs", "flutter", "other" ], @@ -38168,6 +38168,11 @@ "description": "Framework Name.", "x-example": "SvelteKit" }, + "buildRuntime": { + "type": "string", + "description": "Default runtime version.", + "x-example": "node-22" + }, "runtimes": { "type": "array", "description": "List of supported runtime versions.", @@ -38199,6 +38204,7 @@ "required": [ "key", "name", + "buildRuntime", "runtimes", "adapters" ] @@ -38212,11 +38218,6 @@ "description": "Adapter key.", "x-example": "static" }, - "buildRuntime": { - "type": "string", - "description": "Default runtime version.", - "x-example": "node-22" - }, "installCommand": { "type": "string", "description": "Default command to download dependencies.", @@ -38235,7 +38236,6 @@ }, "required": [ "key", - "buildRuntime", "installCommand", "buildCommand", "outputDirectory" diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index cbacaff82b..643d8bf0be 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -17127,13 +17127,13 @@ "framework": { "type": "string", "description": "Sites framework.", - "x-example": "sveltekit", + "x-example": "nextjs", "enum": [ + "nextjs", + "nuxt", "sveltekit", "astro", "remix", - "nuxt", - "nextjs", "flutter", "other" ], @@ -17501,13 +17501,13 @@ "framework": { "type": "string", "description": "Sites framework.", - "x-example": "sveltekit", + "x-example": "nextjs", "enum": [ + "nextjs", + "nuxt", "sveltekit", "astro", "remix", - "nuxt", - "nextjs", "flutter", "other" ], @@ -27897,6 +27897,11 @@ "description": "Framework Name.", "x-example": "SvelteKit" }, + "buildRuntime": { + "type": "string", + "description": "Default runtime version.", + "x-example": "node-22" + }, "runtimes": { "type": "array", "description": "List of supported runtime versions.", @@ -27928,6 +27933,7 @@ "required": [ "key", "name", + "buildRuntime", "runtimes", "adapters" ] @@ -27941,11 +27947,6 @@ "description": "Adapter key.", "x-example": "static" }, - "buildRuntime": { - "type": "string", - "description": "Default runtime version.", - "x-example": "node-22" - }, "installCommand": { "type": "string", "description": "Default command to download dependencies.", @@ -27964,7 +27965,6 @@ }, "required": [ "key", - "buildRuntime", "installCommand", "buildCommand", "outputDirectory" diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index da533d2ef0..1419d4aec8 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -25788,13 +25788,13 @@ "type": "string", "description": "Sites framework.", "default": null, - "x-example": "sveltekit", + "x-example": "nextjs", "enum": [ + "nextjs", + "nuxt", "sveltekit", "astro", "remix", - "nuxt", - "nextjs", "flutter", "other" ], @@ -26414,13 +26414,13 @@ "type": "string", "description": "Sites framework.", "default": null, - "x-example": "sveltekit", + "x-example": "nextjs", "enum": [ + "nextjs", + "nuxt", "sveltekit", "astro", "remix", - "nuxt", - "nextjs", "flutter", "other" ], @@ -38727,6 +38727,11 @@ "description": "Framework Name.", "x-example": "SvelteKit" }, + "buildRuntime": { + "type": "string", + "description": "Default runtime version.", + "x-example": "node-22" + }, "runtimes": { "type": "array", "description": "List of supported runtime versions.", @@ -38759,6 +38764,7 @@ "required": [ "key", "name", + "buildRuntime", "runtimes", "adapters" ] @@ -38772,11 +38778,6 @@ "description": "Adapter key.", "x-example": "static" }, - "buildRuntime": { - "type": "string", - "description": "Default runtime version.", - "x-example": "node-22" - }, "installCommand": { "type": "string", "description": "Default command to download dependencies.", @@ -38795,7 +38796,6 @@ }, "required": [ "key", - "buildRuntime", "installCommand", "buildCommand", "outputDirectory" diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 9f8fd86146..945b1daee6 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -17572,13 +17572,13 @@ "type": "string", "description": "Sites framework.", "default": null, - "x-example": "sveltekit", + "x-example": "nextjs", "enum": [ + "nextjs", + "nuxt", "sveltekit", "astro", "remix", - "nuxt", - "nextjs", "flutter", "other" ], @@ -17967,13 +17967,13 @@ "type": "string", "description": "Sites framework.", "default": null, - "x-example": "sveltekit", + "x-example": "nextjs", "enum": [ + "nextjs", + "nuxt", "sveltekit", "astro", "remix", - "nuxt", - "nextjs", "flutter", "other" ], @@ -28429,6 +28429,11 @@ "description": "Framework Name.", "x-example": "SvelteKit" }, + "buildRuntime": { + "type": "string", + "description": "Default runtime version.", + "x-example": "node-22" + }, "runtimes": { "type": "array", "description": "List of supported runtime versions.", @@ -28461,6 +28466,7 @@ "required": [ "key", "name", + "buildRuntime", "runtimes", "adapters" ] @@ -28474,11 +28480,6 @@ "description": "Adapter key.", "x-example": "static" }, - "buildRuntime": { - "type": "string", - "description": "Default runtime version.", - "x-example": "node-22" - }, "installCommand": { "type": "string", "description": "Default command to download dependencies.", @@ -28497,7 +28498,6 @@ }, "required": [ "key", - "buildRuntime", "installCommand", "buildCommand", "outputDirectory" diff --git a/src/Appwrite/Utopia/Response/Model/Framework.php b/src/Appwrite/Utopia/Response/Model/Framework.php index 40ce126ea0..14d4052133 100644 --- a/src/Appwrite/Utopia/Response/Model/Framework.php +++ b/src/Appwrite/Utopia/Response/Model/Framework.php @@ -22,6 +22,12 @@ class Framework extends Model 'default' => '', 'example' => 'SvelteKit' ]) + ->addRule('buildRuntime', [ + 'type' => self::TYPE_STRING, + 'description' => 'Default runtime version.', + 'default' => '', + 'example' => 'node-22', + ]) ->addRule('runtimes', [ 'type' => self::TYPE_STRING, 'description' => 'List of supported runtime versions.', diff --git a/src/Appwrite/Utopia/Response/Model/FrameworkAdapter.php b/src/Appwrite/Utopia/Response/Model/FrameworkAdapter.php index 08ee79063e..8348f3a6d5 100644 --- a/src/Appwrite/Utopia/Response/Model/FrameworkAdapter.php +++ b/src/Appwrite/Utopia/Response/Model/FrameworkAdapter.php @@ -16,12 +16,6 @@ class FrameworkAdapter extends Model 'default' => '', 'example' => 'static', ]) - ->addRule('buildRuntime', [ - 'type' => self::TYPE_STRING, - 'description' => 'Default runtime version.', - 'default' => '', - 'example' => 'node-22', - ]) ->addRule('installCommand', [ 'type' => self::TYPE_STRING, 'description' => 'Default command to download dependencies.', From cd4f78d61965aeb77d9e64b235b2331783452a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 2 Dec 2024 15:34:39 +0100 Subject: [PATCH 8/8] Update specs --- app/config/specs/open-api3-latest-client.json | 14 +- .../specs/open-api3-latest-console.json | 253 +++++++++++++++++- app/config/specs/open-api3-latest-server.json | 248 ++++++++++++++++- app/config/specs/swagger2-latest-client.json | 14 +- app/config/specs/swagger2-latest-console.json | 251 ++++++++++++++++- app/config/specs/swagger2-latest-server.json | 246 ++++++++++++++++- 6 files changed, 974 insertions(+), 52 deletions(-) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 8757bb885f..0d0a7a0404 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -9360,11 +9360,16 @@ "any" ] }, - "functionId": { + "resourceId": { "type": "string", - "description": "Function ID.", + "description": "Resource ID.", "x-example": "5e5ea6g16897e" }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "sites" + }, "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", @@ -9432,7 +9437,7 @@ }, "duration": { "type": "number", - "description": "Function execution duration in seconds.", + "description": "Resource(function\/site) execution duration in seconds.", "x-example": 0.4, "format": "double" }, @@ -9448,7 +9453,8 @@ "$createdAt", "$updatedAt", "$permissions", - "functionId", + "resourceId", + "resourceType", "trigger", "status", "requestMethod", diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 413b3d8dfe..8d9d716009 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -25568,7 +25568,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 419, + "weight": 422, "cookies": false, "type": "", "deprecated": false, @@ -25670,7 +25670,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 420, + "weight": 423, "cookies": false, "type": "", "deprecated": false, @@ -25732,7 +25732,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 422, + "weight": 425, "cookies": false, "type": "", "deprecated": false, @@ -26800,6 +26800,227 @@ ] } }, + "\/sites\/{siteId}\/logs": { + "get": { + "summary": "List logs", + "operationId": "sitesListLogs", + "tags": [ + "sites" + ], + "description": "", + "responses": { + "200": { + "description": "Executions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/executionList" + } + } + } + } + }, + "x-appwrite": { + "method": "listLogs", + "weight": 415, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/sites\/list-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/logs\/{logId}": { + "get": { + "summary": "Get log", + "operationId": "sitesGetLog", + "tags": [ + "sites" + ], + "description": "", + "responses": { + "200": { + "description": "Execution", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "x-appwrite": { + "method": "getLog", + "weight": 414, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/sites\/get-log.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete log", + "operationId": "sitesDeleteLog", + "tags": [ + "sites" + ], + "description": "", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteLog", + "weight": 416, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/delete-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/sites\/delete-log.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.write", + "platforms": [ + "server" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, "\/sites\/{siteId}\/usage": { "get": { "summary": "Get site usage", @@ -26822,7 +27043,7 @@ }, "x-appwrite": { "method": "getSiteUsage", - "weight": 421, + "weight": 424, "cookies": false, "type": "", "deprecated": false, @@ -26906,7 +27127,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 416, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -26967,7 +27188,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 414, + "weight": 417, "cookies": false, "type": "", "deprecated": false, @@ -27060,7 +27281,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 415, + "weight": 418, "cookies": false, "type": "", "deprecated": false, @@ -27131,7 +27352,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 417, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -27219,7 +27440,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 418, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -38431,11 +38652,16 @@ "any" ] }, - "functionId": { + "resourceId": { "type": "string", - "description": "Function ID.", + "description": "Resource ID.", "x-example": "5e5ea6g16897e" }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "sites" + }, "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", @@ -38503,7 +38729,7 @@ }, "duration": { "type": "number", - "description": "Function execution duration in seconds.", + "description": "Resource(function\/site) execution duration in seconds.", "x-example": 0.4, "format": "double" }, @@ -38519,7 +38745,8 @@ "$createdAt", "$updatedAt", "$permissions", - "functionId", + "resourceId", + "resourceType", "trigger", "status", "requestMethod", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 643d8bf0be..fe2b63bf6d 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -18391,6 +18391,230 @@ ] } }, + "\/sites\/{siteId}\/logs": { + "get": { + "summary": "List logs", + "operationId": "sitesListLogs", + "tags": [ + "sites" + ], + "description": "", + "responses": { + "200": { + "description": "Executions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/executionList" + } + } + } + } + }, + "x-appwrite": { + "method": "listLogs", + "weight": 415, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/sites\/list-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/logs\/{logId}": { + "get": { + "summary": "Get log", + "operationId": "sitesGetLog", + "tags": [ + "sites" + ], + "description": "", + "responses": { + "200": { + "description": "Execution", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "x-appwrite": { + "method": "getLog", + "weight": 414, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/sites\/get-log.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete log", + "operationId": "sitesDeleteLog", + "tags": [ + "sites" + ], + "description": "", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteLog", + "weight": 416, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/delete-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/sites\/delete-log.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.write", + "platforms": [ + "server" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, "\/sites\/{siteId}\/variables": { "get": { "summary": "List variables", @@ -18413,7 +18637,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 416, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -18475,7 +18699,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 414, + "weight": 417, "cookies": false, "type": "", "deprecated": false, @@ -18569,7 +18793,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 415, + "weight": 418, "cookies": false, "type": "", "deprecated": false, @@ -18641,7 +18865,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 417, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -18730,7 +18954,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 418, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -28160,11 +28384,16 @@ "any" ] }, - "functionId": { + "resourceId": { "type": "string", - "description": "Function ID.", + "description": "Resource ID.", "x-example": "5e5ea6g16897e" }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "sites" + }, "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", @@ -28232,7 +28461,7 @@ }, "duration": { "type": "number", - "description": "Function execution duration in seconds.", + "description": "Resource(function\/site) execution duration in seconds.", "x-example": 0.4, "format": "double" }, @@ -28248,7 +28477,8 @@ "$createdAt", "$updatedAt", "$permissions", - "functionId", + "resourceId", + "resourceType", "trigger", "status", "requestMethod", diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 22a28523cc..025f5da29f 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -9539,11 +9539,16 @@ "any" ] }, - "functionId": { + "resourceId": { "type": "string", - "description": "Function ID.", + "description": "Resource ID.", "x-example": "5e5ea6g16897e" }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "sites" + }, "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", @@ -9613,7 +9618,7 @@ }, "duration": { "type": "number", - "description": "Function execution duration in seconds.", + "description": "Resource(function\/site) execution duration in seconds.", "x-example": 0.4, "format": "double" }, @@ -9629,7 +9634,8 @@ "$createdAt", "$updatedAt", "$permissions", - "functionId", + "resourceId", + "resourceType", "trigger", "status", "requestMethod", diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 1419d4aec8..7676c049a1 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -26067,7 +26067,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 419, + "weight": 422, "cookies": false, "type": "", "deprecated": false, @@ -26165,7 +26165,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 420, + "weight": 423, "cookies": false, "type": "", "deprecated": false, @@ -26227,7 +26227,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 422, + "weight": 425, "cookies": false, "type": "", "deprecated": false, @@ -27309,6 +27309,225 @@ ] } }, + "\/sites\/{siteId}\/logs": { + "get": { + "summary": "List logs", + "operationId": "sitesListLogs", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "", + "responses": { + "200": { + "description": "Executions List", + "schema": { + "$ref": "#\/definitions\/executionList" + } + } + }, + "x-appwrite": { + "method": "listLogs", + "weight": 415, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/sites\/list-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "", + "default": "", + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/logs\/{logId}": { + "get": { + "summary": "Get log", + "operationId": "sitesGetLog", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "", + "responses": { + "200": { + "description": "Execution", + "schema": { + "$ref": "#\/definitions\/execution" + } + } + }, + "x-appwrite": { + "method": "getLog", + "weight": 414, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/sites\/get-log.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete log", + "operationId": "sitesDeleteLog", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "sites" + ], + "description": "", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteLog", + "weight": 416, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/delete-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/sites\/delete-log.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.write", + "platforms": [ + "server" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + } + ] + } + }, "\/sites\/{siteId}\/usage": { "get": { "summary": "Get site usage", @@ -27333,7 +27552,7 @@ }, "x-appwrite": { "method": "getSiteUsage", - "weight": 421, + "weight": 424, "cookies": false, "type": "", "deprecated": false, @@ -27415,7 +27634,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 416, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -27476,7 +27695,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 414, + "weight": 417, "cookies": false, "type": "", "deprecated": false, @@ -27570,7 +27789,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 415, + "weight": 418, "cookies": false, "type": "", "deprecated": false, @@ -27639,7 +27858,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 417, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -27727,7 +27946,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 418, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -38991,11 +39210,16 @@ "any" ] }, - "functionId": { + "resourceId": { "type": "string", - "description": "Function ID.", + "description": "Resource ID.", "x-example": "5e5ea6g16897e" }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "sites" + }, "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", @@ -39065,7 +39289,7 @@ }, "duration": { "type": "number", - "description": "Function execution duration in seconds.", + "description": "Resource(function\/site) execution duration in seconds.", "x-example": 0.4, "format": "double" }, @@ -39081,7 +39305,8 @@ "$createdAt", "$updatedAt", "$permissions", - "functionId", + "resourceId", + "resourceType", "trigger", "status", "requestMethod", diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 945b1daee6..5e685419fa 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -18872,6 +18872,228 @@ ] } }, + "\/sites\/{siteId}\/logs": { + "get": { + "summary": "List logs", + "operationId": "sitesListLogs", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "", + "responses": { + "200": { + "description": "Executions List", + "schema": { + "$ref": "#\/definitions\/executionList" + } + } + }, + "x-appwrite": { + "method": "listLogs", + "weight": 415, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/sites\/list-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "", + "default": "", + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/logs\/{logId}": { + "get": { + "summary": "Get log", + "operationId": "sitesGetLog", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "", + "responses": { + "200": { + "description": "Execution", + "schema": { + "$ref": "#\/definitions\/execution" + } + } + }, + "x-appwrite": { + "method": "getLog", + "weight": 414, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/sites\/get-log.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete log", + "operationId": "sitesDeleteLog", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "sites" + ], + "description": "", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteLog", + "weight": 416, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/delete-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/sites\/delete-log.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.write", + "platforms": [ + "server" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + } + ] + } + }, "\/sites\/{siteId}\/variables": { "get": { "summary": "List variables", @@ -18896,7 +19118,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 416, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -18958,7 +19180,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 414, + "weight": 417, "cookies": false, "type": "", "deprecated": false, @@ -19053,7 +19275,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 415, + "weight": 418, "cookies": false, "type": "", "deprecated": false, @@ -19123,7 +19345,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 417, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -19212,7 +19434,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 418, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -28693,11 +28915,16 @@ "any" ] }, - "functionId": { + "resourceId": { "type": "string", - "description": "Function ID.", + "description": "Resource ID.", "x-example": "5e5ea6g16897e" }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "sites" + }, "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", @@ -28767,7 +28994,7 @@ }, "duration": { "type": "number", - "description": "Function execution duration in seconds.", + "description": "Resource(function\/site) execution duration in seconds.", "x-example": 0.4, "format": "double" }, @@ -28783,7 +29010,8 @@ "$createdAt", "$updatedAt", "$permissions", - "functionId", + "resourceId", + "resourceType", "trigger", "status", "requestMethod",