From 5c0579fbc7b0561348f00baee0efa86f2a2c27ee Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 31 Jul 2025 13:50:34 +0530 Subject: [PATCH 01/38] feat: telemetry for cache hits and misses --- app/controllers/shared/api.php | 7 ++++++- app/init/resources.php | 16 ++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 86fb1e5822..ca7fc4e6ec 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -31,6 +31,7 @@ use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; use Utopia\Queue\Publisher; use Utopia\System\System; +use Utopia\Telemetry\Counter; use Utopia\Validator\WhiteList; $parseLabel = function (string $label, array $responsePayload, array $requestParams, Document $user) { @@ -421,7 +422,9 @@ App::init() ->inject('apiKey') ->inject('plan') ->inject('devKey') - ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode, ?Key $apiKey, array $plan, Document $devKey) use ($usageDatabaseListener, $eventDatabaseListener) { + ->inject('cacheHitsCounter') + ->inject('cacheMissesCounter') + ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode, ?Key $apiKey, array $plan, Document $devKey, Counter $cacheHitsCounter, Counter $cacheMissesCounter) use ($usageDatabaseListener, $eventDatabaseListener) { $route = $utopia->getRoute(); @@ -619,10 +622,12 @@ App::init() ->addHeader('Cache-Control', sprintf('private, max-age=%d', $timestamp)) ->addHeader('X-Appwrite-Cache', 'hit') ->setContentType($cacheLog->getAttribute('mimeType')); + $cacheHitsCounter->add(1); if (!$isImageTransformation || !$isDisabled) { $response->send($data); } } else { + $cacheMissesCounter->add(1); $response ->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate') ->addHeader('Pragma', 'no-cache') diff --git a/app/init/resources.php b/app/init/resources.php index 162eab1973..5aa8727e44 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -1009,3 +1009,19 @@ App::setResource('httpReferrerSafe', function (Request $request, string $httpRef $referrer = (!empty($protocol) ? $protocol : $request->getProtocol()) . '://' . $origin . (!empty($port) ? ':' . $port : ''); return $referrer; }, ['request', 'httpReferrer', 'platforms', 'dbForPlatform', 'project', 'utopia']); + +App::setResource('cacheHitsCounter', function (Telemetry $telemetry) { + return $telemetry->createCounter( + 'cache_hits_total', + 'hits', + 'Total number of cache hits' + ); +}, ['telemetry']); + +App::setResource('cacheMissesCounter', function (Telemetry $telemetry) { + return $telemetry->createCounter( + 'cache_misses_total', + 'misses', + 'Total number of cache misses' + ); +}, ['telemetry']); From d1c3a84ba160df49552c509a60bff98effdb229d Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 31 Jul 2025 16:40:40 +0530 Subject: [PATCH 02/38] chore: update to use gauge --- app/controllers/shared/api.php | 14 ++++++++------ app/init/resources.php | 16 ++++------------ 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index ca7fc4e6ec..e1641040c8 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -31,7 +31,7 @@ use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; use Utopia\Queue\Publisher; use Utopia\System\System; -use Utopia\Telemetry\Counter; +use Utopia\Telemetry\Gauge; use Utopia\Validator\WhiteList; $parseLabel = function (string $label, array $responsePayload, array $requestParams, Document $user) { @@ -422,9 +422,9 @@ App::init() ->inject('apiKey') ->inject('plan') ->inject('devKey') - ->inject('cacheHitsCounter') - ->inject('cacheMissesCounter') - ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode, ?Key $apiKey, array $plan, Document $devKey, Counter $cacheHitsCounter, Counter $cacheMissesCounter) use ($usageDatabaseListener, $eventDatabaseListener) { + ->inject('cacheHitsGauge') + ->inject('cacheMissesGauge') + ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode, ?Key $apiKey, array $plan, Document $devKey, Gauge $cacheHitsCounter, Gauge $cacheMissesCounter) use ($usageDatabaseListener, $eventDatabaseListener) { $route = $utopia->getRoute(); @@ -622,12 +622,14 @@ App::init() ->addHeader('Cache-Control', sprintf('private, max-age=%d', $timestamp)) ->addHeader('X-Appwrite-Cache', 'hit') ->setContentType($cacheLog->getAttribute('mimeType')); - $cacheHitsCounter->add(1); + $cacheHitsCounter->record(1, [ + 'resourceType' => $type, + ]); if (!$isImageTransformation || !$isDisabled) { $response->send($data); } } else { - $cacheMissesCounter->add(1); + $cacheMissesCounter->record(1); $response ->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate') ->addHeader('Pragma', 'no-cache') diff --git a/app/init/resources.php b/app/init/resources.php index 5aa8727e44..c68a8d389d 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -1010,18 +1010,10 @@ App::setResource('httpReferrerSafe', function (Request $request, string $httpRef return $referrer; }, ['request', 'httpReferrer', 'platforms', 'dbForPlatform', 'project', 'utopia']); -App::setResource('cacheHitsCounter', function (Telemetry $telemetry) { - return $telemetry->createCounter( - 'cache_hits_total', - 'hits', - 'Total number of cache hits' - ); +App::setResource('cacheHitsGauge', function (Telemetry $telemetry) { + return $telemetry->createGauge('cache.hits.total'); }, ['telemetry']); -App::setResource('cacheMissesCounter', function (Telemetry $telemetry) { - return $telemetry->createCounter( - 'cache_misses_total', - 'misses', - 'Total number of cache misses' - ); +App::setResource('cacheMissesGauge', function (Telemetry $telemetry) { + return $telemetry->createGauge('cache.misses.total'); }, ['telemetry']); From da1fa09e9ce14b0c8568fb2a274b69c7af5031b0 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 31 Jul 2025 17:06:29 +0530 Subject: [PATCH 03/38] chore: update name --- app/controllers/shared/api.php | 10 +++++----- app/init/resources.php | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index e1641040c8..a37d921d40 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -422,9 +422,9 @@ App::init() ->inject('apiKey') ->inject('plan') ->inject('devKey') - ->inject('cacheHitsGauge') - ->inject('cacheMissesGauge') - ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode, ?Key $apiKey, array $plan, Document $devKey, Gauge $cacheHitsCounter, Gauge $cacheMissesCounter) use ($usageDatabaseListener, $eventDatabaseListener) { + ->inject('storageCacheHitsGauge') + ->inject('storageCacheMissesGauge') + ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode, ?Key $apiKey, array $plan, Document $devKey, Gauge $storageCacheHitsCounter, Gauge $storageCacheMissesCounter) use ($usageDatabaseListener, $eventDatabaseListener) { $route = $utopia->getRoute(); @@ -622,14 +622,14 @@ App::init() ->addHeader('Cache-Control', sprintf('private, max-age=%d', $timestamp)) ->addHeader('X-Appwrite-Cache', 'hit') ->setContentType($cacheLog->getAttribute('mimeType')); - $cacheHitsCounter->record(1, [ + $storageCacheHitsCounter->record(1, [ 'resourceType' => $type, ]); if (!$isImageTransformation || !$isDisabled) { $response->send($data); } } else { - $cacheMissesCounter->record(1); + $storageCacheMissesCounter->record(1); $response ->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate') ->addHeader('Pragma', 'no-cache') diff --git a/app/init/resources.php b/app/init/resources.php index c68a8d389d..a01fd0e13e 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -1010,10 +1010,10 @@ App::setResource('httpReferrerSafe', function (Request $request, string $httpRef return $referrer; }, ['request', 'httpReferrer', 'platforms', 'dbForPlatform', 'project', 'utopia']); -App::setResource('cacheHitsGauge', function (Telemetry $telemetry) { - return $telemetry->createGauge('cache.hits.total'); +App::setResource('storageCacheHitsGauge', function (Telemetry $telemetry) { + return $telemetry->createGauge('storage.cache.hits'); }, ['telemetry']); -App::setResource('cacheMissesGauge', function (Telemetry $telemetry) { - return $telemetry->createGauge('cache.misses.total'); +App::setResource('storageCacheMissesGauge', function (Telemetry $telemetry) { + return $telemetry->createGauge('storage.cache.misses'); }, ['telemetry']); From 588087eda6d0487d995e9b565db1248085997f99 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 31 Jul 2025 17:17:15 +0530 Subject: [PATCH 04/38] chore: add total --- app/init/resources.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/init/resources.php b/app/init/resources.php index a01fd0e13e..6ab44e255e 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -1011,9 +1011,9 @@ App::setResource('httpReferrerSafe', function (Request $request, string $httpRef }, ['request', 'httpReferrer', 'platforms', 'dbForPlatform', 'project', 'utopia']); App::setResource('storageCacheHitsGauge', function (Telemetry $telemetry) { - return $telemetry->createGauge('storage.cache.hits'); + return $telemetry->createGauge('storage.cache.hits.total'); }, ['telemetry']); App::setResource('storageCacheMissesGauge', function (Telemetry $telemetry) { - return $telemetry->createGauge('storage.cache.misses'); + return $telemetry->createGauge('storage.cache.misses.total'); }, ['telemetry']); From 81e656e42c81f18a67ec2ba4d54c6a8a91683dfe Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 31 Jul 2025 18:59:17 +0530 Subject: [PATCH 05/38] chore: update counter --- app/controllers/shared/api.php | 14 ++++++++------ app/init/resources.php | 8 ++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index a37d921d40..f627d0ddfe 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -31,7 +31,7 @@ use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; use Utopia\Queue\Publisher; use Utopia\System\System; -use Utopia\Telemetry\Gauge; +use Utopia\Telemetry\Counter; use Utopia\Validator\WhiteList; $parseLabel = function (string $label, array $responsePayload, array $requestParams, Document $user) { @@ -422,9 +422,8 @@ App::init() ->inject('apiKey') ->inject('plan') ->inject('devKey') - ->inject('storageCacheHitsGauge') - ->inject('storageCacheMissesGauge') - ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode, ?Key $apiKey, array $plan, Document $devKey, Gauge $storageCacheHitsCounter, Gauge $storageCacheMissesCounter) use ($usageDatabaseListener, $eventDatabaseListener) { + ->inject('storageCacheOperationsCounter') + ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode, ?Key $apiKey, array $plan, Document $devKey, Counter $storageCacheOperationsCounter) use ($usageDatabaseListener, $eventDatabaseListener) { $route = $utopia->getRoute(); @@ -622,14 +621,17 @@ App::init() ->addHeader('Cache-Control', sprintf('private, max-age=%d', $timestamp)) ->addHeader('X-Appwrite-Cache', 'hit') ->setContentType($cacheLog->getAttribute('mimeType')); - $storageCacheHitsCounter->record(1, [ + $storageCacheOperationsCounter->add(1, [ + 'result' => 'hit', 'resourceType' => $type, ]); if (!$isImageTransformation || !$isDisabled) { $response->send($data); } } else { - $storageCacheMissesCounter->record(1); + $storageCacheOperationsCounter->add(1, [ + 'result' => 'miss', + ]); $response ->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate') ->addHeader('Pragma', 'no-cache') diff --git a/app/init/resources.php b/app/init/resources.php index 6ab44e255e..ec62a6c0bb 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -1010,10 +1010,6 @@ App::setResource('httpReferrerSafe', function (Request $request, string $httpRef return $referrer; }, ['request', 'httpReferrer', 'platforms', 'dbForPlatform', 'project', 'utopia']); -App::setResource('storageCacheHitsGauge', function (Telemetry $telemetry) { - return $telemetry->createGauge('storage.cache.hits.total'); -}, ['telemetry']); - -App::setResource('storageCacheMissesGauge', function (Telemetry $telemetry) { - return $telemetry->createGauge('storage.cache.misses.total'); +App::setResource('storageCacheOperationsCounter', function (Telemetry $telemetry) { + return $telemetry->createCounter('storage.cache.operations.total'); }, ['telemetry']); From 59bebe6be9bf673bd274a688cfc6882a720316b9 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 1 Aug 2025 09:13:34 +0530 Subject: [PATCH 06/38] fix: 500 errors on robots and humans txt files --- app/controllers/general.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index 42e26b6fbe..c98d59d89a 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -1380,7 +1380,7 @@ App::get('/robots.txt') ->inject('apiKey') ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) { $host = $request->getHostname() ?? ''; - $mainDomain = System::getEnv('_APP_DOMAIN', ''); + $mainDomain = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); if (($host === $mainDomain || $host === 'localhost') && empty($previewHostname)) { $template = new View(__DIR__ . '/../views/general/robots.phtml'); @@ -1413,7 +1413,7 @@ App::get('/humans.txt') ->inject('apiKey') ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) { $host = $request->getHostname() ?? ''; - $mainDomain = System::getEnv('_APP_DOMAIN', ''); + $mainDomain = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); if (($host === $mainDomain || $host === 'localhost') && empty($previewHostname)) { $template = new View(__DIR__ . '/../views/general/humans.phtml'); From 471d261114103584dab983274c919336aa8faeac Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 1 Aug 2025 09:28:07 +0530 Subject: [PATCH 07/38] chore: fallback to main domain --- app/controllers/general.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index c98d59d89a..d5b0979441 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -1380,9 +1380,10 @@ App::get('/robots.txt') ->inject('apiKey') ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) { $host = $request->getHostname() ?? ''; - $mainDomain = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); + $consoleDomain = System::getEnv('_APP_CONSOLE_DOMAIN', ''); + $mainDomain = System::getEnv('_APP_DOMAIN', ''); - if (($host === $mainDomain || $host === 'localhost') && empty($previewHostname)) { + if (($host === $consoleDomain || $host === $mainDomain || $host === 'localhost') && empty($previewHostname)) { $template = new View(__DIR__ . '/../views/general/robots.phtml'); $response->text($template->render(false)); } else { @@ -1413,9 +1414,10 @@ App::get('/humans.txt') ->inject('apiKey') ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) { $host = $request->getHostname() ?? ''; - $mainDomain = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); + $consoleDomain = System::getEnv('_APP_CONSOLE_DOMAIN', ''); + $mainDomain = System::getEnv('_APP_DOMAIN', ''); - if (($host === $mainDomain || $host === 'localhost') && empty($previewHostname)) { + if (($host === $consoleDomain || $host === $mainDomain || $host === 'localhost') && empty($previewHostname)) { $template = new View(__DIR__ . '/../views/general/humans.phtml'); $response->text($template->render(false)); } else { From 26be1b5caf1100a66e1e5f261700b1bcf9dd186e Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 1 Aug 2025 13:09:39 +0530 Subject: [PATCH 08/38] feat: add model examples + additonal examples to specs --- app/config/specs/open-api3-latest-client.json | 509 ++++- .../specs/open-api3-latest-console.json | 1760 +++++++++++++++-- app/config/specs/open-api3-latest-server.json | 1065 +++++++++- app/config/specs/swagger2-latest-client.json | 501 ++++- app/config/specs/swagger2-latest-console.json | 1752 ++++++++++++++-- app/config/specs/swagger2-latest-server.json | 1057 +++++++++- .../SDK/Specification/Format/OpenAPI3.php | 9 + .../SDK/Specification/Format/Swagger2.php | 10 + src/Appwrite/Utopia/Response/Model/Any.php | 10 + .../Utopia/Response/Model/Document.php | 11 + 10 files changed, 6033 insertions(+), 651 deletions(-) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 1364e2e053..cb453725f7 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4489,30 +4489,6 @@ } ], "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." - }, - { - "name": "createDocuments", - "auth": { - "Admin": [], - "Key": [] - }, - "parameters": [ - "databaseId", - "collectionId", - "documents" - ], - "required": [ - "databaseId", - "collectionId", - "documents" - ], - "responses": [ - { - "code": 201, - "model": "#\/components\/schemas\/documentList" - } - ], - "description": "**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.\n\nCreate new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." } ], "auth": { @@ -5385,7 +5361,7 @@ "scheduledAt": { "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", - "x-example": null + "x-example": "" } } } @@ -8057,7 +8033,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "error": { "description": "Error", @@ -8089,7 +8066,13 @@ "code", "type", "version" - ] + ], + "example": { + "message": "Not found", + "code": "404", + "type": "not_found", + "version": "1.0" + } }, "documentList": { "description": "Documents List", @@ -8113,7 +8096,11 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } }, "sessionList": { "description": "Sessions List", @@ -8137,7 +8124,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -8161,7 +8152,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -8185,7 +8180,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -8209,7 +8208,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "teamList": { "description": "Teams List", @@ -8233,7 +8236,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -8257,7 +8264,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "executionList": { "description": "Executions List", @@ -8281,7 +8292,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "countryList": { "description": "Countries List", @@ -8305,7 +8320,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -8329,7 +8348,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -8353,7 +8376,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -8377,7 +8404,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -8401,7 +8432,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -8425,7 +8460,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "document": { "description": "Document", @@ -8482,7 +8521,23 @@ "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -8616,7 +8671,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -8777,7 +8855,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -8791,7 +8895,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -8805,7 +8912,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -8819,7 +8929,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -8833,7 +8946,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -8875,7 +8991,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -8907,7 +9030,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -8942,12 +9071,19 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "session": { "description": "Session", @@ -9134,7 +9270,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -9202,7 +9371,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -9246,7 +9427,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -9260,7 +9449,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -9310,7 +9502,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -9330,7 +9531,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -9412,7 +9617,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "team": { "description": "Team", @@ -9463,7 +9683,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -9554,7 +9785,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "execution": { "description": "Execution", @@ -9685,7 +9933,36 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "country": { "description": "Country", @@ -9705,7 +9982,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -9725,7 +10006,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -9751,7 +10036,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -9803,7 +10093,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -9829,7 +10128,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "headers": { "description": "Headers", @@ -9849,7 +10153,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -9881,7 +10189,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -9901,7 +10215,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -9921,7 +10241,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -9953,7 +10277,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "subscriber": { "description": "Subscriber", @@ -10027,7 +10357,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -10089,7 +10439,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } } }, "securitySchemes": { diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index cfce70b45b..e23ddc58d8 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -11820,7 +11820,7 @@ "scheduledAt": { "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", - "x-example": null + "x-example": "" } } } @@ -35466,7 +35466,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "error": { "description": "Error", @@ -35498,7 +35499,13 @@ "code", "type", "version" - ] + ], + "example": { + "message": "Not found", + "code": "404", + "type": "not_found", + "version": "1.0" + } }, "documentList": { "description": "Documents List", @@ -35522,7 +35529,11 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } }, "collectionList": { "description": "Collections List", @@ -35546,7 +35557,11 @@ "required": [ "total", "collections" - ] + ], + "example": { + "total": 5, + "collections": "" + } }, "databaseList": { "description": "Databases List", @@ -35570,7 +35585,11 @@ "required": [ "total", "databases" - ] + ], + "example": { + "total": 5, + "databases": "" + } }, "indexList": { "description": "Indexes List", @@ -35594,7 +35613,11 @@ "required": [ "total", "indexes" - ] + ], + "example": { + "total": 5, + "indexes": "" + } }, "userList": { "description": "Users List", @@ -35618,7 +35641,11 @@ "required": [ "total", "users" - ] + ], + "example": { + "total": 5, + "users": "" + } }, "sessionList": { "description": "Sessions List", @@ -35642,7 +35669,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -35666,7 +35697,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -35690,7 +35725,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -35714,7 +35753,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "bucketList": { "description": "Buckets List", @@ -35738,7 +35781,11 @@ "required": [ "total", "buckets" - ] + ], + "example": { + "total": 5, + "buckets": "" + } }, "resourceTokenList": { "description": "Resource Tokens List", @@ -35762,7 +35809,11 @@ "required": [ "total", "tokens" - ] + ], + "example": { + "total": 5, + "tokens": "" + } }, "teamList": { "description": "Teams List", @@ -35786,7 +35837,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -35810,7 +35865,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "siteList": { "description": "Sites List", @@ -35834,7 +35893,11 @@ "required": [ "total", "sites" - ] + ], + "example": { + "total": 5, + "sites": "" + } }, "templateSiteList": { "description": "Site Templates List", @@ -35858,7 +35921,11 @@ "required": [ "total", "templates" - ] + ], + "example": { + "total": 5, + "templates": "" + } }, "functionList": { "description": "Functions List", @@ -35882,7 +35949,11 @@ "required": [ "total", "functions" - ] + ], + "example": { + "total": 5, + "functions": "" + } }, "templateFunctionList": { "description": "Function Templates List", @@ -35906,7 +35977,11 @@ "required": [ "total", "templates" - ] + ], + "example": { + "total": 5, + "templates": "" + } }, "installationList": { "description": "Installations List", @@ -35930,7 +36005,11 @@ "required": [ "total", "installations" - ] + ], + "example": { + "total": 5, + "installations": "" + } }, "providerRepositoryFrameworkList": { "description": "Framework Provider Repositories List", @@ -35954,7 +36033,11 @@ "required": [ "total", "frameworkProviderRepositories" - ] + ], + "example": { + "total": 5, + "frameworkProviderRepositories": "" + } }, "providerRepositoryRuntimeList": { "description": "Runtime Provider Repositories List", @@ -35978,7 +36061,11 @@ "required": [ "total", "runtimeProviderRepositories" - ] + ], + "example": { + "total": 5, + "runtimeProviderRepositories": "" + } }, "branchList": { "description": "Branches List", @@ -36002,7 +36089,11 @@ "required": [ "total", "branches" - ] + ], + "example": { + "total": 5, + "branches": "" + } }, "frameworkList": { "description": "Frameworks List", @@ -36026,7 +36117,11 @@ "required": [ "total", "frameworks" - ] + ], + "example": { + "total": 5, + "frameworks": "" + } }, "runtimeList": { "description": "Runtimes List", @@ -36050,7 +36145,11 @@ "required": [ "total", "runtimes" - ] + ], + "example": { + "total": 5, + "runtimes": "" + } }, "deploymentList": { "description": "Deployments List", @@ -36074,7 +36173,11 @@ "required": [ "total", "deployments" - ] + ], + "example": { + "total": 5, + "deployments": "" + } }, "executionList": { "description": "Executions List", @@ -36098,7 +36201,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "projectList": { "description": "Projects List", @@ -36122,7 +36229,11 @@ "required": [ "total", "projects" - ] + ], + "example": { + "total": 5, + "projects": "" + } }, "webhookList": { "description": "Webhooks List", @@ -36146,7 +36257,11 @@ "required": [ "total", "webhooks" - ] + ], + "example": { + "total": 5, + "webhooks": "" + } }, "keyList": { "description": "API Keys List", @@ -36170,7 +36285,11 @@ "required": [ "total", "keys" - ] + ], + "example": { + "total": 5, + "keys": "" + } }, "devKeyList": { "description": "Dev Keys List", @@ -36194,7 +36313,11 @@ "required": [ "total", "devKeys" - ] + ], + "example": { + "total": 5, + "devKeys": "" + } }, "platformList": { "description": "Platforms List", @@ -36218,7 +36341,11 @@ "required": [ "total", "platforms" - ] + ], + "example": { + "total": 5, + "platforms": "" + } }, "countryList": { "description": "Countries List", @@ -36242,7 +36369,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -36266,7 +36397,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -36290,7 +36425,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -36314,7 +36453,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -36338,7 +36481,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "variableList": { "description": "Variables List", @@ -36362,7 +36509,11 @@ "required": [ "total", "variables" - ] + ], + "example": { + "total": 5, + "variables": "" + } }, "proxyRuleList": { "description": "Rule List", @@ -36386,7 +36537,11 @@ "required": [ "total", "rules" - ] + ], + "example": { + "total": 5, + "rules": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -36410,7 +36565,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "providerList": { "description": "Provider list", @@ -36434,7 +36593,11 @@ "required": [ "total", "providers" - ] + ], + "example": { + "total": 5, + "providers": "" + } }, "messageList": { "description": "Message list", @@ -36458,7 +36621,11 @@ "required": [ "total", "messages" - ] + ], + "example": { + "total": 5, + "messages": "" + } }, "topicList": { "description": "Topic list", @@ -36482,7 +36649,11 @@ "required": [ "total", "topics" - ] + ], + "example": { + "total": 5, + "topics": "" + } }, "subscriberList": { "description": "Subscriber list", @@ -36506,7 +36677,11 @@ "required": [ "total", "subscribers" - ] + ], + "example": { + "total": 5, + "subscribers": "" + } }, "targetList": { "description": "Target list", @@ -36530,7 +36705,11 @@ "required": [ "total", "targets" - ] + ], + "example": { + "total": 5, + "targets": "" + } }, "migrationList": { "description": "Migrations List", @@ -36554,7 +36733,11 @@ "required": [ "total", "migrations" - ] + ], + "example": { + "total": 5, + "migrations": "" + } }, "specificationList": { "description": "Specifications List", @@ -36578,7 +36761,11 @@ "required": [ "total", "specifications" - ] + ], + "example": { + "total": 5, + "specifications": "" + } }, "vcsContentList": { "description": "VCS Content List", @@ -36602,7 +36789,11 @@ "required": [ "total", "contents" - ] + ], + "example": { + "total": 5, + "contents": "" + } }, "database": { "description": "Database", @@ -36640,7 +36831,14 @@ "$createdAt", "$updatedAt", "enabled" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false + } }, "collection": { "description": "Collection", @@ -36750,7 +36948,21 @@ "documentSecurity", "attributes", "indexes" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {} + } }, "attributeList": { "description": "Attributes List", @@ -36805,7 +37017,11 @@ "required": [ "total", "attributes" - ] + ], + "example": { + "total": 5, + "attributes": "" + } }, "attributeString": { "description": "AttributeString", @@ -36880,7 +37096,20 @@ "$createdAt", "$updatedAt", "size" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } }, "attributeInteger": { "description": "AttributeInteger", @@ -36957,7 +37186,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } }, "attributeFloat": { "description": "AttributeFloat", @@ -37034,7 +37276,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } }, "attributeBoolean": { "description": "AttributeBoolean", @@ -37096,7 +37351,18 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } }, "attributeEmail": { "description": "AttributeEmail", @@ -37164,7 +37430,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } }, "attributeEnum": { "description": "AttributeEnum", @@ -37241,7 +37519,20 @@ "$updatedAt", "elements", "format" - ] + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } }, "attributeIp": { "description": "AttributeIP", @@ -37309,7 +37600,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } }, "attributeUrl": { "description": "AttributeURL", @@ -37377,7 +37680,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } }, "attributeDatetime": { "description": "AttributeDatetime", @@ -37445,7 +37760,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } }, "attributeRelationship": { "description": "AttributeRelationship", @@ -37537,7 +37864,23 @@ "twoWayKey", "onDelete", "side" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } }, "index": { "description": "Index", @@ -37609,7 +37952,18 @@ "lengths", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [], + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "document": { "description": "Document", @@ -37666,7 +38020,23 @@ "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -37800,7 +38170,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -37961,7 +38354,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -37975,7 +38394,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -37989,7 +38411,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -38003,7 +38428,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -38017,7 +38445,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -38059,7 +38490,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -38091,7 +38529,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -38126,12 +38570,19 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "session": { "description": "Session", @@ -38318,7 +38769,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -38386,7 +38870,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -38430,7 +38926,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -38444,7 +38948,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -38494,7 +39001,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -38514,7 +39030,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -38596,7 +39116,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "bucket": { "description": "Bucket", @@ -38688,7 +39223,26 @@ "compression", "encryption", "antivirus" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false + } }, "resourceToken": { "description": "ResourceToken", @@ -38738,7 +39292,16 @@ "expire", "secret", "accessedAt" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "team": { "description": "Team", @@ -38789,7 +39352,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -38880,7 +39454,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "site": { "description": "Site", @@ -39066,7 +39657,38 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } }, "templateSite": { "description": "Template Site", @@ -39161,7 +39783,22 @@ "providerOwner", "providerVersion", "variables" - ] + ], + "example": { + "key": "starter", + "name": "Starter site", + "tagline": "Minimal web app integrating with Appwrite.", + "demoUrl": "https:\/\/nextjs-starter.appwrite.network\/", + "screenshotDark": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-dark.png", + "screenshotLight": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-light.png", + "useCases": "Starter", + "frameworks": [], + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [] + } }, "templateFramework": { "description": "Template Framework", @@ -39223,7 +39860,18 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/build", + "providerRootDirectory": ".\/svelte-kit\/starter", + "buildRuntime": "node-22", + "adapter": "ssr", + "fallbackFile": "index.html" + } }, "function": { "description": "Function", @@ -39412,7 +40060,37 @@ "providerRootDirectory", "providerSilentMode", "specification" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb" + } }, "templateFunction": { "description": "Template Function", @@ -39541,7 +40219,26 @@ "providerVersion", "variables", "scopes" - ] + ], + "example": { + "icon": "icon-lightning-bolt", + "id": "starter", + "name": "Starter function", + "tagline": "A simple function to get started.", + "permissions": "any", + "events": "account.create", + "cron": "0 0 * * *", + "timeout": 300, + "useCases": "Starter", + "runtimes": [], + "instructions": "For documentation and instructions check out .", + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [], + "scopes": "users.read" + } }, "templateRuntime": { "description": "Template Runtime", @@ -39573,7 +40270,13 @@ "commands", "entrypoint", "providerRootDirectory" - ] + ], + "example": { + "name": "node-19.0", + "commands": "npm install", + "entrypoint": "index.js", + "providerRootDirectory": "node\/starter" + } }, "templateVariable": { "description": "Template Variable", @@ -39623,7 +40326,16 @@ "placeholder", "required", "type" - ] + ], + "example": { + "name": "APPWRITE_DATABASE_ID", + "description": "The ID of the Appwrite database that contains the collection to sync.", + "value": "512", + "secret": false, + "placeholder": "64a55...7b912", + "required": false, + "type": "password" + } }, "installation": { "description": "Installation", @@ -39667,7 +40379,15 @@ "provider", "organization", "providerInstallationId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "provider": "github", + "organization": "appwrite", + "providerInstallationId": "5322" + } }, "providerRepository": { "description": "ProviderRepository", @@ -39717,7 +40437,16 @@ "private", "defaultBranch", "pushedAt" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime" + } }, "providerRepositoryFramework": { "description": "ProviderRepositoryFramework", @@ -39773,7 +40502,17 @@ "defaultBranch", "pushedAt", "framework" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime", + "framework": "nextjs" + } }, "providerRepositoryRuntime": { "description": "ProviderRepositoryRuntime", @@ -39829,7 +40568,17 @@ "defaultBranch", "pushedAt", "runtime" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime", + "runtime": "node-22" + } }, "detectionFramework": { "description": "DetectionFramework", @@ -39861,7 +40610,13 @@ "installCommand", "buildCommand", "outputDirectory" - ] + ], + "example": { + "framework": "nuxt", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "dist" + } }, "detectionRuntime": { "description": "DetectionRuntime", @@ -39887,7 +40642,12 @@ "runtime", "entrypoint", "commands" - ] + ], + "example": { + "runtime": "node", + "entrypoint": "index.js", + "commands": "npm install && npm run build" + } }, "vcsContent": { "description": "VcsContents", @@ -39914,7 +40674,12 @@ }, "required": [ "name" - ] + ], + "example": { + "size": 1523, + "isDirectory": true, + "name": "Main.java" + } }, "branch": { "description": "Branch", @@ -39928,7 +40693,10 @@ }, "required": [ "name" - ] + ], + "example": { + "name": "main" + } }, "runtime": { "description": "Runtime", @@ -39987,7 +40755,17 @@ "image", "logo", "supports" - ] + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } }, "framework": { "description": "Framework", @@ -40042,7 +40820,25 @@ "buildRuntime", "runtimes", "adapters" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } }, "frameworkAdapter": { "description": "Framework Adapter", @@ -40080,7 +40876,14 @@ "buildCommand", "outputDirectory", "fallbackFile" - ] + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } }, "deployment": { "description": "Deployment", @@ -40254,7 +41057,36 @@ "providerCommitMessage", "providerCommitUrl", "providerBranchUrl" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerBranch": "0.7.x", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } }, "execution": { "description": "Execution", @@ -40385,7 +41217,36 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "project": { "description": "Project", @@ -40781,7 +41642,73 @@ "serviceStatusForFunctions", "serviceStatusForGraphql", "serviceStatusForMessaging" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "New Project", + "description": "This is a new project.", + "teamId": "1592981250", + "logo": "5f5c451b403cb", + "url": "5f5c451b403cb", + "legalName": "Company LTD.", + "legalCountry": "US", + "legalState": "New York", + "legalCity": "New York City.", + "legalAddress": "620 Eighth Avenue, New York, NY 10018", + "legalTaxId": "131102020", + "authDuration": 60, + "authLimit": 100, + "authSessionsLimit": 10, + "authPasswordHistory": 5, + "authPasswordDictionary": true, + "authPersonalDataCheck": true, + "authMockNumbers": [ + {} + ], + "authSessionAlerts": true, + "authMembershipsUserName": true, + "authMembershipsUserEmail": true, + "authMembershipsMfa": true, + "oAuthProviders": [ + {} + ], + "platforms": {}, + "webhooks": {}, + "keys": {}, + "devKeys": {}, + "smtpEnabled": false, + "smtpSenderName": "John Appwrite", + "smtpSenderEmail": "john@appwrite.io", + "smtpReplyTo": "support@appwrite.io", + "smtpHost": "mail.appwrite.io", + "smtpPort": 25, + "smtpUsername": "emailuser", + "smtpPassword": "securepassword", + "smtpSecure": "tls", + "pingCount": 1, + "pingedAt": "2020-10-15T06:38:00.000+00:00", + "authEmailPassword": true, + "authUsersAuthMagicURL": true, + "authEmailOtp": true, + "authAnonymous": true, + "authInvites": true, + "authJWT": true, + "authPhone": true, + "serviceStatusForAccount": true, + "serviceStatusForAvatars": true, + "serviceStatusForDatabases": true, + "serviceStatusForLocale": true, + "serviceStatusForHealth": true, + "serviceStatusForStorage": true, + "serviceStatusForTeams": true, + "serviceStatusForUsers": true, + "serviceStatusForSites": true, + "serviceStatusForFunctions": true, + "serviceStatusForGraphql": true, + "serviceStatusForMessaging": true + } }, "webhook": { "description": "Webhook", @@ -40871,7 +41798,22 @@ "enabled", "logs", "attempts" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Webhook", + "url": "https:\/\/example.com\/webhook", + "events": "database.collections.update", + "security": true, + "httpUser": "username", + "httpPass": "password", + "signatureKey": "ad3d581ca230e2b7059c545e5a", + "enabled": true, + "logs": "Failed to connect to remote server.", + "attempts": 10 + } }, "key": { "description": "Key", @@ -40939,7 +41881,18 @@ "secret", "accessedAt", "sdks" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "scopes": "users.read", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } }, "devKey": { "description": "DevKey", @@ -40998,7 +41951,17 @@ "secret", "accessedAt", "sdks" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Dev API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } }, "mockNumber": { "description": "Mock Number", @@ -41018,7 +41981,11 @@ "required": [ "phone", "otp" - ] + ], + "example": { + "phone": "+1612842323", + "otp": "123456" + } }, "authProvider": { "description": "AuthProvider", @@ -41056,7 +42023,14 @@ "appId", "secret", "enabled" - ] + ], + "example": { + "key": "github", + "name": "GitHub", + "appId": "259125845563242502", + "secret": "Bpw_g9c2TGXxfgLshDbSaL8tsCcqgczQ", + "enabled": "" + } }, "platform": { "description": "Platform", @@ -41124,7 +42098,19 @@ "hostname", "httpUser", "httpPass" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Web App", + "type": "web", + "key": "com.company.appname", + "store": "", + "hostname": true, + "httpUser": "username", + "httpPass": "password" + } }, "variable": { "description": "Variable", @@ -41180,7 +42166,17 @@ "secret", "resourceType", "resourceId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } }, "country": { "description": "Country", @@ -41200,7 +42196,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -41220,7 +42220,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -41246,7 +42250,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -41298,7 +42307,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -41324,7 +42342,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "healthAntivirus": { "description": "Health Antivirus", @@ -41344,7 +42367,11 @@ "required": [ "version", "status" - ] + ], + "example": { + "version": "1.0.0", + "status": "online" + } }, "healthQueue": { "description": "Health Queue", @@ -41359,7 +42386,10 @@ }, "required": [ "size" - ] + ], + "example": { + "size": 8 + } }, "healthStatus": { "description": "Health Status", @@ -41386,7 +42416,12 @@ "name", "ping", "status" - ] + ], + "example": { + "name": "database", + "ping": 128, + "status": "pass" + } }, "healthCertificate": { "description": "Health Certificate", @@ -41430,7 +42465,15 @@ "validFrom", "validTo", "signatureTypeSN" - ] + ], + "example": { + "name": "\/CN=www.google.com", + "subjectSN": "", + "issuerOrganisation": "", + "validFrom": "1704200998", + "validTo": "1711458597", + "signatureTypeSN": "RSA-SHA256" + } }, "healthTime": { "description": "Health Time", @@ -41459,7 +42502,12 @@ "remoteTime", "localTime", "diff" - ] + ], + "example": { + "remoteTime": 1639490751, + "localTime": 1639490844, + "diff": 93 + } }, "metric": { "description": "Metric", @@ -41480,7 +42528,11 @@ "required": [ "value", "date" - ] + ], + "example": { + "value": 1, + "date": "2020-10-15T06:38:00.000+00:00" + } }, "metricBreakdown": { "description": "Metric Breakdown", @@ -41514,7 +42566,13 @@ "required": [ "name", "value" - ] + ], + "example": { + "resourceId": "5e5ea5c16897e", + "name": "Documents", + "value": 1, + "estimate": 1 + } }, "usageDatabases": { "description": "UsageDatabases", @@ -41624,7 +42682,22 @@ "storage", "databasesReads", "databasesWrites" - ] + ], + "example": { + "range": "30d", + "databasesTotal": 0, + "collectionsTotal": 0, + "documentsTotal": 0, + "storageTotal": 0, + "databasesReadsTotal": 0, + "databasesWritesTotal": 0, + "databases": [], + "collections": [], + "documents": [], + "storage": [], + "databasesReads": [], + "databasesWrites": [] + } }, "usageDatabase": { "description": "UsageDatabase", @@ -41718,7 +42791,20 @@ "storage", "databaseReads", "databaseWrites" - ] + ], + "example": { + "range": "30d", + "collectionsTotal": 0, + "documentsTotal": 0, + "storageTotal": 0, + "databaseReadsTotal": 0, + "databaseWritesTotal": 0, + "collections": [], + "documents": [], + "storage": [], + "databaseReads": [], + "databaseWrites": [] + } }, "usageCollection": { "description": "UsageCollection", @@ -41748,7 +42834,12 @@ "range", "documentsTotal", "documents" - ] + ], + "example": { + "range": "30d", + "documentsTotal": 0, + "documents": [] + } }, "usageUsers": { "description": "UsageUsers", @@ -41794,7 +42885,14 @@ "sessionsTotal", "users", "sessions" - ] + ], + "example": { + "range": "30d", + "usersTotal": 0, + "sessionsTotal": 0, + "users": [], + "sessions": [] + } }, "usageStorage": { "description": "StorageUsage", @@ -41856,7 +42954,16 @@ "buckets", "files", "storage" - ] + ], + "example": { + "range": "30d", + "bucketsTotal": 0, + "filesTotal": 0, + "filesStorageTotal": 0, + "buckets": [], + "files": [], + "storage": [] + } }, "usageBuckets": { "description": "UsageBuckets", @@ -41918,7 +43025,16 @@ "storage", "imageTransformations", "imageTransformationsTotal" - ] + ], + "example": { + "range": "30d", + "filesTotal": 0, + "filesStorageTotal": 0, + "files": [], + "storage": [], + "imageTransformations": [], + "imageTransformationsTotal": 0 + } }, "usageFunctions": { "description": "UsageFunctions", @@ -42124,7 +43240,34 @@ "executionsMbSeconds", "buildsSuccess", "buildsFailed" - ] + ], + "example": { + "range": "30d", + "functionsTotal": 0, + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "functions": 0, + "deployments": [], + "deploymentsStorage": [], + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [] + } }, "usageFunction": { "description": "UsageFunction", @@ -42321,7 +43464,33 @@ "executionsMbSeconds", "buildsSuccess", "buildsFailed" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsTimeAverage": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [] + } }, "usageSites": { "description": "UsageSites", @@ -42575,7 +43744,40 @@ "inbound", "outboundTotal", "outbound" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [], + "sitesTotal": 0, + "sites": [], + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [] + } }, "usageSite": { "description": "UsageSite", @@ -42820,7 +44022,39 @@ "inbound", "outboundTotal", "outbound" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsTimeAverage": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [], + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [] + } }, "usageProject": { "description": "UsageProject", @@ -43073,7 +44307,40 @@ "databasesWrites", "imageTransformations", "imageTransformationsTotal" - ] + ], + "example": { + "executionsTotal": 0, + "documentsTotal": 0, + "databasesTotal": 0, + "databasesStorageTotal": 0, + "usersTotal": 0, + "filesStorageTotal": 0, + "functionsStorageTotal": 0, + "buildsStorageTotal": 0, + "deploymentsStorageTotal": 0, + "bucketsTotal": 0, + "executionsMbSecondsTotal": 0, + "buildsMbSecondsTotal": 0, + "databasesReadsTotal": 0, + "databasesWritesTotal": 0, + "requests": [], + "network": [], + "users": [], + "executions": [], + "executionsBreakdown": [], + "bucketsBreakdown": [], + "databasesStorageBreakdown": [], + "executionsMbSecondsBreakdown": [], + "buildsMbSecondsBreakdown": [], + "functionsStorageBreakdown": [], + "authPhoneTotal": 0, + "authPhoneEstimate": 0, + "authPhoneCountryBreakdown": [], + "databasesReads": [], + "databasesWrites": [], + "imageTransformations": [], + "imageTransformationsTotal": 0 + } }, "headers": { "description": "Headers", @@ -43093,7 +44360,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "specification": { "description": "Specification", @@ -43127,7 +44398,13 @@ "cpus", "enabled", "slug" - ] + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } }, "proxyRule": { "description": "Rule", @@ -43226,7 +44503,24 @@ "status", "logs", "renewAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "domain": "appwrite.company.com", + "type": "deployment", + "trigger": "manual", + "redirectUrl": "https:\/\/appwrite.io\/docs", + "redirectStatusCode": 301, + "deploymentId": "n3u9feiwmf", + "deploymentResourceType": "function", + "deploymentResourceId": "n3u9feiwmf", + "deploymentVcsProviderBranch": "function", + "status": "verified", + "logs": "HTTP challegne failed.", + "renewAt": "datetime" + } }, "smsTemplate": { "description": "SmsTemplate", @@ -43252,7 +44546,12 @@ "type", "locale", "message" - ] + ], + "example": { + "type": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account." + } }, "emailTemplate": { "description": "EmailTemplate", @@ -43302,7 +44601,16 @@ "senderEmail", "replyTo", "subject" - ] + ], + "example": { + "type": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account.", + "senderName": "My User", + "senderEmail": "mail@appwrite.io", + "replyTo": "emails@appwrite.io", + "subject": "Please verify your email address" + } }, "consoleVariables": { "description": "Console Variables", @@ -43390,7 +44698,22 @@ "_APP_DOMAIN_FUNCTIONS", "_APP_OPTIONS_FORCE_HTTPS", "_APP_DOMAINS_NAMESERVERS" - ] + ], + "example": { + "_APP_DOMAIN_TARGET_CNAME": "appwrite.io", + "_APP_DOMAIN_TARGET_A": "127.0.0.1", + "_APP_DOMAIN_TARGET_AAAA": "::1", + "_APP_STORAGE_LIMIT": "30000000", + "_APP_COMPUTE_SIZE_LIMIT": "30000000", + "_APP_USAGE_STATS": "enabled", + "_APP_VCS_ENABLED": true, + "_APP_DOMAIN_ENABLED": true, + "_APP_ASSISTANT_ENABLED": true, + "_APP_DOMAIN_SITES": "sites.localhost", + "_APP_DOMAIN_FUNCTIONS": "functions.localhost", + "_APP_OPTIONS_FORCE_HTTPS": "enabled", + "_APP_DOMAINS_NAMESERVERS": "ns1.example.com,ns2.example.com" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -43422,7 +44745,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -43442,7 +44771,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -43462,7 +44797,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -43494,7 +44833,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "provider": { "description": "Provider", @@ -43560,7 +44905,22 @@ "enabled", "type", "credentials" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } }, "message": { "description": "Message", @@ -43670,7 +45030,33 @@ "deliveredTotal", "data", "status" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } }, "topic": { "description": "Topic", @@ -43732,7 +45118,17 @@ "smsTotal", "pushTotal", "subscribe" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } }, "subscriber": { "description": "Subscriber", @@ -43806,7 +45202,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -43868,7 +45284,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } }, "migration": { "description": "Migration", @@ -43956,7 +45383,23 @@ "statusCounters", "resourceData", "errors" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "status": "pending", + "stage": "init", + "source": "Appwrite", + "destination": "Appwrite", + "resources": [ + "user" + ], + "resourceId": "databaseId:collectionId", + "statusCounters": "{\"Database\": {\"PENDING\": 0, \"SUCCESS\": 1, \"ERROR\": 0, \"SKIP\": 0, \"PROCESSING\": 0, \"WARNING\": 0}}", + "resourceData": "[{\"resource\":\"Database\",\"id\":\"public\",\"status\":\"SUCCESS\",\"message\":\"\"}]", + "errors": [] + } }, "migrationReport": { "description": "Migration Report", @@ -44026,7 +45469,18 @@ "function", "size", "version" - ] + ], + "example": { + "user": 20, + "team": 20, + "database": 20, + "document": 20, + "file": 20, + "bucket": 20, + "function": 20, + "size": 30000, + "version": "1.4.0" + } } }, "securitySchemes": { diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index bd78f99a76..6b63c4eccd 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -10690,7 +10690,7 @@ "scheduledAt": { "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", - "x-example": null + "x-example": "" } } } @@ -25744,7 +25744,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "error": { "description": "Error", @@ -25776,7 +25777,13 @@ "code", "type", "version" - ] + ], + "example": { + "message": "Not found", + "code": "404", + "type": "not_found", + "version": "1.0" + } }, "documentList": { "description": "Documents List", @@ -25800,7 +25807,11 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } }, "collectionList": { "description": "Collections List", @@ -25824,7 +25835,11 @@ "required": [ "total", "collections" - ] + ], + "example": { + "total": 5, + "collections": "" + } }, "databaseList": { "description": "Databases List", @@ -25848,7 +25863,11 @@ "required": [ "total", "databases" - ] + ], + "example": { + "total": 5, + "databases": "" + } }, "indexList": { "description": "Indexes List", @@ -25872,7 +25891,11 @@ "required": [ "total", "indexes" - ] + ], + "example": { + "total": 5, + "indexes": "" + } }, "userList": { "description": "Users List", @@ -25896,7 +25919,11 @@ "required": [ "total", "users" - ] + ], + "example": { + "total": 5, + "users": "" + } }, "sessionList": { "description": "Sessions List", @@ -25920,7 +25947,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -25944,7 +25975,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -25968,7 +26003,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -25992,7 +26031,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "bucketList": { "description": "Buckets List", @@ -26016,7 +26059,11 @@ "required": [ "total", "buckets" - ] + ], + "example": { + "total": 5, + "buckets": "" + } }, "resourceTokenList": { "description": "Resource Tokens List", @@ -26040,7 +26087,11 @@ "required": [ "total", "tokens" - ] + ], + "example": { + "total": 5, + "tokens": "" + } }, "teamList": { "description": "Teams List", @@ -26064,7 +26115,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -26088,7 +26143,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "siteList": { "description": "Sites List", @@ -26112,7 +26171,11 @@ "required": [ "total", "sites" - ] + ], + "example": { + "total": 5, + "sites": "" + } }, "functionList": { "description": "Functions List", @@ -26136,7 +26199,11 @@ "required": [ "total", "functions" - ] + ], + "example": { + "total": 5, + "functions": "" + } }, "frameworkList": { "description": "Frameworks List", @@ -26160,7 +26227,11 @@ "required": [ "total", "frameworks" - ] + ], + "example": { + "total": 5, + "frameworks": "" + } }, "runtimeList": { "description": "Runtimes List", @@ -26184,7 +26255,11 @@ "required": [ "total", "runtimes" - ] + ], + "example": { + "total": 5, + "runtimes": "" + } }, "deploymentList": { "description": "Deployments List", @@ -26208,7 +26283,11 @@ "required": [ "total", "deployments" - ] + ], + "example": { + "total": 5, + "deployments": "" + } }, "executionList": { "description": "Executions List", @@ -26232,7 +26311,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "countryList": { "description": "Countries List", @@ -26256,7 +26339,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -26280,7 +26367,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -26304,7 +26395,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -26328,7 +26423,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -26352,7 +26451,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "variableList": { "description": "Variables List", @@ -26376,7 +26479,11 @@ "required": [ "total", "variables" - ] + ], + "example": { + "total": 5, + "variables": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -26400,7 +26507,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "providerList": { "description": "Provider list", @@ -26424,7 +26535,11 @@ "required": [ "total", "providers" - ] + ], + "example": { + "total": 5, + "providers": "" + } }, "messageList": { "description": "Message list", @@ -26448,7 +26563,11 @@ "required": [ "total", "messages" - ] + ], + "example": { + "total": 5, + "messages": "" + } }, "topicList": { "description": "Topic list", @@ -26472,7 +26591,11 @@ "required": [ "total", "topics" - ] + ], + "example": { + "total": 5, + "topics": "" + } }, "subscriberList": { "description": "Subscriber list", @@ -26496,7 +26619,11 @@ "required": [ "total", "subscribers" - ] + ], + "example": { + "total": 5, + "subscribers": "" + } }, "targetList": { "description": "Target list", @@ -26520,7 +26647,11 @@ "required": [ "total", "targets" - ] + ], + "example": { + "total": 5, + "targets": "" + } }, "specificationList": { "description": "Specifications List", @@ -26544,7 +26675,11 @@ "required": [ "total", "specifications" - ] + ], + "example": { + "total": 5, + "specifications": "" + } }, "database": { "description": "Database", @@ -26582,7 +26717,14 @@ "$createdAt", "$updatedAt", "enabled" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false + } }, "collection": { "description": "Collection", @@ -26692,7 +26834,21 @@ "documentSecurity", "attributes", "indexes" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {} + } }, "attributeList": { "description": "Attributes List", @@ -26747,7 +26903,11 @@ "required": [ "total", "attributes" - ] + ], + "example": { + "total": 5, + "attributes": "" + } }, "attributeString": { "description": "AttributeString", @@ -26822,7 +26982,20 @@ "$createdAt", "$updatedAt", "size" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } }, "attributeInteger": { "description": "AttributeInteger", @@ -26899,7 +27072,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } }, "attributeFloat": { "description": "AttributeFloat", @@ -26976,7 +27162,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } }, "attributeBoolean": { "description": "AttributeBoolean", @@ -27038,7 +27237,18 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } }, "attributeEmail": { "description": "AttributeEmail", @@ -27106,7 +27316,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } }, "attributeEnum": { "description": "AttributeEnum", @@ -27183,7 +27405,20 @@ "$updatedAt", "elements", "format" - ] + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } }, "attributeIp": { "description": "AttributeIP", @@ -27251,7 +27486,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } }, "attributeUrl": { "description": "AttributeURL", @@ -27319,7 +27566,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } }, "attributeDatetime": { "description": "AttributeDatetime", @@ -27387,7 +27646,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } }, "attributeRelationship": { "description": "AttributeRelationship", @@ -27479,7 +27750,23 @@ "twoWayKey", "onDelete", "side" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } }, "index": { "description": "Index", @@ -27551,7 +27838,18 @@ "lengths", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [], + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "document": { "description": "Document", @@ -27608,7 +27906,23 @@ "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -27742,7 +28056,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -27903,7 +28240,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -27917,7 +28280,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -27931,7 +28297,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -27945,7 +28314,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -27959,7 +28331,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -28001,7 +28376,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -28033,7 +28415,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -28068,12 +28456,19 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "session": { "description": "Session", @@ -28260,7 +28655,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -28328,7 +28756,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -28372,7 +28812,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -28386,7 +28834,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -28436,7 +28887,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -28456,7 +28916,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -28538,7 +29002,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "bucket": { "description": "Bucket", @@ -28630,7 +29109,26 @@ "compression", "encryption", "antivirus" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false + } }, "resourceToken": { "description": "ResourceToken", @@ -28680,7 +29178,16 @@ "expire", "secret", "accessedAt" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "team": { "description": "Team", @@ -28731,7 +29238,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -28822,7 +29340,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "site": { "description": "Site", @@ -29008,7 +29543,38 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } }, "function": { "description": "Function", @@ -29197,7 +29763,37 @@ "providerRootDirectory", "providerSilentMode", "specification" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb" + } }, "runtime": { "description": "Runtime", @@ -29256,7 +29852,17 @@ "image", "logo", "supports" - ] + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } }, "framework": { "description": "Framework", @@ -29311,7 +29917,25 @@ "buildRuntime", "runtimes", "adapters" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } }, "frameworkAdapter": { "description": "Framework Adapter", @@ -29349,7 +29973,14 @@ "buildCommand", "outputDirectory", "fallbackFile" - ] + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } }, "deployment": { "description": "Deployment", @@ -29523,7 +30154,36 @@ "providerCommitMessage", "providerCommitUrl", "providerBranchUrl" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerBranch": "0.7.x", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } }, "execution": { "description": "Execution", @@ -29654,7 +30314,36 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "variable": { "description": "Variable", @@ -29710,7 +30399,17 @@ "secret", "resourceType", "resourceId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } }, "country": { "description": "Country", @@ -29730,7 +30429,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -29750,7 +30453,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -29776,7 +30483,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -29828,7 +30540,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -29854,7 +30575,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "healthAntivirus": { "description": "Health Antivirus", @@ -29874,7 +30600,11 @@ "required": [ "version", "status" - ] + ], + "example": { + "version": "1.0.0", + "status": "online" + } }, "healthQueue": { "description": "Health Queue", @@ -29889,7 +30619,10 @@ }, "required": [ "size" - ] + ], + "example": { + "size": 8 + } }, "healthStatus": { "description": "Health Status", @@ -29916,7 +30649,12 @@ "name", "ping", "status" - ] + ], + "example": { + "name": "database", + "ping": 128, + "status": "pass" + } }, "healthCertificate": { "description": "Health Certificate", @@ -29960,7 +30698,15 @@ "validFrom", "validTo", "signatureTypeSN" - ] + ], + "example": { + "name": "\/CN=www.google.com", + "subjectSN": "", + "issuerOrganisation": "", + "validFrom": "1704200998", + "validTo": "1711458597", + "signatureTypeSN": "RSA-SHA256" + } }, "healthTime": { "description": "Health Time", @@ -29989,7 +30735,12 @@ "remoteTime", "localTime", "diff" - ] + ], + "example": { + "remoteTime": 1639490751, + "localTime": 1639490844, + "diff": 93 + } }, "headers": { "description": "Headers", @@ -30009,7 +30760,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "specification": { "description": "Specification", @@ -30043,7 +30798,13 @@ "cpus", "enabled", "slug" - ] + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -30075,7 +30836,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -30095,7 +30862,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -30115,7 +30888,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -30147,7 +30924,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "provider": { "description": "Provider", @@ -30213,7 +30996,22 @@ "enabled", "type", "credentials" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } }, "message": { "description": "Message", @@ -30323,7 +31121,33 @@ "deliveredTotal", "data", "status" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } }, "topic": { "description": "Topic", @@ -30385,7 +31209,17 @@ "smsTotal", "pushTotal", "subscribe" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } }, "subscriber": { "description": "Subscriber", @@ -30459,7 +31293,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -30521,7 +31375,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } } }, "securitySchemes": { diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 23f1e122b8..98635164ae 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4626,30 +4626,6 @@ } ], "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." - }, - { - "name": "createDocuments", - "auth": { - "Admin": [], - "Key": [] - }, - "parameters": [ - "databaseId", - "collectionId", - "documents" - ], - "required": [ - "databaseId", - "collectionId", - "documents" - ], - "responses": [ - { - "code": 201, - "model": "#\/definitions\/documentList" - } - ], - "description": "**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.\n\nCreate new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." } ], "auth": { @@ -5485,7 +5461,7 @@ "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", "default": null, - "x-example": null + "x-example": "" } } } @@ -8118,7 +8094,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "documentList": { "description": "Documents List", @@ -8143,7 +8120,11 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } }, "sessionList": { "description": "Sessions List", @@ -8168,7 +8149,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -8193,7 +8178,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -8218,7 +8207,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -8243,7 +8236,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "teamList": { "description": "Teams List", @@ -8268,7 +8265,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -8293,7 +8294,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "executionList": { "description": "Executions List", @@ -8318,7 +8323,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "countryList": { "description": "Countries List", @@ -8343,7 +8352,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -8368,7 +8381,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -8393,7 +8410,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -8418,7 +8439,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -8443,7 +8468,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -8468,7 +8497,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "document": { "description": "Document", @@ -8525,7 +8558,23 @@ "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -8659,7 +8708,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -8822,7 +8894,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -8836,7 +8934,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -8850,7 +8951,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -8864,7 +8968,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -8878,7 +8985,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -8920,7 +9030,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -8952,7 +9069,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -8987,12 +9110,19 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "session": { "description": "Session", @@ -9179,7 +9309,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -9247,7 +9410,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -9291,7 +9466,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -9305,7 +9488,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -9355,7 +9541,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -9375,7 +9570,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -9457,7 +9656,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "team": { "description": "Team", @@ -9509,7 +9723,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -9600,7 +9825,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "execution": { "description": "Execution", @@ -9733,7 +9975,36 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "country": { "description": "Country", @@ -9753,7 +10024,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -9773,7 +10048,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -9799,7 +10078,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -9851,7 +10135,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -9877,7 +10170,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "headers": { "description": "Headers", @@ -9897,7 +10195,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -9929,7 +10231,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -9949,7 +10257,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -9969,7 +10283,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -10001,7 +10319,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "subscriber": { "description": "Subscriber", @@ -10076,7 +10400,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -10138,7 +10482,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } } }, "externalDocs": { diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 92317a7532..dfca0af6c3 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -11868,7 +11868,7 @@ "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", "default": null, - "x-example": null + "x-example": "" } } } @@ -35618,7 +35618,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "documentList": { "description": "Documents List", @@ -35643,7 +35644,11 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } }, "collectionList": { "description": "Collections List", @@ -35668,7 +35673,11 @@ "required": [ "total", "collections" - ] + ], + "example": { + "total": 5, + "collections": "" + } }, "databaseList": { "description": "Databases List", @@ -35693,7 +35702,11 @@ "required": [ "total", "databases" - ] + ], + "example": { + "total": 5, + "databases": "" + } }, "indexList": { "description": "Indexes List", @@ -35718,7 +35731,11 @@ "required": [ "total", "indexes" - ] + ], + "example": { + "total": 5, + "indexes": "" + } }, "userList": { "description": "Users List", @@ -35743,7 +35760,11 @@ "required": [ "total", "users" - ] + ], + "example": { + "total": 5, + "users": "" + } }, "sessionList": { "description": "Sessions List", @@ -35768,7 +35789,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -35793,7 +35818,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -35818,7 +35847,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -35843,7 +35876,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "bucketList": { "description": "Buckets List", @@ -35868,7 +35905,11 @@ "required": [ "total", "buckets" - ] + ], + "example": { + "total": 5, + "buckets": "" + } }, "resourceTokenList": { "description": "Resource Tokens List", @@ -35893,7 +35934,11 @@ "required": [ "total", "tokens" - ] + ], + "example": { + "total": 5, + "tokens": "" + } }, "teamList": { "description": "Teams List", @@ -35918,7 +35963,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -35943,7 +35992,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "siteList": { "description": "Sites List", @@ -35968,7 +36021,11 @@ "required": [ "total", "sites" - ] + ], + "example": { + "total": 5, + "sites": "" + } }, "templateSiteList": { "description": "Site Templates List", @@ -35993,7 +36050,11 @@ "required": [ "total", "templates" - ] + ], + "example": { + "total": 5, + "templates": "" + } }, "functionList": { "description": "Functions List", @@ -36018,7 +36079,11 @@ "required": [ "total", "functions" - ] + ], + "example": { + "total": 5, + "functions": "" + } }, "templateFunctionList": { "description": "Function Templates List", @@ -36043,7 +36108,11 @@ "required": [ "total", "templates" - ] + ], + "example": { + "total": 5, + "templates": "" + } }, "installationList": { "description": "Installations List", @@ -36068,7 +36137,11 @@ "required": [ "total", "installations" - ] + ], + "example": { + "total": 5, + "installations": "" + } }, "providerRepositoryFrameworkList": { "description": "Framework Provider Repositories List", @@ -36093,7 +36166,11 @@ "required": [ "total", "frameworkProviderRepositories" - ] + ], + "example": { + "total": 5, + "frameworkProviderRepositories": "" + } }, "providerRepositoryRuntimeList": { "description": "Runtime Provider Repositories List", @@ -36118,7 +36195,11 @@ "required": [ "total", "runtimeProviderRepositories" - ] + ], + "example": { + "total": 5, + "runtimeProviderRepositories": "" + } }, "branchList": { "description": "Branches List", @@ -36143,7 +36224,11 @@ "required": [ "total", "branches" - ] + ], + "example": { + "total": 5, + "branches": "" + } }, "frameworkList": { "description": "Frameworks List", @@ -36168,7 +36253,11 @@ "required": [ "total", "frameworks" - ] + ], + "example": { + "total": 5, + "frameworks": "" + } }, "runtimeList": { "description": "Runtimes List", @@ -36193,7 +36282,11 @@ "required": [ "total", "runtimes" - ] + ], + "example": { + "total": 5, + "runtimes": "" + } }, "deploymentList": { "description": "Deployments List", @@ -36218,7 +36311,11 @@ "required": [ "total", "deployments" - ] + ], + "example": { + "total": 5, + "deployments": "" + } }, "executionList": { "description": "Executions List", @@ -36243,7 +36340,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "projectList": { "description": "Projects List", @@ -36268,7 +36369,11 @@ "required": [ "total", "projects" - ] + ], + "example": { + "total": 5, + "projects": "" + } }, "webhookList": { "description": "Webhooks List", @@ -36293,7 +36398,11 @@ "required": [ "total", "webhooks" - ] + ], + "example": { + "total": 5, + "webhooks": "" + } }, "keyList": { "description": "API Keys List", @@ -36318,7 +36427,11 @@ "required": [ "total", "keys" - ] + ], + "example": { + "total": 5, + "keys": "" + } }, "devKeyList": { "description": "Dev Keys List", @@ -36343,7 +36456,11 @@ "required": [ "total", "devKeys" - ] + ], + "example": { + "total": 5, + "devKeys": "" + } }, "platformList": { "description": "Platforms List", @@ -36368,7 +36485,11 @@ "required": [ "total", "platforms" - ] + ], + "example": { + "total": 5, + "platforms": "" + } }, "countryList": { "description": "Countries List", @@ -36393,7 +36514,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -36418,7 +36543,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -36443,7 +36572,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -36468,7 +36601,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -36493,7 +36630,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "variableList": { "description": "Variables List", @@ -36518,7 +36659,11 @@ "required": [ "total", "variables" - ] + ], + "example": { + "total": 5, + "variables": "" + } }, "proxyRuleList": { "description": "Rule List", @@ -36543,7 +36688,11 @@ "required": [ "total", "rules" - ] + ], + "example": { + "total": 5, + "rules": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -36568,7 +36717,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "providerList": { "description": "Provider list", @@ -36593,7 +36746,11 @@ "required": [ "total", "providers" - ] + ], + "example": { + "total": 5, + "providers": "" + } }, "messageList": { "description": "Message list", @@ -36618,7 +36775,11 @@ "required": [ "total", "messages" - ] + ], + "example": { + "total": 5, + "messages": "" + } }, "topicList": { "description": "Topic list", @@ -36643,7 +36804,11 @@ "required": [ "total", "topics" - ] + ], + "example": { + "total": 5, + "topics": "" + } }, "subscriberList": { "description": "Subscriber list", @@ -36668,7 +36833,11 @@ "required": [ "total", "subscribers" - ] + ], + "example": { + "total": 5, + "subscribers": "" + } }, "targetList": { "description": "Target list", @@ -36693,7 +36862,11 @@ "required": [ "total", "targets" - ] + ], + "example": { + "total": 5, + "targets": "" + } }, "migrationList": { "description": "Migrations List", @@ -36718,7 +36891,11 @@ "required": [ "total", "migrations" - ] + ], + "example": { + "total": 5, + "migrations": "" + } }, "specificationList": { "description": "Specifications List", @@ -36743,7 +36920,11 @@ "required": [ "total", "specifications" - ] + ], + "example": { + "total": 5, + "specifications": "" + } }, "vcsContentList": { "description": "VCS Content List", @@ -36768,7 +36949,11 @@ "required": [ "total", "contents" - ] + ], + "example": { + "total": 5, + "contents": "" + } }, "database": { "description": "Database", @@ -36806,7 +36991,14 @@ "$createdAt", "$updatedAt", "enabled" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false + } }, "collection": { "description": "Collection", @@ -36917,7 +37109,21 @@ "documentSecurity", "attributes", "indexes" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {} + } }, "attributeList": { "description": "Attributes List", @@ -36972,7 +37178,11 @@ "required": [ "total", "attributes" - ] + ], + "example": { + "total": 5, + "attributes": "" + } }, "attributeString": { "description": "AttributeString", @@ -37047,7 +37257,20 @@ "$createdAt", "$updatedAt", "size" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } }, "attributeInteger": { "description": "AttributeInteger", @@ -37124,7 +37347,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } }, "attributeFloat": { "description": "AttributeFloat", @@ -37201,7 +37437,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } }, "attributeBoolean": { "description": "AttributeBoolean", @@ -37263,7 +37512,18 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } }, "attributeEmail": { "description": "AttributeEmail", @@ -37331,7 +37591,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } }, "attributeEnum": { "description": "AttributeEnum", @@ -37408,7 +37680,20 @@ "$updatedAt", "elements", "format" - ] + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } }, "attributeIp": { "description": "AttributeIP", @@ -37476,7 +37761,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } }, "attributeUrl": { "description": "AttributeURL", @@ -37544,7 +37841,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } }, "attributeDatetime": { "description": "AttributeDatetime", @@ -37612,7 +37921,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } }, "attributeRelationship": { "description": "AttributeRelationship", @@ -37704,7 +38025,23 @@ "twoWayKey", "onDelete", "side" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } }, "index": { "description": "Index", @@ -37776,7 +38113,18 @@ "lengths", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [], + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "document": { "description": "Document", @@ -37833,7 +38181,23 @@ "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -37967,7 +38331,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -38130,7 +38517,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -38144,7 +38557,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -38158,7 +38574,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -38172,7 +38591,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -38186,7 +38608,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -38228,7 +38653,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -38260,7 +38692,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -38295,12 +38733,19 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "session": { "description": "Session", @@ -38487,7 +38932,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -38555,7 +39033,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -38599,7 +39089,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -38613,7 +39111,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -38663,7 +39164,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -38683,7 +39193,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -38765,7 +39279,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "bucket": { "description": "Bucket", @@ -38857,7 +39386,26 @@ "compression", "encryption", "antivirus" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false + } }, "resourceToken": { "description": "ResourceToken", @@ -38907,7 +39455,16 @@ "expire", "secret", "accessedAt" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "team": { "description": "Team", @@ -38959,7 +39516,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -39050,7 +39618,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "site": { "description": "Site", @@ -39237,7 +39822,38 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } }, "templateSite": { "description": "Template Site", @@ -39334,7 +39950,22 @@ "providerOwner", "providerVersion", "variables" - ] + ], + "example": { + "key": "starter", + "name": "Starter site", + "tagline": "Minimal web app integrating with Appwrite.", + "demoUrl": "https:\/\/nextjs-starter.appwrite.network\/", + "screenshotDark": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-dark.png", + "screenshotLight": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-light.png", + "useCases": "Starter", + "frameworks": [], + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [] + } }, "templateFramework": { "description": "Template Framework", @@ -39396,7 +40027,18 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/build", + "providerRootDirectory": ".\/svelte-kit\/starter", + "buildRuntime": "node-22", + "adapter": "ssr", + "fallbackFile": "index.html" + } }, "function": { "description": "Function", @@ -39586,7 +40228,37 @@ "providerRootDirectory", "providerSilentMode", "specification" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb" + } }, "templateFunction": { "description": "Template Function", @@ -39717,7 +40389,26 @@ "providerVersion", "variables", "scopes" - ] + ], + "example": { + "icon": "icon-lightning-bolt", + "id": "starter", + "name": "Starter function", + "tagline": "A simple function to get started.", + "permissions": "any", + "events": "account.create", + "cron": "0 0 * * *", + "timeout": 300, + "useCases": "Starter", + "runtimes": [], + "instructions": "For documentation and instructions check out .", + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [], + "scopes": "users.read" + } }, "templateRuntime": { "description": "Template Runtime", @@ -39749,7 +40440,13 @@ "commands", "entrypoint", "providerRootDirectory" - ] + ], + "example": { + "name": "node-19.0", + "commands": "npm install", + "entrypoint": "index.js", + "providerRootDirectory": "node\/starter" + } }, "templateVariable": { "description": "Template Variable", @@ -39799,7 +40496,16 @@ "placeholder", "required", "type" - ] + ], + "example": { + "name": "APPWRITE_DATABASE_ID", + "description": "The ID of the Appwrite database that contains the collection to sync.", + "value": "512", + "secret": false, + "placeholder": "64a55...7b912", + "required": false, + "type": "password" + } }, "installation": { "description": "Installation", @@ -39843,7 +40549,15 @@ "provider", "organization", "providerInstallationId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "provider": "github", + "organization": "appwrite", + "providerInstallationId": "5322" + } }, "providerRepository": { "description": "ProviderRepository", @@ -39893,7 +40607,16 @@ "private", "defaultBranch", "pushedAt" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime" + } }, "providerRepositoryFramework": { "description": "ProviderRepositoryFramework", @@ -39949,7 +40672,17 @@ "defaultBranch", "pushedAt", "framework" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime", + "framework": "nextjs" + } }, "providerRepositoryRuntime": { "description": "ProviderRepositoryRuntime", @@ -40005,7 +40738,17 @@ "defaultBranch", "pushedAt", "runtime" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime", + "runtime": "node-22" + } }, "detectionFramework": { "description": "DetectionFramework", @@ -40037,7 +40780,13 @@ "installCommand", "buildCommand", "outputDirectory" - ] + ], + "example": { + "framework": "nuxt", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "dist" + } }, "detectionRuntime": { "description": "DetectionRuntime", @@ -40063,7 +40812,12 @@ "runtime", "entrypoint", "commands" - ] + ], + "example": { + "runtime": "node", + "entrypoint": "index.js", + "commands": "npm install && npm run build" + } }, "vcsContent": { "description": "VcsContents", @@ -40090,7 +40844,12 @@ }, "required": [ "name" - ] + ], + "example": { + "size": 1523, + "isDirectory": true, + "name": "Main.java" + } }, "branch": { "description": "Branch", @@ -40104,7 +40863,10 @@ }, "required": [ "name" - ] + ], + "example": { + "name": "main" + } }, "runtime": { "description": "Runtime", @@ -40163,7 +40925,17 @@ "image", "logo", "supports" - ] + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } }, "framework": { "description": "Framework", @@ -40219,7 +40991,25 @@ "buildRuntime", "runtimes", "adapters" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } }, "frameworkAdapter": { "description": "Framework Adapter", @@ -40257,7 +41047,14 @@ "buildCommand", "outputDirectory", "fallbackFile" - ] + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } }, "deployment": { "description": "Deployment", @@ -40431,7 +41228,36 @@ "providerCommitMessage", "providerCommitUrl", "providerBranchUrl" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerBranch": "0.7.x", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } }, "execution": { "description": "Execution", @@ -40564,7 +41390,36 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "project": { "description": "Project", @@ -40966,7 +41821,73 @@ "serviceStatusForFunctions", "serviceStatusForGraphql", "serviceStatusForMessaging" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "New Project", + "description": "This is a new project.", + "teamId": "1592981250", + "logo": "5f5c451b403cb", + "url": "5f5c451b403cb", + "legalName": "Company LTD.", + "legalCountry": "US", + "legalState": "New York", + "legalCity": "New York City.", + "legalAddress": "620 Eighth Avenue, New York, NY 10018", + "legalTaxId": "131102020", + "authDuration": 60, + "authLimit": 100, + "authSessionsLimit": 10, + "authPasswordHistory": 5, + "authPasswordDictionary": true, + "authPersonalDataCheck": true, + "authMockNumbers": [ + {} + ], + "authSessionAlerts": true, + "authMembershipsUserName": true, + "authMembershipsUserEmail": true, + "authMembershipsMfa": true, + "oAuthProviders": [ + {} + ], + "platforms": {}, + "webhooks": {}, + "keys": {}, + "devKeys": {}, + "smtpEnabled": false, + "smtpSenderName": "John Appwrite", + "smtpSenderEmail": "john@appwrite.io", + "smtpReplyTo": "support@appwrite.io", + "smtpHost": "mail.appwrite.io", + "smtpPort": 25, + "smtpUsername": "emailuser", + "smtpPassword": "securepassword", + "smtpSecure": "tls", + "pingCount": 1, + "pingedAt": "2020-10-15T06:38:00.000+00:00", + "authEmailPassword": true, + "authUsersAuthMagicURL": true, + "authEmailOtp": true, + "authAnonymous": true, + "authInvites": true, + "authJWT": true, + "authPhone": true, + "serviceStatusForAccount": true, + "serviceStatusForAvatars": true, + "serviceStatusForDatabases": true, + "serviceStatusForLocale": true, + "serviceStatusForHealth": true, + "serviceStatusForStorage": true, + "serviceStatusForTeams": true, + "serviceStatusForUsers": true, + "serviceStatusForSites": true, + "serviceStatusForFunctions": true, + "serviceStatusForGraphql": true, + "serviceStatusForMessaging": true + } }, "webhook": { "description": "Webhook", @@ -41056,7 +41977,22 @@ "enabled", "logs", "attempts" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Webhook", + "url": "https:\/\/example.com\/webhook", + "events": "database.collections.update", + "security": true, + "httpUser": "username", + "httpPass": "password", + "signatureKey": "ad3d581ca230e2b7059c545e5a", + "enabled": true, + "logs": "Failed to connect to remote server.", + "attempts": 10 + } }, "key": { "description": "Key", @@ -41124,7 +42060,18 @@ "secret", "accessedAt", "sdks" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "scopes": "users.read", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } }, "devKey": { "description": "DevKey", @@ -41183,7 +42130,17 @@ "secret", "accessedAt", "sdks" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Dev API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } }, "mockNumber": { "description": "Mock Number", @@ -41203,7 +42160,11 @@ "required": [ "phone", "otp" - ] + ], + "example": { + "phone": "+1612842323", + "otp": "123456" + } }, "authProvider": { "description": "AuthProvider", @@ -41241,7 +42202,14 @@ "appId", "secret", "enabled" - ] + ], + "example": { + "key": "github", + "name": "GitHub", + "appId": "259125845563242502", + "secret": "Bpw_g9c2TGXxfgLshDbSaL8tsCcqgczQ", + "enabled": "" + } }, "platform": { "description": "Platform", @@ -41309,7 +42277,19 @@ "hostname", "httpUser", "httpPass" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Web App", + "type": "web", + "key": "com.company.appname", + "store": "", + "hostname": true, + "httpUser": "username", + "httpPass": "password" + } }, "variable": { "description": "Variable", @@ -41365,7 +42345,17 @@ "secret", "resourceType", "resourceId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } }, "country": { "description": "Country", @@ -41385,7 +42375,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -41405,7 +42399,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -41431,7 +42429,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -41483,7 +42486,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -41509,7 +42521,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "healthAntivirus": { "description": "Health Antivirus", @@ -41529,7 +42546,11 @@ "required": [ "version", "status" - ] + ], + "example": { + "version": "1.0.0", + "status": "online" + } }, "healthQueue": { "description": "Health Queue", @@ -41544,7 +42565,10 @@ }, "required": [ "size" - ] + ], + "example": { + "size": 8 + } }, "healthStatus": { "description": "Health Status", @@ -41571,7 +42595,12 @@ "name", "ping", "status" - ] + ], + "example": { + "name": "database", + "ping": 128, + "status": "pass" + } }, "healthCertificate": { "description": "Health Certificate", @@ -41615,7 +42644,15 @@ "validFrom", "validTo", "signatureTypeSN" - ] + ], + "example": { + "name": "\/CN=www.google.com", + "subjectSN": "", + "issuerOrganisation": "", + "validFrom": "1704200998", + "validTo": "1711458597", + "signatureTypeSN": "RSA-SHA256" + } }, "healthTime": { "description": "Health Time", @@ -41644,7 +42681,12 @@ "remoteTime", "localTime", "diff" - ] + ], + "example": { + "remoteTime": 1639490751, + "localTime": 1639490844, + "diff": 93 + } }, "metric": { "description": "Metric", @@ -41665,7 +42707,11 @@ "required": [ "value", "date" - ] + ], + "example": { + "value": 1, + "date": "2020-10-15T06:38:00.000+00:00" + } }, "metricBreakdown": { "description": "Metric Breakdown", @@ -41699,7 +42745,13 @@ "required": [ "name", "value" - ] + ], + "example": { + "resourceId": "5e5ea5c16897e", + "name": "Documents", + "value": 1, + "estimate": 1 + } }, "usageDatabases": { "description": "UsageDatabases", @@ -41815,7 +42867,22 @@ "storage", "databasesReads", "databasesWrites" - ] + ], + "example": { + "range": "30d", + "databasesTotal": 0, + "collectionsTotal": 0, + "documentsTotal": 0, + "storageTotal": 0, + "databasesReadsTotal": 0, + "databasesWritesTotal": 0, + "databases": [], + "collections": [], + "documents": [], + "storage": [], + "databasesReads": [], + "databasesWrites": [] + } }, "usageDatabase": { "description": "UsageDatabase", @@ -41914,7 +42981,20 @@ "storage", "databaseReads", "databaseWrites" - ] + ], + "example": { + "range": "30d", + "collectionsTotal": 0, + "documentsTotal": 0, + "storageTotal": 0, + "databaseReadsTotal": 0, + "databaseWritesTotal": 0, + "collections": [], + "documents": [], + "storage": [], + "databaseReads": [], + "databaseWrites": [] + } }, "usageCollection": { "description": "UsageCollection", @@ -41945,7 +43025,12 @@ "range", "documentsTotal", "documents" - ] + ], + "example": { + "range": "30d", + "documentsTotal": 0, + "documents": [] + } }, "usageUsers": { "description": "UsageUsers", @@ -41993,7 +43078,14 @@ "sessionsTotal", "users", "sessions" - ] + ], + "example": { + "range": "30d", + "usersTotal": 0, + "sessionsTotal": 0, + "users": [], + "sessions": [] + } }, "usageStorage": { "description": "StorageUsage", @@ -42058,7 +43150,16 @@ "buckets", "files", "storage" - ] + ], + "example": { + "range": "30d", + "bucketsTotal": 0, + "filesTotal": 0, + "filesStorageTotal": 0, + "buckets": [], + "files": [], + "storage": [] + } }, "usageBuckets": { "description": "UsageBuckets", @@ -42123,7 +43224,16 @@ "storage", "imageTransformations", "imageTransformationsTotal" - ] + ], + "example": { + "range": "30d", + "filesTotal": 0, + "filesStorageTotal": 0, + "files": [], + "storage": [], + "imageTransformations": [], + "imageTransformationsTotal": 0 + } }, "usageFunctions": { "description": "UsageFunctions", @@ -42341,7 +43451,34 @@ "executionsMbSeconds", "buildsSuccess", "buildsFailed" - ] + ], + "example": { + "range": "30d", + "functionsTotal": 0, + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "functions": 0, + "deployments": [], + "deploymentsStorage": [], + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [] + } }, "usageFunction": { "description": "UsageFunction", @@ -42549,7 +43686,33 @@ "executionsMbSeconds", "buildsSuccess", "buildsFailed" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsTimeAverage": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [] + } }, "usageSites": { "description": "UsageSites", @@ -42818,7 +43981,40 @@ "inbound", "outboundTotal", "outbound" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [], + "sitesTotal": 0, + "sites": [], + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [] + } }, "usageSite": { "description": "UsageSite", @@ -43077,7 +44273,39 @@ "inbound", "outboundTotal", "outbound" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsTimeAverage": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [], + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [] + } }, "usageProject": { "description": "UsageProject", @@ -43344,7 +44572,40 @@ "databasesWrites", "imageTransformations", "imageTransformationsTotal" - ] + ], + "example": { + "executionsTotal": 0, + "documentsTotal": 0, + "databasesTotal": 0, + "databasesStorageTotal": 0, + "usersTotal": 0, + "filesStorageTotal": 0, + "functionsStorageTotal": 0, + "buildsStorageTotal": 0, + "deploymentsStorageTotal": 0, + "bucketsTotal": 0, + "executionsMbSecondsTotal": 0, + "buildsMbSecondsTotal": 0, + "databasesReadsTotal": 0, + "databasesWritesTotal": 0, + "requests": [], + "network": [], + "users": [], + "executions": [], + "executionsBreakdown": [], + "bucketsBreakdown": [], + "databasesStorageBreakdown": [], + "executionsMbSecondsBreakdown": [], + "buildsMbSecondsBreakdown": [], + "functionsStorageBreakdown": [], + "authPhoneTotal": 0, + "authPhoneEstimate": 0, + "authPhoneCountryBreakdown": [], + "databasesReads": [], + "databasesWrites": [], + "imageTransformations": [], + "imageTransformationsTotal": 0 + } }, "headers": { "description": "Headers", @@ -43364,7 +44625,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "specification": { "description": "Specification", @@ -43398,7 +44663,13 @@ "cpus", "enabled", "slug" - ] + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } }, "proxyRule": { "description": "Rule", @@ -43497,7 +44768,24 @@ "status", "logs", "renewAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "domain": "appwrite.company.com", + "type": "deployment", + "trigger": "manual", + "redirectUrl": "https:\/\/appwrite.io\/docs", + "redirectStatusCode": 301, + "deploymentId": "n3u9feiwmf", + "deploymentResourceType": "function", + "deploymentResourceId": "n3u9feiwmf", + "deploymentVcsProviderBranch": "function", + "status": "verified", + "logs": "HTTP challegne failed.", + "renewAt": "datetime" + } }, "smsTemplate": { "description": "SmsTemplate", @@ -43523,7 +44811,12 @@ "type", "locale", "message" - ] + ], + "example": { + "type": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account." + } }, "emailTemplate": { "description": "EmailTemplate", @@ -43573,7 +44866,16 @@ "senderEmail", "replyTo", "subject" - ] + ], + "example": { + "type": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account.", + "senderName": "My User", + "senderEmail": "mail@appwrite.io", + "replyTo": "emails@appwrite.io", + "subject": "Please verify your email address" + } }, "consoleVariables": { "description": "Console Variables", @@ -43661,7 +44963,22 @@ "_APP_DOMAIN_FUNCTIONS", "_APP_OPTIONS_FORCE_HTTPS", "_APP_DOMAINS_NAMESERVERS" - ] + ], + "example": { + "_APP_DOMAIN_TARGET_CNAME": "appwrite.io", + "_APP_DOMAIN_TARGET_A": "127.0.0.1", + "_APP_DOMAIN_TARGET_AAAA": "::1", + "_APP_STORAGE_LIMIT": "30000000", + "_APP_COMPUTE_SIZE_LIMIT": "30000000", + "_APP_USAGE_STATS": "enabled", + "_APP_VCS_ENABLED": true, + "_APP_DOMAIN_ENABLED": true, + "_APP_ASSISTANT_ENABLED": true, + "_APP_DOMAIN_SITES": "sites.localhost", + "_APP_DOMAIN_FUNCTIONS": "functions.localhost", + "_APP_OPTIONS_FORCE_HTTPS": "enabled", + "_APP_DOMAINS_NAMESERVERS": "ns1.example.com,ns2.example.com" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -43693,7 +45010,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -43713,7 +45036,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -43733,7 +45062,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -43765,7 +45098,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "provider": { "description": "Provider", @@ -43832,7 +45171,22 @@ "enabled", "type", "credentials" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } }, "message": { "description": "Message", @@ -43943,7 +45297,33 @@ "deliveredTotal", "data", "status" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } }, "topic": { "description": "Topic", @@ -44005,7 +45385,17 @@ "smsTotal", "pushTotal", "subscribe" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } }, "subscriber": { "description": "Subscriber", @@ -44080,7 +45470,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -44142,7 +45552,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } }, "migration": { "description": "Migration", @@ -44232,7 +45653,23 @@ "statusCounters", "resourceData", "errors" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "status": "pending", + "stage": "init", + "source": "Appwrite", + "destination": "Appwrite", + "resources": [ + "user" + ], + "resourceId": "databaseId:collectionId", + "statusCounters": "{\"Database\": {\"PENDING\": 0, \"SUCCESS\": 1, \"ERROR\": 0, \"SKIP\": 0, \"PROCESSING\": 0, \"WARNING\": 0}}", + "resourceData": "[{\"resource\":\"Database\",\"id\":\"public\",\"status\":\"SUCCESS\",\"message\":\"\"}]", + "errors": [] + } }, "migrationReport": { "description": "Migration Report", @@ -44302,7 +45739,18 @@ "function", "size", "version" - ] + ], + "example": { + "user": 20, + "team": 20, + "database": 20, + "document": 20, + "file": 20, + "bucket": 20, + "function": 20, + "size": 30000, + "version": "1.4.0" + } } }, "externalDocs": { diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index c67d26dd54..23a33b310c 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -10763,7 +10763,7 @@ "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", "default": null, - "x-example": null + "x-example": "" } } } @@ -25977,7 +25977,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "documentList": { "description": "Documents List", @@ -26002,7 +26003,11 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } }, "collectionList": { "description": "Collections List", @@ -26027,7 +26032,11 @@ "required": [ "total", "collections" - ] + ], + "example": { + "total": 5, + "collections": "" + } }, "databaseList": { "description": "Databases List", @@ -26052,7 +26061,11 @@ "required": [ "total", "databases" - ] + ], + "example": { + "total": 5, + "databases": "" + } }, "indexList": { "description": "Indexes List", @@ -26077,7 +26090,11 @@ "required": [ "total", "indexes" - ] + ], + "example": { + "total": 5, + "indexes": "" + } }, "userList": { "description": "Users List", @@ -26102,7 +26119,11 @@ "required": [ "total", "users" - ] + ], + "example": { + "total": 5, + "users": "" + } }, "sessionList": { "description": "Sessions List", @@ -26127,7 +26148,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -26152,7 +26177,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -26177,7 +26206,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -26202,7 +26235,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "bucketList": { "description": "Buckets List", @@ -26227,7 +26264,11 @@ "required": [ "total", "buckets" - ] + ], + "example": { + "total": 5, + "buckets": "" + } }, "resourceTokenList": { "description": "Resource Tokens List", @@ -26252,7 +26293,11 @@ "required": [ "total", "tokens" - ] + ], + "example": { + "total": 5, + "tokens": "" + } }, "teamList": { "description": "Teams List", @@ -26277,7 +26322,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -26302,7 +26351,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "siteList": { "description": "Sites List", @@ -26327,7 +26380,11 @@ "required": [ "total", "sites" - ] + ], + "example": { + "total": 5, + "sites": "" + } }, "functionList": { "description": "Functions List", @@ -26352,7 +26409,11 @@ "required": [ "total", "functions" - ] + ], + "example": { + "total": 5, + "functions": "" + } }, "frameworkList": { "description": "Frameworks List", @@ -26377,7 +26438,11 @@ "required": [ "total", "frameworks" - ] + ], + "example": { + "total": 5, + "frameworks": "" + } }, "runtimeList": { "description": "Runtimes List", @@ -26402,7 +26467,11 @@ "required": [ "total", "runtimes" - ] + ], + "example": { + "total": 5, + "runtimes": "" + } }, "deploymentList": { "description": "Deployments List", @@ -26427,7 +26496,11 @@ "required": [ "total", "deployments" - ] + ], + "example": { + "total": 5, + "deployments": "" + } }, "executionList": { "description": "Executions List", @@ -26452,7 +26525,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "countryList": { "description": "Countries List", @@ -26477,7 +26554,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -26502,7 +26583,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -26527,7 +26612,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -26552,7 +26641,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -26577,7 +26670,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "variableList": { "description": "Variables List", @@ -26602,7 +26699,11 @@ "required": [ "total", "variables" - ] + ], + "example": { + "total": 5, + "variables": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -26627,7 +26728,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "providerList": { "description": "Provider list", @@ -26652,7 +26757,11 @@ "required": [ "total", "providers" - ] + ], + "example": { + "total": 5, + "providers": "" + } }, "messageList": { "description": "Message list", @@ -26677,7 +26786,11 @@ "required": [ "total", "messages" - ] + ], + "example": { + "total": 5, + "messages": "" + } }, "topicList": { "description": "Topic list", @@ -26702,7 +26815,11 @@ "required": [ "total", "topics" - ] + ], + "example": { + "total": 5, + "topics": "" + } }, "subscriberList": { "description": "Subscriber list", @@ -26727,7 +26844,11 @@ "required": [ "total", "subscribers" - ] + ], + "example": { + "total": 5, + "subscribers": "" + } }, "targetList": { "description": "Target list", @@ -26752,7 +26873,11 @@ "required": [ "total", "targets" - ] + ], + "example": { + "total": 5, + "targets": "" + } }, "specificationList": { "description": "Specifications List", @@ -26777,7 +26902,11 @@ "required": [ "total", "specifications" - ] + ], + "example": { + "total": 5, + "specifications": "" + } }, "database": { "description": "Database", @@ -26815,7 +26944,14 @@ "$createdAt", "$updatedAt", "enabled" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false + } }, "collection": { "description": "Collection", @@ -26926,7 +27062,21 @@ "documentSecurity", "attributes", "indexes" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {} + } }, "attributeList": { "description": "Attributes List", @@ -26981,7 +27131,11 @@ "required": [ "total", "attributes" - ] + ], + "example": { + "total": 5, + "attributes": "" + } }, "attributeString": { "description": "AttributeString", @@ -27056,7 +27210,20 @@ "$createdAt", "$updatedAt", "size" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } }, "attributeInteger": { "description": "AttributeInteger", @@ -27133,7 +27300,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } }, "attributeFloat": { "description": "AttributeFloat", @@ -27210,7 +27390,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } }, "attributeBoolean": { "description": "AttributeBoolean", @@ -27272,7 +27465,18 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } }, "attributeEmail": { "description": "AttributeEmail", @@ -27340,7 +27544,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } }, "attributeEnum": { "description": "AttributeEnum", @@ -27417,7 +27633,20 @@ "$updatedAt", "elements", "format" - ] + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } }, "attributeIp": { "description": "AttributeIP", @@ -27485,7 +27714,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } }, "attributeUrl": { "description": "AttributeURL", @@ -27553,7 +27794,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } }, "attributeDatetime": { "description": "AttributeDatetime", @@ -27621,7 +27874,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } }, "attributeRelationship": { "description": "AttributeRelationship", @@ -27713,7 +27978,23 @@ "twoWayKey", "onDelete", "side" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } }, "index": { "description": "Index", @@ -27785,7 +28066,18 @@ "lengths", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [], + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "document": { "description": "Document", @@ -27842,7 +28134,23 @@ "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -27976,7 +28284,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -28139,7 +28470,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -28153,7 +28510,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -28167,7 +28527,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -28181,7 +28544,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -28195,7 +28561,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -28237,7 +28606,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -28269,7 +28645,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -28304,12 +28686,19 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "session": { "description": "Session", @@ -28496,7 +28885,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -28564,7 +28986,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -28608,7 +29042,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -28622,7 +29064,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -28672,7 +29117,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -28692,7 +29146,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -28774,7 +29232,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "bucket": { "description": "Bucket", @@ -28866,7 +29339,26 @@ "compression", "encryption", "antivirus" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false + } }, "resourceToken": { "description": "ResourceToken", @@ -28916,7 +29408,16 @@ "expire", "secret", "accessedAt" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "team": { "description": "Team", @@ -28968,7 +29469,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -29059,7 +29571,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "site": { "description": "Site", @@ -29246,7 +29775,38 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } }, "function": { "description": "Function", @@ -29436,7 +29996,37 @@ "providerRootDirectory", "providerSilentMode", "specification" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb" + } }, "runtime": { "description": "Runtime", @@ -29495,7 +30085,17 @@ "image", "logo", "supports" - ] + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } }, "framework": { "description": "Framework", @@ -29551,7 +30151,25 @@ "buildRuntime", "runtimes", "adapters" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } }, "frameworkAdapter": { "description": "Framework Adapter", @@ -29589,7 +30207,14 @@ "buildCommand", "outputDirectory", "fallbackFile" - ] + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } }, "deployment": { "description": "Deployment", @@ -29763,7 +30388,36 @@ "providerCommitMessage", "providerCommitUrl", "providerBranchUrl" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerBranch": "0.7.x", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } }, "execution": { "description": "Execution", @@ -29896,7 +30550,36 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "variable": { "description": "Variable", @@ -29952,7 +30635,17 @@ "secret", "resourceType", "resourceId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } }, "country": { "description": "Country", @@ -29972,7 +30665,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -29992,7 +30689,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -30018,7 +30719,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -30070,7 +30776,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -30096,7 +30811,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "healthAntivirus": { "description": "Health Antivirus", @@ -30116,7 +30836,11 @@ "required": [ "version", "status" - ] + ], + "example": { + "version": "1.0.0", + "status": "online" + } }, "healthQueue": { "description": "Health Queue", @@ -30131,7 +30855,10 @@ }, "required": [ "size" - ] + ], + "example": { + "size": 8 + } }, "healthStatus": { "description": "Health Status", @@ -30158,7 +30885,12 @@ "name", "ping", "status" - ] + ], + "example": { + "name": "database", + "ping": 128, + "status": "pass" + } }, "healthCertificate": { "description": "Health Certificate", @@ -30202,7 +30934,15 @@ "validFrom", "validTo", "signatureTypeSN" - ] + ], + "example": { + "name": "\/CN=www.google.com", + "subjectSN": "", + "issuerOrganisation": "", + "validFrom": "1704200998", + "validTo": "1711458597", + "signatureTypeSN": "RSA-SHA256" + } }, "healthTime": { "description": "Health Time", @@ -30231,7 +30971,12 @@ "remoteTime", "localTime", "diff" - ] + ], + "example": { + "remoteTime": 1639490751, + "localTime": 1639490844, + "diff": 93 + } }, "headers": { "description": "Headers", @@ -30251,7 +30996,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "specification": { "description": "Specification", @@ -30285,7 +31034,13 @@ "cpus", "enabled", "slug" - ] + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -30317,7 +31072,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -30337,7 +31098,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -30357,7 +31124,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -30389,7 +31160,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "provider": { "description": "Provider", @@ -30456,7 +31233,22 @@ "enabled", "type", "credentials" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } }, "message": { "description": "Message", @@ -30567,7 +31359,33 @@ "deliveredTotal", "data", "status" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } }, "topic": { "description": "Topic", @@ -30629,7 +31447,17 @@ "smsTotal", "pushTotal", "subscribe" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } }, "subscriber": { "description": "Subscriber", @@ -30704,7 +31532,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -30766,7 +31614,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } } }, "externalDocs": { diff --git a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php index c3d70fa7a2..03afe7fee2 100644 --- a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php @@ -603,6 +603,7 @@ class OpenAPI3 extends Format $required = $model->getRequired(); $rules = $model->getRules(); + $examples = []; $output['components']['schemas'][$model->getType()] = [ 'description' => $model->getName(), @@ -692,6 +693,7 @@ class OpenAPI3 extends Format ], 'x-example' => $rule['example'] ?? null, ]; + $examples[$name] = $rule['example'] ?? null; if ($format) { $output['components']['schemas'][$model->getType()]['properties'][$name]['items']['format'] = $format; @@ -702,6 +704,7 @@ class OpenAPI3 extends Format 'description' => $rule['description'] ?? '', 'x-example' => $rule['example'] ?? null, ]; + $examples[$name] = $rule['example'] ?? null; if ($format) { $output['components']['schemas'][$model->getType()]['properties'][$name]['format'] = $format; @@ -714,6 +717,12 @@ class OpenAPI3 extends Format $output['components']['schemas'][$model->getType()]['properties'][$name]['nullable'] = true; } } + + if ($model->isAny() && !empty($model->getAnyExamples())) { + $examples = array_merge($examples, $model->getAnyExamples()); + } + + $output['components']['schemas'][$model->getType()]['example'] = $examples; } \ksort($output['paths']); diff --git a/src/Appwrite/SDK/Specification/Format/Swagger2.php b/src/Appwrite/SDK/Specification/Format/Swagger2.php index 10acca933f..316a780bb6 100644 --- a/src/Appwrite/SDK/Specification/Format/Swagger2.php +++ b/src/Appwrite/SDK/Specification/Format/Swagger2.php @@ -610,6 +610,7 @@ class Swagger2 extends Format $required = $model->getRequired(); $rules = $model->getRules(); + $examples = []; $output['definitions'][$model->getType()] = [ 'description' => $model->getName(), @@ -696,6 +697,7 @@ class Swagger2 extends Format 'description' => $rule['description'] ?? '', 'x-example' => $rule['example'] ?? null, ]; + $examples[$name] = $rule['example'] ?? null; continue; } @@ -708,6 +710,7 @@ class Swagger2 extends Format ], 'x-example' => $rule['example'] ?? null, ]; + $examples[$name] = $rule['example'] ?? null; if ($format) { $output['definitions'][$model->getType()]['properties'][$name]['items']['format'] = $format; @@ -718,6 +721,7 @@ class Swagger2 extends Format 'description' => $rule['description'] ?? '', 'x-example' => $rule['example'] ?? null, ]; + $examples[$name] = $rule['example'] ?? null; if ($format) { $output['definitions'][$model->getType()]['properties'][$name]['format'] = $format; @@ -730,6 +734,12 @@ class Swagger2 extends Format $output['definitions'][$model->getType()]['properties'][$name]['x-nullable'] = true; } } + + if ($model->isAny() && !empty($model->getAnyExamples())) { + $examples = array_merge($examples, $model->getAnyExamples()); + } + + $output['definitions'][$model->getType()]['example'] = $examples; } \ksort($output['paths']); diff --git a/src/Appwrite/Utopia/Response/Model/Any.php b/src/Appwrite/Utopia/Response/Model/Any.php index 634e0859b9..1df0f280b4 100644 --- a/src/Appwrite/Utopia/Response/Model/Any.php +++ b/src/Appwrite/Utopia/Response/Model/Any.php @@ -31,4 +31,14 @@ class Any extends Model { return Response::MODEL_ANY; } + + /** + * Get "any" examples + * + * @return array + */ + public function getAnyExamples(): array + { + return []; + } } diff --git a/src/Appwrite/Utopia/Response/Model/Document.php b/src/Appwrite/Utopia/Response/Model/Document.php index c36d6de12e..2460114d5a 100644 --- a/src/Appwrite/Utopia/Response/Model/Document.php +++ b/src/Appwrite/Utopia/Response/Model/Document.php @@ -95,4 +95,15 @@ class Document extends Any return $document; } + + public function getAnyExamples(): array + { + return [ + 'username' => 'john.doe', + 'email' => 'john.doe@example.com', + 'fullName' => 'John Doe', + 'age' => 30, + 'isAdmin' => false, + ]; + } } From 3d5b755115db7f2561854541acbb6ab2b4b829e6 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 1 Aug 2025 13:17:45 +0530 Subject: [PATCH 09/38] chore: simplify --- src/Appwrite/SDK/Specification/Format/OpenAPI3.php | 4 ++-- src/Appwrite/SDK/Specification/Format/Swagger2.php | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php index 03afe7fee2..1874775239 100644 --- a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php @@ -627,6 +627,8 @@ class OpenAPI3 extends Format $format = null; $items = null; + $examples[$name] = $rule['example'] ?? null; + switch ($rule['type']) { case 'string': case 'datetime': @@ -693,7 +695,6 @@ class OpenAPI3 extends Format ], 'x-example' => $rule['example'] ?? null, ]; - $examples[$name] = $rule['example'] ?? null; if ($format) { $output['components']['schemas'][$model->getType()]['properties'][$name]['items']['format'] = $format; @@ -704,7 +705,6 @@ class OpenAPI3 extends Format 'description' => $rule['description'] ?? '', 'x-example' => $rule['example'] ?? null, ]; - $examples[$name] = $rule['example'] ?? null; if ($format) { $output['components']['schemas'][$model->getType()]['properties'][$name]['format'] = $format; diff --git a/src/Appwrite/SDK/Specification/Format/Swagger2.php b/src/Appwrite/SDK/Specification/Format/Swagger2.php index 316a780bb6..56db370ef2 100644 --- a/src/Appwrite/SDK/Specification/Format/Swagger2.php +++ b/src/Appwrite/SDK/Specification/Format/Swagger2.php @@ -634,6 +634,8 @@ class Swagger2 extends Format $format = null; $items = null; + $examples[$name] = $rule['example'] ?? null; + switch ($rule['type']) { case 'string': case 'datetime': @@ -697,7 +699,6 @@ class Swagger2 extends Format 'description' => $rule['description'] ?? '', 'x-example' => $rule['example'] ?? null, ]; - $examples[$name] = $rule['example'] ?? null; continue; } @@ -710,7 +711,6 @@ class Swagger2 extends Format ], 'x-example' => $rule['example'] ?? null, ]; - $examples[$name] = $rule['example'] ?? null; if ($format) { $output['definitions'][$model->getType()]['properties'][$name]['items']['format'] = $format; @@ -721,7 +721,6 @@ class Swagger2 extends Format 'description' => $rule['description'] ?? '', 'x-example' => $rule['example'] ?? null, ]; - $examples[$name] = $rule['example'] ?? null; if ($format) { $output['definitions'][$model->getType()]['properties'][$name]['format'] = $format; From b3ba91cd5275fd605ec3486f5c44eb78dc275691 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 1 Aug 2025 15:26:34 +0530 Subject: [PATCH 10/38] chore: update naming and specs --- app/config/specs/open-api3-latest-client.json | 6 ++++- .../specs/open-api3-latest-console.json | 6 ++++- app/config/specs/open-api3-latest-server.json | 6 ++++- app/config/specs/swagger2-latest-client.json | 6 ++++- app/config/specs/swagger2-latest-console.json | 6 ++++- app/config/specs/swagger2-latest-server.json | 6 ++++- composer.lock | 24 +++++++++---------- .../SDK/Specification/Format/OpenAPI3.php | 4 ++-- .../SDK/Specification/Format/Swagger2.php | 4 ++-- src/Appwrite/Utopia/Response/Model/Any.php | 4 ++-- .../Utopia/Response/Model/Document.php | 2 +- .../Utopia/Response/Model/Preferences.php | 9 +++++++ 12 files changed, 58 insertions(+), 25 deletions(-) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index cb453725f7..6813c71f74 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -9083,7 +9083,11 @@ "description": "Preferences", "type": "object", "additionalProperties": true, - "example": [] + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index e23ddc58d8..358b282600 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -38582,7 +38582,11 @@ "description": "Preferences", "type": "object", "additionalProperties": true, - "example": [] + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 6b63c4eccd..35a1066924 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -28468,7 +28468,11 @@ "description": "Preferences", "type": "object", "additionalProperties": true, - "example": [] + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 98635164ae..07a12f0dbb 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -9122,7 +9122,11 @@ "description": "Preferences", "type": "object", "additionalProperties": true, - "example": [] + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index dfca0af6c3..32afa9e180 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -38745,7 +38745,11 @@ "description": "Preferences", "type": "object", "additionalProperties": true, - "example": [] + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 23a33b310c..391adc2dfc 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -28698,7 +28698,11 @@ "description": "Preferences", "type": "object", "additionalProperties": true, - "example": [] + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", diff --git a/composer.lock b/composer.lock index da084c8fcd..4bcf132ded 100644 --- a/composer.lock +++ b/composer.lock @@ -69,16 +69,16 @@ }, { "name": "appwrite/appwrite", - "version": "15.0.0", + "version": "15.1.0", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-for-php.git", - "reference": "deb97b62e0abed8a4fd5c5d48e77365cf89867cf" + "reference": "c438b3885071ac7c0329199dce5e6f6a24dd215b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/deb97b62e0abed8a4fd5c5d48e77365cf89867cf", - "reference": "deb97b62e0abed8a4fd5c5d48e77365cf89867cf", + "url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/c438b3885071ac7c0329199dce5e6f6a24dd215b", + "reference": "c438b3885071ac7c0329199dce5e6f6a24dd215b", "shasum": "" }, "require": { @@ -104,10 +104,10 @@ "support": { "email": "team@appwrite.io", "issues": "https://github.com/appwrite/sdk-for-php/issues", - "source": "https://github.com/appwrite/sdk-for-php/tree/15.0.0", + "source": "https://github.com/appwrite/sdk-for-php/tree/15.1.0", "url": "https://appwrite.io/support" }, - "time": "2025-05-18T09:47:10+00:00" + "time": "2025-08-01T04:50:51+00:00" }, { "name": "appwrite/php-clamav", @@ -5280,16 +5280,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.13.3", + "version": "1.13.4", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "faed855a7b5f4d4637717c2b3863e277116beb36" + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/faed855a7b5f4d4637717c2b3863e277116beb36", - "reference": "faed855a7b5f4d4637717c2b3863e277116beb36", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", "shasum": "" }, "require": { @@ -5328,7 +5328,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.3" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" }, "funding": [ { @@ -5336,7 +5336,7 @@ "type": "tidelift" } ], - "time": "2025-07-05T12:25:42+00:00" + "time": "2025-08-01T08:46:24+00:00" }, { "name": "nikic/php-parser", diff --git a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php index 1874775239..c4a39b707b 100644 --- a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php @@ -718,8 +718,8 @@ class OpenAPI3 extends Format } } - if ($model->isAny() && !empty($model->getAnyExamples())) { - $examples = array_merge($examples, $model->getAnyExamples()); + if ($model->isAny() && !empty($model->getSampleData())) { + $examples = array_merge($examples, $model->getSampleData()); } $output['components']['schemas'][$model->getType()]['example'] = $examples; diff --git a/src/Appwrite/SDK/Specification/Format/Swagger2.php b/src/Appwrite/SDK/Specification/Format/Swagger2.php index 56db370ef2..45fdc63bc8 100644 --- a/src/Appwrite/SDK/Specification/Format/Swagger2.php +++ b/src/Appwrite/SDK/Specification/Format/Swagger2.php @@ -734,8 +734,8 @@ class Swagger2 extends Format } } - if ($model->isAny() && !empty($model->getAnyExamples())) { - $examples = array_merge($examples, $model->getAnyExamples()); + if ($model->isAny() && !empty($model->getSampleData())) { + $examples = array_merge($examples, $model->getSampleData()); } $output['definitions'][$model->getType()]['example'] = $examples; diff --git a/src/Appwrite/Utopia/Response/Model/Any.php b/src/Appwrite/Utopia/Response/Model/Any.php index 1df0f280b4..6863748ac8 100644 --- a/src/Appwrite/Utopia/Response/Model/Any.php +++ b/src/Appwrite/Utopia/Response/Model/Any.php @@ -33,11 +33,11 @@ class Any extends Model } /** - * Get "any" examples + * Get sample data * * @return array */ - public function getAnyExamples(): array + public function getSampleData(): array { return []; } diff --git a/src/Appwrite/Utopia/Response/Model/Document.php b/src/Appwrite/Utopia/Response/Model/Document.php index 2460114d5a..dc9faf6a8e 100644 --- a/src/Appwrite/Utopia/Response/Model/Document.php +++ b/src/Appwrite/Utopia/Response/Model/Document.php @@ -96,7 +96,7 @@ class Document extends Any return $document; } - public function getAnyExamples(): array + public function getSampleData(): array { return [ 'username' => 'john.doe', diff --git a/src/Appwrite/Utopia/Response/Model/Preferences.php b/src/Appwrite/Utopia/Response/Model/Preferences.php index 379543660c..e40ca6bfda 100644 --- a/src/Appwrite/Utopia/Response/Model/Preferences.php +++ b/src/Appwrite/Utopia/Response/Model/Preferences.php @@ -25,4 +25,13 @@ class Preferences extends Any { return Response::MODEL_PREFERENCES; } + + public function getSampleData(): array + { + return [ + 'language' => 'en', + 'timezone' => 'UTC', + 'darkTheme' => true, + ]; + } } From 58d556aab52727650a4949802954771f21e6b0c2 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 1 Aug 2025 15:52:27 +0530 Subject: [PATCH 11/38] chore: update metric naming --- app/controllers/shared/api.php | 16 ++++++---------- app/init/resources.php | 4 ---- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index f627d0ddfe..2ef992764f 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -31,7 +31,7 @@ use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; use Utopia\Queue\Publisher; use Utopia\System\System; -use Utopia\Telemetry\Counter; +use Utopia\Telemetry\Adapter as Telemetry; use Utopia\Validator\WhiteList; $parseLabel = function (string $label, array $responsePayload, array $requestParams, Document $user) { @@ -422,8 +422,8 @@ App::init() ->inject('apiKey') ->inject('plan') ->inject('devKey') - ->inject('storageCacheOperationsCounter') - ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode, ?Key $apiKey, array $plan, Document $devKey, Counter $storageCacheOperationsCounter) use ($usageDatabaseListener, $eventDatabaseListener) { + ->inject('telemetry') + ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode, ?Key $apiKey, array $plan, Document $devKey, Telemetry $telemetry) use ($usageDatabaseListener, $eventDatabaseListener) { $route = $utopia->getRoute(); @@ -556,6 +556,7 @@ App::init() )); $useCache = $route->getLabel('cache', false); + $storageCacheOperationsCounter = $telemetry->createCounter('storage.cache.operations.load'); if ($useCache) { $route = $utopia->match($request); $isImageTransformation = $route->getPath() === '/v1/storage/buckets/:bucketId/files/:fileId/preview'; @@ -621,17 +622,12 @@ App::init() ->addHeader('Cache-Control', sprintf('private, max-age=%d', $timestamp)) ->addHeader('X-Appwrite-Cache', 'hit') ->setContentType($cacheLog->getAttribute('mimeType')); - $storageCacheOperationsCounter->add(1, [ - 'result' => 'hit', - 'resourceType' => $type, - ]); + $storageCacheOperationsCounter->add(1, ['result' => 'hit']); if (!$isImageTransformation || !$isDisabled) { $response->send($data); } } else { - $storageCacheOperationsCounter->add(1, [ - 'result' => 'miss', - ]); + $storageCacheOperationsCounter->add(1, ['result' => 'miss']); $response ->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate') ->addHeader('Pragma', 'no-cache') diff --git a/app/init/resources.php b/app/init/resources.php index ec62a6c0bb..162eab1973 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -1009,7 +1009,3 @@ App::setResource('httpReferrerSafe', function (Request $request, string $httpRef $referrer = (!empty($protocol) ? $protocol : $request->getProtocol()) . '://' . $origin . (!empty($port) ? ':' . $port : ''); return $referrer; }, ['request', 'httpReferrer', 'platforms', 'dbForPlatform', 'project', 'utopia']); - -App::setResource('storageCacheOperationsCounter', function (Telemetry $telemetry) { - return $telemetry->createCounter('storage.cache.operations.total'); -}, ['telemetry']); From 9929facd73774490397d69701f83d8b2ccca1821 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 1 Aug 2025 16:44:27 +0530 Subject: [PATCH 12/38] chore: update sdk gen --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 4bcf132ded..9ff91c61b7 100644 --- a/composer.lock +++ b/composer.lock @@ -4814,16 +4814,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.41.27", + "version": "0.41.28", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "083fd2e8163d6a4e59ee971ac6cb97277d831dd5" + "reference": "8eace11070264c62c8da3c69498fb8dc98fcfaf7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/083fd2e8163d6a4e59ee971ac6cb97277d831dd5", - "reference": "083fd2e8163d6a4e59ee971ac6cb97277d831dd5", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/8eace11070264c62c8da3c69498fb8dc98fcfaf7", + "reference": "8eace11070264c62c8da3c69498fb8dc98fcfaf7", "shasum": "" }, "require": { @@ -4859,9 +4859,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.41.27" + "source": "https://github.com/appwrite/sdk-generator/tree/0.41.28" }, - "time": "2025-07-31T10:20:46+00:00" + "time": "2025-08-01T11:06:30+00:00" }, { "name": "doctrine/annotations", From c2358701120149cab85734db7817ff99d06b871e Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 1 Aug 2025 17:36:03 +0530 Subject: [PATCH 13/38] chore: add placeholder version --- app/config/platforms.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/platforms.php b/app/config/platforms.php index 525e278cd1..280ffc30a6 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -207,7 +207,7 @@ return [ [ 'key' => 'web', 'name' => 'Console', - 'version' => '', + 'version' => '0.1.0', 'url' => '', 'package' => '', 'enabled' => true, From f5682c05169e0eef88f24d0650c4255e790097b9 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Sun, 3 Aug 2025 13:23:34 +0530 Subject: [PATCH 14/38] chore: add support for svg favicons --- app/controllers/api/avatars.php | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 3a7b4aa582..5083142a7e 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -362,7 +362,8 @@ App::get('/v1/avatars/favicon') $client = new Client(); try { $res = $client - ->setAllowRedirects(false) + ->setAllowRedirects(true) + ->setMaxRedirects(5) ->setUserAgent(\sprintf( APP_USERAGENT, System::getEnv('_APP_VERSION', 'UNKNOWN'), @@ -399,6 +400,11 @@ App::get('/v1/avatars/favicon') $ext = \pathinfo(\parse_url($absolute, PHP_URL_PATH), PATHINFO_EXTENSION); switch ($ext) { + case 'svg': + $space = PHP_INT_MAX; + $outputHref = $absolute; + $outputExt = $ext; + break; case 'ico': case 'png': case 'jpg': @@ -437,7 +443,8 @@ App::get('/v1/avatars/favicon') $client = new Client(); try { $res = $client - ->setAllowRedirects(false) + ->setAllowRedirects(true) + ->setMaxRedirects(5) ->fetch($outputHref); } catch (\Throwable) { throw new Exception(Exception::AVATAR_REMOTE_URL_FAILED); @@ -450,7 +457,7 @@ App::get('/v1/avatars/favicon') $data = $res->getBody(); if ('ico' == $outputExt) { // Skip crop, Imagick isn\'t supporting icon files - if (empty($data) || (\mb_substr($data, 0, 5) === 'file($data); } + if ('svg' == $outputExt) { // Skip crop, Imagick isn\'t supporting svg files + $response + ->addHeader('Cache-Control', 'private, max-age=2592000') // 30 days + ->setContentType('image/svg+xml') + ->file($data); + return; + } + $image = new Image($data); $image->crop((int) $width, (int) $height); $output = (empty($output)) ? $type : $output; From 4adebc8ba222c1c3a7b8db4e5345aa9b66235edc Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Sun, 3 Aug 2025 13:33:10 +0530 Subject: [PATCH 15/38] chore: add svg sanitization --- app/controllers/api/avatars.php | 12 ++++- composer.json | 3 +- composer.lock | 83 +++++++++++++++++++++++++-------- 3 files changed, 77 insertions(+), 21 deletions(-) diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 5083142a7e..b0eaddd742 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -401,6 +401,7 @@ App::get('/v1/avatars/favicon') switch ($ext) { case 'svg': + // SVG icons are prioritized by assigning the maximum possible value. $space = PHP_INT_MAX; $outputHref = $absolute; $outputExt = $ext; @@ -457,7 +458,11 @@ App::get('/v1/avatars/favicon') $data = $res->getBody(); if ('ico' == $outputExt) { // Skip crop, Imagick isn\'t supporting icon files - if (empty($data) || str_starts_with($data, 'sanitize($data); + if ($cleanSvg === false) { + throw new \Exception('SVG sanitization failed'); + } $response ->addHeader('Cache-Control', 'private, max-age=2592000') // 30 days ->setContentType('image/svg+xml') diff --git a/composer.json b/composer.json index 31a31af9f2..73cdcc3d86 100644 --- a/composer.json +++ b/composer.json @@ -82,7 +82,8 @@ "adhocore/jwt": "1.1.*", "spomky-labs/otphp": "^10.0", "webonyx/graphql-php": "14.11.*", - "league/csv": "9.14.*" + "league/csv": "9.14.*", + "enshrined/svg-sanitize": "0.21.*" }, "require-dev": { "ext-fileinfo": "*", diff --git a/composer.lock b/composer.lock index da084c8fcd..aafe1d216c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "edbe5912c45e1f467f398541a75a77de", + "content-hash": "7b2ef6192403daf5c492219822ce0aa1", "packages": [ { "name": "adhocore/jwt", @@ -69,16 +69,16 @@ }, { "name": "appwrite/appwrite", - "version": "15.0.0", + "version": "15.1.0", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-for-php.git", - "reference": "deb97b62e0abed8a4fd5c5d48e77365cf89867cf" + "reference": "c438b3885071ac7c0329199dce5e6f6a24dd215b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/deb97b62e0abed8a4fd5c5d48e77365cf89867cf", - "reference": "deb97b62e0abed8a4fd5c5d48e77365cf89867cf", + "url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/c438b3885071ac7c0329199dce5e6f6a24dd215b", + "reference": "c438b3885071ac7c0329199dce5e6f6a24dd215b", "shasum": "" }, "require": { @@ -104,10 +104,10 @@ "support": { "email": "team@appwrite.io", "issues": "https://github.com/appwrite/sdk-for-php/issues", - "source": "https://github.com/appwrite/sdk-for-php/tree/15.0.0", + "source": "https://github.com/appwrite/sdk-for-php/tree/15.1.0", "url": "https://appwrite.io/support" }, - "time": "2025-05-18T09:47:10+00:00" + "time": "2025-08-01T04:50:51+00:00" }, { "name": "appwrite/php-clamav", @@ -628,6 +628,51 @@ ], "time": "2023-08-10T19:36:49+00:00" }, + { + "name": "enshrined/svg-sanitize", + "version": "0.21.0", + "source": { + "type": "git", + "url": "https://github.com/darylldoyle/svg-sanitizer.git", + "reference": "5e477468fac5c5ce933dce53af3e8e4e58dcccc9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/5e477468fac5c5ce933dce53af3e8e4e58dcccc9", + "reference": "5e477468fac5c5ce933dce53af3e8e4e58dcccc9", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5 || ^8.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "enshrined\\svgSanitize\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Daryll Doyle", + "email": "daryll@enshrined.co.uk" + } + ], + "description": "An SVG sanitizer for PHP", + "support": { + "issues": "https://github.com/darylldoyle/svg-sanitizer/issues", + "source": "https://github.com/darylldoyle/svg-sanitizer/tree/0.21.0" + }, + "time": "2025-01-13T09:32:25+00:00" + }, { "name": "giggsey/libphonenumber-for-php-lite", "version": "8.13.36", @@ -4814,16 +4859,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.41.27", + "version": "0.41.28", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "083fd2e8163d6a4e59ee971ac6cb97277d831dd5" + "reference": "8eace11070264c62c8da3c69498fb8dc98fcfaf7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/083fd2e8163d6a4e59ee971ac6cb97277d831dd5", - "reference": "083fd2e8163d6a4e59ee971ac6cb97277d831dd5", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/8eace11070264c62c8da3c69498fb8dc98fcfaf7", + "reference": "8eace11070264c62c8da3c69498fb8dc98fcfaf7", "shasum": "" }, "require": { @@ -4859,9 +4904,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.41.27" + "source": "https://github.com/appwrite/sdk-generator/tree/0.41.28" }, - "time": "2025-07-31T10:20:46+00:00" + "time": "2025-08-01T11:06:30+00:00" }, { "name": "doctrine/annotations", @@ -5280,16 +5325,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.13.3", + "version": "1.13.4", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "faed855a7b5f4d4637717c2b3863e277116beb36" + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/faed855a7b5f4d4637717c2b3863e277116beb36", - "reference": "faed855a7b5f4d4637717c2b3863e277116beb36", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", "shasum": "" }, "require": { @@ -5328,7 +5373,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.3" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" }, "funding": [ { @@ -5336,7 +5381,7 @@ "type": "tidelift" } ], - "time": "2025-07-05T12:25:42+00:00" + "time": "2025-08-01T08:46:24+00:00" }, { "name": "nikic/php-parser", From 7c5dd9d0f4df3b492a495148baf376c113e33d2b Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Sun, 3 Aug 2025 13:38:59 +0530 Subject: [PATCH 16/38] add test --- tests/e2e/Services/Avatars/AvatarsBase.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/e2e/Services/Avatars/AvatarsBase.php b/tests/e2e/Services/Avatars/AvatarsBase.php index ba66920ed6..915ee4bfa4 100644 --- a/tests/e2e/Services/Avatars/AvatarsBase.php +++ b/tests/e2e/Services/Avatars/AvatarsBase.php @@ -287,6 +287,16 @@ trait AvatarsBase $this->assertEquals('image/x-icon', $response['headers']['content-type']); $this->assertNotEmpty($response['body']); + $response = $this->client->call(Client::METHOD_GET, '/avatars/favicon', [ + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'url' => 'https://appwrite.io/', + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals('image/svg+xml', $response['headers']['content-type']); + $this->assertNotEmpty($response['body']); + /** * Test for FAILURE */ From a00b93416d74aeacd7ba7494663a075cbeee3234 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Sun, 3 Aug 2025 13:39:30 +0530 Subject: [PATCH 17/38] fix: cleansvg --- app/controllers/api/avatars.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index b0eaddd742..297b70c1dc 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -480,7 +480,7 @@ App::get('/v1/avatars/favicon') $response ->addHeader('Cache-Control', 'private, max-age=2592000') // 30 days ->setContentType('image/svg+xml') - ->file($data); + ->file($cleanSvg); return; } From 4c971910bbc67d324d673febfe937affbd02d17c Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Sun, 3 Aug 2025 22:08:25 +0530 Subject: [PATCH 18/38] chore: fix import --- app/controllers/api/avatars.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 297b70c1dc..0617a84532 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -10,6 +10,7 @@ use Appwrite\URL\URL as URLParse; use Appwrite\Utopia\Response; use chillerlan\QRCode\QRCode; use chillerlan\QRCode\QROptions; +use enshrined\svgSanitize\Sanitizer as SvgSanitizer; use Utopia\App; use Utopia\Config\Config; use Utopia\Database\Database; @@ -457,7 +458,7 @@ App::get('/v1/avatars/favicon') $data = $res->getBody(); - if ('ico' == $outputExt) { // Skip crop, Imagick isn\'t supporting icon files + if ('ico' === $outputExt) { // Skip crop, Imagick isn\'t supporting icon files if ( empty($data) || stripos($data, 'addHeader('Cache-Control', 'private, max-age=2592000') // 30 days ->setContentType('image/x-icon') ->file($data); + return; } - if ('svg' == $outputExt) { // Skip crop, Imagick isn\'t supporting svg files - $sanitizer = new \Enshrined\SvgSanitize\Sanitizer(); + if ('svg' === $outputExt) { // Skip crop, Imagick isn\'t supporting svg files + $sanitizer = new SvgSanitizer(); $cleanSvg = $sanitizer->sanitize($data); if ($cleanSvg === false) { throw new \Exception('SVG sanitization failed'); From 10b82716e41be9ee32a7e2181b7dde901d979e8e Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Sun, 3 Aug 2025 22:31:26 +0530 Subject: [PATCH 19/38] chore: update test --- tests/e2e/Services/Avatars/AvatarsBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/Services/Avatars/AvatarsBase.php b/tests/e2e/Services/Avatars/AvatarsBase.php index 915ee4bfa4..6d34418438 100644 --- a/tests/e2e/Services/Avatars/AvatarsBase.php +++ b/tests/e2e/Services/Avatars/AvatarsBase.php @@ -284,7 +284,7 @@ trait AvatarsBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals('image/x-icon', $response['headers']['content-type']); + $this->assertEquals('image/svg+xml', $response['headers']['content-type']); $this->assertNotEmpty($response['body']); $response = $this->client->call(Client::METHOD_GET, '/avatars/favicon', [ From 484ebb50591831ca71a5fb4304903e0f732e2de4 Mon Sep 17 00:00:00 2001 From: Khushboo Verma Date: Mon, 4 Aug 2025 00:42:00 +0530 Subject: [PATCH 20/38] Check CAA record in DNSTest --- .env | 4 +- app/config/variables.php | 18 +++ app/controllers/api/console.php | 2 + app/controllers/api/proxy.php | 6 + composer.json | 1 + composer.lock | 107 ++++++++++++++---- docker-compose.yml | 8 ++ src/Appwrite/Network/Validator/DNS.php | 34 +++--- .../Platform/Workers/Certificates.php | 6 + .../Response/Model/ConsoleVariables.php | 12 ++ tests/unit/Network/Validators/DNSTest.php | 23 ++++ 11 files changed, 178 insertions(+), 43 deletions(-) diff --git a/.env b/.env index 76af83a946..7fe837ea7e 100644 --- a/.env +++ b/.env @@ -121,4 +121,6 @@ _APP_MESSAGE_PUSH_TEST_DSN= _APP_WEBHOOK_MAX_FAILED_ATTEMPTS=10 _APP_PROJECT_REGIONS=default _APP_FUNCTIONS_CREATION_ABUSE_LIMIT=5000 -_APP_STATS_USAGE_DUAL_WRITING_DBS=database_db_main \ No newline at end of file +_APP_STATS_USAGE_DUAL_WRITING_DBS=database_db_main +_APP_DOMAINS_DNS=8.8.8.8 +_APP_DOMAIN_TARGET_CAA='0 issue "digicert.com"' \ No newline at end of file diff --git a/app/config/variables.php b/app/config/variables.php index 71ed13a483..61a0cd563f 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -151,6 +151,24 @@ return [ 'question' => '', 'filter' => '' ], + [ + 'name' => '_APP_DOMAIN_TARGET_CAA', + 'description' => 'A CAA record value that can be used to validate custom domains. Format: "0 issue \"certainly.com\""', + 'introduction' => '', + 'default' => '', + 'required' => false, + 'question' => '', + 'filter' => '' + ], + [ + 'name' => '_APP_DOMAINS_DNS', + 'description' => 'DNS server to use for domain validation. Default: 8.8.8.8', + 'introduction' => '', + 'default' => '8.8.8.8', + 'required' => false, + 'question' => '', + 'filter' => '' + ], [ 'name' => '_APP_CONSOLE_WHITELIST_ROOT', 'description' => 'This option allows you to disable the creation of new users on the Appwrite console. When enabled only 1 user will be able to use the registration form. New users can be added by inviting them to your project. By default this option is enabled.', diff --git a/app/controllers/api/console.php b/app/controllers/api/console.php index 558dc0e4ef..a564031e7c 100644 --- a/app/controllers/api/console.php +++ b/app/controllers/api/console.php @@ -71,6 +71,8 @@ App::get('/v1/console/variables') '_APP_DOMAIN_TARGET_CNAME' => System::getEnv('_APP_DOMAIN_TARGET_CNAME'), '_APP_DOMAIN_TARGET_AAAA' => System::getEnv('_APP_DOMAIN_TARGET_AAAA'), '_APP_DOMAIN_TARGET_A' => System::getEnv('_APP_DOMAIN_TARGET_A'), + '_APP_DOMAIN_TARGET_CAA' => System::getEnv('_APP_DOMAIN_TARGET_CAA'), + '_APP_DOMAINS_DNS' => System::getEnv('_APP_DOMAINS_DNS'), '_APP_STORAGE_LIMIT' => +System::getEnv('_APP_STORAGE_LIMIT'), '_APP_COMPUTE_SIZE_LIMIT' => +System::getEnv('_APP_COMPUTE_SIZE_LIMIT'), '_APP_USAGE_STATS' => System::getEnv('_APP_USAGE_STATS'), diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index 417ea602ba..5596124a3a 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -257,6 +257,12 @@ App::patch('/v1/proxy/rules/:ruleId/verification') $validators[] = new DNS(System::getEnv('_APP_DOMAIN_TARGET_AAAA', ''), DNS::RECORD_AAAA); } + // Add CAA validation if configured + $caaTarget = System::getEnv('_APP_DOMAIN_TARGET_CAA', ''); + if (!empty($caaTarget)) { + $validators[] = new DNS($caaTarget, DNS::RECORD_CAA); + } + if (empty($validators)) { throw new Exception(Exception::GENERAL_SERVER_ERROR, 'At least one of domain targets environment variable must be configured.'); } diff --git a/composer.json b/composer.json index 31a31af9f2..10b8b7cc88 100644 --- a/composer.json +++ b/composer.json @@ -55,6 +55,7 @@ "utopia-php/database": "0.71.*", "utopia-php/detector": "0.1.*", "utopia-php/domains": "0.8.*", + "utopia-php/dns": "dev-feat-add-CAA-to-client as 0.2.99", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", "utopia-php/fetch": "0.4.*", diff --git a/composer.lock b/composer.lock index da084c8fcd..b2c9ba0b0d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "edbe5912c45e1f467f398541a75a77de", + "content-hash": "d36ad770ee5e4ea6e3bb0206c2c584ff", "packages": [ { "name": "adhocore/jwt", @@ -69,16 +69,16 @@ }, { "name": "appwrite/appwrite", - "version": "15.0.0", + "version": "15.1.0", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-for-php.git", - "reference": "deb97b62e0abed8a4fd5c5d48e77365cf89867cf" + "reference": "c438b3885071ac7c0329199dce5e6f6a24dd215b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/deb97b62e0abed8a4fd5c5d48e77365cf89867cf", - "reference": "deb97b62e0abed8a4fd5c5d48e77365cf89867cf", + "url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/c438b3885071ac7c0329199dce5e6f6a24dd215b", + "reference": "c438b3885071ac7c0329199dce5e6f6a24dd215b", "shasum": "" }, "require": { @@ -104,10 +104,10 @@ "support": { "email": "team@appwrite.io", "issues": "https://github.com/appwrite/sdk-for-php/issues", - "source": "https://github.com/appwrite/sdk-for-php/tree/15.0.0", + "source": "https://github.com/appwrite/sdk-for-php/tree/15.1.0", "url": "https://appwrite.io/support" }, - "time": "2025-05-18T09:47:10+00:00" + "time": "2025-08-01T04:50:51+00:00" }, { "name": "appwrite/php-clamav", @@ -3596,6 +3596,62 @@ }, "time": "2025-05-19T11:01:28+00:00" }, + { + "name": "utopia-php/dns", + "version": "dev-feat-add-CAA-to-client", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/dns.git", + "reference": "a7d45e4c5dfc7020c0467de9587ccd7e15488206" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/dns/zipball/a7d45e4c5dfc7020c0467de9587ccd7e15488206", + "reference": "a7d45e4c5dfc7020c0467de9587ccd7e15488206", + "shasum": "" + }, + "require": { + "php": ">=8.0", + "utopia-php/cli": "0.15.*", + "utopia-php/telemetry": "^0.1.1" + }, + "require-dev": { + "laravel/pint": "1.2.*", + "phpstan/phpstan": "1.8.*", + "phpunit/phpunit": "^9.3", + "rregeer/phpunit-coverage-check": "^0.3.1", + "swoole/ide-helper": "4.6.6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\DNS\\": "src/DNS" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eldad Fux", + "email": "eldad@appwrite.io" + } + ], + "description": "Lite & fast micro PHP DNS server abstraction that is **easy to use**.", + "keywords": [ + "dns", + "framework", + "php", + "upf", + "utopia" + ], + "support": { + "issues": "https://github.com/utopia-php/dns/issues", + "source": "https://github.com/utopia-php/dns/tree/feat-add-CAA-to-client" + }, + "time": "2025-08-03T18:46:13+00:00" + }, { "name": "utopia-php/domains", "version": "0.8.0", @@ -4814,16 +4870,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.41.27", + "version": "0.41.28", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "083fd2e8163d6a4e59ee971ac6cb97277d831dd5" + "reference": "8eace11070264c62c8da3c69498fb8dc98fcfaf7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/083fd2e8163d6a4e59ee971ac6cb97277d831dd5", - "reference": "083fd2e8163d6a4e59ee971ac6cb97277d831dd5", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/8eace11070264c62c8da3c69498fb8dc98fcfaf7", + "reference": "8eace11070264c62c8da3c69498fb8dc98fcfaf7", "shasum": "" }, "require": { @@ -4859,9 +4915,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.41.27" + "source": "https://github.com/appwrite/sdk-generator/tree/0.41.28" }, - "time": "2025-07-31T10:20:46+00:00" + "time": "2025-08-01T11:06:30+00:00" }, { "name": "doctrine/annotations", @@ -5280,16 +5336,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.13.3", + "version": "1.13.4", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "faed855a7b5f4d4637717c2b3863e277116beb36" + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/faed855a7b5f4d4637717c2b3863e277116beb36", - "reference": "faed855a7b5f4d4637717c2b3863e277116beb36", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", "shasum": "" }, "require": { @@ -5328,7 +5384,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.3" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" }, "funding": [ { @@ -5336,7 +5392,7 @@ "type": "tidelift" } ], - "time": "2025-07-05T12:25:42+00:00" + "time": "2025-08-01T08:46:24+00:00" }, { "name": "nikic/php-parser", @@ -8261,9 +8317,18 @@ "time": "2024-03-07T20:33:40+00:00" } ], - "aliases": [], + "aliases": [ + { + "package": "utopia-php/dns", + "version": "dev-feat-add-CAA-to-client", + "alias": "0.2.99", + "alias_normalized": "0.2.99.0" + } + ], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": { + "utopia-php/dns": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/docker-compose.yml b/docker-compose.yml index 58b78fcd8e..830e0905fa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -120,6 +120,8 @@ services: - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A + - _APP_DOMAIN_TARGET_CAA + - _APP_DOMAINS_DNS - _APP_DOMAIN_FUNCTIONS - _APP_REDIS_HOST - _APP_REDIS_PORT @@ -535,6 +537,8 @@ services: - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A + - _APP_DOMAIN_TARGET_CAA + - _APP_DOMAINS_DNS - _APP_DOMAIN_FUNCTIONS - _APP_EMAIL_CERTIFICATES - _APP_REDIS_HOST @@ -704,6 +708,8 @@ services: - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A + - _APP_DOMAIN_TARGET_CAA + - _APP_DOMAINS_DNS - _APP_EMAIL_SECURITY - _APP_REDIS_HOST - _APP_REDIS_PORT @@ -738,6 +744,8 @@ services: - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A + - _APP_DOMAIN_TARGET_CAA + - _APP_DOMAINS_DNS - _APP_DOMAIN_FUNCTIONS - _APP_OPENSSL_KEY_V1 - _APP_REDIS_HOST diff --git a/src/Appwrite/Network/Validator/DNS.php b/src/Appwrite/Network/Validator/DNS.php index 73494ddc3e..eff19c90f1 100644 --- a/src/Appwrite/Network/Validator/DNS.php +++ b/src/Appwrite/Network/Validator/DNS.php @@ -2,6 +2,8 @@ namespace Appwrite\Network\Validator; +use Utopia\DNS\Client; +use Utopia\System\System; use Utopia\Validator; class DNS extends Validator @@ -9,6 +11,7 @@ class DNS extends Validator public const RECORD_A = 'a'; public const RECORD_AAAA = 'aaaa'; public const RECORD_CNAME = 'cname'; + public const RECORD_CAA = 'caa'; /** * @var mixed @@ -42,42 +45,31 @@ class DNS extends Validator * Check if DNS record value matches specific value * * @param mixed $domain - * * @return bool */ public function isValid($value): bool { - $typeNative = match ($this->type) { - self::RECORD_A => DNS_A, - self::RECORD_AAAA => DNS_AAAA, - self::RECORD_CNAME => DNS_CNAME, - default => throw new \Exception('Record type not supported.') - }; - - $dnsKey = match ($this->type) { - self::RECORD_A => 'ip', - self::RECORD_AAAA => 'ipv6', - self::RECORD_CNAME => 'target', - default => throw new \Exception('Record type not supported.') - }; - if (!is_string($value)) { return false; } + $dnsServer = System::getEnv('_APP_DOMAINS_DNS', ''); + $dns = new Client($dnsServer); + try { - $records = \dns_get_record($value, $typeNative); - $this->logs = $records; - } catch (\Throwable $th) { + $query = $dns->query($value, strtoupper($this->type)); + $this->logs = $query; + } catch (\Exception $e) { + $this->logs = ['error' => $e->getMessage()]; return false; } - if (!$records) { + if (empty($query)) { return false; } - foreach ($records as $record) { - if (isset($record[$dnsKey]) && $record[$dnsKey] === $this->target) { + foreach ($query as $record) { + if ($record->getRdata() === $this->target) { return true; } } diff --git a/src/Appwrite/Platform/Workers/Certificates.php b/src/Appwrite/Platform/Workers/Certificates.php index 207f95ff7d..dd927aae84 100644 --- a/src/Appwrite/Platform/Workers/Certificates.php +++ b/src/Appwrite/Platform/Workers/Certificates.php @@ -314,6 +314,12 @@ class Certificates extends Action $validators[] = new DNS(System::getEnv('_APP_DOMAIN_TARGET_AAAA', ''), DNS::RECORD_AAAA); } + // Add CAA validation if configured + $caaTarget = System::getEnv('_APP_DOMAIN_TARGET_CAA', ''); + if (!empty($caaTarget)) { + $validators[] = new DNS($caaTarget, DNS::RECORD_CAA); + } + // Validate if domain target is properly configured if (empty($validators)) { throw new Exception('At least one of domain targets environment variable must be configured.'); diff --git a/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php b/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php index 97dae2efcd..21141254ab 100644 --- a/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php +++ b/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php @@ -27,6 +27,18 @@ class ConsoleVariables extends Model 'description' => 'AAAA target for your Appwrite custom domains.', 'default' => '', 'example' => '::1', + ]) + ->addRule('_APP_DOMAIN_TARGET_CAA', [ + 'type' => self::TYPE_STRING, + 'description' => 'CAA target for your Appwrite custom domains.', + 'default' => '', + 'example' => '0 issue "certainly.com"', + ]) + ->addRule('_APP_DOMAINS_DNS', [ + 'type' => self::TYPE_STRING, + 'description' => 'DNS server to use for domain validation.', + 'default' => '8.8.8.8', + 'example' => '8.8.8.8', ]) ->addRule('_APP_STORAGE_LIMIT', [ 'type' => self::TYPE_INTEGER, diff --git a/tests/unit/Network/Validators/DNSTest.php b/tests/unit/Network/Validators/DNSTest.php index 5e8652381a..19f42892cb 100644 --- a/tests/unit/Network/Validators/DNSTest.php +++ b/tests/unit/Network/Validators/DNSTest.php @@ -47,4 +47,27 @@ class DNSTest extends TestCase $this->assertEquals($validator->isValid('aaaa-unit-test.appwrite.org'), true); $this->assertEquals($validator->isValid('test1.appwrite.org'), false); } + + public function testCAA(): void + { + $validator = new DNS('0 issue "pki.goog"', DNS::RECORD_CAA); + + $this->assertEquals($validator->isValid(''), false); + $this->assertEquals($validator->isValid(null), false); + $this->assertEquals($validator->isValid(false), false); + + $result = $validator->isValid('google.com'); + if ($result === false) { + $logs = $validator->getLogs(); + if (isset($logs['error']) && strpos($logs['error'], 'Failed to receive data') !== false) { + $this->markTestSkipped('DNS resolution not available in test environment: ' . $logs['error']); + } + } + $this->assertEquals($result, true); + + $this->assertEquals($validator->isValid('test1.appwrite.org'), false); + + $validator2 = new DNS('0 issue "letsencrypt.org"', DNS::RECORD_CAA); + $this->assertEquals($validator2->isValid('test2.appwrite.org'), false); + } } From 9f8fabe58a42f33c853a6ad24093b18e25483b9c Mon Sep 17 00:00:00 2001 From: Khushboo Verma Date: Mon, 4 Aug 2025 01:12:58 +0530 Subject: [PATCH 21/38] Verify domain CAA after certificate issuance --- app/controllers/api/proxy.php | 6 ---- .../Platform/Workers/Certificates.php | 34 +++++++++++++++---- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index 5596124a3a..417ea602ba 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -257,12 +257,6 @@ App::patch('/v1/proxy/rules/:ruleId/verification') $validators[] = new DNS(System::getEnv('_APP_DOMAIN_TARGET_AAAA', ''), DNS::RECORD_AAAA); } - // Add CAA validation if configured - $caaTarget = System::getEnv('_APP_DOMAIN_TARGET_CAA', ''); - if (!empty($caaTarget)) { - $validators[] = new DNS($caaTarget, DNS::RECORD_CAA); - } - if (empty($validators)) { throw new Exception(Exception::GENERAL_SERVER_ERROR, 'At least one of domain targets environment variable must be configured.'); } diff --git a/src/Appwrite/Platform/Workers/Certificates.php b/src/Appwrite/Platform/Workers/Certificates.php index dd927aae84..287abfd1a2 100644 --- a/src/Appwrite/Platform/Workers/Certificates.php +++ b/src/Appwrite/Platform/Workers/Certificates.php @@ -188,8 +188,11 @@ class Certificates extends Action $certName = ID::unique(); $renewDate = $certificates->issueCertificate($certName, $domain->get(), $domainType); + // Validate CAA records after certificate generation to ensure the CA was authorized + $this->validateCAARecords($domain->get(), $log); + // Command succeeded, store all data into document - $certificate->setAttribute('logs', 'Certificate successfully generated.'); + $certificate->setAttribute('logs', 'Certificate successfully generated and CAA validated.'); // Update certificate info stored in database $certificate->setAttribute('renewDate', $renewDate); @@ -314,12 +317,6 @@ class Certificates extends Action $validators[] = new DNS(System::getEnv('_APP_DOMAIN_TARGET_AAAA', ''), DNS::RECORD_AAAA); } - // Add CAA validation if configured - $caaTarget = System::getEnv('_APP_DOMAIN_TARGET_CAA', ''); - if (!empty($caaTarget)) { - $validators[] = new DNS($caaTarget, DNS::RECORD_CAA); - } - // Validate if domain target is properly configured if (empty($validators)) { throw new Exception('At least one of domain targets environment variable must be configured.'); @@ -349,6 +346,29 @@ class Certificates extends Action } } + /** + * Validate CAA records to ensure the certificate authority (CA) was authorized by the domain owner. + * + * @param string $domain The domain to validate CAA records for. + * @param Log $log The logger instance. + * @return void + * @throws Exception + */ + private function validateCAARecords(string $domain, Log $log): void + { + $caaTarget = System::getEnv('_APP_DOMAIN_TARGET_CAA', ''); + if (empty($caaTarget)) { + return; + } + + $validator = new DNS($caaTarget, DNS::RECORD_CAA); + if (!$validator->isValid($domain)) { + $log->addTag('caaDomain', $domain); + $log->addExtra('caaResponse', $validator->getLogs()); + throw new Exception('Failed to verify CAA records for domain: ' . $domain); + } + } + /** * Method to make sure information about error is delivered to admnistrator. * From d48aa6060979a43e7757374d95b83b527a495d1a Mon Sep 17 00:00:00 2001 From: Khushboo Verma Date: Mon, 4 Aug 2025 01:22:10 +0530 Subject: [PATCH 22/38] Update test --- tests/unit/Network/Validators/DNSTest.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/unit/Network/Validators/DNSTest.php b/tests/unit/Network/Validators/DNSTest.php index 19f42892cb..f5c5e093dd 100644 --- a/tests/unit/Network/Validators/DNSTest.php +++ b/tests/unit/Network/Validators/DNSTest.php @@ -57,12 +57,6 @@ class DNSTest extends TestCase $this->assertEquals($validator->isValid(false), false); $result = $validator->isValid('google.com'); - if ($result === false) { - $logs = $validator->getLogs(); - if (isset($logs['error']) && strpos($logs['error'], 'Failed to receive data') !== false) { - $this->markTestSkipped('DNS resolution not available in test environment: ' . $logs['error']); - } - } $this->assertEquals($result, true); $this->assertEquals($validator->isValid('test1.appwrite.org'), false); From 69dbb3222fd21f167f5417707245f057d5b8ca89 Mon Sep 17 00:00:00 2001 From: Khushboo Verma Date: Mon, 4 Aug 2025 01:33:47 +0530 Subject: [PATCH 23/38] Add check in proxy --- app/controllers/api/proxy.php | 5 +++ .../Platform/Workers/Certificates.php | 34 ++++--------------- tests/unit/Network/Validators/DNSTest.php | 4 +-- 3 files changed, 14 insertions(+), 29 deletions(-) diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index 417ea602ba..eb7dcf625a 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -257,6 +257,11 @@ App::patch('/v1/proxy/rules/:ruleId/verification') $validators[] = new DNS(System::getEnv('_APP_DOMAIN_TARGET_AAAA', ''), DNS::RECORD_AAAA); } + $caaTarget = System::getEnv('_APP_DOMAIN_TARGET_CAA', ''); + if (!empty($caaTarget)) { + $validators[] = new DNS($caaTarget, DNS::RECORD_CAA); + } + if (empty($validators)) { throw new Exception(Exception::GENERAL_SERVER_ERROR, 'At least one of domain targets environment variable must be configured.'); } diff --git a/src/Appwrite/Platform/Workers/Certificates.php b/src/Appwrite/Platform/Workers/Certificates.php index 287abfd1a2..dd927aae84 100644 --- a/src/Appwrite/Platform/Workers/Certificates.php +++ b/src/Appwrite/Platform/Workers/Certificates.php @@ -188,11 +188,8 @@ class Certificates extends Action $certName = ID::unique(); $renewDate = $certificates->issueCertificate($certName, $domain->get(), $domainType); - // Validate CAA records after certificate generation to ensure the CA was authorized - $this->validateCAARecords($domain->get(), $log); - // Command succeeded, store all data into document - $certificate->setAttribute('logs', 'Certificate successfully generated and CAA validated.'); + $certificate->setAttribute('logs', 'Certificate successfully generated.'); // Update certificate info stored in database $certificate->setAttribute('renewDate', $renewDate); @@ -317,6 +314,12 @@ class Certificates extends Action $validators[] = new DNS(System::getEnv('_APP_DOMAIN_TARGET_AAAA', ''), DNS::RECORD_AAAA); } + // Add CAA validation if configured + $caaTarget = System::getEnv('_APP_DOMAIN_TARGET_CAA', ''); + if (!empty($caaTarget)) { + $validators[] = new DNS($caaTarget, DNS::RECORD_CAA); + } + // Validate if domain target is properly configured if (empty($validators)) { throw new Exception('At least one of domain targets environment variable must be configured.'); @@ -346,29 +349,6 @@ class Certificates extends Action } } - /** - * Validate CAA records to ensure the certificate authority (CA) was authorized by the domain owner. - * - * @param string $domain The domain to validate CAA records for. - * @param Log $log The logger instance. - * @return void - * @throws Exception - */ - private function validateCAARecords(string $domain, Log $log): void - { - $caaTarget = System::getEnv('_APP_DOMAIN_TARGET_CAA', ''); - if (empty($caaTarget)) { - return; - } - - $validator = new DNS($caaTarget, DNS::RECORD_CAA); - if (!$validator->isValid($domain)) { - $log->addTag('caaDomain', $domain); - $log->addExtra('caaResponse', $validator->getLogs()); - throw new Exception('Failed to verify CAA records for domain: ' . $domain); - } - } - /** * Method to make sure information about error is delivered to admnistrator. * diff --git a/tests/unit/Network/Validators/DNSTest.php b/tests/unit/Network/Validators/DNSTest.php index f5c5e093dd..64293258a4 100644 --- a/tests/unit/Network/Validators/DNSTest.php +++ b/tests/unit/Network/Validators/DNSTest.php @@ -50,13 +50,13 @@ class DNSTest extends TestCase public function testCAA(): void { - $validator = new DNS('0 issue "pki.goog"', DNS::RECORD_CAA); + $validator = new DNS('0 issue "digicert.com"', DNS::RECORD_CAA); $this->assertEquals($validator->isValid(''), false); $this->assertEquals($validator->isValid(null), false); $this->assertEquals($validator->isValid(false), false); - $result = $validator->isValid('google.com'); + $result = $validator->isValid('github.com'); $this->assertEquals($result, true); $this->assertEquals($validator->isValid('test1.appwrite.org'), false); From 783894a82b5b2a0ad696dfa75e9ce88db6ee960a Mon Sep 17 00:00:00 2001 From: Khushboo Verma Date: Mon, 4 Aug 2025 01:40:39 +0530 Subject: [PATCH 24/38] Add default value --- src/Appwrite/Network/Validator/DNS.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Network/Validator/DNS.php b/src/Appwrite/Network/Validator/DNS.php index eff19c90f1..7557a0d04b 100644 --- a/src/Appwrite/Network/Validator/DNS.php +++ b/src/Appwrite/Network/Validator/DNS.php @@ -53,7 +53,7 @@ class DNS extends Validator return false; } - $dnsServer = System::getEnv('_APP_DOMAINS_DNS', ''); + $dnsServer = System::getEnv('_APP_DOMAINS_DNS', '8.8.8.8'); $dns = new Client($dnsServer); try { From 16685dad4e20a0ba4ce3c9126ea2787cf2dac9eb Mon Sep 17 00:00:00 2001 From: Khushboo Verma Date: Mon, 4 Aug 2025 01:49:08 +0530 Subject: [PATCH 25/38] Update console tests --- tests/e2e/Services/Console/ConsoleConsoleClientTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/e2e/Services/Console/ConsoleConsoleClientTest.php b/tests/e2e/Services/Console/ConsoleConsoleClientTest.php index 6059cb2000..bfad5b480b 100644 --- a/tests/e2e/Services/Console/ConsoleConsoleClientTest.php +++ b/tests/e2e/Services/Console/ConsoleConsoleClientTest.php @@ -24,10 +24,11 @@ class ConsoleConsoleClientTest extends Scope ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(13, $response['body']); + $this->assertCount(15, $response['body']); $this->assertIsString($response['body']['_APP_DOMAIN_TARGET_CNAME']); $this->assertIsString($response['body']['_APP_DOMAIN_TARGET_A']); $this->assertIsString($response['body']['_APP_DOMAIN_TARGET_AAAA']); + $this->assertIsString($response['body']['_APP_DOMAIN_TARGET_CAA']); $this->assertIsInt($response['body']['_APP_STORAGE_LIMIT']); $this->assertIsInt($response['body']['_APP_COMPUTE_SIZE_LIMIT']); $this->assertIsBool($response['body']['_APP_DOMAIN_ENABLED']); @@ -37,6 +38,7 @@ class ConsoleConsoleClientTest extends Scope $this->assertIsString($response['body']['_APP_DOMAIN_FUNCTIONS']); $this->assertIsString($response['body']['_APP_OPTIONS_FORCE_HTTPS']); $this->assertIsString($response['body']['_APP_DOMAINS_NAMESERVERS']); + $this->assertIsString($response['body']['_APP_DOMAINS_DNS']); // When adding new keys, dont forget to update count a few lines above } } From 55938fa3c3503b1458515e25b4e21d1dd4e1eb78 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 4 Aug 2025 08:52:07 +0530 Subject: [PATCH 26/38] update 1.7.x examples --- app/config/specs/open-api3-1.7.x-client.json | 489 ++++- app/config/specs/open-api3-1.7.x-console.json | 1782 +++++++++++++++-- app/config/specs/open-api3-1.7.x-server.json | 1069 +++++++++- app/config/specs/swagger2-1.7.x-client.json | 481 ++++- app/config/specs/swagger2-1.7.x-console.json | 1774 ++++++++++++++-- app/config/specs/swagger2-1.7.x-server.json | 1061 +++++++++- 6 files changed, 6053 insertions(+), 603 deletions(-) diff --git a/app/config/specs/open-api3-1.7.x-client.json b/app/config/specs/open-api3-1.7.x-client.json index 3cf675c5ad..6813c71f74 100644 --- a/app/config/specs/open-api3-1.7.x-client.json +++ b/app/config/specs/open-api3-1.7.x-client.json @@ -5361,7 +5361,7 @@ "scheduledAt": { "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", - "x-example": null + "x-example": "" } } } @@ -8033,7 +8033,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "error": { "description": "Error", @@ -8065,7 +8066,13 @@ "code", "type", "version" - ] + ], + "example": { + "message": "Not found", + "code": "404", + "type": "not_found", + "version": "1.0" + } }, "documentList": { "description": "Documents List", @@ -8089,7 +8096,11 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } }, "sessionList": { "description": "Sessions List", @@ -8113,7 +8124,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -8137,7 +8152,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -8161,7 +8180,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -8185,7 +8208,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "teamList": { "description": "Teams List", @@ -8209,7 +8236,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -8233,7 +8264,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "executionList": { "description": "Executions List", @@ -8257,7 +8292,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "countryList": { "description": "Countries List", @@ -8281,7 +8320,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -8305,7 +8348,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -8329,7 +8376,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -8353,7 +8404,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -8377,7 +8432,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -8401,7 +8460,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "document": { "description": "Document", @@ -8458,7 +8521,23 @@ "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -8592,7 +8671,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -8753,7 +8855,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -8767,7 +8895,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -8781,7 +8912,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -8795,7 +8929,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -8809,7 +8946,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -8851,7 +8991,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -8883,7 +9030,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -8918,12 +9071,23 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", @@ -9110,7 +9274,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -9178,7 +9375,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -9222,7 +9431,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -9236,7 +9453,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -9286,7 +9506,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -9306,7 +9535,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -9388,7 +9621,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "team": { "description": "Team", @@ -9439,7 +9687,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -9530,7 +9789,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "execution": { "description": "Execution", @@ -9661,7 +9937,36 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "country": { "description": "Country", @@ -9681,7 +9986,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -9701,7 +10010,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -9727,7 +10040,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -9779,7 +10097,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -9805,7 +10132,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "headers": { "description": "Headers", @@ -9825,7 +10157,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -9857,7 +10193,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -9877,7 +10219,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -9897,7 +10245,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -9929,7 +10281,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "subscriber": { "description": "Subscriber", @@ -10003,7 +10361,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -10065,7 +10443,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } } }, "securitySchemes": { diff --git a/app/config/specs/open-api3-1.7.x-console.json b/app/config/specs/open-api3-1.7.x-console.json index 0bfebf37b9..358b282600 100644 --- a/app/config/specs/open-api3-1.7.x-console.json +++ b/app/config/specs/open-api3-1.7.x-console.json @@ -11820,7 +11820,7 @@ "scheduledAt": { "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", - "x-example": null + "x-example": "" } } } @@ -35466,7 +35466,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "error": { "description": "Error", @@ -35498,7 +35499,13 @@ "code", "type", "version" - ] + ], + "example": { + "message": "Not found", + "code": "404", + "type": "not_found", + "version": "1.0" + } }, "documentList": { "description": "Documents List", @@ -35522,7 +35529,11 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } }, "collectionList": { "description": "Collections List", @@ -35546,7 +35557,11 @@ "required": [ "total", "collections" - ] + ], + "example": { + "total": 5, + "collections": "" + } }, "databaseList": { "description": "Databases List", @@ -35570,7 +35585,11 @@ "required": [ "total", "databases" - ] + ], + "example": { + "total": 5, + "databases": "" + } }, "indexList": { "description": "Indexes List", @@ -35594,7 +35613,11 @@ "required": [ "total", "indexes" - ] + ], + "example": { + "total": 5, + "indexes": "" + } }, "userList": { "description": "Users List", @@ -35618,7 +35641,11 @@ "required": [ "total", "users" - ] + ], + "example": { + "total": 5, + "users": "" + } }, "sessionList": { "description": "Sessions List", @@ -35642,7 +35669,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -35666,7 +35697,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -35690,7 +35725,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -35714,7 +35753,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "bucketList": { "description": "Buckets List", @@ -35738,7 +35781,11 @@ "required": [ "total", "buckets" - ] + ], + "example": { + "total": 5, + "buckets": "" + } }, "resourceTokenList": { "description": "Resource Tokens List", @@ -35762,7 +35809,11 @@ "required": [ "total", "tokens" - ] + ], + "example": { + "total": 5, + "tokens": "" + } }, "teamList": { "description": "Teams List", @@ -35786,7 +35837,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -35810,7 +35865,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "siteList": { "description": "Sites List", @@ -35834,7 +35893,11 @@ "required": [ "total", "sites" - ] + ], + "example": { + "total": 5, + "sites": "" + } }, "templateSiteList": { "description": "Site Templates List", @@ -35858,7 +35921,11 @@ "required": [ "total", "templates" - ] + ], + "example": { + "total": 5, + "templates": "" + } }, "functionList": { "description": "Functions List", @@ -35882,7 +35949,11 @@ "required": [ "total", "functions" - ] + ], + "example": { + "total": 5, + "functions": "" + } }, "templateFunctionList": { "description": "Function Templates List", @@ -35906,7 +35977,11 @@ "required": [ "total", "templates" - ] + ], + "example": { + "total": 5, + "templates": "" + } }, "installationList": { "description": "Installations List", @@ -35930,7 +36005,11 @@ "required": [ "total", "installations" - ] + ], + "example": { + "total": 5, + "installations": "" + } }, "providerRepositoryFrameworkList": { "description": "Framework Provider Repositories List", @@ -35954,7 +36033,11 @@ "required": [ "total", "frameworkProviderRepositories" - ] + ], + "example": { + "total": 5, + "frameworkProviderRepositories": "" + } }, "providerRepositoryRuntimeList": { "description": "Runtime Provider Repositories List", @@ -35978,7 +36061,11 @@ "required": [ "total", "runtimeProviderRepositories" - ] + ], + "example": { + "total": 5, + "runtimeProviderRepositories": "" + } }, "branchList": { "description": "Branches List", @@ -36002,7 +36089,11 @@ "required": [ "total", "branches" - ] + ], + "example": { + "total": 5, + "branches": "" + } }, "frameworkList": { "description": "Frameworks List", @@ -36026,7 +36117,11 @@ "required": [ "total", "frameworks" - ] + ], + "example": { + "total": 5, + "frameworks": "" + } }, "runtimeList": { "description": "Runtimes List", @@ -36050,7 +36145,11 @@ "required": [ "total", "runtimes" - ] + ], + "example": { + "total": 5, + "runtimes": "" + } }, "deploymentList": { "description": "Deployments List", @@ -36074,7 +36173,11 @@ "required": [ "total", "deployments" - ] + ], + "example": { + "total": 5, + "deployments": "" + } }, "executionList": { "description": "Executions List", @@ -36098,7 +36201,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "projectList": { "description": "Projects List", @@ -36122,7 +36229,11 @@ "required": [ "total", "projects" - ] + ], + "example": { + "total": 5, + "projects": "" + } }, "webhookList": { "description": "Webhooks List", @@ -36146,7 +36257,11 @@ "required": [ "total", "webhooks" - ] + ], + "example": { + "total": 5, + "webhooks": "" + } }, "keyList": { "description": "API Keys List", @@ -36170,7 +36285,11 @@ "required": [ "total", "keys" - ] + ], + "example": { + "total": 5, + "keys": "" + } }, "devKeyList": { "description": "Dev Keys List", @@ -36194,7 +36313,11 @@ "required": [ "total", "devKeys" - ] + ], + "example": { + "total": 5, + "devKeys": "" + } }, "platformList": { "description": "Platforms List", @@ -36218,7 +36341,11 @@ "required": [ "total", "platforms" - ] + ], + "example": { + "total": 5, + "platforms": "" + } }, "countryList": { "description": "Countries List", @@ -36242,7 +36369,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -36266,7 +36397,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -36290,7 +36425,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -36314,7 +36453,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -36338,7 +36481,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "variableList": { "description": "Variables List", @@ -36362,7 +36509,11 @@ "required": [ "total", "variables" - ] + ], + "example": { + "total": 5, + "variables": "" + } }, "proxyRuleList": { "description": "Rule List", @@ -36386,7 +36537,11 @@ "required": [ "total", "rules" - ] + ], + "example": { + "total": 5, + "rules": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -36410,7 +36565,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "providerList": { "description": "Provider list", @@ -36434,7 +36593,11 @@ "required": [ "total", "providers" - ] + ], + "example": { + "total": 5, + "providers": "" + } }, "messageList": { "description": "Message list", @@ -36458,7 +36621,11 @@ "required": [ "total", "messages" - ] + ], + "example": { + "total": 5, + "messages": "" + } }, "topicList": { "description": "Topic list", @@ -36482,7 +36649,11 @@ "required": [ "total", "topics" - ] + ], + "example": { + "total": 5, + "topics": "" + } }, "subscriberList": { "description": "Subscriber list", @@ -36506,7 +36677,11 @@ "required": [ "total", "subscribers" - ] + ], + "example": { + "total": 5, + "subscribers": "" + } }, "targetList": { "description": "Target list", @@ -36530,7 +36705,11 @@ "required": [ "total", "targets" - ] + ], + "example": { + "total": 5, + "targets": "" + } }, "migrationList": { "description": "Migrations List", @@ -36554,7 +36733,11 @@ "required": [ "total", "migrations" - ] + ], + "example": { + "total": 5, + "migrations": "" + } }, "specificationList": { "description": "Specifications List", @@ -36578,7 +36761,11 @@ "required": [ "total", "specifications" - ] + ], + "example": { + "total": 5, + "specifications": "" + } }, "vcsContentList": { "description": "VCS Content List", @@ -36602,7 +36789,11 @@ "required": [ "total", "contents" - ] + ], + "example": { + "total": 5, + "contents": "" + } }, "database": { "description": "Database", @@ -36640,7 +36831,14 @@ "$createdAt", "$updatedAt", "enabled" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false + } }, "collection": { "description": "Collection", @@ -36750,7 +36948,21 @@ "documentSecurity", "attributes", "indexes" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {} + } }, "attributeList": { "description": "Attributes List", @@ -36805,7 +37017,11 @@ "required": [ "total", "attributes" - ] + ], + "example": { + "total": 5, + "attributes": "" + } }, "attributeString": { "description": "AttributeString", @@ -36880,7 +37096,20 @@ "$createdAt", "$updatedAt", "size" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } }, "attributeInteger": { "description": "AttributeInteger", @@ -36957,7 +37186,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } }, "attributeFloat": { "description": "AttributeFloat", @@ -37034,7 +37276,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } }, "attributeBoolean": { "description": "AttributeBoolean", @@ -37096,7 +37351,18 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } }, "attributeEmail": { "description": "AttributeEmail", @@ -37164,7 +37430,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } }, "attributeEnum": { "description": "AttributeEnum", @@ -37241,7 +37519,20 @@ "$updatedAt", "elements", "format" - ] + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } }, "attributeIp": { "description": "AttributeIP", @@ -37309,7 +37600,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } }, "attributeUrl": { "description": "AttributeURL", @@ -37377,7 +37680,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } }, "attributeDatetime": { "description": "AttributeDatetime", @@ -37445,7 +37760,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } }, "attributeRelationship": { "description": "AttributeRelationship", @@ -37537,7 +37864,23 @@ "twoWayKey", "onDelete", "side" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } }, "index": { "description": "Index", @@ -37609,7 +37952,18 @@ "lengths", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [], + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "document": { "description": "Document", @@ -37666,7 +38020,23 @@ "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -37800,7 +38170,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -37961,7 +38354,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -37975,7 +38394,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -37989,7 +38411,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -38003,7 +38428,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -38017,7 +38445,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -38059,7 +38490,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -38091,7 +38529,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -38126,12 +38570,23 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", @@ -38318,7 +38773,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -38386,7 +38874,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -38430,7 +38930,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -38444,7 +38952,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -38494,7 +39005,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -38514,7 +39034,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -38596,7 +39120,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "bucket": { "description": "Bucket", @@ -38688,7 +39227,26 @@ "compression", "encryption", "antivirus" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false + } }, "resourceToken": { "description": "ResourceToken", @@ -38738,7 +39296,16 @@ "expire", "secret", "accessedAt" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "team": { "description": "Team", @@ -38789,7 +39356,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -38880,7 +39458,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "site": { "description": "Site", @@ -39066,7 +39661,38 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } }, "templateSite": { "description": "Template Site", @@ -39161,7 +39787,22 @@ "providerOwner", "providerVersion", "variables" - ] + ], + "example": { + "key": "starter", + "name": "Starter site", + "tagline": "Minimal web app integrating with Appwrite.", + "demoUrl": "https:\/\/nextjs-starter.appwrite.network\/", + "screenshotDark": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-dark.png", + "screenshotLight": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-light.png", + "useCases": "Starter", + "frameworks": [], + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [] + } }, "templateFramework": { "description": "Template Framework", @@ -39223,7 +39864,18 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/build", + "providerRootDirectory": ".\/svelte-kit\/starter", + "buildRuntime": "node-22", + "adapter": "ssr", + "fallbackFile": "index.html" + } }, "function": { "description": "Function", @@ -39412,7 +40064,37 @@ "providerRootDirectory", "providerSilentMode", "specification" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb" + } }, "templateFunction": { "description": "Template Function", @@ -39541,7 +40223,26 @@ "providerVersion", "variables", "scopes" - ] + ], + "example": { + "icon": "icon-lightning-bolt", + "id": "starter", + "name": "Starter function", + "tagline": "A simple function to get started.", + "permissions": "any", + "events": "account.create", + "cron": "0 0 * * *", + "timeout": 300, + "useCases": "Starter", + "runtimes": [], + "instructions": "For documentation and instructions check out .", + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [], + "scopes": "users.read" + } }, "templateRuntime": { "description": "Template Runtime", @@ -39573,7 +40274,13 @@ "commands", "entrypoint", "providerRootDirectory" - ] + ], + "example": { + "name": "node-19.0", + "commands": "npm install", + "entrypoint": "index.js", + "providerRootDirectory": "node\/starter" + } }, "templateVariable": { "description": "Template Variable", @@ -39623,7 +40330,16 @@ "placeholder", "required", "type" - ] + ], + "example": { + "name": "APPWRITE_DATABASE_ID", + "description": "The ID of the Appwrite database that contains the collection to sync.", + "value": "512", + "secret": false, + "placeholder": "64a55...7b912", + "required": false, + "type": "password" + } }, "installation": { "description": "Installation", @@ -39667,7 +40383,15 @@ "provider", "organization", "providerInstallationId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "provider": "github", + "organization": "appwrite", + "providerInstallationId": "5322" + } }, "providerRepository": { "description": "ProviderRepository", @@ -39698,6 +40422,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39710,8 +40439,18 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime" + } }, "providerRepositoryFramework": { "description": "ProviderRepositoryFramework", @@ -39742,6 +40481,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39759,9 +40503,20 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt", "framework" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime", + "framework": "nextjs" + } }, "providerRepositoryRuntime": { "description": "ProviderRepositoryRuntime", @@ -39792,6 +40547,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39809,9 +40569,20 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt", "runtime" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime", + "runtime": "node-22" + } }, "detectionFramework": { "description": "DetectionFramework", @@ -39843,7 +40614,13 @@ "installCommand", "buildCommand", "outputDirectory" - ] + ], + "example": { + "framework": "nuxt", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "dist" + } }, "detectionRuntime": { "description": "DetectionRuntime", @@ -39869,7 +40646,12 @@ "runtime", "entrypoint", "commands" - ] + ], + "example": { + "runtime": "node", + "entrypoint": "index.js", + "commands": "npm install && npm run build" + } }, "vcsContent": { "description": "VcsContents", @@ -39896,7 +40678,12 @@ }, "required": [ "name" - ] + ], + "example": { + "size": 1523, + "isDirectory": true, + "name": "Main.java" + } }, "branch": { "description": "Branch", @@ -39910,7 +40697,10 @@ }, "required": [ "name" - ] + ], + "example": { + "name": "main" + } }, "runtime": { "description": "Runtime", @@ -39969,7 +40759,17 @@ "image", "logo", "supports" - ] + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } }, "framework": { "description": "Framework", @@ -40024,7 +40824,25 @@ "buildRuntime", "runtimes", "adapters" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } }, "frameworkAdapter": { "description": "Framework Adapter", @@ -40062,7 +40880,14 @@ "buildCommand", "outputDirectory", "fallbackFile" - ] + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } }, "deployment": { "description": "Deployment", @@ -40236,7 +41061,36 @@ "providerCommitMessage", "providerCommitUrl", "providerBranchUrl" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerBranch": "0.7.x", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } }, "execution": { "description": "Execution", @@ -40367,7 +41221,36 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "project": { "description": "Project", @@ -40763,7 +41646,73 @@ "serviceStatusForFunctions", "serviceStatusForGraphql", "serviceStatusForMessaging" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "New Project", + "description": "This is a new project.", + "teamId": "1592981250", + "logo": "5f5c451b403cb", + "url": "5f5c451b403cb", + "legalName": "Company LTD.", + "legalCountry": "US", + "legalState": "New York", + "legalCity": "New York City.", + "legalAddress": "620 Eighth Avenue, New York, NY 10018", + "legalTaxId": "131102020", + "authDuration": 60, + "authLimit": 100, + "authSessionsLimit": 10, + "authPasswordHistory": 5, + "authPasswordDictionary": true, + "authPersonalDataCheck": true, + "authMockNumbers": [ + {} + ], + "authSessionAlerts": true, + "authMembershipsUserName": true, + "authMembershipsUserEmail": true, + "authMembershipsMfa": true, + "oAuthProviders": [ + {} + ], + "platforms": {}, + "webhooks": {}, + "keys": {}, + "devKeys": {}, + "smtpEnabled": false, + "smtpSenderName": "John Appwrite", + "smtpSenderEmail": "john@appwrite.io", + "smtpReplyTo": "support@appwrite.io", + "smtpHost": "mail.appwrite.io", + "smtpPort": 25, + "smtpUsername": "emailuser", + "smtpPassword": "securepassword", + "smtpSecure": "tls", + "pingCount": 1, + "pingedAt": "2020-10-15T06:38:00.000+00:00", + "authEmailPassword": true, + "authUsersAuthMagicURL": true, + "authEmailOtp": true, + "authAnonymous": true, + "authInvites": true, + "authJWT": true, + "authPhone": true, + "serviceStatusForAccount": true, + "serviceStatusForAvatars": true, + "serviceStatusForDatabases": true, + "serviceStatusForLocale": true, + "serviceStatusForHealth": true, + "serviceStatusForStorage": true, + "serviceStatusForTeams": true, + "serviceStatusForUsers": true, + "serviceStatusForSites": true, + "serviceStatusForFunctions": true, + "serviceStatusForGraphql": true, + "serviceStatusForMessaging": true + } }, "webhook": { "description": "Webhook", @@ -40853,7 +41802,22 @@ "enabled", "logs", "attempts" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Webhook", + "url": "https:\/\/example.com\/webhook", + "events": "database.collections.update", + "security": true, + "httpUser": "username", + "httpPass": "password", + "signatureKey": "ad3d581ca230e2b7059c545e5a", + "enabled": true, + "logs": "Failed to connect to remote server.", + "attempts": 10 + } }, "key": { "description": "Key", @@ -40921,7 +41885,18 @@ "secret", "accessedAt", "sdks" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "scopes": "users.read", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } }, "devKey": { "description": "DevKey", @@ -40980,7 +41955,17 @@ "secret", "accessedAt", "sdks" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Dev API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } }, "mockNumber": { "description": "Mock Number", @@ -41000,7 +41985,11 @@ "required": [ "phone", "otp" - ] + ], + "example": { + "phone": "+1612842323", + "otp": "123456" + } }, "authProvider": { "description": "AuthProvider", @@ -41038,7 +42027,14 @@ "appId", "secret", "enabled" - ] + ], + "example": { + "key": "github", + "name": "GitHub", + "appId": "259125845563242502", + "secret": "Bpw_g9c2TGXxfgLshDbSaL8tsCcqgczQ", + "enabled": "" + } }, "platform": { "description": "Platform", @@ -41106,7 +42102,19 @@ "hostname", "httpUser", "httpPass" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Web App", + "type": "web", + "key": "com.company.appname", + "store": "", + "hostname": true, + "httpUser": "username", + "httpPass": "password" + } }, "variable": { "description": "Variable", @@ -41162,7 +42170,17 @@ "secret", "resourceType", "resourceId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } }, "country": { "description": "Country", @@ -41182,7 +42200,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -41202,7 +42224,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -41228,7 +42254,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -41280,7 +42311,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -41306,7 +42346,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "healthAntivirus": { "description": "Health Antivirus", @@ -41326,7 +42371,11 @@ "required": [ "version", "status" - ] + ], + "example": { + "version": "1.0.0", + "status": "online" + } }, "healthQueue": { "description": "Health Queue", @@ -41341,7 +42390,10 @@ }, "required": [ "size" - ] + ], + "example": { + "size": 8 + } }, "healthStatus": { "description": "Health Status", @@ -41368,7 +42420,12 @@ "name", "ping", "status" - ] + ], + "example": { + "name": "database", + "ping": 128, + "status": "pass" + } }, "healthCertificate": { "description": "Health Certificate", @@ -41412,7 +42469,15 @@ "validFrom", "validTo", "signatureTypeSN" - ] + ], + "example": { + "name": "\/CN=www.google.com", + "subjectSN": "", + "issuerOrganisation": "", + "validFrom": "1704200998", + "validTo": "1711458597", + "signatureTypeSN": "RSA-SHA256" + } }, "healthTime": { "description": "Health Time", @@ -41441,7 +42506,12 @@ "remoteTime", "localTime", "diff" - ] + ], + "example": { + "remoteTime": 1639490751, + "localTime": 1639490844, + "diff": 93 + } }, "metric": { "description": "Metric", @@ -41462,7 +42532,11 @@ "required": [ "value", "date" - ] + ], + "example": { + "value": 1, + "date": "2020-10-15T06:38:00.000+00:00" + } }, "metricBreakdown": { "description": "Metric Breakdown", @@ -41496,7 +42570,13 @@ "required": [ "name", "value" - ] + ], + "example": { + "resourceId": "5e5ea5c16897e", + "name": "Documents", + "value": 1, + "estimate": 1 + } }, "usageDatabases": { "description": "UsageDatabases", @@ -41606,7 +42686,22 @@ "storage", "databasesReads", "databasesWrites" - ] + ], + "example": { + "range": "30d", + "databasesTotal": 0, + "collectionsTotal": 0, + "documentsTotal": 0, + "storageTotal": 0, + "databasesReadsTotal": 0, + "databasesWritesTotal": 0, + "databases": [], + "collections": [], + "documents": [], + "storage": [], + "databasesReads": [], + "databasesWrites": [] + } }, "usageDatabase": { "description": "UsageDatabase", @@ -41700,7 +42795,20 @@ "storage", "databaseReads", "databaseWrites" - ] + ], + "example": { + "range": "30d", + "collectionsTotal": 0, + "documentsTotal": 0, + "storageTotal": 0, + "databaseReadsTotal": 0, + "databaseWritesTotal": 0, + "collections": [], + "documents": [], + "storage": [], + "databaseReads": [], + "databaseWrites": [] + } }, "usageCollection": { "description": "UsageCollection", @@ -41730,7 +42838,12 @@ "range", "documentsTotal", "documents" - ] + ], + "example": { + "range": "30d", + "documentsTotal": 0, + "documents": [] + } }, "usageUsers": { "description": "UsageUsers", @@ -41776,7 +42889,14 @@ "sessionsTotal", "users", "sessions" - ] + ], + "example": { + "range": "30d", + "usersTotal": 0, + "sessionsTotal": 0, + "users": [], + "sessions": [] + } }, "usageStorage": { "description": "StorageUsage", @@ -41838,7 +42958,16 @@ "buckets", "files", "storage" - ] + ], + "example": { + "range": "30d", + "bucketsTotal": 0, + "filesTotal": 0, + "filesStorageTotal": 0, + "buckets": [], + "files": [], + "storage": [] + } }, "usageBuckets": { "description": "UsageBuckets", @@ -41900,7 +43029,16 @@ "storage", "imageTransformations", "imageTransformationsTotal" - ] + ], + "example": { + "range": "30d", + "filesTotal": 0, + "filesStorageTotal": 0, + "files": [], + "storage": [], + "imageTransformations": [], + "imageTransformationsTotal": 0 + } }, "usageFunctions": { "description": "UsageFunctions", @@ -42106,7 +43244,34 @@ "executionsMbSeconds", "buildsSuccess", "buildsFailed" - ] + ], + "example": { + "range": "30d", + "functionsTotal": 0, + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "functions": 0, + "deployments": [], + "deploymentsStorage": [], + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [] + } }, "usageFunction": { "description": "UsageFunction", @@ -42303,7 +43468,33 @@ "executionsMbSeconds", "buildsSuccess", "buildsFailed" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsTimeAverage": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [] + } }, "usageSites": { "description": "UsageSites", @@ -42557,7 +43748,40 @@ "inbound", "outboundTotal", "outbound" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [], + "sitesTotal": 0, + "sites": [], + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [] + } }, "usageSite": { "description": "UsageSite", @@ -42802,7 +44026,39 @@ "inbound", "outboundTotal", "outbound" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsTimeAverage": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [], + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [] + } }, "usageProject": { "description": "UsageProject", @@ -43055,7 +44311,40 @@ "databasesWrites", "imageTransformations", "imageTransformationsTotal" - ] + ], + "example": { + "executionsTotal": 0, + "documentsTotal": 0, + "databasesTotal": 0, + "databasesStorageTotal": 0, + "usersTotal": 0, + "filesStorageTotal": 0, + "functionsStorageTotal": 0, + "buildsStorageTotal": 0, + "deploymentsStorageTotal": 0, + "bucketsTotal": 0, + "executionsMbSecondsTotal": 0, + "buildsMbSecondsTotal": 0, + "databasesReadsTotal": 0, + "databasesWritesTotal": 0, + "requests": [], + "network": [], + "users": [], + "executions": [], + "executionsBreakdown": [], + "bucketsBreakdown": [], + "databasesStorageBreakdown": [], + "executionsMbSecondsBreakdown": [], + "buildsMbSecondsBreakdown": [], + "functionsStorageBreakdown": [], + "authPhoneTotal": 0, + "authPhoneEstimate": 0, + "authPhoneCountryBreakdown": [], + "databasesReads": [], + "databasesWrites": [], + "imageTransformations": [], + "imageTransformationsTotal": 0 + } }, "headers": { "description": "Headers", @@ -43075,7 +44364,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "specification": { "description": "Specification", @@ -43109,7 +44402,13 @@ "cpus", "enabled", "slug" - ] + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } }, "proxyRule": { "description": "Rule", @@ -43208,7 +44507,24 @@ "status", "logs", "renewAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "domain": "appwrite.company.com", + "type": "deployment", + "trigger": "manual", + "redirectUrl": "https:\/\/appwrite.io\/docs", + "redirectStatusCode": 301, + "deploymentId": "n3u9feiwmf", + "deploymentResourceType": "function", + "deploymentResourceId": "n3u9feiwmf", + "deploymentVcsProviderBranch": "function", + "status": "verified", + "logs": "HTTP challegne failed.", + "renewAt": "datetime" + } }, "smsTemplate": { "description": "SmsTemplate", @@ -43234,7 +44550,12 @@ "type", "locale", "message" - ] + ], + "example": { + "type": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account." + } }, "emailTemplate": { "description": "EmailTemplate", @@ -43284,7 +44605,16 @@ "senderEmail", "replyTo", "subject" - ] + ], + "example": { + "type": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account.", + "senderName": "My User", + "senderEmail": "mail@appwrite.io", + "replyTo": "emails@appwrite.io", + "subject": "Please verify your email address" + } }, "consoleVariables": { "description": "Console Variables", @@ -43372,7 +44702,22 @@ "_APP_DOMAIN_FUNCTIONS", "_APP_OPTIONS_FORCE_HTTPS", "_APP_DOMAINS_NAMESERVERS" - ] + ], + "example": { + "_APP_DOMAIN_TARGET_CNAME": "appwrite.io", + "_APP_DOMAIN_TARGET_A": "127.0.0.1", + "_APP_DOMAIN_TARGET_AAAA": "::1", + "_APP_STORAGE_LIMIT": "30000000", + "_APP_COMPUTE_SIZE_LIMIT": "30000000", + "_APP_USAGE_STATS": "enabled", + "_APP_VCS_ENABLED": true, + "_APP_DOMAIN_ENABLED": true, + "_APP_ASSISTANT_ENABLED": true, + "_APP_DOMAIN_SITES": "sites.localhost", + "_APP_DOMAIN_FUNCTIONS": "functions.localhost", + "_APP_OPTIONS_FORCE_HTTPS": "enabled", + "_APP_DOMAINS_NAMESERVERS": "ns1.example.com,ns2.example.com" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -43404,7 +44749,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -43424,7 +44775,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -43444,7 +44801,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -43476,7 +44837,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "provider": { "description": "Provider", @@ -43542,7 +44909,22 @@ "enabled", "type", "credentials" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } }, "message": { "description": "Message", @@ -43652,7 +45034,33 @@ "deliveredTotal", "data", "status" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } }, "topic": { "description": "Topic", @@ -43714,7 +45122,17 @@ "smsTotal", "pushTotal", "subscribe" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } }, "subscriber": { "description": "Subscriber", @@ -43788,7 +45206,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -43850,7 +45288,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } }, "migration": { "description": "Migration", @@ -43938,7 +45387,23 @@ "statusCounters", "resourceData", "errors" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "status": "pending", + "stage": "init", + "source": "Appwrite", + "destination": "Appwrite", + "resources": [ + "user" + ], + "resourceId": "databaseId:collectionId", + "statusCounters": "{\"Database\": {\"PENDING\": 0, \"SUCCESS\": 1, \"ERROR\": 0, \"SKIP\": 0, \"PROCESSING\": 0, \"WARNING\": 0}}", + "resourceData": "[{\"resource\":\"Database\",\"id\":\"public\",\"status\":\"SUCCESS\",\"message\":\"\"}]", + "errors": [] + } }, "migrationReport": { "description": "Migration Report", @@ -44008,7 +45473,18 @@ "function", "size", "version" - ] + ], + "example": { + "user": 20, + "team": 20, + "database": 20, + "document": 20, + "file": 20, + "bucket": 20, + "function": 20, + "size": 30000, + "version": "1.4.0" + } } }, "securitySchemes": { diff --git a/app/config/specs/open-api3-1.7.x-server.json b/app/config/specs/open-api3-1.7.x-server.json index bd78f99a76..35a1066924 100644 --- a/app/config/specs/open-api3-1.7.x-server.json +++ b/app/config/specs/open-api3-1.7.x-server.json @@ -10690,7 +10690,7 @@ "scheduledAt": { "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", - "x-example": null + "x-example": "" } } } @@ -25744,7 +25744,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "error": { "description": "Error", @@ -25776,7 +25777,13 @@ "code", "type", "version" - ] + ], + "example": { + "message": "Not found", + "code": "404", + "type": "not_found", + "version": "1.0" + } }, "documentList": { "description": "Documents List", @@ -25800,7 +25807,11 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } }, "collectionList": { "description": "Collections List", @@ -25824,7 +25835,11 @@ "required": [ "total", "collections" - ] + ], + "example": { + "total": 5, + "collections": "" + } }, "databaseList": { "description": "Databases List", @@ -25848,7 +25863,11 @@ "required": [ "total", "databases" - ] + ], + "example": { + "total": 5, + "databases": "" + } }, "indexList": { "description": "Indexes List", @@ -25872,7 +25891,11 @@ "required": [ "total", "indexes" - ] + ], + "example": { + "total": 5, + "indexes": "" + } }, "userList": { "description": "Users List", @@ -25896,7 +25919,11 @@ "required": [ "total", "users" - ] + ], + "example": { + "total": 5, + "users": "" + } }, "sessionList": { "description": "Sessions List", @@ -25920,7 +25947,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -25944,7 +25975,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -25968,7 +26003,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -25992,7 +26031,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "bucketList": { "description": "Buckets List", @@ -26016,7 +26059,11 @@ "required": [ "total", "buckets" - ] + ], + "example": { + "total": 5, + "buckets": "" + } }, "resourceTokenList": { "description": "Resource Tokens List", @@ -26040,7 +26087,11 @@ "required": [ "total", "tokens" - ] + ], + "example": { + "total": 5, + "tokens": "" + } }, "teamList": { "description": "Teams List", @@ -26064,7 +26115,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -26088,7 +26143,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "siteList": { "description": "Sites List", @@ -26112,7 +26171,11 @@ "required": [ "total", "sites" - ] + ], + "example": { + "total": 5, + "sites": "" + } }, "functionList": { "description": "Functions List", @@ -26136,7 +26199,11 @@ "required": [ "total", "functions" - ] + ], + "example": { + "total": 5, + "functions": "" + } }, "frameworkList": { "description": "Frameworks List", @@ -26160,7 +26227,11 @@ "required": [ "total", "frameworks" - ] + ], + "example": { + "total": 5, + "frameworks": "" + } }, "runtimeList": { "description": "Runtimes List", @@ -26184,7 +26255,11 @@ "required": [ "total", "runtimes" - ] + ], + "example": { + "total": 5, + "runtimes": "" + } }, "deploymentList": { "description": "Deployments List", @@ -26208,7 +26283,11 @@ "required": [ "total", "deployments" - ] + ], + "example": { + "total": 5, + "deployments": "" + } }, "executionList": { "description": "Executions List", @@ -26232,7 +26311,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "countryList": { "description": "Countries List", @@ -26256,7 +26339,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -26280,7 +26367,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -26304,7 +26395,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -26328,7 +26423,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -26352,7 +26451,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "variableList": { "description": "Variables List", @@ -26376,7 +26479,11 @@ "required": [ "total", "variables" - ] + ], + "example": { + "total": 5, + "variables": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -26400,7 +26507,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "providerList": { "description": "Provider list", @@ -26424,7 +26535,11 @@ "required": [ "total", "providers" - ] + ], + "example": { + "total": 5, + "providers": "" + } }, "messageList": { "description": "Message list", @@ -26448,7 +26563,11 @@ "required": [ "total", "messages" - ] + ], + "example": { + "total": 5, + "messages": "" + } }, "topicList": { "description": "Topic list", @@ -26472,7 +26591,11 @@ "required": [ "total", "topics" - ] + ], + "example": { + "total": 5, + "topics": "" + } }, "subscriberList": { "description": "Subscriber list", @@ -26496,7 +26619,11 @@ "required": [ "total", "subscribers" - ] + ], + "example": { + "total": 5, + "subscribers": "" + } }, "targetList": { "description": "Target list", @@ -26520,7 +26647,11 @@ "required": [ "total", "targets" - ] + ], + "example": { + "total": 5, + "targets": "" + } }, "specificationList": { "description": "Specifications List", @@ -26544,7 +26675,11 @@ "required": [ "total", "specifications" - ] + ], + "example": { + "total": 5, + "specifications": "" + } }, "database": { "description": "Database", @@ -26582,7 +26717,14 @@ "$createdAt", "$updatedAt", "enabled" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false + } }, "collection": { "description": "Collection", @@ -26692,7 +26834,21 @@ "documentSecurity", "attributes", "indexes" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {} + } }, "attributeList": { "description": "Attributes List", @@ -26747,7 +26903,11 @@ "required": [ "total", "attributes" - ] + ], + "example": { + "total": 5, + "attributes": "" + } }, "attributeString": { "description": "AttributeString", @@ -26822,7 +26982,20 @@ "$createdAt", "$updatedAt", "size" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } }, "attributeInteger": { "description": "AttributeInteger", @@ -26899,7 +27072,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } }, "attributeFloat": { "description": "AttributeFloat", @@ -26976,7 +27162,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } }, "attributeBoolean": { "description": "AttributeBoolean", @@ -27038,7 +27237,18 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } }, "attributeEmail": { "description": "AttributeEmail", @@ -27106,7 +27316,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } }, "attributeEnum": { "description": "AttributeEnum", @@ -27183,7 +27405,20 @@ "$updatedAt", "elements", "format" - ] + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } }, "attributeIp": { "description": "AttributeIP", @@ -27251,7 +27486,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } }, "attributeUrl": { "description": "AttributeURL", @@ -27319,7 +27566,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } }, "attributeDatetime": { "description": "AttributeDatetime", @@ -27387,7 +27646,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } }, "attributeRelationship": { "description": "AttributeRelationship", @@ -27479,7 +27750,23 @@ "twoWayKey", "onDelete", "side" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } }, "index": { "description": "Index", @@ -27551,7 +27838,18 @@ "lengths", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [], + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "document": { "description": "Document", @@ -27608,7 +27906,23 @@ "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -27742,7 +28056,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -27903,7 +28240,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -27917,7 +28280,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -27931,7 +28297,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -27945,7 +28314,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -27959,7 +28331,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -28001,7 +28376,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -28033,7 +28415,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -28068,12 +28456,23 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", @@ -28260,7 +28659,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -28328,7 +28760,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -28372,7 +28816,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -28386,7 +28838,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -28436,7 +28891,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -28456,7 +28920,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -28538,7 +29006,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "bucket": { "description": "Bucket", @@ -28630,7 +29113,26 @@ "compression", "encryption", "antivirus" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false + } }, "resourceToken": { "description": "ResourceToken", @@ -28680,7 +29182,16 @@ "expire", "secret", "accessedAt" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "team": { "description": "Team", @@ -28731,7 +29242,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -28822,7 +29344,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "site": { "description": "Site", @@ -29008,7 +29547,38 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } }, "function": { "description": "Function", @@ -29197,7 +29767,37 @@ "providerRootDirectory", "providerSilentMode", "specification" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb" + } }, "runtime": { "description": "Runtime", @@ -29256,7 +29856,17 @@ "image", "logo", "supports" - ] + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } }, "framework": { "description": "Framework", @@ -29311,7 +29921,25 @@ "buildRuntime", "runtimes", "adapters" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } }, "frameworkAdapter": { "description": "Framework Adapter", @@ -29349,7 +29977,14 @@ "buildCommand", "outputDirectory", "fallbackFile" - ] + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } }, "deployment": { "description": "Deployment", @@ -29523,7 +30158,36 @@ "providerCommitMessage", "providerCommitUrl", "providerBranchUrl" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerBranch": "0.7.x", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } }, "execution": { "description": "Execution", @@ -29654,7 +30318,36 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "variable": { "description": "Variable", @@ -29710,7 +30403,17 @@ "secret", "resourceType", "resourceId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } }, "country": { "description": "Country", @@ -29730,7 +30433,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -29750,7 +30457,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -29776,7 +30487,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -29828,7 +30544,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -29854,7 +30579,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "healthAntivirus": { "description": "Health Antivirus", @@ -29874,7 +30604,11 @@ "required": [ "version", "status" - ] + ], + "example": { + "version": "1.0.0", + "status": "online" + } }, "healthQueue": { "description": "Health Queue", @@ -29889,7 +30623,10 @@ }, "required": [ "size" - ] + ], + "example": { + "size": 8 + } }, "healthStatus": { "description": "Health Status", @@ -29916,7 +30653,12 @@ "name", "ping", "status" - ] + ], + "example": { + "name": "database", + "ping": 128, + "status": "pass" + } }, "healthCertificate": { "description": "Health Certificate", @@ -29960,7 +30702,15 @@ "validFrom", "validTo", "signatureTypeSN" - ] + ], + "example": { + "name": "\/CN=www.google.com", + "subjectSN": "", + "issuerOrganisation": "", + "validFrom": "1704200998", + "validTo": "1711458597", + "signatureTypeSN": "RSA-SHA256" + } }, "healthTime": { "description": "Health Time", @@ -29989,7 +30739,12 @@ "remoteTime", "localTime", "diff" - ] + ], + "example": { + "remoteTime": 1639490751, + "localTime": 1639490844, + "diff": 93 + } }, "headers": { "description": "Headers", @@ -30009,7 +30764,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "specification": { "description": "Specification", @@ -30043,7 +30802,13 @@ "cpus", "enabled", "slug" - ] + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -30075,7 +30840,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -30095,7 +30866,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -30115,7 +30892,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -30147,7 +30928,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "provider": { "description": "Provider", @@ -30213,7 +31000,22 @@ "enabled", "type", "credentials" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } }, "message": { "description": "Message", @@ -30323,7 +31125,33 @@ "deliveredTotal", "data", "status" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } }, "topic": { "description": "Topic", @@ -30385,7 +31213,17 @@ "smsTotal", "pushTotal", "subscribe" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } }, "subscriber": { "description": "Subscriber", @@ -30459,7 +31297,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -30521,7 +31379,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } } }, "securitySchemes": { diff --git a/app/config/specs/swagger2-1.7.x-client.json b/app/config/specs/swagger2-1.7.x-client.json index 95d88bb925..07a12f0dbb 100644 --- a/app/config/specs/swagger2-1.7.x-client.json +++ b/app/config/specs/swagger2-1.7.x-client.json @@ -5461,7 +5461,7 @@ "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", "default": null, - "x-example": null + "x-example": "" } } } @@ -8094,7 +8094,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "documentList": { "description": "Documents List", @@ -8119,7 +8120,11 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } }, "sessionList": { "description": "Sessions List", @@ -8144,7 +8149,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -8169,7 +8178,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -8194,7 +8207,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -8219,7 +8236,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "teamList": { "description": "Teams List", @@ -8244,7 +8265,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -8269,7 +8294,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "executionList": { "description": "Executions List", @@ -8294,7 +8323,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "countryList": { "description": "Countries List", @@ -8319,7 +8352,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -8344,7 +8381,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -8369,7 +8410,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -8394,7 +8439,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -8419,7 +8468,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -8444,7 +8497,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "document": { "description": "Document", @@ -8501,7 +8558,23 @@ "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -8635,7 +8708,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -8798,7 +8894,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -8812,7 +8934,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -8826,7 +8951,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -8840,7 +8968,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -8854,7 +8985,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -8896,7 +9030,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -8928,7 +9069,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -8963,12 +9110,23 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", @@ -9155,7 +9313,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -9223,7 +9414,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -9267,7 +9470,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -9281,7 +9492,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -9331,7 +9545,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -9351,7 +9574,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -9433,7 +9660,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "team": { "description": "Team", @@ -9485,7 +9727,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -9576,7 +9829,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "execution": { "description": "Execution", @@ -9709,7 +9979,36 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "country": { "description": "Country", @@ -9729,7 +10028,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -9749,7 +10052,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -9775,7 +10082,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -9827,7 +10139,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -9853,7 +10174,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "headers": { "description": "Headers", @@ -9873,7 +10199,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -9905,7 +10235,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -9925,7 +10261,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -9945,7 +10287,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -9977,7 +10323,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "subscriber": { "description": "Subscriber", @@ -10052,7 +10404,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -10114,7 +10486,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } } }, "externalDocs": { diff --git a/app/config/specs/swagger2-1.7.x-console.json b/app/config/specs/swagger2-1.7.x-console.json index 314564477c..32afa9e180 100644 --- a/app/config/specs/swagger2-1.7.x-console.json +++ b/app/config/specs/swagger2-1.7.x-console.json @@ -11868,7 +11868,7 @@ "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", "default": null, - "x-example": null + "x-example": "" } } } @@ -35618,7 +35618,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "documentList": { "description": "Documents List", @@ -35643,7 +35644,11 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } }, "collectionList": { "description": "Collections List", @@ -35668,7 +35673,11 @@ "required": [ "total", "collections" - ] + ], + "example": { + "total": 5, + "collections": "" + } }, "databaseList": { "description": "Databases List", @@ -35693,7 +35702,11 @@ "required": [ "total", "databases" - ] + ], + "example": { + "total": 5, + "databases": "" + } }, "indexList": { "description": "Indexes List", @@ -35718,7 +35731,11 @@ "required": [ "total", "indexes" - ] + ], + "example": { + "total": 5, + "indexes": "" + } }, "userList": { "description": "Users List", @@ -35743,7 +35760,11 @@ "required": [ "total", "users" - ] + ], + "example": { + "total": 5, + "users": "" + } }, "sessionList": { "description": "Sessions List", @@ -35768,7 +35789,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -35793,7 +35818,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -35818,7 +35847,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -35843,7 +35876,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "bucketList": { "description": "Buckets List", @@ -35868,7 +35905,11 @@ "required": [ "total", "buckets" - ] + ], + "example": { + "total": 5, + "buckets": "" + } }, "resourceTokenList": { "description": "Resource Tokens List", @@ -35893,7 +35934,11 @@ "required": [ "total", "tokens" - ] + ], + "example": { + "total": 5, + "tokens": "" + } }, "teamList": { "description": "Teams List", @@ -35918,7 +35963,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -35943,7 +35992,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "siteList": { "description": "Sites List", @@ -35968,7 +36021,11 @@ "required": [ "total", "sites" - ] + ], + "example": { + "total": 5, + "sites": "" + } }, "templateSiteList": { "description": "Site Templates List", @@ -35993,7 +36050,11 @@ "required": [ "total", "templates" - ] + ], + "example": { + "total": 5, + "templates": "" + } }, "functionList": { "description": "Functions List", @@ -36018,7 +36079,11 @@ "required": [ "total", "functions" - ] + ], + "example": { + "total": 5, + "functions": "" + } }, "templateFunctionList": { "description": "Function Templates List", @@ -36043,7 +36108,11 @@ "required": [ "total", "templates" - ] + ], + "example": { + "total": 5, + "templates": "" + } }, "installationList": { "description": "Installations List", @@ -36068,7 +36137,11 @@ "required": [ "total", "installations" - ] + ], + "example": { + "total": 5, + "installations": "" + } }, "providerRepositoryFrameworkList": { "description": "Framework Provider Repositories List", @@ -36093,7 +36166,11 @@ "required": [ "total", "frameworkProviderRepositories" - ] + ], + "example": { + "total": 5, + "frameworkProviderRepositories": "" + } }, "providerRepositoryRuntimeList": { "description": "Runtime Provider Repositories List", @@ -36118,7 +36195,11 @@ "required": [ "total", "runtimeProviderRepositories" - ] + ], + "example": { + "total": 5, + "runtimeProviderRepositories": "" + } }, "branchList": { "description": "Branches List", @@ -36143,7 +36224,11 @@ "required": [ "total", "branches" - ] + ], + "example": { + "total": 5, + "branches": "" + } }, "frameworkList": { "description": "Frameworks List", @@ -36168,7 +36253,11 @@ "required": [ "total", "frameworks" - ] + ], + "example": { + "total": 5, + "frameworks": "" + } }, "runtimeList": { "description": "Runtimes List", @@ -36193,7 +36282,11 @@ "required": [ "total", "runtimes" - ] + ], + "example": { + "total": 5, + "runtimes": "" + } }, "deploymentList": { "description": "Deployments List", @@ -36218,7 +36311,11 @@ "required": [ "total", "deployments" - ] + ], + "example": { + "total": 5, + "deployments": "" + } }, "executionList": { "description": "Executions List", @@ -36243,7 +36340,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "projectList": { "description": "Projects List", @@ -36268,7 +36369,11 @@ "required": [ "total", "projects" - ] + ], + "example": { + "total": 5, + "projects": "" + } }, "webhookList": { "description": "Webhooks List", @@ -36293,7 +36398,11 @@ "required": [ "total", "webhooks" - ] + ], + "example": { + "total": 5, + "webhooks": "" + } }, "keyList": { "description": "API Keys List", @@ -36318,7 +36427,11 @@ "required": [ "total", "keys" - ] + ], + "example": { + "total": 5, + "keys": "" + } }, "devKeyList": { "description": "Dev Keys List", @@ -36343,7 +36456,11 @@ "required": [ "total", "devKeys" - ] + ], + "example": { + "total": 5, + "devKeys": "" + } }, "platformList": { "description": "Platforms List", @@ -36368,7 +36485,11 @@ "required": [ "total", "platforms" - ] + ], + "example": { + "total": 5, + "platforms": "" + } }, "countryList": { "description": "Countries List", @@ -36393,7 +36514,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -36418,7 +36543,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -36443,7 +36572,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -36468,7 +36601,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -36493,7 +36630,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "variableList": { "description": "Variables List", @@ -36518,7 +36659,11 @@ "required": [ "total", "variables" - ] + ], + "example": { + "total": 5, + "variables": "" + } }, "proxyRuleList": { "description": "Rule List", @@ -36543,7 +36688,11 @@ "required": [ "total", "rules" - ] + ], + "example": { + "total": 5, + "rules": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -36568,7 +36717,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "providerList": { "description": "Provider list", @@ -36593,7 +36746,11 @@ "required": [ "total", "providers" - ] + ], + "example": { + "total": 5, + "providers": "" + } }, "messageList": { "description": "Message list", @@ -36618,7 +36775,11 @@ "required": [ "total", "messages" - ] + ], + "example": { + "total": 5, + "messages": "" + } }, "topicList": { "description": "Topic list", @@ -36643,7 +36804,11 @@ "required": [ "total", "topics" - ] + ], + "example": { + "total": 5, + "topics": "" + } }, "subscriberList": { "description": "Subscriber list", @@ -36668,7 +36833,11 @@ "required": [ "total", "subscribers" - ] + ], + "example": { + "total": 5, + "subscribers": "" + } }, "targetList": { "description": "Target list", @@ -36693,7 +36862,11 @@ "required": [ "total", "targets" - ] + ], + "example": { + "total": 5, + "targets": "" + } }, "migrationList": { "description": "Migrations List", @@ -36718,7 +36891,11 @@ "required": [ "total", "migrations" - ] + ], + "example": { + "total": 5, + "migrations": "" + } }, "specificationList": { "description": "Specifications List", @@ -36743,7 +36920,11 @@ "required": [ "total", "specifications" - ] + ], + "example": { + "total": 5, + "specifications": "" + } }, "vcsContentList": { "description": "VCS Content List", @@ -36768,7 +36949,11 @@ "required": [ "total", "contents" - ] + ], + "example": { + "total": 5, + "contents": "" + } }, "database": { "description": "Database", @@ -36806,7 +36991,14 @@ "$createdAt", "$updatedAt", "enabled" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false + } }, "collection": { "description": "Collection", @@ -36917,7 +37109,21 @@ "documentSecurity", "attributes", "indexes" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {} + } }, "attributeList": { "description": "Attributes List", @@ -36972,7 +37178,11 @@ "required": [ "total", "attributes" - ] + ], + "example": { + "total": 5, + "attributes": "" + } }, "attributeString": { "description": "AttributeString", @@ -37047,7 +37257,20 @@ "$createdAt", "$updatedAt", "size" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } }, "attributeInteger": { "description": "AttributeInteger", @@ -37124,7 +37347,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } }, "attributeFloat": { "description": "AttributeFloat", @@ -37201,7 +37437,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } }, "attributeBoolean": { "description": "AttributeBoolean", @@ -37263,7 +37512,18 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } }, "attributeEmail": { "description": "AttributeEmail", @@ -37331,7 +37591,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } }, "attributeEnum": { "description": "AttributeEnum", @@ -37408,7 +37680,20 @@ "$updatedAt", "elements", "format" - ] + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } }, "attributeIp": { "description": "AttributeIP", @@ -37476,7 +37761,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } }, "attributeUrl": { "description": "AttributeURL", @@ -37544,7 +37841,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } }, "attributeDatetime": { "description": "AttributeDatetime", @@ -37612,7 +37921,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } }, "attributeRelationship": { "description": "AttributeRelationship", @@ -37704,7 +38025,23 @@ "twoWayKey", "onDelete", "side" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } }, "index": { "description": "Index", @@ -37776,7 +38113,18 @@ "lengths", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [], + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "document": { "description": "Document", @@ -37833,7 +38181,23 @@ "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -37967,7 +38331,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -38130,7 +38517,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -38144,7 +38557,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -38158,7 +38574,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -38172,7 +38591,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -38186,7 +38608,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -38228,7 +38653,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -38260,7 +38692,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -38295,12 +38733,23 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", @@ -38487,7 +38936,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -38555,7 +39037,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -38599,7 +39093,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -38613,7 +39115,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -38663,7 +39168,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -38683,7 +39197,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -38765,7 +39283,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "bucket": { "description": "Bucket", @@ -38857,7 +39390,26 @@ "compression", "encryption", "antivirus" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false + } }, "resourceToken": { "description": "ResourceToken", @@ -38907,7 +39459,16 @@ "expire", "secret", "accessedAt" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "team": { "description": "Team", @@ -38959,7 +39520,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -39050,7 +39622,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "site": { "description": "Site", @@ -39237,7 +39826,38 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } }, "templateSite": { "description": "Template Site", @@ -39334,7 +39954,22 @@ "providerOwner", "providerVersion", "variables" - ] + ], + "example": { + "key": "starter", + "name": "Starter site", + "tagline": "Minimal web app integrating with Appwrite.", + "demoUrl": "https:\/\/nextjs-starter.appwrite.network\/", + "screenshotDark": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-dark.png", + "screenshotLight": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-light.png", + "useCases": "Starter", + "frameworks": [], + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [] + } }, "templateFramework": { "description": "Template Framework", @@ -39396,7 +40031,18 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/build", + "providerRootDirectory": ".\/svelte-kit\/starter", + "buildRuntime": "node-22", + "adapter": "ssr", + "fallbackFile": "index.html" + } }, "function": { "description": "Function", @@ -39586,7 +40232,37 @@ "providerRootDirectory", "providerSilentMode", "specification" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb" + } }, "templateFunction": { "description": "Template Function", @@ -39717,7 +40393,26 @@ "providerVersion", "variables", "scopes" - ] + ], + "example": { + "icon": "icon-lightning-bolt", + "id": "starter", + "name": "Starter function", + "tagline": "A simple function to get started.", + "permissions": "any", + "events": "account.create", + "cron": "0 0 * * *", + "timeout": 300, + "useCases": "Starter", + "runtimes": [], + "instructions": "For documentation and instructions check out .", + "vcsProvider": "github", + "providerRepositoryId": "templates", + "providerOwner": "appwrite", + "providerVersion": "main", + "variables": [], + "scopes": "users.read" + } }, "templateRuntime": { "description": "Template Runtime", @@ -39749,7 +40444,13 @@ "commands", "entrypoint", "providerRootDirectory" - ] + ], + "example": { + "name": "node-19.0", + "commands": "npm install", + "entrypoint": "index.js", + "providerRootDirectory": "node\/starter" + } }, "templateVariable": { "description": "Template Variable", @@ -39799,7 +40500,16 @@ "placeholder", "required", "type" - ] + ], + "example": { + "name": "APPWRITE_DATABASE_ID", + "description": "The ID of the Appwrite database that contains the collection to sync.", + "value": "512", + "secret": false, + "placeholder": "64a55...7b912", + "required": false, + "type": "password" + } }, "installation": { "description": "Installation", @@ -39843,7 +40553,15 @@ "provider", "organization", "providerInstallationId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "provider": "github", + "organization": "appwrite", + "providerInstallationId": "5322" + } }, "providerRepository": { "description": "ProviderRepository", @@ -39874,6 +40592,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39886,8 +40609,18 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime" + } }, "providerRepositoryFramework": { "description": "ProviderRepositoryFramework", @@ -39918,6 +40651,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39935,9 +40673,20 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt", "framework" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime", + "framework": "nextjs" + } }, "providerRepositoryRuntime": { "description": "ProviderRepositoryRuntime", @@ -39968,6 +40717,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39985,9 +40739,20 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt", "runtime" - ] + ], + "example": { + "id": "5e5ea5c16897e", + "name": "appwrite", + "organization": "appwrite", + "provider": "github", + "private": true, + "defaultBranch": "main", + "pushedAt": "datetime", + "runtime": "node-22" + } }, "detectionFramework": { "description": "DetectionFramework", @@ -40019,7 +40784,13 @@ "installCommand", "buildCommand", "outputDirectory" - ] + ], + "example": { + "framework": "nuxt", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "dist" + } }, "detectionRuntime": { "description": "DetectionRuntime", @@ -40045,7 +40816,12 @@ "runtime", "entrypoint", "commands" - ] + ], + "example": { + "runtime": "node", + "entrypoint": "index.js", + "commands": "npm install && npm run build" + } }, "vcsContent": { "description": "VcsContents", @@ -40072,7 +40848,12 @@ }, "required": [ "name" - ] + ], + "example": { + "size": 1523, + "isDirectory": true, + "name": "Main.java" + } }, "branch": { "description": "Branch", @@ -40086,7 +40867,10 @@ }, "required": [ "name" - ] + ], + "example": { + "name": "main" + } }, "runtime": { "description": "Runtime", @@ -40145,7 +40929,17 @@ "image", "logo", "supports" - ] + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } }, "framework": { "description": "Framework", @@ -40201,7 +40995,25 @@ "buildRuntime", "runtimes", "adapters" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } }, "frameworkAdapter": { "description": "Framework Adapter", @@ -40239,7 +41051,14 @@ "buildCommand", "outputDirectory", "fallbackFile" - ] + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } }, "deployment": { "description": "Deployment", @@ -40413,7 +41232,36 @@ "providerCommitMessage", "providerCommitUrl", "providerBranchUrl" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerBranch": "0.7.x", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } }, "execution": { "description": "Execution", @@ -40546,7 +41394,36 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "project": { "description": "Project", @@ -40948,7 +41825,73 @@ "serviceStatusForFunctions", "serviceStatusForGraphql", "serviceStatusForMessaging" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "New Project", + "description": "This is a new project.", + "teamId": "1592981250", + "logo": "5f5c451b403cb", + "url": "5f5c451b403cb", + "legalName": "Company LTD.", + "legalCountry": "US", + "legalState": "New York", + "legalCity": "New York City.", + "legalAddress": "620 Eighth Avenue, New York, NY 10018", + "legalTaxId": "131102020", + "authDuration": 60, + "authLimit": 100, + "authSessionsLimit": 10, + "authPasswordHistory": 5, + "authPasswordDictionary": true, + "authPersonalDataCheck": true, + "authMockNumbers": [ + {} + ], + "authSessionAlerts": true, + "authMembershipsUserName": true, + "authMembershipsUserEmail": true, + "authMembershipsMfa": true, + "oAuthProviders": [ + {} + ], + "platforms": {}, + "webhooks": {}, + "keys": {}, + "devKeys": {}, + "smtpEnabled": false, + "smtpSenderName": "John Appwrite", + "smtpSenderEmail": "john@appwrite.io", + "smtpReplyTo": "support@appwrite.io", + "smtpHost": "mail.appwrite.io", + "smtpPort": 25, + "smtpUsername": "emailuser", + "smtpPassword": "securepassword", + "smtpSecure": "tls", + "pingCount": 1, + "pingedAt": "2020-10-15T06:38:00.000+00:00", + "authEmailPassword": true, + "authUsersAuthMagicURL": true, + "authEmailOtp": true, + "authAnonymous": true, + "authInvites": true, + "authJWT": true, + "authPhone": true, + "serviceStatusForAccount": true, + "serviceStatusForAvatars": true, + "serviceStatusForDatabases": true, + "serviceStatusForLocale": true, + "serviceStatusForHealth": true, + "serviceStatusForStorage": true, + "serviceStatusForTeams": true, + "serviceStatusForUsers": true, + "serviceStatusForSites": true, + "serviceStatusForFunctions": true, + "serviceStatusForGraphql": true, + "serviceStatusForMessaging": true + } }, "webhook": { "description": "Webhook", @@ -41038,7 +41981,22 @@ "enabled", "logs", "attempts" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Webhook", + "url": "https:\/\/example.com\/webhook", + "events": "database.collections.update", + "security": true, + "httpUser": "username", + "httpPass": "password", + "signatureKey": "ad3d581ca230e2b7059c545e5a", + "enabled": true, + "logs": "Failed to connect to remote server.", + "attempts": 10 + } }, "key": { "description": "Key", @@ -41106,7 +42064,18 @@ "secret", "accessedAt", "sdks" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "scopes": "users.read", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } }, "devKey": { "description": "DevKey", @@ -41165,7 +42134,17 @@ "secret", "accessedAt", "sdks" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Dev API Key", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "919c2d18fb5d4...a2ae413da83346ad2", + "accessedAt": "2020-10-15T06:38:00.000+00:00", + "sdks": "appwrite:flutter" + } }, "mockNumber": { "description": "Mock Number", @@ -41185,7 +42164,11 @@ "required": [ "phone", "otp" - ] + ], + "example": { + "phone": "+1612842323", + "otp": "123456" + } }, "authProvider": { "description": "AuthProvider", @@ -41223,7 +42206,14 @@ "appId", "secret", "enabled" - ] + ], + "example": { + "key": "github", + "name": "GitHub", + "appId": "259125845563242502", + "secret": "Bpw_g9c2TGXxfgLshDbSaL8tsCcqgczQ", + "enabled": "" + } }, "platform": { "description": "Platform", @@ -41291,7 +42281,19 @@ "hostname", "httpUser", "httpPass" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Web App", + "type": "web", + "key": "com.company.appname", + "store": "", + "hostname": true, + "httpUser": "username", + "httpPass": "password" + } }, "variable": { "description": "Variable", @@ -41347,7 +42349,17 @@ "secret", "resourceType", "resourceId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } }, "country": { "description": "Country", @@ -41367,7 +42379,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -41387,7 +42403,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -41413,7 +42433,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -41465,7 +42490,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -41491,7 +42525,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "healthAntivirus": { "description": "Health Antivirus", @@ -41511,7 +42550,11 @@ "required": [ "version", "status" - ] + ], + "example": { + "version": "1.0.0", + "status": "online" + } }, "healthQueue": { "description": "Health Queue", @@ -41526,7 +42569,10 @@ }, "required": [ "size" - ] + ], + "example": { + "size": 8 + } }, "healthStatus": { "description": "Health Status", @@ -41553,7 +42599,12 @@ "name", "ping", "status" - ] + ], + "example": { + "name": "database", + "ping": 128, + "status": "pass" + } }, "healthCertificate": { "description": "Health Certificate", @@ -41597,7 +42648,15 @@ "validFrom", "validTo", "signatureTypeSN" - ] + ], + "example": { + "name": "\/CN=www.google.com", + "subjectSN": "", + "issuerOrganisation": "", + "validFrom": "1704200998", + "validTo": "1711458597", + "signatureTypeSN": "RSA-SHA256" + } }, "healthTime": { "description": "Health Time", @@ -41626,7 +42685,12 @@ "remoteTime", "localTime", "diff" - ] + ], + "example": { + "remoteTime": 1639490751, + "localTime": 1639490844, + "diff": 93 + } }, "metric": { "description": "Metric", @@ -41647,7 +42711,11 @@ "required": [ "value", "date" - ] + ], + "example": { + "value": 1, + "date": "2020-10-15T06:38:00.000+00:00" + } }, "metricBreakdown": { "description": "Metric Breakdown", @@ -41681,7 +42749,13 @@ "required": [ "name", "value" - ] + ], + "example": { + "resourceId": "5e5ea5c16897e", + "name": "Documents", + "value": 1, + "estimate": 1 + } }, "usageDatabases": { "description": "UsageDatabases", @@ -41797,7 +42871,22 @@ "storage", "databasesReads", "databasesWrites" - ] + ], + "example": { + "range": "30d", + "databasesTotal": 0, + "collectionsTotal": 0, + "documentsTotal": 0, + "storageTotal": 0, + "databasesReadsTotal": 0, + "databasesWritesTotal": 0, + "databases": [], + "collections": [], + "documents": [], + "storage": [], + "databasesReads": [], + "databasesWrites": [] + } }, "usageDatabase": { "description": "UsageDatabase", @@ -41896,7 +42985,20 @@ "storage", "databaseReads", "databaseWrites" - ] + ], + "example": { + "range": "30d", + "collectionsTotal": 0, + "documentsTotal": 0, + "storageTotal": 0, + "databaseReadsTotal": 0, + "databaseWritesTotal": 0, + "collections": [], + "documents": [], + "storage": [], + "databaseReads": [], + "databaseWrites": [] + } }, "usageCollection": { "description": "UsageCollection", @@ -41927,7 +43029,12 @@ "range", "documentsTotal", "documents" - ] + ], + "example": { + "range": "30d", + "documentsTotal": 0, + "documents": [] + } }, "usageUsers": { "description": "UsageUsers", @@ -41975,7 +43082,14 @@ "sessionsTotal", "users", "sessions" - ] + ], + "example": { + "range": "30d", + "usersTotal": 0, + "sessionsTotal": 0, + "users": [], + "sessions": [] + } }, "usageStorage": { "description": "StorageUsage", @@ -42040,7 +43154,16 @@ "buckets", "files", "storage" - ] + ], + "example": { + "range": "30d", + "bucketsTotal": 0, + "filesTotal": 0, + "filesStorageTotal": 0, + "buckets": [], + "files": [], + "storage": [] + } }, "usageBuckets": { "description": "UsageBuckets", @@ -42105,7 +43228,16 @@ "storage", "imageTransformations", "imageTransformationsTotal" - ] + ], + "example": { + "range": "30d", + "filesTotal": 0, + "filesStorageTotal": 0, + "files": [], + "storage": [], + "imageTransformations": [], + "imageTransformationsTotal": 0 + } }, "usageFunctions": { "description": "UsageFunctions", @@ -42323,7 +43455,34 @@ "executionsMbSeconds", "buildsSuccess", "buildsFailed" - ] + ], + "example": { + "range": "30d", + "functionsTotal": 0, + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "functions": 0, + "deployments": [], + "deploymentsStorage": [], + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [] + } }, "usageFunction": { "description": "UsageFunction", @@ -42531,7 +43690,33 @@ "executionsMbSeconds", "buildsSuccess", "buildsFailed" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsTimeAverage": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [] + } }, "usageSites": { "description": "UsageSites", @@ -42800,7 +43985,40 @@ "inbound", "outboundTotal", "outbound" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [], + "sitesTotal": 0, + "sites": [], + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [] + } }, "usageSite": { "description": "UsageSite", @@ -43059,7 +44277,39 @@ "inbound", "outboundTotal", "outbound" - ] + ], + "example": { + "range": "30d", + "deploymentsTotal": 0, + "deploymentsStorageTotal": 0, + "buildsTotal": 0, + "buildsSuccessTotal": 0, + "buildsFailedTotal": 0, + "buildsStorageTotal": 0, + "buildsTimeTotal": 0, + "buildsTimeAverage": 0, + "buildsMbSecondsTotal": 0, + "executionsTotal": 0, + "executionsTimeTotal": 0, + "executionsMbSecondsTotal": 0, + "deployments": [], + "deploymentsStorage": [], + "builds": [], + "buildsStorage": [], + "buildsTime": [], + "buildsMbSeconds": [], + "executions": [], + "executionsTime": [], + "executionsMbSeconds": [], + "buildsSuccess": [], + "buildsFailed": [], + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [] + } }, "usageProject": { "description": "UsageProject", @@ -43326,7 +44576,40 @@ "databasesWrites", "imageTransformations", "imageTransformationsTotal" - ] + ], + "example": { + "executionsTotal": 0, + "documentsTotal": 0, + "databasesTotal": 0, + "databasesStorageTotal": 0, + "usersTotal": 0, + "filesStorageTotal": 0, + "functionsStorageTotal": 0, + "buildsStorageTotal": 0, + "deploymentsStorageTotal": 0, + "bucketsTotal": 0, + "executionsMbSecondsTotal": 0, + "buildsMbSecondsTotal": 0, + "databasesReadsTotal": 0, + "databasesWritesTotal": 0, + "requests": [], + "network": [], + "users": [], + "executions": [], + "executionsBreakdown": [], + "bucketsBreakdown": [], + "databasesStorageBreakdown": [], + "executionsMbSecondsBreakdown": [], + "buildsMbSecondsBreakdown": [], + "functionsStorageBreakdown": [], + "authPhoneTotal": 0, + "authPhoneEstimate": 0, + "authPhoneCountryBreakdown": [], + "databasesReads": [], + "databasesWrites": [], + "imageTransformations": [], + "imageTransformationsTotal": 0 + } }, "headers": { "description": "Headers", @@ -43346,7 +44629,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "specification": { "description": "Specification", @@ -43380,7 +44667,13 @@ "cpus", "enabled", "slug" - ] + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } }, "proxyRule": { "description": "Rule", @@ -43479,7 +44772,24 @@ "status", "logs", "renewAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "domain": "appwrite.company.com", + "type": "deployment", + "trigger": "manual", + "redirectUrl": "https:\/\/appwrite.io\/docs", + "redirectStatusCode": 301, + "deploymentId": "n3u9feiwmf", + "deploymentResourceType": "function", + "deploymentResourceId": "n3u9feiwmf", + "deploymentVcsProviderBranch": "function", + "status": "verified", + "logs": "HTTP challegne failed.", + "renewAt": "datetime" + } }, "smsTemplate": { "description": "SmsTemplate", @@ -43505,7 +44815,12 @@ "type", "locale", "message" - ] + ], + "example": { + "type": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account." + } }, "emailTemplate": { "description": "EmailTemplate", @@ -43555,7 +44870,16 @@ "senderEmail", "replyTo", "subject" - ] + ], + "example": { + "type": "verification", + "locale": "en_us", + "message": "Click on the link to verify your account.", + "senderName": "My User", + "senderEmail": "mail@appwrite.io", + "replyTo": "emails@appwrite.io", + "subject": "Please verify your email address" + } }, "consoleVariables": { "description": "Console Variables", @@ -43643,7 +44967,22 @@ "_APP_DOMAIN_FUNCTIONS", "_APP_OPTIONS_FORCE_HTTPS", "_APP_DOMAINS_NAMESERVERS" - ] + ], + "example": { + "_APP_DOMAIN_TARGET_CNAME": "appwrite.io", + "_APP_DOMAIN_TARGET_A": "127.0.0.1", + "_APP_DOMAIN_TARGET_AAAA": "::1", + "_APP_STORAGE_LIMIT": "30000000", + "_APP_COMPUTE_SIZE_LIMIT": "30000000", + "_APP_USAGE_STATS": "enabled", + "_APP_VCS_ENABLED": true, + "_APP_DOMAIN_ENABLED": true, + "_APP_ASSISTANT_ENABLED": true, + "_APP_DOMAIN_SITES": "sites.localhost", + "_APP_DOMAIN_FUNCTIONS": "functions.localhost", + "_APP_OPTIONS_FORCE_HTTPS": "enabled", + "_APP_DOMAINS_NAMESERVERS": "ns1.example.com,ns2.example.com" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -43675,7 +45014,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -43695,7 +45040,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -43715,7 +45066,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -43747,7 +45102,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "provider": { "description": "Provider", @@ -43814,7 +45175,22 @@ "enabled", "type", "credentials" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } }, "message": { "description": "Message", @@ -43925,7 +45301,33 @@ "deliveredTotal", "data", "status" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } }, "topic": { "description": "Topic", @@ -43987,7 +45389,17 @@ "smsTotal", "pushTotal", "subscribe" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } }, "subscriber": { "description": "Subscriber", @@ -44062,7 +45474,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -44124,7 +45556,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } }, "migration": { "description": "Migration", @@ -44214,7 +45657,23 @@ "statusCounters", "resourceData", "errors" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "status": "pending", + "stage": "init", + "source": "Appwrite", + "destination": "Appwrite", + "resources": [ + "user" + ], + "resourceId": "databaseId:collectionId", + "statusCounters": "{\"Database\": {\"PENDING\": 0, \"SUCCESS\": 1, \"ERROR\": 0, \"SKIP\": 0, \"PROCESSING\": 0, \"WARNING\": 0}}", + "resourceData": "[{\"resource\":\"Database\",\"id\":\"public\",\"status\":\"SUCCESS\",\"message\":\"\"}]", + "errors": [] + } }, "migrationReport": { "description": "Migration Report", @@ -44284,7 +45743,18 @@ "function", "size", "version" - ] + ], + "example": { + "user": 20, + "team": 20, + "database": 20, + "document": 20, + "file": 20, + "bucket": 20, + "function": 20, + "size": 30000, + "version": "1.4.0" + } } }, "externalDocs": { diff --git a/app/config/specs/swagger2-1.7.x-server.json b/app/config/specs/swagger2-1.7.x-server.json index c67d26dd54..391adc2dfc 100644 --- a/app/config/specs/swagger2-1.7.x-server.json +++ b/app/config/specs/swagger2-1.7.x-server.json @@ -10763,7 +10763,7 @@ "type": "string", "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", "default": null, - "x-example": null + "x-example": "" } } } @@ -25977,7 +25977,8 @@ "any": { "description": "Any", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": [] }, "documentList": { "description": "Documents List", @@ -26002,7 +26003,11 @@ "required": [ "total", "documents" - ] + ], + "example": { + "total": 5, + "documents": "" + } }, "collectionList": { "description": "Collections List", @@ -26027,7 +26032,11 @@ "required": [ "total", "collections" - ] + ], + "example": { + "total": 5, + "collections": "" + } }, "databaseList": { "description": "Databases List", @@ -26052,7 +26061,11 @@ "required": [ "total", "databases" - ] + ], + "example": { + "total": 5, + "databases": "" + } }, "indexList": { "description": "Indexes List", @@ -26077,7 +26090,11 @@ "required": [ "total", "indexes" - ] + ], + "example": { + "total": 5, + "indexes": "" + } }, "userList": { "description": "Users List", @@ -26102,7 +26119,11 @@ "required": [ "total", "users" - ] + ], + "example": { + "total": 5, + "users": "" + } }, "sessionList": { "description": "Sessions List", @@ -26127,7 +26148,11 @@ "required": [ "total", "sessions" - ] + ], + "example": { + "total": 5, + "sessions": "" + } }, "identityList": { "description": "Identities List", @@ -26152,7 +26177,11 @@ "required": [ "total", "identities" - ] + ], + "example": { + "total": 5, + "identities": "" + } }, "logList": { "description": "Logs List", @@ -26177,7 +26206,11 @@ "required": [ "total", "logs" - ] + ], + "example": { + "total": 5, + "logs": "" + } }, "fileList": { "description": "Files List", @@ -26202,7 +26235,11 @@ "required": [ "total", "files" - ] + ], + "example": { + "total": 5, + "files": "" + } }, "bucketList": { "description": "Buckets List", @@ -26227,7 +26264,11 @@ "required": [ "total", "buckets" - ] + ], + "example": { + "total": 5, + "buckets": "" + } }, "resourceTokenList": { "description": "Resource Tokens List", @@ -26252,7 +26293,11 @@ "required": [ "total", "tokens" - ] + ], + "example": { + "total": 5, + "tokens": "" + } }, "teamList": { "description": "Teams List", @@ -26277,7 +26322,11 @@ "required": [ "total", "teams" - ] + ], + "example": { + "total": 5, + "teams": "" + } }, "membershipList": { "description": "Memberships List", @@ -26302,7 +26351,11 @@ "required": [ "total", "memberships" - ] + ], + "example": { + "total": 5, + "memberships": "" + } }, "siteList": { "description": "Sites List", @@ -26327,7 +26380,11 @@ "required": [ "total", "sites" - ] + ], + "example": { + "total": 5, + "sites": "" + } }, "functionList": { "description": "Functions List", @@ -26352,7 +26409,11 @@ "required": [ "total", "functions" - ] + ], + "example": { + "total": 5, + "functions": "" + } }, "frameworkList": { "description": "Frameworks List", @@ -26377,7 +26438,11 @@ "required": [ "total", "frameworks" - ] + ], + "example": { + "total": 5, + "frameworks": "" + } }, "runtimeList": { "description": "Runtimes List", @@ -26402,7 +26467,11 @@ "required": [ "total", "runtimes" - ] + ], + "example": { + "total": 5, + "runtimes": "" + } }, "deploymentList": { "description": "Deployments List", @@ -26427,7 +26496,11 @@ "required": [ "total", "deployments" - ] + ], + "example": { + "total": 5, + "deployments": "" + } }, "executionList": { "description": "Executions List", @@ -26452,7 +26525,11 @@ "required": [ "total", "executions" - ] + ], + "example": { + "total": 5, + "executions": "" + } }, "countryList": { "description": "Countries List", @@ -26477,7 +26554,11 @@ "required": [ "total", "countries" - ] + ], + "example": { + "total": 5, + "countries": "" + } }, "continentList": { "description": "Continents List", @@ -26502,7 +26583,11 @@ "required": [ "total", "continents" - ] + ], + "example": { + "total": 5, + "continents": "" + } }, "languageList": { "description": "Languages List", @@ -26527,7 +26612,11 @@ "required": [ "total", "languages" - ] + ], + "example": { + "total": 5, + "languages": "" + } }, "currencyList": { "description": "Currencies List", @@ -26552,7 +26641,11 @@ "required": [ "total", "currencies" - ] + ], + "example": { + "total": 5, + "currencies": "" + } }, "phoneList": { "description": "Phones List", @@ -26577,7 +26670,11 @@ "required": [ "total", "phones" - ] + ], + "example": { + "total": 5, + "phones": "" + } }, "variableList": { "description": "Variables List", @@ -26602,7 +26699,11 @@ "required": [ "total", "variables" - ] + ], + "example": { + "total": 5, + "variables": "" + } }, "localeCodeList": { "description": "Locale codes list", @@ -26627,7 +26728,11 @@ "required": [ "total", "localeCodes" - ] + ], + "example": { + "total": 5, + "localeCodes": "" + } }, "providerList": { "description": "Provider list", @@ -26652,7 +26757,11 @@ "required": [ "total", "providers" - ] + ], + "example": { + "total": 5, + "providers": "" + } }, "messageList": { "description": "Message list", @@ -26677,7 +26786,11 @@ "required": [ "total", "messages" - ] + ], + "example": { + "total": 5, + "messages": "" + } }, "topicList": { "description": "Topic list", @@ -26702,7 +26815,11 @@ "required": [ "total", "topics" - ] + ], + "example": { + "total": 5, + "topics": "" + } }, "subscriberList": { "description": "Subscriber list", @@ -26727,7 +26844,11 @@ "required": [ "total", "subscribers" - ] + ], + "example": { + "total": 5, + "subscribers": "" + } }, "targetList": { "description": "Target list", @@ -26752,7 +26873,11 @@ "required": [ "total", "targets" - ] + ], + "example": { + "total": 5, + "targets": "" + } }, "specificationList": { "description": "Specifications List", @@ -26777,7 +26902,11 @@ "required": [ "total", "specifications" - ] + ], + "example": { + "total": 5, + "specifications": "" + } }, "database": { "description": "Database", @@ -26815,7 +26944,14 @@ "$createdAt", "$updatedAt", "enabled" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "name": "My Database", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "enabled": false + } }, "collection": { "description": "Collection", @@ -26926,7 +27062,21 @@ "documentSecurity", "attributes", "indexes" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "databaseId": "5e5ea5c16897e", + "name": "My Collection", + "enabled": false, + "documentSecurity": true, + "attributes": {}, + "indexes": {} + } }, "attributeList": { "description": "Attributes List", @@ -26981,7 +27131,11 @@ "required": [ "total", "attributes" - ] + ], + "example": { + "total": 5, + "attributes": "" + } }, "attributeString": { "description": "AttributeString", @@ -27056,7 +27210,20 @@ "$createdAt", "$updatedAt", "size" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "size": 128, + "default": "default", + "encrypt": false + } }, "attributeInteger": { "description": "AttributeInteger", @@ -27133,7 +27300,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "count", + "type": "integer", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1, + "max": 10, + "default": 10 + } }, "attributeFloat": { "description": "AttributeFloat", @@ -27210,7 +27390,20 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "percentageCompleted", + "type": "double", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "min": 1.5, + "max": 10.5, + "default": 2.5 + } }, "attributeBoolean": { "description": "AttributeBoolean", @@ -27272,7 +27465,18 @@ "required", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "isEnabled", + "type": "boolean", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": false + } }, "attributeEmail": { "description": "AttributeEmail", @@ -27340,7 +27544,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "userEmail", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "email", + "default": "default@example.com" + } }, "attributeEnum": { "description": "AttributeEnum", @@ -27417,7 +27633,20 @@ "$updatedAt", "elements", "format" - ] + ], + "example": { + "key": "status", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "elements": "element", + "format": "enum", + "default": "element" + } }, "attributeIp": { "description": "AttributeIP", @@ -27485,7 +27714,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "ipAddress", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "ip", + "default": "192.0.2.0" + } }, "attributeUrl": { "description": "AttributeURL", @@ -27553,7 +27794,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "githubUrl", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "url", + "default": "http:\/\/example.com" + } }, "attributeDatetime": { "description": "AttributeDatetime", @@ -27621,7 +27874,19 @@ "$createdAt", "$updatedAt", "format" - ] + ], + "example": { + "key": "birthDay", + "type": "datetime", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "default": "2020-10-15T06:38:00.000+00:00" + } }, "attributeRelationship": { "description": "AttributeRelationship", @@ -27713,7 +27978,23 @@ "twoWayKey", "onDelete", "side" - ] + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "relatedCollection": "collection", + "relationType": "oneToOne|oneToMany|manyToOne|manyToMany", + "twoWay": false, + "twoWayKey": "string", + "onDelete": "restrict|cascade|setNull", + "side": "parent|child" + } }, "index": { "description": "Index", @@ -27785,7 +28066,18 @@ "lengths", "$createdAt", "$updatedAt" - ] + ], + "example": { + "key": "index1", + "type": "primary", + "status": "available", + "error": "string", + "attributes": [], + "lengths": [], + "orders": [], + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "document": { "description": "Document", @@ -27842,7 +28134,23 @@ "$createdAt", "$updatedAt", "$permissions" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$sequence": 1, + "$collectionId": "5e5ea5c15117e", + "$databaseId": "5e5ea5c15117e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "username": "john.doe", + "email": "john.doe@example.com", + "fullName": "John Doe", + "age": 30, + "isAdmin": false + } }, "log": { "description": "Log", @@ -27976,7 +28284,30 @@ "deviceModel", "countryCode", "countryName" - ] + ], + "example": { + "event": "account.sessions.create", + "userId": "610fc2f985ee0", + "userEmail": "john@appwrite.io", + "userName": "John Doe", + "mode": "admin", + "ip": "127.0.0.1", + "time": "2020-10-15T06:38:00.000+00:00", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States" + } }, "user": { "description": "User", @@ -28139,7 +28470,33 @@ "prefs", "targets", "accessedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "John Doe", + "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "hash": "argon2", + "hashOptions": {}, + "registration": "2020-10-15T06:38:00.000+00:00", + "status": true, + "labels": [ + "vip" + ], + "passwordUpdate": "2020-10-15T06:38:00.000+00:00", + "email": "john@appwrite.io", + "phone": "+4930901820", + "emailVerification": true, + "phoneVerification": true, + "mfa": true, + "prefs": { + "theme": "pink", + "timezone": "UTC" + }, + "targets": [], + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "algoMd5": { "description": "AlgoMD5", @@ -28153,7 +28510,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "md5" + } }, "algoSha": { "description": "AlgoSHA", @@ -28167,7 +28527,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "sha" + } }, "algoPhpass": { "description": "AlgoPHPass", @@ -28181,7 +28544,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "phpass" + } }, "algoBcrypt": { "description": "AlgoBcrypt", @@ -28195,7 +28561,10 @@ }, "required": [ "type" - ] + ], + "example": { + "type": "bcrypt" + } }, "algoScrypt": { "description": "AlgoScrypt", @@ -28237,7 +28606,14 @@ "costMemory", "costParallel", "length" - ] + ], + "example": { + "type": "scrypt", + "costCpu": 8, + "costMemory": 14, + "costParallel": 1, + "length": 64 + } }, "algoScryptModified": { "description": "AlgoScryptModified", @@ -28269,7 +28645,13 @@ "salt", "saltSeparator", "signerKey" - ] + ], + "example": { + "type": "scryptMod", + "salt": "UxLMreBr6tYyjQ==", + "saltSeparator": "Bw==", + "signerKey": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } }, "algoArgon2": { "description": "AlgoArgon2", @@ -28304,12 +28686,23 @@ "memoryCost", "timeCost", "threads" - ] + ], + "example": { + "type": "argon2", + "memoryCost": 65536, + "timeCost": 4, + "threads": 3 + } }, "preferences": { "description": "Preferences", "type": "object", - "additionalProperties": true + "additionalProperties": true, + "example": { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }, "session": { "description": "Session", @@ -28496,7 +28889,40 @@ "factors", "secret", "mfaUpdatedAt" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "expire": "2020-10-15T06:38:00.000+00:00", + "provider": "email", + "providerUid": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "ip": "127.0.0.1", + "osCode": "Mac", + "osName": "Mac", + "osVersion": "Mac", + "clientType": "browser", + "clientCode": "CM", + "clientName": "Chrome Mobile iOS", + "clientVersion": "84.0", + "clientEngine": "WebKit", + "clientEngineVersion": "605.1.15", + "deviceName": "smartphone", + "deviceBrand": "Google", + "deviceModel": "Nexus 5", + "countryCode": "US", + "countryName": "United States", + "current": true, + "factors": [ + "email" + ], + "secret": "5e5bb8c16897e", + "mfaUpdatedAt": "2020-10-15T06:38:00.000+00:00" + } }, "identity": { "description": "Identity", @@ -28564,7 +28990,19 @@ "providerAccessToken", "providerAccessTokenExpiry", "providerRefreshToken" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5bb8c16897e", + "provider": "email", + "providerUid": "5e5bb8c16897e", + "providerEmail": "user@example.com", + "providerAccessToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", + "providerAccessTokenExpiry": "2020-10-15T06:38:00.000+00:00", + "providerRefreshToken": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } }, "token": { "description": "Token", @@ -28608,7 +29046,15 @@ "secret", "expire", "phrase" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "secret": "", + "expire": "2020-10-15T06:38:00.000+00:00", + "phrase": "Golden Fox" + } }, "jwt": { "description": "JWT", @@ -28622,7 +29068,10 @@ }, "required": [ "jwt" - ] + ], + "example": { + "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } }, "locale": { "description": "Locale", @@ -28672,7 +29121,16 @@ "continent", "eu", "currency" - ] + ], + "example": { + "ip": "127.0.0.1", + "countryCode": "US", + "country": "United States", + "continentCode": "NA", + "continent": "North America", + "eu": false, + "currency": "USD" + } }, "localeCode": { "description": "LocaleCode", @@ -28692,7 +29150,11 @@ "required": [ "code", "name" - ] + ], + "example": { + "code": "en-us", + "name": "US" + } }, "file": { "description": "File", @@ -28774,7 +29236,22 @@ "sizeOriginal", "chunksTotal", "chunksUploaded" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "bucketId": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "name": "Pink.png", + "signature": "5d529fd02b544198ae075bd57c1762bb", + "mimeType": "image\/png", + "sizeOriginal": 17890, + "chunksTotal": 17890, + "chunksUploaded": 17890 + } }, "bucket": { "description": "Bucket", @@ -28866,7 +29343,26 @@ "compression", "encryption", "antivirus" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "read(\"any\")" + ], + "fileSecurity": true, + "name": "Documents", + "enabled": false, + "maximumFileSize": 100, + "allowedFileExtensions": [ + "jpg", + "png" + ], + "compression": "gzip", + "encryption": false, + "antivirus": false + } }, "resourceToken": { "description": "ResourceToken", @@ -28916,7 +29412,16 @@ "expire", "secret", "accessedAt" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "resourceId": "5e5ea5c168bb8:5e5ea5c168bb8", + "resourceType": "files", + "expire": "2020-10-15T06:38:00.000+00:00", + "secret": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + "accessedAt": "2020-10-15T06:38:00.000+00:00" + } }, "team": { "description": "Team", @@ -28968,7 +29473,18 @@ "name", "total", "prefs" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "VIP", + "total": 7, + "prefs": { + "theme": "pink", + "timezone": "UTC" + } + } }, "membership": { "description": "Membership", @@ -29059,7 +29575,24 @@ "confirm", "mfa", "roles" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c16897e", + "userName": "John Doe", + "userEmail": "john@appwrite.io", + "teamId": "5e5ea5c16897e", + "teamName": "VIP", + "invited": "2020-10-15T06:38:00.000+00:00", + "joined": "2020-10-15T06:38:00.000+00:00", + "confirm": false, + "mfa": false, + "roles": [ + "owner" + ] + } }, "site": { "description": "Site", @@ -29246,7 +29779,38 @@ "buildRuntime", "adapter", "fallbackFile" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "My Site", + "enabled": false, + "live": false, + "logging": false, + "framework": "react", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "deploymentScreenshotLight": "5e5ea5c16897e", + "deploymentScreenshotDark": "5e5ea5c16897e", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "vars": [], + "timeout": 300, + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "build", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "sites\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb", + "buildRuntime": "node-22", + "adapter": "static", + "fallbackFile": "index.html" + } }, "function": { "description": "Function", @@ -29436,7 +30000,37 @@ "providerRootDirectory", "providerSilentMode", "specification" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "execute": "users", + "name": "My Function", + "enabled": false, + "live": false, + "logging": false, + "runtime": "python-3.8", + "deploymentId": "5e5ea5c16897e", + "deploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentId": "5e5ea5c16897e", + "latestDeploymentCreatedAt": "2020-10-15T06:38:00.000+00:00", + "latestDeploymentStatus": "ready", + "scopes": "users.read", + "vars": [], + "events": "account.create", + "schedule": "5 4 * * *", + "timeout": 300, + "entrypoint": "index.js", + "commands": "npm install", + "version": "v2", + "installationId": "6m40at4ejk5h2u9s1hboo", + "providerRepositoryId": "appwrite", + "providerBranch": "main", + "providerRootDirectory": "functions\/helloWorld", + "providerSilentMode": false, + "specification": "s-1vcpu-512mb" + } }, "runtime": { "description": "Runtime", @@ -29495,7 +30089,17 @@ "image", "logo", "supports" - ] + ], + "example": { + "$id": "python-3.8", + "key": "python", + "name": "Python", + "version": "3.8", + "base": "python:3.8-alpine", + "image": "appwrite\\\/runtime-for-python:3.8", + "logo": "python.png", + "supports": "amd64" + } }, "framework": { "description": "Framework", @@ -29551,7 +30155,25 @@ "buildRuntime", "runtimes", "adapters" - ] + ], + "example": { + "key": "sveltekit", + "name": "SvelteKit", + "buildRuntime": "node-22", + "runtimes": [ + "static-1", + "node-22" + ], + "adapters": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } }, "frameworkAdapter": { "description": "Framework Adapter", @@ -29589,7 +30211,14 @@ "buildCommand", "outputDirectory", "fallbackFile" - ] + ], + "example": { + "key": "static", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": ".\/dist", + "fallbackFile": "index.html" + } }, "deployment": { "description": "Deployment", @@ -29763,7 +30392,36 @@ "providerCommitMessage", "providerCommitUrl", "providerBranchUrl" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "type": "vcs", + "resourceId": "5e5ea6g16897e", + "resourceType": "functions", + "entrypoint": "index.js", + "sourceSize": 128, + "buildSize": 128, + "totalSize": 128, + "buildId": "5e5ea5c16897e", + "activate": true, + "screenshotLight": "5e5ea5c16897e", + "screenshotDark": "5e5ea5c16897e", + "status": "ready", + "buildLogs": "Compiling source files...", + "buildDuration": 128, + "providerRepositoryName": "database", + "providerRepositoryOwner": "utopia", + "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", + "providerBranch": "0.7.x", + "providerCommitHash": "7c3f25d", + "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", + "providerCommitAuthor": "Khushboo Verma", + "providerCommitMessage": "Update index.js", + "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } }, "execution": { "description": "Execution", @@ -29896,7 +30554,36 @@ "logs", "errors", "duration" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "$permissions": [ + "any" + ], + "functionId": "5e5ea6g16897e", + "trigger": "http", + "status": "processing", + "requestMethod": "GET", + "requestPath": "\/articles?id=5", + "requestHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "responseStatusCode": 200, + "responseBody": "", + "responseHeaders": [ + { + "Content-Type": "application\/json" + } + ], + "logs": "", + "errors": "", + "duration": 0.4, + "scheduledAt": "2020-10-15T06:38:00.000+00:00" + } }, "variable": { "description": "Variable", @@ -29952,7 +30639,17 @@ "secret", "resourceType", "resourceId" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "key": "API_KEY", + "value": "myPa$$word1", + "secret": false, + "resourceType": "function", + "resourceId": "myAwesomeFunction" + } }, "country": { "description": "Country", @@ -29972,7 +30669,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "United States", + "code": "US" + } }, "continent": { "description": "Continent", @@ -29992,7 +30693,11 @@ "required": [ "name", "code" - ] + ], + "example": { + "name": "Europe", + "code": "EU" + } }, "language": { "description": "Language", @@ -30018,7 +30723,12 @@ "name", "code", "nativeName" - ] + ], + "example": { + "name": "Italian", + "code": "it", + "nativeName": "Italiano" + } }, "currency": { "description": "Currency", @@ -30070,7 +30780,16 @@ "rounding", "code", "namePlural" - ] + ], + "example": { + "symbol": "$", + "name": "US dollar", + "symbolNative": "$", + "decimalDigits": 2, + "rounding": 0, + "code": "USD", + "namePlural": "US dollars" + } }, "phone": { "description": "Phone", @@ -30096,7 +30815,12 @@ "code", "countryCode", "countryName" - ] + ], + "example": { + "code": "+1", + "countryCode": "US", + "countryName": "United States" + } }, "healthAntivirus": { "description": "Health Antivirus", @@ -30116,7 +30840,11 @@ "required": [ "version", "status" - ] + ], + "example": { + "version": "1.0.0", + "status": "online" + } }, "healthQueue": { "description": "Health Queue", @@ -30131,7 +30859,10 @@ }, "required": [ "size" - ] + ], + "example": { + "size": 8 + } }, "healthStatus": { "description": "Health Status", @@ -30158,7 +30889,12 @@ "name", "ping", "status" - ] + ], + "example": { + "name": "database", + "ping": 128, + "status": "pass" + } }, "healthCertificate": { "description": "Health Certificate", @@ -30202,7 +30938,15 @@ "validFrom", "validTo", "signatureTypeSN" - ] + ], + "example": { + "name": "\/CN=www.google.com", + "subjectSN": "", + "issuerOrganisation": "", + "validFrom": "1704200998", + "validTo": "1711458597", + "signatureTypeSN": "RSA-SHA256" + } }, "healthTime": { "description": "Health Time", @@ -30231,7 +30975,12 @@ "remoteTime", "localTime", "diff" - ] + ], + "example": { + "remoteTime": 1639490751, + "localTime": 1639490844, + "diff": 93 + } }, "headers": { "description": "Headers", @@ -30251,7 +31000,11 @@ "required": [ "name", "value" - ] + ], + "example": { + "name": "Content-Type", + "value": "application\/json" + } }, "specification": { "description": "Specification", @@ -30285,7 +31038,13 @@ "cpus", "enabled", "slug" - ] + ], + "example": { + "memory": 512, + "cpus": 1, + "enabled": true, + "slug": "s-1vcpu-512mb" + } }, "mfaChallenge": { "description": "MFA Challenge", @@ -30317,7 +31076,13 @@ "$createdAt", "userId", "expire" - ] + ], + "example": { + "$id": "bb8ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "userId": "5e5ea5c168bb8", + "expire": "2020-10-15T06:38:00.000+00:00" + } }, "mfaRecoveryCodes": { "description": "MFA Recovery Codes", @@ -30337,7 +31102,13 @@ }, "required": [ "recoveryCodes" - ] + ], + "example": { + "recoveryCodes": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } }, "mfaType": { "description": "MFAType", @@ -30357,7 +31128,11 @@ "required": [ "secret", "uri" - ] + ], + "example": { + "secret": true, + "uri": true + } }, "mfaFactors": { "description": "MFAFactors", @@ -30389,7 +31164,13 @@ "phone", "email", "recoveryCode" - ] + ], + "example": { + "totp": true, + "phone": true, + "email": true, + "recoveryCode": true + } }, "provider": { "description": "Provider", @@ -30456,7 +31237,22 @@ "enabled", "type", "credentials" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Mailgun", + "provider": "mailgun", + "enabled": true, + "type": "sms", + "credentials": { + "key": "123456789" + }, + "options": { + "from": "sender-email@mydomain" + } + } }, "message": { "description": "Message", @@ -30567,7 +31363,33 @@ "deliveredTotal", "data", "status" - ] + ], + "example": { + "$id": "5e5ea5c16897e", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "topics": [ + "5e5ea5c16897e" + ], + "users": [ + "5e5ea5c16897e" + ], + "targets": [ + "5e5ea5c16897e" + ], + "scheduledAt": "2020-10-15T06:38:00.000+00:00", + "deliveredAt": "2020-10-15T06:38:00.000+00:00", + "deliveryErrors": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "deliveredTotal": 1, + "data": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + }, + "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } }, "topic": { "description": "Topic", @@ -30629,7 +31451,17 @@ "smsTotal", "pushTotal", "subscribe" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "events", + "emailTotal": 100, + "smsTotal": 100, + "pushTotal": 100, + "subscribe": "users" + } }, "subscriber": { "description": "Subscriber", @@ -30704,7 +31536,27 @@ "userName", "topicId", "providerType" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "targetId": "259125845563242502", + "target": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "userId": "5e5ea5c16897e", + "userName": "Aegon Targaryen", + "topicId": "259125845563242502", + "providerType": "email" + } }, "target": { "description": "Target", @@ -30766,7 +31618,18 @@ "providerType", "identifier", "expired" - ] + ], + "example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "name": "Apple iPhone 12", + "userId": "259125845563242502", + "providerId": "259125845563242502", + "providerType": "email", + "identifier": "token", + "expired": false + } } }, "externalDocs": { From 048dbe81c7a135b6ac29bc796aaaca9a74151b55 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 4 Aug 2025 14:34:45 +0530 Subject: [PATCH 27/38] chore: minify svg --- app/controllers/api/avatars.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 0617a84532..d0d77d5c3e 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -475,7 +475,9 @@ App::get('/v1/avatars/favicon') if ('svg' === $outputExt) { // Skip crop, Imagick isn\'t supporting svg files $sanitizer = new SvgSanitizer(); - $cleanSvg = $sanitizer->sanitize($data); + $cleanSvg = $sanitizer + ->minify() + ->sanitize($data); if ($cleanSvg === false) { throw new \Exception('SVG sanitization failed'); } From 7a507917c978c5e2f99925157c27784caeaac50f Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 4 Aug 2025 14:41:57 +0530 Subject: [PATCH 28/38] fix: minify --- app/controllers/api/avatars.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index d0d77d5c3e..1d50d2c899 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -475,9 +475,8 @@ App::get('/v1/avatars/favicon') if ('svg' === $outputExt) { // Skip crop, Imagick isn\'t supporting svg files $sanitizer = new SvgSanitizer(); - $cleanSvg = $sanitizer - ->minify() - ->sanitize($data); + $sanitizer->minify(true); + $cleanSvg = $sanitizer->sanitize($data); if ($cleanSvg === false) { throw new \Exception('SVG sanitization failed'); } From 84e3dc0275a6beeb10daa913a82b22e9a692e68f Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 4 Aug 2025 17:14:38 +0530 Subject: [PATCH 29/38] fix: favicons endpoint to fallback to ico instead of throwing error --- app/controllers/api/avatars.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 1d50d2c899..785324739b 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -375,15 +375,11 @@ App::get('/v1/avatars/favicon') throw new Exception(Exception::AVATAR_REMOTE_URL_FAILED); } - if ($res->getStatusCode() !== 200) { - throw new Exception(Exception::AVATAR_REMOTE_URL_FAILED); - } - $doc = new DOMDocument(); $doc->strictErrorChecking = false; @$doc->loadHTML($res->getBody()); - $links = $doc->getElementsByTagName('link'); + $links = $doc->getElementsByTagName('link') ?? []; $outputHref = ''; $outputExt = ''; $space = 0; From 4cafd2e07d2c775d6a19ac1bf375f5e915d7fadd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 4 Aug 2025 14:28:50 +0200 Subject: [PATCH 30/38] Improve PR quality --- .env | 6 +-- app/config/variables.php | 4 +- app/controllers/api/console.php | 4 +- app/controllers/api/proxy.php | 6 +-- app/views/install/compose.phtml | 8 +++ composer.json | 2 +- composer.lock | 29 ++++------ docker-compose.yml | 8 +-- src/Appwrite/Network/Validator/DNS.php | 18 ++++++- .../Platform/Workers/Certificates.php | 7 +-- .../Response/Model/ConsoleVariables.php | 54 +++++++++---------- .../Console/ConsoleConsoleClientTest.php | 3 +- tests/unit/Network/Validators/DNSTest.php | 15 +++--- 13 files changed, 83 insertions(+), 81 deletions(-) diff --git a/.env b/.env index 7fe837ea7e..4d7c038a6b 100644 --- a/.env +++ b/.env @@ -21,6 +21,7 @@ _APP_OPTIONS_ROUTER_PROTECTION=disabled _APP_OPTIONS_FORCE_HTTPS=disabled _APP_OPTIONS_ROUTER_FORCE_HTTPS=disabled _APP_OPENSSL_KEY_V1=your-secret-key +_APP_DNS=8.8.8.8 _APP_DOMAIN=traefik _APP_CONSOLE_DOMAIN=localhost _APP_DOMAIN_FUNCTIONS=functions.localhost @@ -28,6 +29,7 @@ _APP_DOMAIN_SITES=sites.localhost _APP_DOMAIN_TARGET_CNAME=test.localhost _APP_DOMAIN_TARGET_A=127.0.0.1 _APP_DOMAIN_TARGET_AAAA=::1 +_APP_DOMAIN_TARGET_CAA=digicert.com _APP_RULES_FORMAT=md5 _APP_REDIS_HOST=redis _APP_REDIS_PORT=6379 @@ -121,6 +123,4 @@ _APP_MESSAGE_PUSH_TEST_DSN= _APP_WEBHOOK_MAX_FAILED_ATTEMPTS=10 _APP_PROJECT_REGIONS=default _APP_FUNCTIONS_CREATION_ABUSE_LIMIT=5000 -_APP_STATS_USAGE_DUAL_WRITING_DBS=database_db_main -_APP_DOMAINS_DNS=8.8.8.8 -_APP_DOMAIN_TARGET_CAA='0 issue "digicert.com"' \ No newline at end of file +_APP_STATS_USAGE_DUAL_WRITING_DBS=database_db_main \ No newline at end of file diff --git a/app/config/variables.php b/app/config/variables.php index 61a0cd563f..8fd00557b3 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -153,7 +153,7 @@ return [ ], [ 'name' => '_APP_DOMAIN_TARGET_CAA', - 'description' => 'A CAA record value that can be used to validate custom domains. Format: "0 issue \"certainly.com\""', + 'description' => 'A CAA record domain that can be used to validate custom domains. Value should be domain\'s hostname.', 'introduction' => '', 'default' => '', 'required' => false, @@ -161,7 +161,7 @@ return [ 'filter' => '' ], [ - 'name' => '_APP_DOMAINS_DNS', + 'name' => '_APP_DNS', 'description' => 'DNS server to use for domain validation. Default: 8.8.8.8', 'introduction' => '', 'default' => '8.8.8.8', diff --git a/app/controllers/api/console.php b/app/controllers/api/console.php index a564031e7c..fc9849cc17 100644 --- a/app/controllers/api/console.php +++ b/app/controllers/api/console.php @@ -71,8 +71,8 @@ App::get('/v1/console/variables') '_APP_DOMAIN_TARGET_CNAME' => System::getEnv('_APP_DOMAIN_TARGET_CNAME'), '_APP_DOMAIN_TARGET_AAAA' => System::getEnv('_APP_DOMAIN_TARGET_AAAA'), '_APP_DOMAIN_TARGET_A' => System::getEnv('_APP_DOMAIN_TARGET_A'), - '_APP_DOMAIN_TARGET_CAA' => System::getEnv('_APP_DOMAIN_TARGET_CAA'), - '_APP_DOMAINS_DNS' => System::getEnv('_APP_DOMAINS_DNS'), + // Combine CAA domain with most common flags and tag (no parameters) + '_APP_DOMAIN_TARGET_CAA' => '0 issue "' + System::getEnv('_APP_DOMAIN_TARGET_CAA') + '"', '_APP_STORAGE_LIMIT' => +System::getEnv('_APP_STORAGE_LIMIT'), '_APP_COMPUTE_SIZE_LIMIT' => +System::getEnv('_APP_COMPUTE_SIZE_LIMIT'), '_APP_USAGE_STATS' => System::getEnv('_APP_USAGE_STATS'), diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index eb7dcf625a..c2be924c40 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -256,10 +256,8 @@ App::patch('/v1/proxy/rules/:ruleId/verification') if ((new IP(IP::V6))->isValid(System::getEnv('_APP_DOMAIN_TARGET_AAAA', ''))) { $validators[] = new DNS(System::getEnv('_APP_DOMAIN_TARGET_AAAA', ''), DNS::RECORD_AAAA); } - - $caaTarget = System::getEnv('_APP_DOMAIN_TARGET_CAA', ''); - if (!empty($caaTarget)) { - $validators[] = new DNS($caaTarget, DNS::RECORD_CAA); + if (!empty(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''))) { + $validators[] = new DNS(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''), DNS::RECORD_CAA); } if (empty($validators)) { diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index 89facfe0f1..34940e7c6e 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -95,6 +95,8 @@ $image = $this->getParam('image', ''); - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A + - _APP_DOMAIN_TARGET_CAA + - _APP_DOMAINS_DNS - _APP_DOMAIN_FUNCTIONS - _APP_REDIS_HOST - _APP_REDIS_PORT @@ -472,6 +474,8 @@ $image = $this->getParam('image', ''); - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A + - _APP_DOMAIN_TARGET_CAA + - _APP_DOMAINS_DNS - _APP_DOMAIN_FUNCTIONS - _APP_EMAIL_CERTIFICATES - _APP_REDIS_HOST @@ -629,6 +633,8 @@ $image = $this->getParam('image', ''); - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A + - _APP_DOMAIN_TARGET_CAA + - _APP_DOMAINS_DNS - _APP_EMAIL_SECURITY - _APP_REDIS_HOST - _APP_REDIS_PORT @@ -660,6 +666,8 @@ $image = $this->getParam('image', ''); - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A + - _APP_DOMAIN_TARGET_CAA + - _APP_DOMAINS_DNS - _APP_DOMAIN_FUNCTIONS - _APP_OPENSSL_KEY_V1 - _APP_REDIS_HOST diff --git a/composer.json b/composer.json index 10b8b7cc88..1f42130168 100644 --- a/composer.json +++ b/composer.json @@ -55,7 +55,7 @@ "utopia-php/database": "0.71.*", "utopia-php/detector": "0.1.*", "utopia-php/domains": "0.8.*", - "utopia-php/dns": "dev-feat-add-CAA-to-client as 0.2.99", + "utopia-php/dns": "0.3.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", "utopia-php/fetch": "0.4.*", diff --git a/composer.lock b/composer.lock index b2c9ba0b0d..6ff2cc6fd3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d36ad770ee5e4ea6e3bb0206c2c584ff", + "content-hash": "65958cc5b58b8f32a044bb8cc33cbeef", "packages": [ { "name": "adhocore/jwt", @@ -3598,16 +3598,16 @@ }, { "name": "utopia-php/dns", - "version": "dev-feat-add-CAA-to-client", + "version": "0.3.0", "source": { "type": "git", "url": "https://github.com/utopia-php/dns.git", - "reference": "a7d45e4c5dfc7020c0467de9587ccd7e15488206" + "reference": "8fd4161bc3a8021a670c1101b40f6b09a97f1a54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/dns/zipball/a7d45e4c5dfc7020c0467de9587ccd7e15488206", - "reference": "a7d45e4c5dfc7020c0467de9587ccd7e15488206", + "url": "https://api.github.com/repos/utopia-php/dns/zipball/8fd4161bc3a8021a670c1101b40f6b09a97f1a54", + "reference": "8fd4161bc3a8021a670c1101b40f6b09a97f1a54", "shasum": "" }, "require": { @@ -3648,9 +3648,9 @@ ], "support": { "issues": "https://github.com/utopia-php/dns/issues", - "source": "https://github.com/utopia-php/dns/tree/feat-add-CAA-to-client" + "source": "https://github.com/utopia-php/dns/tree/0.3.0" }, - "time": "2025-08-03T18:46:13+00:00" + "time": "2025-08-04T11:05:53+00:00" }, { "name": "utopia-php/domains", @@ -8317,18 +8317,9 @@ "time": "2024-03-07T20:33:40+00:00" } ], - "aliases": [ - { - "package": "utopia-php/dns", - "version": "dev-feat-add-CAA-to-client", - "alias": "0.2.99", - "alias_normalized": "0.2.99.0" - } - ], + "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "utopia-php/dns": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -8352,5 +8343,5 @@ "platform-overrides": { "php": "8.3" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } diff --git a/docker-compose.yml b/docker-compose.yml index 830e0905fa..0e299c8a2c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -121,7 +121,7 @@ services: - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A - _APP_DOMAIN_TARGET_CAA - - _APP_DOMAINS_DNS + - _APP_DNS - _APP_DOMAIN_FUNCTIONS - _APP_REDIS_HOST - _APP_REDIS_PORT @@ -538,7 +538,7 @@ services: - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A - _APP_DOMAIN_TARGET_CAA - - _APP_DOMAINS_DNS + - _APP_DNS - _APP_DOMAIN_FUNCTIONS - _APP_EMAIL_CERTIFICATES - _APP_REDIS_HOST @@ -709,7 +709,7 @@ services: - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A - _APP_DOMAIN_TARGET_CAA - - _APP_DOMAINS_DNS + - _APP_DNS - _APP_EMAIL_SECURITY - _APP_REDIS_HOST - _APP_REDIS_PORT @@ -745,7 +745,7 @@ services: - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A - _APP_DOMAIN_TARGET_CAA - - _APP_DOMAINS_DNS + - _APP_DNS - _APP_DOMAIN_FUNCTIONS - _APP_OPENSSL_KEY_V1 - _APP_REDIS_HOST diff --git a/src/Appwrite/Network/Validator/DNS.php b/src/Appwrite/Network/Validator/DNS.php index 7557a0d04b..b28ef2f800 100644 --- a/src/Appwrite/Network/Validator/DNS.php +++ b/src/Appwrite/Network/Validator/DNS.php @@ -11,7 +11,7 @@ class DNS extends Validator public const RECORD_A = 'a'; public const RECORD_AAAA = 'aaaa'; public const RECORD_CNAME = 'cname'; - public const RECORD_CAA = 'caa'; + public const RECORD_CAA = 'caa'; // Only provide domain as $target for CAA validation /** * @var mixed @@ -53,7 +53,7 @@ class DNS extends Validator return false; } - $dnsServer = System::getEnv('_APP_DOMAINS_DNS', '8.8.8.8'); + $dnsServer = System::getEnv('_APP_DNS', '8.8.8.8'); $dns = new Client($dnsServer); try { @@ -69,6 +69,20 @@ class DNS extends Validator } foreach ($query as $record) { + // CAA validation only needs to ensure domain + if ($this->type === self::RECORD_CAA) { + // Original: 255 issuewild "certainly.com;validationmethods=tls-alpn-01;retrytimeout=3600" + // Extracted: certainly.com + $rdata = $record->getRdata(); + $rdata = \explode(' ', $rdata, 3)[2] ?? ''; + $rdata = \trim('"'); + $rdata = \explode(';', $rdata, 2)[0] ?? ''; + + if ($rdata === $this->target) { + return true; + } + } + if ($record->getRdata() === $this->target) { return true; } diff --git a/src/Appwrite/Platform/Workers/Certificates.php b/src/Appwrite/Platform/Workers/Certificates.php index dd927aae84..fc2878a1d0 100644 --- a/src/Appwrite/Platform/Workers/Certificates.php +++ b/src/Appwrite/Platform/Workers/Certificates.php @@ -313,11 +313,8 @@ class Certificates extends Action if ((new IP(IP::V6))->isValid(System::getEnv('_APP_DOMAIN_TARGET_AAAA', ''))) { $validators[] = new DNS(System::getEnv('_APP_DOMAIN_TARGET_AAAA', ''), DNS::RECORD_AAAA); } - - // Add CAA validation if configured - $caaTarget = System::getEnv('_APP_DOMAIN_TARGET_CAA', ''); - if (!empty($caaTarget)) { - $validators[] = new DNS($caaTarget, DNS::RECORD_CAA); + if (!empty(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''))) { + $validators[] = new DNS(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''), DNS::RECORD_CAA); } // Validate if domain target is properly configured diff --git a/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php b/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php index 21141254ab..b81502f0a1 100644 --- a/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php +++ b/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php @@ -10,36 +10,30 @@ class ConsoleVariables extends Model public function __construct() { $this - ->addRule('_APP_DOMAIN_TARGET_CNAME', [ - 'type' => self::TYPE_STRING, - 'description' => 'CNAME target for your Appwrite custom domains.', - 'default' => '', - 'example' => 'appwrite.io', - ]) - ->addRule('_APP_DOMAIN_TARGET_A', [ - 'type' => self::TYPE_STRING, - 'description' => 'A target for your Appwrite custom domains.', - 'default' => '', - 'example' => '127.0.0.1', - ]) - ->addRule('_APP_DOMAIN_TARGET_AAAA', [ - 'type' => self::TYPE_STRING, - 'description' => 'AAAA target for your Appwrite custom domains.', - 'default' => '', - 'example' => '::1', - ]) - ->addRule('_APP_DOMAIN_TARGET_CAA', [ - 'type' => self::TYPE_STRING, - 'description' => 'CAA target for your Appwrite custom domains.', - 'default' => '', - 'example' => '0 issue "certainly.com"', - ]) - ->addRule('_APP_DOMAINS_DNS', [ - 'type' => self::TYPE_STRING, - 'description' => 'DNS server to use for domain validation.', - 'default' => '8.8.8.8', - 'example' => '8.8.8.8', - ]) + ->addRule('_APP_DOMAIN_TARGET_CNAME', [ + 'type' => self::TYPE_STRING, + 'description' => 'CNAME target for your Appwrite custom domains.', + 'default' => '', + 'example' => 'appwrite.io', + ]) + ->addRule('_APP_DOMAIN_TARGET_A', [ + 'type' => self::TYPE_STRING, + 'description' => 'A target for your Appwrite custom domains.', + 'default' => '', + 'example' => '127.0.0.1', + ]) + ->addRule('_APP_DOMAIN_TARGET_AAAA', [ + 'type' => self::TYPE_STRING, + 'description' => 'AAAA target for your Appwrite custom domains.', + 'default' => '', + 'example' => '::1', + ]) + ->addRule('_APP_DOMAIN_TARGET_CAA', [ + 'type' => self::TYPE_STRING, + 'description' => 'CAA target for your Appwrite custom domains.', + 'default' => '', + 'example' => 'digicert.com', + ]) ->addRule('_APP_STORAGE_LIMIT', [ 'type' => self::TYPE_INTEGER, 'description' => 'Maximum file size allowed for file upload in bytes.', diff --git a/tests/e2e/Services/Console/ConsoleConsoleClientTest.php b/tests/e2e/Services/Console/ConsoleConsoleClientTest.php index bfad5b480b..340cabc8c0 100644 --- a/tests/e2e/Services/Console/ConsoleConsoleClientTest.php +++ b/tests/e2e/Services/Console/ConsoleConsoleClientTest.php @@ -24,7 +24,7 @@ class ConsoleConsoleClientTest extends Scope ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(15, $response['body']); + $this->assertCount(14, $response['body']); $this->assertIsString($response['body']['_APP_DOMAIN_TARGET_CNAME']); $this->assertIsString($response['body']['_APP_DOMAIN_TARGET_A']); $this->assertIsString($response['body']['_APP_DOMAIN_TARGET_AAAA']); @@ -38,7 +38,6 @@ class ConsoleConsoleClientTest extends Scope $this->assertIsString($response['body']['_APP_DOMAIN_FUNCTIONS']); $this->assertIsString($response['body']['_APP_OPTIONS_FORCE_HTTPS']); $this->assertIsString($response['body']['_APP_DOMAINS_NAMESERVERS']); - $this->assertIsString($response['body']['_APP_DOMAINS_DNS']); // When adding new keys, dont forget to update count a few lines above } } diff --git a/tests/unit/Network/Validators/DNSTest.php b/tests/unit/Network/Validators/DNSTest.php index 64293258a4..42417cce05 100644 --- a/tests/unit/Network/Validators/DNSTest.php +++ b/tests/unit/Network/Validators/DNSTest.php @@ -50,18 +50,19 @@ class DNSTest extends TestCase public function testCAA(): void { - $validator = new DNS('0 issue "digicert.com"', DNS::RECORD_CAA); + $validator = new DNS('digicert.com', DNS::RECORD_CAA); + $this->assertEquals($validator->isValid('github.com'), true); $this->assertEquals($validator->isValid(''), false); $this->assertEquals($validator->isValid(null), false); $this->assertEquals($validator->isValid(false), false); - - $result = $validator->isValid('github.com'); - $this->assertEquals($result, true); - $this->assertEquals($validator->isValid('test1.appwrite.org'), false); - $validator2 = new DNS('0 issue "letsencrypt.org"', DNS::RECORD_CAA); - $this->assertEquals($validator2->isValid('test2.appwrite.org'), false); + $validator = new DNS('0 issue "digicert.com"', DNS::RECORD_CAA); + + $this->assertEquals($validator->isValid('github.com'), false); + + $validator = new DNS('letsencrypt.org', DNS::RECORD_CAA); + $this->assertEquals($validator->isValid('test2.appwrite.org'), false); } } From 75bf37a074ce5972149b6e7757e19e0ae6c27f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 4 Aug 2025 14:32:38 +0200 Subject: [PATCH 31/38] Update composer.lock --- composer.lock | 62 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 59 insertions(+), 3 deletions(-) diff --git a/composer.lock b/composer.lock index aafe1d216c..88356d5349 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7b2ef6192403daf5c492219822ce0aa1", + "content-hash": "761a7e17b49381e68038c92873888125", "packages": [ { "name": "adhocore/jwt", @@ -3641,6 +3641,62 @@ }, "time": "2025-05-19T11:01:28+00:00" }, + { + "name": "utopia-php/dns", + "version": "0.3.0", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/dns.git", + "reference": "8fd4161bc3a8021a670c1101b40f6b09a97f1a54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/dns/zipball/8fd4161bc3a8021a670c1101b40f6b09a97f1a54", + "reference": "8fd4161bc3a8021a670c1101b40f6b09a97f1a54", + "shasum": "" + }, + "require": { + "php": ">=8.0", + "utopia-php/cli": "0.15.*", + "utopia-php/telemetry": "^0.1.1" + }, + "require-dev": { + "laravel/pint": "1.2.*", + "phpstan/phpstan": "1.8.*", + "phpunit/phpunit": "^9.3", + "rregeer/phpunit-coverage-check": "^0.3.1", + "swoole/ide-helper": "4.6.6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\DNS\\": "src/DNS" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eldad Fux", + "email": "eldad@appwrite.io" + } + ], + "description": "Lite & fast micro PHP DNS server abstraction that is **easy to use**.", + "keywords": [ + "dns", + "framework", + "php", + "upf", + "utopia" + ], + "support": { + "issues": "https://github.com/utopia-php/dns/issues", + "source": "https://github.com/utopia-php/dns/tree/0.3.0" + }, + "time": "2025-08-04T11:05:53+00:00" + }, { "name": "utopia-php/domains", "version": "0.8.0", @@ -8308,7 +8364,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -8332,5 +8388,5 @@ "platform-overrides": { "php": "8.3" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } From 48a977526e1898354fbbe40a0ab0f37440a41f9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 4 Aug 2025 14:53:13 +0200 Subject: [PATCH 32/38] Fix tests --- app/controllers/api/console.php | 2 +- src/Appwrite/Network/Validator/DNS.php | 4 ++-- tests/unit/Network/Validators/DNSTest.php | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/console.php b/app/controllers/api/console.php index fc9849cc17..b0619df3b3 100644 --- a/app/controllers/api/console.php +++ b/app/controllers/api/console.php @@ -72,7 +72,7 @@ App::get('/v1/console/variables') '_APP_DOMAIN_TARGET_AAAA' => System::getEnv('_APP_DOMAIN_TARGET_AAAA'), '_APP_DOMAIN_TARGET_A' => System::getEnv('_APP_DOMAIN_TARGET_A'), // Combine CAA domain with most common flags and tag (no parameters) - '_APP_DOMAIN_TARGET_CAA' => '0 issue "' + System::getEnv('_APP_DOMAIN_TARGET_CAA') + '"', + '_APP_DOMAIN_TARGET_CAA' => '0 issue "' . System::getEnv('_APP_DOMAIN_TARGET_CAA') . '"', '_APP_STORAGE_LIMIT' => +System::getEnv('_APP_STORAGE_LIMIT'), '_APP_COMPUTE_SIZE_LIMIT' => +System::getEnv('_APP_COMPUTE_SIZE_LIMIT'), '_APP_USAGE_STATS' => System::getEnv('_APP_USAGE_STATS'), diff --git a/src/Appwrite/Network/Validator/DNS.php b/src/Appwrite/Network/Validator/DNS.php index b28ef2f800..67c0ca53d5 100644 --- a/src/Appwrite/Network/Validator/DNS.php +++ b/src/Appwrite/Network/Validator/DNS.php @@ -11,7 +11,7 @@ class DNS extends Validator public const RECORD_A = 'a'; public const RECORD_AAAA = 'aaaa'; public const RECORD_CNAME = 'cname'; - public const RECORD_CAA = 'caa'; // Only provide domain as $target for CAA validation + public const RECORD_CAA = 'caa'; // You can provide domain only (as $target) for CAA validation /** * @var mixed @@ -75,7 +75,7 @@ class DNS extends Validator // Extracted: certainly.com $rdata = $record->getRdata(); $rdata = \explode(' ', $rdata, 3)[2] ?? ''; - $rdata = \trim('"'); + $rdata = \trim($rdata, '"'); $rdata = \explode(';', $rdata, 2)[0] ?? ''; if ($rdata === $this->target) { diff --git a/tests/unit/Network/Validators/DNSTest.php b/tests/unit/Network/Validators/DNSTest.php index 42417cce05..377018fe7b 100644 --- a/tests/unit/Network/Validators/DNSTest.php +++ b/tests/unit/Network/Validators/DNSTest.php @@ -51,7 +51,6 @@ class DNSTest extends TestCase public function testCAA(): void { $validator = new DNS('digicert.com', DNS::RECORD_CAA); - $this->assertEquals($validator->isValid('github.com'), true); $this->assertEquals($validator->isValid(''), false); $this->assertEquals($validator->isValid(null), false); @@ -59,7 +58,12 @@ class DNSTest extends TestCase $this->assertEquals($validator->isValid('test1.appwrite.org'), false); $validator = new DNS('0 issue "digicert.com"', DNS::RECORD_CAA); + $this->assertEquals($validator->isValid('github.com'), true); + $validator = new DNS('0 issuewild "digicert.com"', DNS::RECORD_CAA); + $this->assertEquals($validator->isValid('github.com'), true); + + $validator = new DNS('128 issue "digicert.com"', DNS::RECORD_CAA); $this->assertEquals($validator->isValid('github.com'), false); $validator = new DNS('letsencrypt.org', DNS::RECORD_CAA); From 2a63de0c467c810d311f8ddc3a86dc7fbf35076e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 4 Aug 2025 14:57:35 +0200 Subject: [PATCH 33/38] Improve docs --- src/Appwrite/Network/Validator/DNS.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Appwrite/Network/Validator/DNS.php b/src/Appwrite/Network/Validator/DNS.php index 67c0ca53d5..2807156a2d 100644 --- a/src/Appwrite/Network/Validator/DNS.php +++ b/src/Appwrite/Network/Validator/DNS.php @@ -71,12 +71,11 @@ class DNS extends Validator foreach ($query as $record) { // CAA validation only needs to ensure domain if ($this->type === self::RECORD_CAA) { - // Original: 255 issuewild "certainly.com;validationmethods=tls-alpn-01;retrytimeout=3600" - // Extracted: certainly.com - $rdata = $record->getRdata(); - $rdata = \explode(' ', $rdata, 3)[2] ?? ''; - $rdata = \trim($rdata, '"'); - $rdata = \explode(';', $rdata, 2)[0] ?? ''; + // Extract domain; comments showcase extraction steps in most complex scenario + $rdata = $record->getRdata(); // 255 issuewild "certainly.com;validationmethods=tls-alpn-01;retrytimeout=3600" + $rdata = \explode(' ', $rdata, 3)[2] ?? ''; // "certainly.com;validationmethods=tls-alpn-01;retrytimeout=3600" + $rdata = \trim($rdata, '"'); // certainly.com;validationmethods=tls-alpn-01;retrytimeout=3600 + $rdata = \explode(';', $rdata, 2)[0] ?? ''; // certainly.com if ($rdata === $this->target) { return true; From 5e294d084985d808c9fc4470cdf724cd1810b4e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 4 Aug 2025 15:35:40 +0200 Subject: [PATCH 34/38] Support empty CAA records --- src/Appwrite/Network/Validator/DNS.php | 26 ++++++++++++++++++----- tests/unit/Network/Validators/DNSTest.php | 15 ++++++++----- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/src/Appwrite/Network/Validator/DNS.php b/src/Appwrite/Network/Validator/DNS.php index 2807156a2d..95d8436eda 100644 --- a/src/Appwrite/Network/Validator/DNS.php +++ b/src/Appwrite/Network/Validator/DNS.php @@ -8,10 +8,10 @@ use Utopia\Validator; class DNS extends Validator { - public const RECORD_A = 'a'; - public const RECORD_AAAA = 'aaaa'; - public const RECORD_CNAME = 'cname'; - public const RECORD_CAA = 'caa'; // You can provide domain only (as $target) for CAA validation + public const RECORD_A = 'A'; + public const RECORD_AAAA = 'AAAA'; + public const RECORD_CNAME = 'CNAME'; + public const RECORD_CAA = 'CAA'; // You can provide domain only (as $target) for CAA validation /** * @var mixed @@ -57,7 +57,7 @@ class DNS extends Validator $dns = new Client($dnsServer); try { - $query = $dns->query($value, strtoupper($this->type)); + $query = $dns->query($value, $this->type); $this->logs = $query; } catch (\Exception $e) { $this->logs = ['error' => $e->getMessage()]; @@ -65,10 +65,21 @@ class DNS extends Validator } if (empty($query)) { + // No CAA records means anyone can issue certificate + if ($this->type === self::RECORD_CAA) { + return true; + } + return false; } + $caaCount = 0; + foreach ($query as $record) { + if ($record->getTypeName() === self::RECORD_CAA) { + $caaCount++; + } + // CAA validation only needs to ensure domain if ($this->type === self::RECORD_CAA) { // Extract domain; comments showcase extraction steps in most complex scenario @@ -87,6 +98,11 @@ class DNS extends Validator } } + if ($this->type === self::RECORD_CAA && $caaCount === 0) { + // No CAA records, means anyone can issue certificate + return true; + } + return false; } diff --git a/tests/unit/Network/Validators/DNSTest.php b/tests/unit/Network/Validators/DNSTest.php index 377018fe7b..6609a0838a 100644 --- a/tests/unit/Network/Validators/DNSTest.php +++ b/tests/unit/Network/Validators/DNSTest.php @@ -52,10 +52,7 @@ class DNSTest extends TestCase { $validator = new DNS('digicert.com', DNS::RECORD_CAA); $this->assertEquals($validator->isValid('github.com'), true); - $this->assertEquals($validator->isValid(''), false); - $this->assertEquals($validator->isValid(null), false); - $this->assertEquals($validator->isValid(false), false); - $this->assertEquals($validator->isValid('test1.appwrite.org'), false); + $this->assertEquals($validator->isValid('test1.appwrite.org'), true); $validator = new DNS('0 issue "digicert.com"', DNS::RECORD_CAA); $this->assertEquals($validator->isValid('github.com'), true); @@ -67,6 +64,14 @@ class DNSTest extends TestCase $this->assertEquals($validator->isValid('github.com'), false); $validator = new DNS('letsencrypt.org', DNS::RECORD_CAA); - $this->assertEquals($validator->isValid('test2.appwrite.org'), false); + $this->assertEquals($validator->isValid('github.com'), false); + + // Valid becasue no CAA record configured + $validator = new DNS('anything.com', DNS::RECORD_CAA); + $this->assertEquals($validator->isValid('cloud.appwrite.io'), true); + + // Valid becasue no CAA record configured + $validator = new DNS('something.org', DNS::RECORD_CAA); + $this->assertEquals($validator->isValid('cloud.appwrite.io'), true); } } From 8c3530ee60cd89ad5f0bf7975727756f8dd9d9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 4 Aug 2025 16:18:06 +0200 Subject: [PATCH 35/38] Fix caa validation breaking existing validations --- app/controllers/api/proxy.php | 16 +++++++++++++--- src/Appwrite/Platform/Workers/Certificates.php | 16 +++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index c2be924c40..6b76b0c34c 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -256,9 +256,6 @@ App::patch('/v1/proxy/rules/:ruleId/verification') if ((new IP(IP::V6))->isValid(System::getEnv('_APP_DOMAIN_TARGET_AAAA', ''))) { $validators[] = new DNS(System::getEnv('_APP_DOMAIN_TARGET_AAAA', ''), DNS::RECORD_AAAA); } - if (!empty(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''))) { - $validators[] = new DNS(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''), DNS::RECORD_CAA); - } if (empty($validators)) { throw new Exception(Exception::GENERAL_SERVER_ERROR, 'At least one of domain targets environment variable must be configured.'); @@ -289,6 +286,19 @@ App::patch('/v1/proxy/rules/:ruleId/verification') throw new Exception(Exception::RULE_VERIFICATION_FAILED); } + // Ensure CAA won't block certificate issuance + if (!empty(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''))) { + $validationStart = \microtime(true); + $validator = new DNS(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''), DNS::RECORD_CAA); + if (!$validator->isValid($domain->get())) { + $log->addExtra('dnsTimingCaa', \strval(\microtime(true) - $validationStart)); + $log->addTag('dnsDomain', $domain->get()); + $error = $validator->getDescription(); + $log->addExtra('dnsResponse', \is_array($error) ? \json_encode($error) : \strval($error)); + throw new Exception(Exception::RULE_VERIFICATION_FAILED, 'Domain verification failed because CAA records do not allow certainly.com to issue certificates.'); + } + } + $dbForPlatform->updateDocument('rules', $rule->getId(), $rule->setAttribute('status', 'verifying')); // Issue a TLS certificate when domain is verified diff --git a/src/Appwrite/Platform/Workers/Certificates.php b/src/Appwrite/Platform/Workers/Certificates.php index fc2878a1d0..d14bf0428d 100644 --- a/src/Appwrite/Platform/Workers/Certificates.php +++ b/src/Appwrite/Platform/Workers/Certificates.php @@ -313,9 +313,6 @@ class Certificates extends Action if ((new IP(IP::V6))->isValid(System::getEnv('_APP_DOMAIN_TARGET_AAAA', ''))) { $validators[] = new DNS(System::getEnv('_APP_DOMAIN_TARGET_AAAA', ''), DNS::RECORD_AAAA); } - if (!empty(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''))) { - $validators[] = new DNS(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''), DNS::RECORD_CAA); - } // Validate if domain target is properly configured if (empty($validators)) { @@ -340,6 +337,19 @@ class Certificates extends Action throw new Exception('Failed to verify domain DNS records.'); } + + // Ensure CAA won't block certificate issuance + if (!empty(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''))) { + $validationStart = \microtime(true); + $validator = new DNS(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''), DNS::RECORD_CAA); + if (!$validator->isValid($domain->get())) { + $log->addExtra('dnsTimingCaa', \strval(\microtime(true) - $validationStart)); + $log->addTag('dnsDomain', $domain->get()); + $error = $validator->getDescription(); + $log->addExtra('dnsResponse', \is_array($error) ? \json_encode($error) : \strval($error)); + throw new Exception('Failed to verify domain DNS records. CAA records do not allow certificates from certainly.com to issue certificates.'); + } + } } else { // Main domain validation // TODO: Would be awesome to check A/AAAA record here. Maybe dry run? From 7f690a1048444e5189c7983a124cc0e031c33278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 4 Aug 2025 16:51:49 +0200 Subject: [PATCH 36/38] Simplify implementation --- src/Appwrite/Network/Validator/DNS.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/Appwrite/Network/Validator/DNS.php b/src/Appwrite/Network/Validator/DNS.php index 95d8436eda..7549d18f54 100644 --- a/src/Appwrite/Network/Validator/DNS.php +++ b/src/Appwrite/Network/Validator/DNS.php @@ -73,13 +73,7 @@ class DNS extends Validator return false; } - $caaCount = 0; - foreach ($query as $record) { - if ($record->getTypeName() === self::RECORD_CAA) { - $caaCount++; - } - // CAA validation only needs to ensure domain if ($this->type === self::RECORD_CAA) { // Extract domain; comments showcase extraction steps in most complex scenario @@ -98,11 +92,6 @@ class DNS extends Validator } } - if ($this->type === self::RECORD_CAA && $caaCount === 0) { - // No CAA records, means anyone can issue certificate - return true; - } - return false; } From 9c320f9c71c504c34f5c8254cf0a2146676f2b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 5 Aug 2025 10:23:39 +0200 Subject: [PATCH 37/38] Revert "Check CAA record before issuing certificate" --- .env | 2 - app/config/variables.php | 18 ------ app/controllers/api/console.php | 2 - app/controllers/api/proxy.php | 13 ---- app/views/install/compose.phtml | 8 --- composer.json | 1 - composer.lock | 62 +------------------ docker-compose.yml | 8 --- src/Appwrite/Network/Validator/DNS.php | 58 +++++++---------- .../Platform/Workers/Certificates.php | 13 ---- .../Response/Model/ConsoleVariables.php | 42 ++++++------- .../Console/ConsoleConsoleClientTest.php | 3 +- tests/unit/Network/Validators/DNSTest.php | 27 -------- 13 files changed, 46 insertions(+), 211 deletions(-) diff --git a/.env b/.env index 4d7c038a6b..76af83a946 100644 --- a/.env +++ b/.env @@ -21,7 +21,6 @@ _APP_OPTIONS_ROUTER_PROTECTION=disabled _APP_OPTIONS_FORCE_HTTPS=disabled _APP_OPTIONS_ROUTER_FORCE_HTTPS=disabled _APP_OPENSSL_KEY_V1=your-secret-key -_APP_DNS=8.8.8.8 _APP_DOMAIN=traefik _APP_CONSOLE_DOMAIN=localhost _APP_DOMAIN_FUNCTIONS=functions.localhost @@ -29,7 +28,6 @@ _APP_DOMAIN_SITES=sites.localhost _APP_DOMAIN_TARGET_CNAME=test.localhost _APP_DOMAIN_TARGET_A=127.0.0.1 _APP_DOMAIN_TARGET_AAAA=::1 -_APP_DOMAIN_TARGET_CAA=digicert.com _APP_RULES_FORMAT=md5 _APP_REDIS_HOST=redis _APP_REDIS_PORT=6379 diff --git a/app/config/variables.php b/app/config/variables.php index 8fd00557b3..71ed13a483 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -151,24 +151,6 @@ return [ 'question' => '', 'filter' => '' ], - [ - 'name' => '_APP_DOMAIN_TARGET_CAA', - 'description' => 'A CAA record domain that can be used to validate custom domains. Value should be domain\'s hostname.', - 'introduction' => '', - 'default' => '', - 'required' => false, - 'question' => '', - 'filter' => '' - ], - [ - 'name' => '_APP_DNS', - 'description' => 'DNS server to use for domain validation. Default: 8.8.8.8', - 'introduction' => '', - 'default' => '8.8.8.8', - 'required' => false, - 'question' => '', - 'filter' => '' - ], [ 'name' => '_APP_CONSOLE_WHITELIST_ROOT', 'description' => 'This option allows you to disable the creation of new users on the Appwrite console. When enabled only 1 user will be able to use the registration form. New users can be added by inviting them to your project. By default this option is enabled.', diff --git a/app/controllers/api/console.php b/app/controllers/api/console.php index b0619df3b3..558dc0e4ef 100644 --- a/app/controllers/api/console.php +++ b/app/controllers/api/console.php @@ -71,8 +71,6 @@ App::get('/v1/console/variables') '_APP_DOMAIN_TARGET_CNAME' => System::getEnv('_APP_DOMAIN_TARGET_CNAME'), '_APP_DOMAIN_TARGET_AAAA' => System::getEnv('_APP_DOMAIN_TARGET_AAAA'), '_APP_DOMAIN_TARGET_A' => System::getEnv('_APP_DOMAIN_TARGET_A'), - // Combine CAA domain with most common flags and tag (no parameters) - '_APP_DOMAIN_TARGET_CAA' => '0 issue "' . System::getEnv('_APP_DOMAIN_TARGET_CAA') . '"', '_APP_STORAGE_LIMIT' => +System::getEnv('_APP_STORAGE_LIMIT'), '_APP_COMPUTE_SIZE_LIMIT' => +System::getEnv('_APP_COMPUTE_SIZE_LIMIT'), '_APP_USAGE_STATS' => System::getEnv('_APP_USAGE_STATS'), diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index 6b76b0c34c..417ea602ba 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -286,19 +286,6 @@ App::patch('/v1/proxy/rules/:ruleId/verification') throw new Exception(Exception::RULE_VERIFICATION_FAILED); } - // Ensure CAA won't block certificate issuance - if (!empty(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''))) { - $validationStart = \microtime(true); - $validator = new DNS(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''), DNS::RECORD_CAA); - if (!$validator->isValid($domain->get())) { - $log->addExtra('dnsTimingCaa', \strval(\microtime(true) - $validationStart)); - $log->addTag('dnsDomain', $domain->get()); - $error = $validator->getDescription(); - $log->addExtra('dnsResponse', \is_array($error) ? \json_encode($error) : \strval($error)); - throw new Exception(Exception::RULE_VERIFICATION_FAILED, 'Domain verification failed because CAA records do not allow certainly.com to issue certificates.'); - } - } - $dbForPlatform->updateDocument('rules', $rule->getId(), $rule->setAttribute('status', 'verifying')); // Issue a TLS certificate when domain is verified diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index 34940e7c6e..89facfe0f1 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -95,8 +95,6 @@ $image = $this->getParam('image', ''); - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A - - _APP_DOMAIN_TARGET_CAA - - _APP_DOMAINS_DNS - _APP_DOMAIN_FUNCTIONS - _APP_REDIS_HOST - _APP_REDIS_PORT @@ -474,8 +472,6 @@ $image = $this->getParam('image', ''); - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A - - _APP_DOMAIN_TARGET_CAA - - _APP_DOMAINS_DNS - _APP_DOMAIN_FUNCTIONS - _APP_EMAIL_CERTIFICATES - _APP_REDIS_HOST @@ -633,8 +629,6 @@ $image = $this->getParam('image', ''); - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A - - _APP_DOMAIN_TARGET_CAA - - _APP_DOMAINS_DNS - _APP_EMAIL_SECURITY - _APP_REDIS_HOST - _APP_REDIS_PORT @@ -666,8 +660,6 @@ $image = $this->getParam('image', ''); - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A - - _APP_DOMAIN_TARGET_CAA - - _APP_DOMAINS_DNS - _APP_DOMAIN_FUNCTIONS - _APP_OPENSSL_KEY_V1 - _APP_REDIS_HOST diff --git a/composer.json b/composer.json index 8ba8e49f4a..73cdcc3d86 100644 --- a/composer.json +++ b/composer.json @@ -55,7 +55,6 @@ "utopia-php/database": "0.71.*", "utopia-php/detector": "0.1.*", "utopia-php/domains": "0.8.*", - "utopia-php/dns": "0.3.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", "utopia-php/fetch": "0.4.*", diff --git a/composer.lock b/composer.lock index 88356d5349..aafe1d216c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "761a7e17b49381e68038c92873888125", + "content-hash": "7b2ef6192403daf5c492219822ce0aa1", "packages": [ { "name": "adhocore/jwt", @@ -3641,62 +3641,6 @@ }, "time": "2025-05-19T11:01:28+00:00" }, - { - "name": "utopia-php/dns", - "version": "0.3.0", - "source": { - "type": "git", - "url": "https://github.com/utopia-php/dns.git", - "reference": "8fd4161bc3a8021a670c1101b40f6b09a97f1a54" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/utopia-php/dns/zipball/8fd4161bc3a8021a670c1101b40f6b09a97f1a54", - "reference": "8fd4161bc3a8021a670c1101b40f6b09a97f1a54", - "shasum": "" - }, - "require": { - "php": ">=8.0", - "utopia-php/cli": "0.15.*", - "utopia-php/telemetry": "^0.1.1" - }, - "require-dev": { - "laravel/pint": "1.2.*", - "phpstan/phpstan": "1.8.*", - "phpunit/phpunit": "^9.3", - "rregeer/phpunit-coverage-check": "^0.3.1", - "swoole/ide-helper": "4.6.6" - }, - "type": "library", - "autoload": { - "psr-4": { - "Utopia\\DNS\\": "src/DNS" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Eldad Fux", - "email": "eldad@appwrite.io" - } - ], - "description": "Lite & fast micro PHP DNS server abstraction that is **easy to use**.", - "keywords": [ - "dns", - "framework", - "php", - "upf", - "utopia" - ], - "support": { - "issues": "https://github.com/utopia-php/dns/issues", - "source": "https://github.com/utopia-php/dns/tree/0.3.0" - }, - "time": "2025-08-04T11:05:53+00:00" - }, { "name": "utopia-php/domains", "version": "0.8.0", @@ -8364,7 +8308,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -8388,5 +8332,5 @@ "platform-overrides": { "php": "8.3" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/docker-compose.yml b/docker-compose.yml index 0e299c8a2c..58b78fcd8e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -120,8 +120,6 @@ services: - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A - - _APP_DOMAIN_TARGET_CAA - - _APP_DNS - _APP_DOMAIN_FUNCTIONS - _APP_REDIS_HOST - _APP_REDIS_PORT @@ -537,8 +535,6 @@ services: - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A - - _APP_DOMAIN_TARGET_CAA - - _APP_DNS - _APP_DOMAIN_FUNCTIONS - _APP_EMAIL_CERTIFICATES - _APP_REDIS_HOST @@ -708,8 +704,6 @@ services: - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A - - _APP_DOMAIN_TARGET_CAA - - _APP_DNS - _APP_EMAIL_SECURITY - _APP_REDIS_HOST - _APP_REDIS_PORT @@ -744,8 +738,6 @@ services: - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A - - _APP_DOMAIN_TARGET_CAA - - _APP_DNS - _APP_DOMAIN_FUNCTIONS - _APP_OPENSSL_KEY_V1 - _APP_REDIS_HOST diff --git a/src/Appwrite/Network/Validator/DNS.php b/src/Appwrite/Network/Validator/DNS.php index 7549d18f54..73494ddc3e 100644 --- a/src/Appwrite/Network/Validator/DNS.php +++ b/src/Appwrite/Network/Validator/DNS.php @@ -2,16 +2,13 @@ namespace Appwrite\Network\Validator; -use Utopia\DNS\Client; -use Utopia\System\System; use Utopia\Validator; class DNS extends Validator { - public const RECORD_A = 'A'; - public const RECORD_AAAA = 'AAAA'; - public const RECORD_CNAME = 'CNAME'; - public const RECORD_CAA = 'CAA'; // You can provide domain only (as $target) for CAA validation + public const RECORD_A = 'a'; + public const RECORD_AAAA = 'aaaa'; + public const RECORD_CNAME = 'cname'; /** * @var mixed @@ -45,49 +42,42 @@ class DNS extends Validator * Check if DNS record value matches specific value * * @param mixed $domain + * * @return bool */ public function isValid($value): bool { + $typeNative = match ($this->type) { + self::RECORD_A => DNS_A, + self::RECORD_AAAA => DNS_AAAA, + self::RECORD_CNAME => DNS_CNAME, + default => throw new \Exception('Record type not supported.') + }; + + $dnsKey = match ($this->type) { + self::RECORD_A => 'ip', + self::RECORD_AAAA => 'ipv6', + self::RECORD_CNAME => 'target', + default => throw new \Exception('Record type not supported.') + }; + if (!is_string($value)) { return false; } - $dnsServer = System::getEnv('_APP_DNS', '8.8.8.8'); - $dns = new Client($dnsServer); - try { - $query = $dns->query($value, $this->type); - $this->logs = $query; - } catch (\Exception $e) { - $this->logs = ['error' => $e->getMessage()]; + $records = \dns_get_record($value, $typeNative); + $this->logs = $records; + } catch (\Throwable $th) { return false; } - if (empty($query)) { - // No CAA records means anyone can issue certificate - if ($this->type === self::RECORD_CAA) { - return true; - } - + if (!$records) { return false; } - foreach ($query as $record) { - // CAA validation only needs to ensure domain - if ($this->type === self::RECORD_CAA) { - // Extract domain; comments showcase extraction steps in most complex scenario - $rdata = $record->getRdata(); // 255 issuewild "certainly.com;validationmethods=tls-alpn-01;retrytimeout=3600" - $rdata = \explode(' ', $rdata, 3)[2] ?? ''; // "certainly.com;validationmethods=tls-alpn-01;retrytimeout=3600" - $rdata = \trim($rdata, '"'); // certainly.com;validationmethods=tls-alpn-01;retrytimeout=3600 - $rdata = \explode(';', $rdata, 2)[0] ?? ''; // certainly.com - - if ($rdata === $this->target) { - return true; - } - } - - if ($record->getRdata() === $this->target) { + foreach ($records as $record) { + if (isset($record[$dnsKey]) && $record[$dnsKey] === $this->target) { return true; } } diff --git a/src/Appwrite/Platform/Workers/Certificates.php b/src/Appwrite/Platform/Workers/Certificates.php index d14bf0428d..207f95ff7d 100644 --- a/src/Appwrite/Platform/Workers/Certificates.php +++ b/src/Appwrite/Platform/Workers/Certificates.php @@ -337,19 +337,6 @@ class Certificates extends Action throw new Exception('Failed to verify domain DNS records.'); } - - // Ensure CAA won't block certificate issuance - if (!empty(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''))) { - $validationStart = \microtime(true); - $validator = new DNS(System::getEnv('_APP_DOMAIN_TARGET_CAA', ''), DNS::RECORD_CAA); - if (!$validator->isValid($domain->get())) { - $log->addExtra('dnsTimingCaa', \strval(\microtime(true) - $validationStart)); - $log->addTag('dnsDomain', $domain->get()); - $error = $validator->getDescription(); - $log->addExtra('dnsResponse', \is_array($error) ? \json_encode($error) : \strval($error)); - throw new Exception('Failed to verify domain DNS records. CAA records do not allow certificates from certainly.com to issue certificates.'); - } - } } else { // Main domain validation // TODO: Would be awesome to check A/AAAA record here. Maybe dry run? diff --git a/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php b/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php index b81502f0a1..97dae2efcd 100644 --- a/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php +++ b/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php @@ -10,30 +10,24 @@ class ConsoleVariables extends Model public function __construct() { $this - ->addRule('_APP_DOMAIN_TARGET_CNAME', [ - 'type' => self::TYPE_STRING, - 'description' => 'CNAME target for your Appwrite custom domains.', - 'default' => '', - 'example' => 'appwrite.io', - ]) - ->addRule('_APP_DOMAIN_TARGET_A', [ - 'type' => self::TYPE_STRING, - 'description' => 'A target for your Appwrite custom domains.', - 'default' => '', - 'example' => '127.0.0.1', - ]) - ->addRule('_APP_DOMAIN_TARGET_AAAA', [ - 'type' => self::TYPE_STRING, - 'description' => 'AAAA target for your Appwrite custom domains.', - 'default' => '', - 'example' => '::1', - ]) - ->addRule('_APP_DOMAIN_TARGET_CAA', [ - 'type' => self::TYPE_STRING, - 'description' => 'CAA target for your Appwrite custom domains.', - 'default' => '', - 'example' => 'digicert.com', - ]) + ->addRule('_APP_DOMAIN_TARGET_CNAME', [ + 'type' => self::TYPE_STRING, + 'description' => 'CNAME target for your Appwrite custom domains.', + 'default' => '', + 'example' => 'appwrite.io', + ]) + ->addRule('_APP_DOMAIN_TARGET_A', [ + 'type' => self::TYPE_STRING, + 'description' => 'A target for your Appwrite custom domains.', + 'default' => '', + 'example' => '127.0.0.1', + ]) + ->addRule('_APP_DOMAIN_TARGET_AAAA', [ + 'type' => self::TYPE_STRING, + 'description' => 'AAAA target for your Appwrite custom domains.', + 'default' => '', + 'example' => '::1', + ]) ->addRule('_APP_STORAGE_LIMIT', [ 'type' => self::TYPE_INTEGER, 'description' => 'Maximum file size allowed for file upload in bytes.', diff --git a/tests/e2e/Services/Console/ConsoleConsoleClientTest.php b/tests/e2e/Services/Console/ConsoleConsoleClientTest.php index 340cabc8c0..6059cb2000 100644 --- a/tests/e2e/Services/Console/ConsoleConsoleClientTest.php +++ b/tests/e2e/Services/Console/ConsoleConsoleClientTest.php @@ -24,11 +24,10 @@ class ConsoleConsoleClientTest extends Scope ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(14, $response['body']); + $this->assertCount(13, $response['body']); $this->assertIsString($response['body']['_APP_DOMAIN_TARGET_CNAME']); $this->assertIsString($response['body']['_APP_DOMAIN_TARGET_A']); $this->assertIsString($response['body']['_APP_DOMAIN_TARGET_AAAA']); - $this->assertIsString($response['body']['_APP_DOMAIN_TARGET_CAA']); $this->assertIsInt($response['body']['_APP_STORAGE_LIMIT']); $this->assertIsInt($response['body']['_APP_COMPUTE_SIZE_LIMIT']); $this->assertIsBool($response['body']['_APP_DOMAIN_ENABLED']); diff --git a/tests/unit/Network/Validators/DNSTest.php b/tests/unit/Network/Validators/DNSTest.php index 6609a0838a..5e8652381a 100644 --- a/tests/unit/Network/Validators/DNSTest.php +++ b/tests/unit/Network/Validators/DNSTest.php @@ -47,31 +47,4 @@ class DNSTest extends TestCase $this->assertEquals($validator->isValid('aaaa-unit-test.appwrite.org'), true); $this->assertEquals($validator->isValid('test1.appwrite.org'), false); } - - public function testCAA(): void - { - $validator = new DNS('digicert.com', DNS::RECORD_CAA); - $this->assertEquals($validator->isValid('github.com'), true); - $this->assertEquals($validator->isValid('test1.appwrite.org'), true); - - $validator = new DNS('0 issue "digicert.com"', DNS::RECORD_CAA); - $this->assertEquals($validator->isValid('github.com'), true); - - $validator = new DNS('0 issuewild "digicert.com"', DNS::RECORD_CAA); - $this->assertEquals($validator->isValid('github.com'), true); - - $validator = new DNS('128 issue "digicert.com"', DNS::RECORD_CAA); - $this->assertEquals($validator->isValid('github.com'), false); - - $validator = new DNS('letsencrypt.org', DNS::RECORD_CAA); - $this->assertEquals($validator->isValid('github.com'), false); - - // Valid becasue no CAA record configured - $validator = new DNS('anything.com', DNS::RECORD_CAA); - $this->assertEquals($validator->isValid('cloud.appwrite.io'), true); - - // Valid becasue no CAA record configured - $validator = new DNS('something.org', DNS::RECORD_CAA); - $this->assertEquals($validator->isValid('cloud.appwrite.io'), true); - } } From 43f0849979b42f1c908afc1c6786c99bb2050a13 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 5 Aug 2025 20:38:26 +1200 Subject: [PATCH 38/38] Fix atomic num ops with limit 0 --- composer.lock | 16 +++++++------- .../e2e/Services/Databases/DatabasesBase.php | 22 ++++++++++++++++++- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/composer.lock b/composer.lock index 88356d5349..b3450f36fb 100644 --- a/composer.lock +++ b/composer.lock @@ -3542,16 +3542,16 @@ }, { "name": "utopia-php/database", - "version": "0.71.10", + "version": "0.71.11", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "83278d663f9c63c25a11d9e71c7922da7ec48636" + "reference": "644ed827aace63cbdf8c6c64a3998c11b43e3383" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/83278d663f9c63c25a11d9e71c7922da7ec48636", - "reference": "83278d663f9c63c25a11d9e71c7922da7ec48636", + "url": "https://api.github.com/repos/utopia-php/database/zipball/644ed827aace63cbdf8c6c64a3998c11b43e3383", + "reference": "644ed827aace63cbdf8c6c64a3998c11b43e3383", "shasum": "" }, "require": { @@ -3592,9 +3592,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.71.10" + "source": "https://github.com/utopia-php/database/tree/0.71.11" }, - "time": "2025-07-18T00:05:55+00:00" + "time": "2025-08-05T08:35:29+00:00" }, { "name": "utopia-php/detector", @@ -8364,7 +8364,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -8388,5 +8388,5 @@ "platform-overrides": { "php": "8.3" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index de5d33f29d..9b3e31dd70 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -5664,7 +5664,27 @@ trait DatabasesBase ]), ['min' => 7]); $this->assertEquals(400, $err['headers']['status-code']); - // Test type error on non-numeric attribut + // Test min limit exceeded with custom value + $err = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId . '/count/decrement', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), [ + 'value' => 3, + 'min' => 5, + ]); + $this->assertEquals(400, $err['headers']['status-code']); + + // Test min limit 0 + $err = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId . '/count/decrement', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), [ + 'value' => 10, + 'min' => 0, + ]); + $this->assertEquals(400, $err['headers']['status-code']); + + // Test type error on non-numeric attribute $typeErr = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId . '/count/decrement', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'],